annotate dwt/widgets/Widget.d @ 25:fc2b263b8a3f

Merged back the System.arraycopy and use a System class
author Frank Benoit <benoit@tionex.de>
date Tue, 08 Jan 2008 01:23:25 +0100
parents
children 09f5459a5014
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1 /*******************************************************************************
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
2 * Copyright (c) 2000, 2007 IBM Corporation and others.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
3 * All rights reserved. This program and the accompanying materials
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
4 * are made available under the terms of the Eclipse Public License v1.0
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
5 * which accompanies this distribution, and is available at
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
6 * http://www.eclipse.org/legal/epl-v10.html
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
7 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
8 * Contributors:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
9 * IBM Corporation - initial API and implementation
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
10 *******************************************************************************/
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
11 module dwt.widgets.Widget;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
12
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
13 class Widget{
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
14 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
15 /++
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
16 import dwt.SWT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
17 import dwt.internal.*;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
18 import dwt.internal.gtk.*;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
19 import dwt.events.*;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
20
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
21 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
22 * This class is the abstract superclass of all user interface objects.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
23 * Widgets are created, disposed and issue notification to listeners
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
24 * when events occur which affect them.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
25 * <dl>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
26 * <dt><b>Styles:</b></dt>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
27 * <dd>(none)</dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
28 * <dt><b>Events:</b></dt>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
29 * <dd>Dispose</dd>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
30 * </dl>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
31 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
32 * IMPORTANT: This class is intended to be subclassed <em>only</em>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
33 * within the SWT implementation. However, it has not been marked
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
34 * final to allow those outside of the SWT development team to implement
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
35 * patched versions of the class in order to get around specific
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
36 * limitations in advance of when those limitations can be addressed
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
37 * by the team. Any class built using subclassing to access the internals
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
38 * of this class will likely fail to compile or run between releases and
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
39 * may be strongly platform specific. Subclassing should not be attempted
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
40 * without an intimate and detailed understanding of the workings of the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
41 * hierarchy. No support is provided for user-written classes which are
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
42 * implemented as subclasses of this class.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
43 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
44 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
45 * @see #checkSubclass
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
46 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
47 public abstract class Widget {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
48 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
49 * the handle to the OS resource
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
50 * (Warning: This field is platform dependent)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
51 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
52 * <b>IMPORTANT:</b> This field is <em>not</em> part of the SWT
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
53 * public API. It is marked public only so that it can be shared
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
54 * within the packages provided by SWT. It is not available on all
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
55 * platforms and should never be accessed from application code.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
56 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
57 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
58 public int /*long*/ handle;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
59 int style, state;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
60 Display display;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
61 EventTable eventTable;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
62 Object data;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
63
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
64 /* Global state flags */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
65 static final int DISPOSED = 1<<0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
66 static final int CANVAS = 1<<1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
67 static final int KEYED_DATA = 1<<2;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
68 static final int HANDLE = 1<<3;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
69 static final int DISABLED = 1<<4;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
70 static final int MENU = 1<<5;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
71 static final int OBSCURED = 1<<6;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
72 static final int MOVED = 1<<7;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
73 static final int RESIZED = 1<<8;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
74 static final int ZERO_WIDTH = 1<<9;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
75 static final int ZERO_HEIGHT = 1<<10;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
76 static final int HIDDEN = 1<<11;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
77 static final int FOREGROUND = 1<<12;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
78 static final int BACKGROUND = 1<<13;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
79 static final int FONT = 1<<14;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
80 static final int PARENT_BACKGROUND = 1<<15;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
81 static final int THEME_BACKGROUND = 1<<16;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
82
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
83 /* A layout was requested on this widget */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
84 static final int LAYOUT_NEEDED = 1<<17;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
85
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
86 /* The preferred size of a child has changed */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
87 static final int LAYOUT_CHANGED = 1<<18;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
88
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
89 /* A layout was requested in this widget hierachy */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
90 static final int LAYOUT_CHILD = 1<<19;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
91
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
92 /* More global state flags */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
93 static final int RELEASED = 1<<20;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
94 static final int DISPOSE_SENT = 1<<21;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
95 static final int FOREIGN_HANDLE = 1<<22;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
96 static final int DRAG_DETECT = 1<<23;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
97
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
98 /* Default size for widgets */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
99 static final int DEFAULT_WIDTH = 64;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
100 static final int DEFAULT_HEIGHT = 64;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
101
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
102 /* GTK signals data */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
103 static final int ACTIVATE = 1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
104 static final int BUTTON_PRESS_EVENT = 2;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
105 static final int BUTTON_PRESS_EVENT_INVERSE = 3;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
106 static final int BUTTON_RELEASE_EVENT = 4;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
107 static final int BUTTON_RELEASE_EVENT_INVERSE = 5;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
108 static final int CHANGED = 6;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
109 static final int CHANGE_VALUE = 7;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
110 static final int CLICKED = 8;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
111 static final int COMMIT = 9;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
112 static final int CONFIGURE_EVENT = 10;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
113 static final int DELETE_EVENT = 11;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
114 static final int DELETE_RANGE = 12;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
115 static final int DELETE_TEXT = 13;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
116 static final int ENTER_NOTIFY_EVENT = 14;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
117 static final int EVENT = 15;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
118 static final int EVENT_AFTER = 16;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
119 static final int EXPAND_COLLAPSE_CURSOR_ROW = 17;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
120 static final int EXPOSE_EVENT = 18;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
121 static final int EXPOSE_EVENT_INVERSE = 19;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
122 static final int FOCUS = 20;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
123 static final int FOCUS_IN_EVENT = 21;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
124 static final int FOCUS_OUT_EVENT = 22;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
125 static final int GRAB_FOCUS = 23;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
126 static final int HIDE = 24;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
127 static final int INPUT = 25;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
128 static final int INSERT_TEXT = 26;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
129 static final int KEY_PRESS_EVENT = 27;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
130 static final int KEY_RELEASE_EVENT = 28;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
131 static final int LEAVE_NOTIFY_EVENT = 29;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
132 static final int MAP = 30;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
133 static final int MAP_EVENT = 31;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
134 static final int MNEMONIC_ACTIVATE = 32;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
135 static final int MOTION_NOTIFY_EVENT = 33;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
136 static final int MOTION_NOTIFY_EVENT_INVERSE = 34;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
137 static final int MOVE_FOCUS = 35;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
138 static final int OUTPUT = 36;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
139 static final int POPUP_MENU = 37;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
140 static final int PREEDIT_CHANGED = 38;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
141 static final int REALIZE = 39;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
142 static final int ROW_ACTIVATED = 40;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
143 static final int SCROLL_CHILD = 41;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
144 static final int SCROLL_EVENT = 42;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
145 static final int SELECT = 43;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
146 static final int SHOW = 44;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
147 static final int SHOW_HELP = 45;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
148 static final int SIZE_ALLOCATE = 46;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
149 static final int STYLE_SET = 47;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
150 static final int SWITCH_PAGE = 48;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
151 static final int TEST_COLLAPSE_ROW = 49;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
152 static final int TEST_EXPAND_ROW = 50;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
153 static final int TEXT_BUFFER_INSERT_TEXT = 51;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
154 static final int TOGGLED = 52;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
155 static final int UNMAP = 53;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
156 static final int UNMAP_EVENT = 54;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
157 static final int UNREALIZE = 55;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
158 static final int VALUE_CHANGED = 56;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
159 static final int VISIBILITY_NOTIFY_EVENT = 57;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
160 static final int WINDOW_STATE_EVENT = 58;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
161 static final int ACTIVATE_INVERSE = 59;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
162 static final int DAY_SELECTED = 60;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
163 static final int MONTH_CHANGED = 61;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
164 static final int LAST_SIGNAL = 62;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
165
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
166 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
167 * Prevents uninitialized instances from being created outside the package.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
168 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
169 Widget () {}
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
170
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
171 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
172 * Constructs a new instance of this class given its parent
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
173 * and a style value describing its behavior and appearance.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
174 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
175 * The style value is either one of the style constants defined in
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
176 * class <code>SWT</code> which is applicable to instances of this
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
177 * class, or must be built by <em>bitwise OR</em>'ing together
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
178 * (that is, using the <code>int</code> "|" operator) two or more
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
179 * of those <code>SWT</code> style constants. The class description
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
180 * lists the style constants that are applicable to the class.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
181 * Style bits are also inherited from superclasses.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
182 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
183 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
184 * @param parent a widget which will be the parent of the new instance (cannot be null)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
185 * @param style the style of widget to construct
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
186 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
187 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
188 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
189 * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
190 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
191 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
192 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
193 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
194 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
195 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
196 * @see SWT
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
197 * @see #checkSubclass
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
198 * @see #getStyle
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
199 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
200 public Widget (Widget parent, int style) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
201 checkSubclass ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
202 checkParent (parent);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
203 this.style = style;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
204 display = parent.display;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
205 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
206
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
207 void _addListener (int eventType, Listener listener) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
208 if (eventTable == null) eventTable = new EventTable ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
209 eventTable.hook (eventType, listener);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
210 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
211
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
212 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
213 * Adds the listener to the collection of listeners who will
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
214 * be notified when an event of the given type occurs. When the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
215 * event does occur in the widget, the listener is notified by
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
216 * sending it the <code>handleEvent()</code> message. The event
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
217 * type is one of the event constants defined in class <code>SWT</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
218 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
219 * @param eventType the type of event to listen for
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
220 * @param listener the listener which should be notified when the event occurs
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
221 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
222 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
223 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
224 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
225 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
226 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
227 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
228 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
229 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
230 * @see Listener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
231 * @see SWT
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
232 * @see #removeListener(int, Listener)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
233 * @see #notifyListeners
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
234 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
235 public void addListener (int eventType, Listener listener) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
236 checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
237 if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
238 _addListener (eventType, listener);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
239 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
240
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
241 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
242 * Adds the listener to the collection of listeners who will
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
243 * be notified when the widget is disposed. When the widget is
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
244 * disposed, the listener is notified by sending it the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
245 * <code>widgetDisposed()</code> message.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
246 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
247 * @param listener the listener which should be notified when the receiver is disposed
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
248 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
249 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
250 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
251 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
252 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
253 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
254 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
255 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
256 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
257 * @see DisposeListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
258 * @see #removeDisposeListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
259 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
260 public void addDisposeListener (DisposeListener listener) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
261 checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
262 if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
263 TypedListener typedListener = new TypedListener (listener);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
264 addListener (SWT.Dispose, typedListener);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
265 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
266
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
267 int /*long*/ paintWindow () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
268 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
269 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
270
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
271 static int checkBits (int style, int int0, int int1, int int2, int int3, int int4, int int5) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
272 int mask = int0 | int1 | int2 | int3 | int4 | int5;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
273 if ((style & mask) == 0) style |= int0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
274 if ((style & int0) != 0) style = (style & ~mask) | int0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
275 if ((style & int1) != 0) style = (style & ~mask) | int1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
276 if ((style & int2) != 0) style = (style & ~mask) | int2;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
277 if ((style & int3) != 0) style = (style & ~mask) | int3;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
278 if ((style & int4) != 0) style = (style & ~mask) | int4;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
279 if ((style & int5) != 0) style = (style & ~mask) | int5;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
280 return style;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
281 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
282
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
283 int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*long*/ tree_model, int /*long*/ iter, int /*long*/ data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
284 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
285 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
286
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
287 void checkOpen () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
288 /* Do nothing */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
289 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
290
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
291 void checkOrientation (Widget parent) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
292 style &= ~SWT.MIRRORED;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
293 if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) == 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
294 if (parent != null) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
295 if ((parent.style & SWT.LEFT_TO_RIGHT) != 0) style |= SWT.LEFT_TO_RIGHT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
296 if ((parent.style & SWT.RIGHT_TO_LEFT) != 0) style |= SWT.RIGHT_TO_LEFT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
297 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
298 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
299 style = checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
300 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
301
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
302 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
303 * Throws an exception if the specified widget can not be
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
304 * used as a parent for the receiver.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
305 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
306 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
307 * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
308 * <li>ERROR_INVALID_ARGUMENT - if the parent is disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
309 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
310 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
311 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
312 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
313 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
314 void checkParent (Widget parent) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
315 if (parent == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
316 if (parent.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
317 parent.checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
318 parent.checkOpen ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
319 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
320
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
321 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
322 * Checks that this class can be subclassed.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
323 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
324 * The SWT class library is intended to be subclassed
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
325 * only at specific, controlled points (most notably,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
326 * <code>Composite</code> and <code>Canvas</code> when
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
327 * implementing new widgets). This method enforces this
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
328 * rule unless it is overridden.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
329 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
330 * <em>IMPORTANT:</em> By providing an implementation of this
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
331 * method that allows a subclass of a class which does not
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
332 * normally allow subclassing to be created, the implementer
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
333 * agrees to be fully responsible for the fact that any such
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
334 * subclass will likely fail between SWT releases and will be
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
335 * strongly platform specific. No support is provided for
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
336 * user-written classes which are implemented in this fashion.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
337 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
338 * The ability to subclass outside of the allowed SWT classes
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
339 * is intended purely to enable those not on the SWT development
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
340 * team to implement patches in order to get around specific
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
341 * limitations in advance of when those limitations can be
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
342 * addressed by the team. Subclassing should not be attempted
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
343 * without an intimate and detailed understanding of the hierarchy.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
344 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
345 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
346 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
347 * <li>ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
348 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
349 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
350 protected void checkSubclass () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
351 if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
352 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
353
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
354 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
355 * Throws an <code>SWTException</code> if the receiver can not
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
356 * be accessed by the caller. This may include both checks on
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
357 * the state of the receiver and more generally on the entire
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
358 * execution context. This method <em>should</em> be called by
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
359 * widget implementors to enforce the standard SWT invariants.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
360 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
361 * Currently, it is an error to invoke any method (other than
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
362 * <code>isDisposed()</code>) on a widget that has had its
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
363 * <code>dispose()</code> method called. It is also an error
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
364 * to call widget methods from any thread that is different
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
365 * from the thread that created the widget.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
366 * </p><p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
367 * In future releases of SWT, there may be more or fewer error
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
368 * checks and exceptions may be thrown for different reasons.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
369 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
370 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
371 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
372 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
373 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
374 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
375 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
376 protected void checkWidget () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
377 Display display = this.display;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
378 if (display == null) error (SWT.ERROR_WIDGET_DISPOSED);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
379 if (display.thread != Thread.currentThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
380 if ((state & DISPOSED) != 0) error (SWT.ERROR_WIDGET_DISPOSED);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
381 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
382
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
383 void createHandle (int index) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
384 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
385
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
386 void createWidget (int index) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
387 createHandle (index);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
388 setOrientation ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
389 hookEvents ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
390 register ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
391 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
392
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
393 void deregister () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
394 if (handle == 0) return;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
395 if ((state & HANDLE) != 0) display.removeWidget (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
396 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
397
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
398 void destroyWidget () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
399 int /*long*/ topHandle = topHandle ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
400 releaseHandle ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
401 if (topHandle != 0 && (state & HANDLE) != 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
402 OS.gtk_widget_destroy (topHandle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
403 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
404 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
405
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
406 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
407 * Disposes of the operating system resources associated with
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
408 * the receiver and all its descendants. After this method has
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
409 * been invoked, the receiver and all descendants will answer
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
410 * <code>true</code> when sent the message <code>isDisposed()</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
411 * Any internal connections between the widgets in the tree will
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
412 * have been removed to facilitate garbage collection.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
413 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
414 * NOTE: This method is not called recursively on the descendants
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
415 * of the receiver. This means that, widget implementers can not
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
416 * detect when a widget is being disposed of by re-implementing
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
417 * this method, but should instead listen for the <code>Dispose</code>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
418 * event.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
419 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
420 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
421 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
422 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
423 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
424 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
425 * @see #addDisposeListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
426 * @see #removeDisposeListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
427 * @see #checkWidget
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
428 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
429 public void dispose () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
430 /*
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
431 * Note: It is valid to attempt to dispose a widget
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
432 * more than once. If this happens, fail silently.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
433 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
434 if (isDisposed ()) return;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
435 if (!isValidThread ()) error (SWT.ERROR_THREAD_INVALID_ACCESS);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
436 release (true);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
437 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
438
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
439 void error (int code) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
440 SWT.error (code);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
441 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
442
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
443 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
444 * Returns the application defined widget data associated
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
445 * with the receiver, or null if it has not been set. The
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
446 * <em>widget data</em> is a single, unnamed field that is
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
447 * stored with every widget.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
448 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
449 * Applications may put arbitrary objects in this field. If
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
450 * the object stored in the widget data needs to be notified
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
451 * when the widget is disposed of, it is the application's
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
452 * responsibility to hook the Dispose event on the widget and
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
453 * do so.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
454 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
455 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
456 * @return the widget data
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
457 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
458 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
459 * <li>ERROR_WIDGET_DISPOSED - when the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
460 * <li>ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
461 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
462 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
463 * @see #setData(Object)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
464 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
465 public Object getData () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
466 checkWidget();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
467 return (state & KEYED_DATA) != 0 ? ((Object []) data) [0] : data;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
468 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
469 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
470 * Returns the application defined property of the receiver
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
471 * with the specified name, or null if it has not been set.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
472 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
473 * Applications may have associated arbitrary objects with the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
474 * receiver in this fashion. If the objects stored in the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
475 * properties need to be notified when the widget is disposed
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
476 * of, it is the application's responsibility to hook the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
477 * Dispose event on the widget and do so.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
478 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
479 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
480 * @param key the name of the property
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
481 * @return the value of the property or null if it has not been set
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
482 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
483 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
484 * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
485 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
486 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
487 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
488 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
489 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
490 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
491 * @see #setData(String, Object)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
492 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
493 public Object getData (String key) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
494 checkWidget();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
495 if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
496 if ((state & KEYED_DATA) != 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
497 Object [] table = (Object []) data;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
498 for (int i=1; i<table.length; i+=2) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
499 if (key.equals (table [i])) return table [i+1];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
500 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
501 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
502 return null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
503 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
504
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
505 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
506 * Returns the <code>Display</code> that is associated with
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
507 * the receiver.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
508 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
509 * A widget's display is either provided when it is created
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
510 * (for example, top level <code>Shell</code>s) or is the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
511 * same as its parent's display.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
512 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
513 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
514 * @return the receiver's display
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
515 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
516 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
517 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
518 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
519 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
520 public Display getDisplay () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
521 Display display = this.display;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
522 if (display == null) error (SWT.ERROR_WIDGET_DISPOSED);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
523 return display;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
524 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
525
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
526 String getName () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
527 // String string = getClass ().getName ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
528 // int index = string.lastIndexOf ('.');
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
529 // if (index == -1) return string;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
530 String string = getClass ().getName ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
531 int index = string.length ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
532 while ((--index > 0) && (string.charAt (index) != '.')) {}
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
533 return string.substring (index + 1, string.length ());
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
534 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
535
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
536 String getNameText () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
537 return "";
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
538 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
539
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
540 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
541 * Returns the receiver's style information.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
542 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
543 * Note that the value which is returned by this method <em>may
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
544 * not match</em> the value which was provided to the constructor
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
545 * when the receiver was created. This can occur when the underlying
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
546 * operating system does not support a particular combination of
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
547 * requested styles. For example, if the platform widget used to
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
548 * implement a particular SWT widget always has scroll bars, the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
549 * result of calling this method would always have the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
550 * <code>SWT.H_SCROLL</code> and <code>SWT.V_SCROLL</code> bits set.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
551 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
552 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
553 * @return the style bits
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
554 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
555 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
556 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
557 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
558 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
559 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
560 public int getStyle () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
561 checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
562 return style;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
563 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
564
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
565
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
566 int /*long*/ gtk_activate (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
567 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
568 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
569
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
570 int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
571 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
572 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
573
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
574 int /*long*/ gtk_button_release_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
575 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
576 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
577
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
578 int /*long*/ gtk_changed (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
579 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
580 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
581
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
582 int /*long*/ gtk_change_value (int /*long*/ widget, int /*long*/ scroll, int /*long*/ value1, int /*long*/ value2) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
583 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
584 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
585
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
586 int /*long*/ gtk_clicked (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
587 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
588 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
589
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
590 int /*long*/ gtk_commit (int /*long*/ imcontext, int /*long*/ text) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
591 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
592 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
593
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
594 int /*long*/ gtk_configure_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
595 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
596 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
597
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
598 int /*long*/ gtk_day_selected (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
599 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
600 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
601
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
602 int /*long*/ gtk_delete_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
603 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
604 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
605
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
606 int /*long*/ gtk_delete_range (int /*long*/ widget, int /*long*/ iter1, int /*long*/ iter2) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
607 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
608 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
609
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
610 int /*long*/ gtk_delete_text (int /*long*/ widget, int /*long*/ start_pos, int /*long*/ end_pos) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
611 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
612 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
613
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
614 int /*long*/ gtk_enter_notify_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
615 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
616 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
617
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
618 int /*long*/ gtk_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
619 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
620 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
621
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
622 int /*long*/ gtk_event_after (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
623 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
624 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
625
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
626 int /*long*/ gtk_expand_collapse_cursor_row (int /*long*/ widget, int /*long*/ logical, int /*long*/ expand, int /*long*/ open_all) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
627 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
628 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
629
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
630 int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
631 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
632 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
633
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
634 int /*long*/ gtk_focus (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
635 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
636 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
637
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
638 int /*long*/ gtk_focus_in_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
639 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
640 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
641
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
642 int /*long*/ gtk_focus_out_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
643 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
644 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
645
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
646 int /*long*/ gtk_grab_focus (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
647 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
648 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
649
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
650 int /*long*/ gtk_hide (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
651 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
652 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
653
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
654 int /*long*/ gtk_input (int /*long*/ widget, int /*long*/ arg1) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
655 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
656 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
657
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
658 int /*long*/ gtk_insert_text (int /*long*/ widget, int /*long*/ new_text, int /*long*/ new_text_length, int /*long*/ position) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
659 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
660 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
661
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
662 int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
663 GdkEventKey gdkEvent = new GdkEventKey ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
664 OS.memmove (gdkEvent, event, GdkEventKey.sizeof);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
665 return sendKeyEvent (SWT.KeyDown, gdkEvent) ? 0 : 1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
666 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
667
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
668 int /*long*/ gtk_key_release_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
669 GdkEventKey gdkEvent = new GdkEventKey ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
670 OS.memmove (gdkEvent, event, GdkEventKey.sizeof);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
671 return sendKeyEvent (SWT.KeyUp, gdkEvent) ? 0 : 1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
672 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
673
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
674 int /*long*/ gtk_leave_notify_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
675 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
676 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
677
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
678 int /*long*/ gtk_map (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
679 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
680 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
681
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
682 int /*long*/ gtk_map_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
683 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
684 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
685
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
686 int /*long*/ gtk_mnemonic_activate (int /*long*/ widget, int /*long*/ arg1) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
687 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
688 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
689
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
690 int /*long*/ gtk_month_changed (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
691 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
692 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
693
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
694 int /*long*/ gtk_motion_notify_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
695 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
696 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
697
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
698 int /*long*/ gtk_move_focus (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
699 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
700 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
701
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
702 int /*long*/ gtk_output (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
703 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
704 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
705
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
706 int /*long*/ gtk_popup_menu (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
707 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
708 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
709
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
710 int /*long*/ gtk_preedit_changed (int /*long*/ imcontext) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
711 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
712 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
713
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
714 int /*long*/ gtk_realize (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
715 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
716 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
717
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
718 int /*long*/ gtk_row_activated (int /*long*/ tree, int /*long*/ path, int /*long*/ column) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
719 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
720 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
721
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
722 int /*long*/ gtk_scroll_child (int /*long*/ widget, int /*long*/ scrollType, int /*long*/ horizontal) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
723 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
724 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
725
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
726 int /*long*/ gtk_scroll_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
727 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
728 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
729
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
730 int /*long*/ gtk_select (int /*long*/ item) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
731 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
732 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
733
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
734 int /*long*/ gtk_show (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
735 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
736 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
737
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
738 int /*long*/ gtk_show_help (int /*long*/ widget, int /*long*/ helpType) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
739 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
740 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
741
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
742 int /*long*/ gtk_size_allocate (int /*long*/ widget, int /*long*/ allocation) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
743 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
744 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
745
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
746 int /*long*/ gtk_style_set (int /*long*/ widget, int /*long*/ previousStyle) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
747 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
748 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
749
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
750 int /*long*/ gtk_switch_page (int /*long*/ widget, int /*long*/ page, int /*long*/ page_num) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
751 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
752 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
753
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
754 int /*long*/ gtk_test_collapse_row (int /*long*/ tree, int /*long*/ iter, int /*long*/ path) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
755 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
756 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
757
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
758 int /*long*/ gtk_test_expand_row (int /*long*/ tree, int /*long*/ iter, int /*long*/ path) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
759 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
760 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
761
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
762 int /*long*/ gtk_text_buffer_insert_text (int /*long*/ widget, int /*long*/ iter, int /*long*/ text, int /*long*/ length) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
763 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
764 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
765
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
766 int /*long*/ gtk_timer () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
767 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
768 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
769
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
770 int /*long*/ gtk_toggled (int /*long*/ renderer, int /*long*/ pathStr) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
771 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
772 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
773
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
774 int /*long*/ gtk_unmap (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
775 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
776 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
777
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
778 int /*long*/ gtk_unmap_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
779 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
780 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
781
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
782 int /*long*/ gtk_unrealize (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
783 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
784 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
785
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
786 int /*long*/ gtk_value_changed (int /*long*/ adjustment) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
787 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
788 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
789
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
790 int /*long*/ gtk_visibility_notify_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
791 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
792 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
793
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
794 int /*long*/ gtk_window_state_event (int /*long*/ widget, int /*long*/ event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
795 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
796 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
797
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
798 int fontHeight (int /*long*/ font, int /*long*/ widgetHandle) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
799 int /*long*/ context = OS.gtk_widget_get_pango_context (widgetHandle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
800 int /*long*/ lang = OS.pango_context_get_language (context);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
801 int /*long*/ metrics = OS.pango_context_get_metrics (context, font, lang);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
802 int ascent = OS.pango_font_metrics_get_ascent (metrics);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
803 int descent = OS.pango_font_metrics_get_descent (metrics);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
804 OS.pango_font_metrics_unref (metrics);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
805 return OS.PANGO_PIXELS (ascent + descent);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
806 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
807
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
808 int /*long*/ filterProc(int /*long*/ xEvent, int /*long*/ gdkEvent, int /*long*/ data2) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
809 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
810 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
811
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
812 boolean filters (int eventType) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
813 return display.filters (eventType);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
814 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
815
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
816 int /*long*/ fixedMapProc (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
817 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
818 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
819
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
820 char [] fixMnemonic (String string) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
821 int length = string.length ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
822 char [] text = new char [length];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
823 string.getChars (0, length, text, 0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
824 int i = 0, j = 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
825 char [] result = new char [length * 2];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
826 while (i < length) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
827 switch (text [i]) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
828 case '&':
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
829 if (i + 1 < length && text [i + 1] == '&') {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
830 i++;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
831 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
832 text [i] = '_';
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
833 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
834 break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
835 case '_':
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
836 result [j++] = '_';
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
837 break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
838 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
839 result [j++] = text [i++];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
840 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
841 return result;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
842 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
843
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
844 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
845 * Returns <code>true</code> if the widget has been disposed,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
846 * and <code>false</code> otherwise.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
847 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
848 * This method gets the dispose state for the widget.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
849 * When a widget has been disposed, it is an error to
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
850 * invoke any other method using the widget.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
851 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
852 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
853 * @return <code>true</code> when the widget is disposed and <code>false</code> otherwise
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
854 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
855 public boolean isDisposed () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
856 return (state & DISPOSED) != 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
857 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
858
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
859 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
860 * Returns <code>true</code> if there are any listeners
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
861 * for the specified event type associated with the receiver,
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
862 * and <code>false</code> otherwise. The event type is one of
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
863 * the event constants defined in class <code>SWT</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
864 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
865 * @param eventType the type of event
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
866 * @return true if the event is hooked
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
867 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
868 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
869 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
870 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
871 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
872 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
873 * @see SWT
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
874 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
875 public boolean isListening (int eventType) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
876 checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
877 return hooks (eventType);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
878 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
879
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
880 boolean isValidThread () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
881 return getDisplay ().isValidThread ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
882 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
883
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
884 boolean isValidSubclass() {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
885 return Display.isValidClass(getClass());
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
886 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
887
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
888 void hookEvents () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
889 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
890
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
891 /*
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
892 * Returns <code>true</code> if the specified eventType is
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
893 * hooked, and <code>false</code> otherwise. Implementations
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
894 * of SWT can avoid creating objects and sending events
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
895 * when an event happens in the operating system but
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
896 * there are no listeners hooked for the event.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
897 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
898 * @param eventType the event to be checked
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
899 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
900 * @return <code>true</code> when the eventType is hooked and <code>false</code> otherwise
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
901 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
902 * @see #isListening
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
903 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
904 boolean hooks (int eventType) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
905 if (eventTable == null) return false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
906 return eventTable.hooks (eventType);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
907 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
908
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
909 int /*long*/ hoverProc (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
910 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
911 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
912
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
913 int /*long*/ menuPositionProc (int /*long*/ menu, int /*long*/ x, int /*long*/ y, int /*long*/ push_in, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
914 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
915 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
916
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
917 boolean mnemonicHit (int /*long*/ mnemonicHandle, char key) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
918 if (!mnemonicMatch (mnemonicHandle, key)) return false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
919 OS.g_signal_handlers_block_matched (mnemonicHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, MNEMONIC_ACTIVATE);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
920 boolean result = OS.gtk_widget_mnemonic_activate (mnemonicHandle, false);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
921 OS.g_signal_handlers_unblock_matched (mnemonicHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, MNEMONIC_ACTIVATE);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
922 return result;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
923 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
924
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
925 boolean mnemonicMatch (int /*long*/ mnemonicHandle, char key) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
926 int keyval1 = OS.gdk_keyval_to_lower (OS.gdk_unicode_to_keyval (key));
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
927 int keyval2 = OS.gdk_keyval_to_lower (OS.gtk_label_get_mnemonic_keyval (mnemonicHandle));
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
928 return keyval1 == keyval2;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
929 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
930
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
931 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
932 * Notifies all of the receiver's listeners for events
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
933 * of the given type that one such event has occurred by
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
934 * invoking their <code>handleEvent()</code> method. The
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
935 * event type is one of the event constants defined in class
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
936 * <code>SWT</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
937 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
938 * @param eventType the type of event which has occurred
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
939 * @param event the event data
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
940 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
941 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
942 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
943 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
944 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
945 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
946 * @see SWT
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
947 * @see #addListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
948 * @see #removeListener(int, Listener)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
949 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
950 public void notifyListeners (int eventType, Event event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
951 checkWidget();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
952 if (event == null) event = new Event ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
953 sendEvent (eventType, event);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
954 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
955
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
956 void postEvent (int eventType) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
957 sendEvent (eventType, null, false);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
958 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
959
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
960 void postEvent (int eventType, Event event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
961 sendEvent (eventType, event, false);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
962 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
963
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
964 void register () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
965 if (handle == 0) return;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
966 if ((state & HANDLE) != 0) display.addWidget (handle, this);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
967 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
968
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
969 void release (boolean destroy) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
970 if ((state & DISPOSE_SENT) == 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
971 state |= DISPOSE_SENT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
972 sendEvent (SWT.Dispose);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
973 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
974 if ((state & DISPOSED) == 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
975 releaseChildren (destroy);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
976 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
977 if ((state & RELEASED) == 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
978 state |= RELEASED;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
979 if (destroy) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
980 releaseParent ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
981 releaseWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
982 destroyWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
983 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
984 releaseWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
985 releaseHandle ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
986 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
987 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
988 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
989
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
990 void releaseChildren (boolean destroy) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
991 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
992
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
993 void releaseHandle () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
994 handle = 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
995 state |= DISPOSED;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
996 display = null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
997 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
998
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
999 void releaseParent () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1000 /* Do nothing */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1001 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1002
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1003 void releaseWidget () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1004 deregister ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1005 eventTable = null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1006 data = null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1007 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1008
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1009 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1010 * Removes the listener from the collection of listeners who will
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1011 * be notified when an event of the given type occurs. The event
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1012 * type is one of the event constants defined in class <code>SWT</code>.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1013 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1014 * @param eventType the type of event to listen for
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1015 * @param listener the listener which should no longer be notified when the event occurs
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1016 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1017 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1018 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1019 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1020 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1021 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1022 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1023 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1024 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1025 * @see Listener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1026 * @see SWT
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1027 * @see #addListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1028 * @see #notifyListeners
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1029 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1030 public void removeListener (int eventType, Listener handler) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1031 checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1032 if (handler == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1033 if (eventTable == null) return;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1034 eventTable.unhook (eventType, handler);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1035 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1036
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1037 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1038 * Removes the listener from the collection of listeners who will
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1039 * be notified when an event of the given type occurs.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1040 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1041 * <b>IMPORTANT:</b> This method is <em>not</em> part of the SWT
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1042 * public API. It is marked public only so that it can be shared
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1043 * within the packages provided by SWT. It should never be
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1044 * referenced from application code.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1045 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1046 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1047 * @param eventType the type of event to listen for
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1048 * @param listener the listener which should no longer be notified when the event occurs
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1049 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1050 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1051 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1052 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1053 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1054 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1055 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1056 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1057 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1058 * @see Listener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1059 * @see #addListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1060 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1061 protected void removeListener (int eventType, SWTEventListener handler) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1062 checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1063 if (handler == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1064 if (eventTable == null) return;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1065 eventTable.unhook (eventType, handler);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1066 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1067
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1068 int /*long*/ rendererGetSizeProc (int /*long*/ cell, int /*long*/ handle, int /*long*/ cell_area, int /*long*/ x_offset, int /*long*/ y_offset, int /*long*/ width, int /*long*/ height) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1069 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1070 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1071
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1072 int /*long*/ rendererRenderProc (int /*long*/ cell, int /*long*/ window, int /*long*/ handle, int /*long*/ background_area, int /*long*/ cell_area, int /*long*/ expose_area, int /*long*/ flags) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1073 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1074 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1075
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1076 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1077 * Removes the listener from the collection of listeners who will
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1078 * be notified when the widget is disposed.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1079 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1080 * @param listener the listener which should no longer be notified when the receiver is disposed
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1081 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1082 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1083 * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1084 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1085 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1086 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1087 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1088 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1089 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1090 * @see DisposeListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1091 * @see #addDisposeListener
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1092 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1093 public void removeDisposeListener (DisposeListener listener) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1094 checkWidget ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1095 if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1096 if (eventTable == null) return;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1097 eventTable.unhook (SWT.Dispose, listener);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1098 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1099
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1100 void sendEvent (Event event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1101 Display display = event.display;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1102 if (!display.filterEvent (event)) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1103 if (eventTable != null) eventTable.sendEvent (event);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1104 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1105 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1106
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1107 void sendEvent (int eventType) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1108 sendEvent (eventType, null, true);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1109 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1110
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1111 void sendEvent (int eventType, Event event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1112 sendEvent (eventType, event, true);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1113 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1114
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1115 void sendEvent (int eventType, Event event, boolean send) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1116 if (eventTable == null && !display.filters (eventType)) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1117 return;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1118 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1119 if (event == null) event = new Event ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1120 event.type = eventType;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1121 event.display = display;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1122 event.widget = this;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1123 if (event.time == 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1124 event.time = display.getLastEventTime ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1125 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1126 if (send) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1127 sendEvent (event);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1128 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1129 display.postEvent (event);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1130 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1131 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1132
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1133 boolean sendKeyEvent (int type, GdkEventKey keyEvent) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1134 int length = keyEvent.length;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1135 if (keyEvent.string == 0 || OS.g_utf8_strlen (keyEvent.string, length) <= 1) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1136 Event event = new Event ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1137 event.time = keyEvent.time;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1138 if (!setKeyState (event, keyEvent)) return true;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1139 sendEvent (type, event);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1140 // widget could be disposed at this point
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1141
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1142 /*
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1143 * It is possible (but unlikely), that application
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1144 * code could have disposed the widget in the key
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1145 * events. If this happens, end the processing of
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1146 * the key by returning false.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1147 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1148 if (isDisposed ()) return false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1149 return event.doit;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1150 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1151 byte [] buffer = new byte [length];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1152 OS.memmove (buffer, keyEvent.string, length);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1153 char [] chars = Converter.mbcsToWcs (null, buffer);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1154 return sendIMKeyEvent (type, keyEvent, chars) != null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1155 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1156
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1157 char [] sendIMKeyEvent (int type, GdkEventKey keyEvent, char [] chars) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1158 int index = 0, count = 0, state = 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1159 int /*long*/ ptr = 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1160 if (keyEvent == null) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1161 ptr = OS.gtk_get_current_event ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1162 if (ptr != 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1163 keyEvent = new GdkEventKey ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1164 OS.memmove (keyEvent, ptr, GdkEventKey.sizeof);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1165 switch (keyEvent.type) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1166 case OS.GDK_KEY_PRESS:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1167 case OS.GDK_KEY_RELEASE:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1168 state = keyEvent.state;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1169 break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1170 default:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1171 keyEvent = null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1172 break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1173 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1174 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1175 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1176 if (keyEvent == null) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1177 int [] buffer = new int [1];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1178 OS.gtk_get_current_event_state (buffer);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1179 state = buffer [0];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1180 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1181 while (index < chars.length) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1182 Event event = new Event ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1183 if (keyEvent != null && chars.length <= 1) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1184 setKeyState (event, keyEvent);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1185 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1186 setInputState (event, state);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1187 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1188 event.character = chars [index];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1189 sendEvent (type, event);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1190
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1191 /*
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1192 * It is possible (but unlikely), that application
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1193 * code could have disposed the widget in the key
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1194 * events. If this happens, end the processing of
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1195 * the key by returning null.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1196 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1197 if (isDisposed ()) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1198 if (ptr != 0) OS.gdk_event_free (ptr);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1199 return null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1200 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1201 if (event.doit) chars [count++] = chars [index];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1202 index++;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1203 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1204 if (ptr != 0) OS.gdk_event_free (ptr);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1205 if (count == 0) return null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1206 if (index != count) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1207 char [] result = new char [count];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1208 System.arraycopy (chars, 0, result, 0, count);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1209 return result;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1210 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1211 return chars;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1212 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1213
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1214 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1215 * Sets the application defined widget data associated
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1216 * with the receiver to be the argument. The <em>widget
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1217 * data</em> is a single, unnamed field that is stored
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1218 * with every widget.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1219 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1220 * Applications may put arbitrary objects in this field. If
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1221 * the object stored in the widget data needs to be notified
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1222 * when the widget is disposed of, it is the application's
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1223 * responsibility to hook the Dispose event on the widget and
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1224 * do so.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1225 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1226 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1227 * @param data the widget data
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1228 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1229 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1230 * <li>ERROR_WIDGET_DISPOSED - when the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1231 * <li>ERROR_THREAD_INVALID_ACCESS - when called from the wrong thread</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1232 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1233 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1234 * @see #getData()
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1235 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1236 public void setData (Object data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1237 checkWidget();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1238 if ((state & KEYED_DATA) != 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1239 ((Object []) this.data) [0] = data;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1240 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1241 this.data = data;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1242 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1243 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1244
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1245 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1246 * Sets the application defined property of the receiver
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1247 * with the specified name to the given value.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1248 * <p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1249 * Applications may associate arbitrary objects with the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1250 * receiver in this fashion. If the objects stored in the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1251 * properties need to be notified when the widget is disposed
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1252 * of, it is the application's responsibility to hook the
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1253 * Dispose event on the widget and do so.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1254 * </p>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1255 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1256 * @param key the name of the property
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1257 * @param value the new value for the property
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1258 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1259 * @exception IllegalArgumentException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1260 * <li>ERROR_NULL_ARGUMENT - if the key is null</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1261 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1262 * @exception SWTException <ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1263 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1264 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1265 * </ul>
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1266 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1267 * @see #getData(String)
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1268 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1269 public void setData (String key, Object value) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1270 checkWidget();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1271 if (key == null) error (SWT.ERROR_NULL_ARGUMENT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1272 int index = 1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1273 Object [] table = null;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1274 if ((state & KEYED_DATA) != 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1275 table = (Object []) data;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1276 while (index < table.length) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1277 if (key.equals (table [index])) break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1278 index += 2;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1279 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1280 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1281 if (value != null) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1282 if ((state & KEYED_DATA) != 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1283 if (index == table.length) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1284 Object [] newTable = new Object [table.length + 2];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1285 System.arraycopy (table, 0, newTable, 0, table.length);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1286 data = table = newTable;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1287 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1288 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1289 table = new Object [3];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1290 table [0] = data;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1291 data = table;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1292 state |= KEYED_DATA;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1293 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1294 table [index] = key;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1295 table [index + 1] = value;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1296 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1297 if ((state & KEYED_DATA) != 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1298 if (index != table.length) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1299 int length = table.length - 2;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1300 if (length == 1) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1301 data = table [0];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1302 state &= ~KEYED_DATA;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1303 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1304 Object [] newTable = new Object [length];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1305 System.arraycopy (table, 0, newTable, 0, index);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1306 System.arraycopy (table, index + 2, newTable, index, length - index);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1307 data = newTable;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1308 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1309 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1310 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1311 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1312 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1313
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1314 void setForegroundColor (int /*long*/ handle, GdkColor color) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1315 int /*long*/ style = OS.gtk_widget_get_modifier_style (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1316 OS.gtk_rc_style_set_fg (style, OS.GTK_STATE_NORMAL, color);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1317 OS.gtk_rc_style_set_fg (style, OS.GTK_STATE_ACTIVE, color);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1318 OS.gtk_rc_style_set_fg (style, OS.GTK_STATE_PRELIGHT, color);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1319 int flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1320 flags = (color == null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1321 OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_NORMAL, flags);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1322 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_ACTIVE);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1323 flags = (color == null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1324 OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_ACTIVE, flags);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1325 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_PRELIGHT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1326 flags = (color == null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1327 OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_PRELIGHT, flags);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1328
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1329 OS.gtk_rc_style_set_text (style, OS.GTK_STATE_NORMAL, color);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1330 OS.gtk_rc_style_set_text (style, OS.GTK_STATE_ACTIVE, color);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1331 OS.gtk_rc_style_set_text (style, OS.GTK_STATE_PRELIGHT, color);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1332 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1333 flags = (color == null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1334 OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_NORMAL, flags);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1335 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_PRELIGHT);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1336 flags = (color == null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1337 OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_PRELIGHT, flags);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1338 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_ACTIVE);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1339 flags = (color == null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1340 OS.gtk_rc_style_set_color_flags (style, OS.GTK_STATE_ACTIVE, flags);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1341 OS.gtk_widget_modify_style (handle, style);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1342 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1343
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1344 boolean setInputState (Event event, int state) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1345 if ((state & OS.GDK_MOD1_MASK) != 0) event.stateMask |= SWT.ALT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1346 if ((state & OS.GDK_SHIFT_MASK) != 0) event.stateMask |= SWT.SHIFT;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1347 if ((state & OS.GDK_CONTROL_MASK) != 0) event.stateMask |= SWT.CONTROL;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1348 if ((state & OS.GDK_BUTTON1_MASK) != 0) event.stateMask |= SWT.BUTTON1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1349 if ((state & OS.GDK_BUTTON2_MASK) != 0) event.stateMask |= SWT.BUTTON2;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1350 if ((state & OS.GDK_BUTTON3_MASK) != 0) event.stateMask |= SWT.BUTTON3;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1351 return true;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1352 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1353
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1354 boolean setKeyState (Event event, GdkEventKey keyEvent) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1355 if (keyEvent.string != 0 && OS.g_utf8_strlen (keyEvent.string, keyEvent.length) > 1) return false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1356 boolean isNull = false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1357 event.keyCode = Display.translateKey (keyEvent.keyval);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1358 switch (keyEvent.keyval) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1359 case OS.GDK_BackSpace: event.character = SWT.BS; break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1360 case OS.GDK_Linefeed: event.character = SWT.LF; break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1361 case OS.GDK_KP_Enter:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1362 case OS.GDK_Return: event.character = SWT.CR; break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1363 case OS.GDK_KP_Delete:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1364 case OS.GDK_Delete: event.character = SWT.DEL; break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1365 case OS.GDK_Escape: event.character = SWT.ESC; break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1366 case OS.GDK_Tab:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1367 case OS.GDK_ISO_Left_Tab: event.character = SWT.TAB; break;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1368 default: {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1369 if (event.keyCode == 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1370 int [] keyval = new int [1], effective_group= new int [1], level = new int [1], consumed_modifiers = new int [1];
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1371 if (OS.gdk_keymap_translate_keyboard_state(OS.gdk_keymap_get_default (), keyEvent.hardware_keycode, 0, keyEvent.group, keyval, effective_group, level, consumed_modifiers)) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1372 event.keyCode = OS.gdk_keyval_to_unicode (keyval [0]);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1373 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1374 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1375 int key = keyEvent.keyval;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1376 if ((keyEvent.state & OS.GDK_CONTROL_MASK) != 0 && (0 <= key && key <= 0x7F)) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1377 if ('a' <= key && key <= 'z') key -= 'a' - 'A';
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1378 if (64 <= key && key <= 95) key -= 64;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1379 event.character = (char) key;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1380 isNull = keyEvent.keyval == '@' && key == 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1381 } else {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1382 event.character = (char) OS.gdk_keyval_to_unicode (key);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1383 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1384 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1385 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1386 if (event.keyCode == 0 && event.character == 0) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1387 if (!isNull) return false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1388 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1389 return setInputState (event, keyEvent.state);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1390 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1391
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1392 void setOrientation () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1393 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1394
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1395 int /*long*/ shellMapProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1396 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1397 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1398
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1399 int /*long*/ sizeAllocateProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1400 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1401 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1402
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1403 int /*long*/ sizeRequestProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1404 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1405 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1406
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1407 /**
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1408 * Returns a string containing a concise, human-readable
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1409 * description of the receiver.
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1410 *
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1411 * @return a string representation of the receiver
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1412 */
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1413 public String toString () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1414 String string = "*Disposed*";
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1415 if (!isDisposed ()) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1416 string = "*Wrong Thread*";
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1417 if (isValidThread ()) string = getNameText ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1418 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1419 return getName () + " {" + string + "}";
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1420 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1421
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1422 int /*long*/ topHandle () {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1423 return handle;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1424 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1425
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1426 int /*long*/ timerProc (int /*long*/ widget) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1427 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1428 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1429
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1430 int /*long*/ treeSelectionProc (int /*long*/ model, int /*long*/ path, int /*long*/ iter, int [] selection, int length) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1431 return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1432 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1433
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1434 boolean translateTraversal (int event) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1435 return false;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1436 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1437
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1438 int /*long*/ windowProc (int /*long*/ handle, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1439 switch ((int)/*64*/user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1440 case ACTIVATE: return gtk_activate (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1441 case CHANGED: return gtk_changed (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1442 case CLICKED: return gtk_clicked (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1443 case DAY_SELECTED: return gtk_day_selected (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1444 case HIDE: return gtk_hide (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1445 case GRAB_FOCUS: return gtk_grab_focus (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1446 case MAP: return gtk_map (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1447 case MONTH_CHANGED: return gtk_month_changed (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1448 case OUTPUT: return gtk_output (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1449 case POPUP_MENU: return gtk_popup_menu (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1450 case PREEDIT_CHANGED: return gtk_preedit_changed (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1451 case REALIZE: return gtk_realize (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1452 case SELECT: return gtk_select (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1453 case SHOW: return gtk_show (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1454 case VALUE_CHANGED: return gtk_value_changed (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1455 case UNMAP: return gtk_unmap (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1456 case UNREALIZE: return gtk_unrealize (handle);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1457 default: return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1458 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1459 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1460
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1461 int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1462 switch ((int)/*64*/user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1463 case EXPOSE_EVENT_INVERSE: {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1464 GdkEventExpose gdkEvent = new GdkEventExpose ();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1465 OS.memmove (gdkEvent, arg0, GdkEventExpose.sizeof);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1466 int /*long*/ paintWindow = paintWindow();
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1467 int /*long*/ window = gdkEvent.window;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1468 if (window != paintWindow) return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1469 return (state & OBSCURED) != 0 ? 1 : 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1470 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1471 case BUTTON_PRESS_EVENT_INVERSE:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1472 case BUTTON_RELEASE_EVENT_INVERSE:
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1473 case MOTION_NOTIFY_EVENT_INVERSE: {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1474 return 1;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1475 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1476 case BUTTON_PRESS_EVENT: return gtk_button_press_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1477 case BUTTON_RELEASE_EVENT: return gtk_button_release_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1478 case COMMIT: return gtk_commit (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1479 case CONFIGURE_EVENT: return gtk_configure_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1480 case DELETE_EVENT: return gtk_delete_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1481 case ENTER_NOTIFY_EVENT: return gtk_enter_notify_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1482 case EVENT: return gtk_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1483 case EVENT_AFTER: return gtk_event_after (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1484 case EXPOSE_EVENT: return gtk_expose_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1485 case FOCUS: return gtk_focus (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1486 case FOCUS_IN_EVENT: return gtk_focus_in_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1487 case FOCUS_OUT_EVENT: return gtk_focus_out_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1488 case KEY_PRESS_EVENT: return gtk_key_press_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1489 case KEY_RELEASE_EVENT: return gtk_key_release_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1490 case INPUT: return gtk_input (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1491 case LEAVE_NOTIFY_EVENT: return gtk_leave_notify_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1492 case MAP_EVENT: return gtk_map_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1493 case MNEMONIC_ACTIVATE: return gtk_mnemonic_activate (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1494 case MOTION_NOTIFY_EVENT: return gtk_motion_notify_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1495 case MOVE_FOCUS: return gtk_move_focus (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1496 case SCROLL_EVENT: return gtk_scroll_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1497 case SHOW_HELP: return gtk_show_help (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1498 case SIZE_ALLOCATE: return gtk_size_allocate (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1499 case STYLE_SET: return gtk_style_set (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1500 case TOGGLED: return gtk_toggled (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1501 case UNMAP_EVENT: return gtk_unmap_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1502 case VISIBILITY_NOTIFY_EVENT: return gtk_visibility_notify_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1503 case WINDOW_STATE_EVENT: return gtk_window_state_event (handle, arg0);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1504 default: return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1505 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1506 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1507
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1508 int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1509 switch ((int)/*64*/user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1510 case DELETE_RANGE: return gtk_delete_range (handle, arg0, arg1);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1511 case DELETE_TEXT: return gtk_delete_text (handle, arg0, arg1);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1512 case ROW_ACTIVATED: return gtk_row_activated (handle, arg0, arg1);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1513 case SCROLL_CHILD: return gtk_scroll_child (handle, arg0, arg1);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1514 case SWITCH_PAGE: return gtk_switch_page (handle, arg0, arg1);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1515 case TEST_COLLAPSE_ROW: return gtk_test_collapse_row (handle, arg0, arg1);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1516 case TEST_EXPAND_ROW: return gtk_test_expand_row(handle, arg0, arg1);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1517 default: return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1518 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1519 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1520
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1521 int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1522 switch ((int)/*64*/user_data) {
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1523 case CHANGE_VALUE: return gtk_change_value (handle, arg0, arg1, arg2);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1524 case EXPAND_COLLAPSE_CURSOR_ROW: return gtk_expand_collapse_cursor_row (handle, arg0, arg1, arg2);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1525 case INSERT_TEXT: return gtk_insert_text (handle, arg0, arg1, arg2);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1526 case TEXT_BUFFER_INSERT_TEXT: return gtk_text_buffer_insert_text (handle, arg0, arg1, arg2);
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1527 default: return 0;
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1528 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1529 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1530
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1531 }
fc2b263b8a3f Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff changeset
1532 ++/