Mercurial > projects > dwt-linux
annotate dwt/widgets/Widget.d @ 33:27324bbbac70
changed to regenerated BCD bindings
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 10 Jan 2008 02:18:07 +0100 |
parents | ffffd0cd3b59 |
children | c86fc3d50cfa |
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 |
28 | 13 import dwt.SWT; |
14 import dwt.dwthelper.utils; | |
15 | |
16 import dwt.events.DisposeListener; | |
17 import dwt.internal.Converter; | |
18 import dwt.internal.SWTEventListener; | |
19 import dwt.internal.gtk.OS; | |
20 import dwt.widgets.Display; | |
27 | 21 import dwt.widgets.Event; |
28 | 22 import dwt.widgets.EventTable; |
23 import dwt.widgets.Listener; | |
24 import dwt.widgets.TypedListener; | |
26 | 25 |
28 | 26 import tango.stdc.stringz; |
27 import tango.stdc.string; | |
28 | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
29 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
30 * 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
|
31 * 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
|
32 * 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
|
33 * <dl> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
34 * <dt><b>Styles:</b></dt> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
35 * <dd>(none)</dd> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
36 * <dt><b>Events:</b></dt> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
37 * <dd>Dispose</dd> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
38 * </dl> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
39 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
40 * 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
|
41 * 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
|
42 * 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
|
43 * 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
|
44 * 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
|
45 * 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
|
46 * 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
|
47 * 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
|
48 * 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
|
49 * 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
|
50 * 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
|
51 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
52 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
53 * @see #checkSubclass |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
54 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
55 public abstract class Widget { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
56 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
57 * 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
|
58 * (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
|
59 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 * <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
|
61 * 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
|
62 * 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
|
63 * 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
|
64 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 */ |
28 | 66 public GtkWidget* handle; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 int style, state; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 Display display; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 EventTable eventTable; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 Object data; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 /* Global state flags */ |
26 | 73 static const int DISPOSED = 1<<0; |
74 static const int CANVAS = 1<<1; | |
75 static const int KEYED_DATA = 1<<2; | |
76 static const int HANDLE = 1<<3; | |
77 static const int DISABLED = 1<<4; | |
78 static const int MENU = 1<<5; | |
79 static const int OBSCURED = 1<<6; | |
80 static const int MOVED = 1<<7; | |
81 static const int RESIZED = 1<<8; | |
82 static const int ZERO_WIDTH = 1<<9; | |
83 static const int ZERO_HEIGHT = 1<<10; | |
84 static const int HIDDEN = 1<<11; | |
85 static const int FOREGROUND = 1<<12; | |
86 static const int BACKGROUND = 1<<13; | |
87 static const int FONT = 1<<14; | |
88 static const int PARENT_BACKGROUND = 1<<15; | |
89 static const int THEME_BACKGROUND = 1<<16; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
90 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
91 /* A layout was requested on this widget */ |
26 | 92 static const int LAYOUT_NEEDED = 1<<17; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
94 /* The preferred size of a child has changed */ |
26 | 95 static const int LAYOUT_CHANGED = 1<<18; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
96 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
97 /* A layout was requested in this widget hierachy */ |
26 | 98 static const int LAYOUT_CHILD = 1<<19; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
99 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
100 /* More global state flags */ |
26 | 101 static const int RELEASED = 1<<20; |
102 static const int DISPOSE_SENT = 1<<21; | |
103 static const int FOREIGN_HANDLE = 1<<22; | |
104 static const int DRAG_DETECT = 1<<23; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
105 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
106 /* Default size for widgets */ |
26 | 107 static const int DEFAULT_WIDTH = 64; |
108 static const int DEFAULT_HEIGHT = 64; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
109 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 /* GTK signals data */ |
26 | 111 static const int ACTIVATE = 1; |
112 static const int BUTTON_PRESS_EVENT = 2; | |
113 static const int BUTTON_PRESS_EVENT_INVERSE = 3; | |
114 static const int BUTTON_RELEASE_EVENT = 4; | |
115 static const int BUTTON_RELEASE_EVENT_INVERSE = 5; | |
116 static const int CHANGED = 6; | |
117 static const int CHANGE_VALUE = 7; | |
118 static const int CLICKED = 8; | |
119 static const int COMMIT = 9; | |
120 static const int CONFIGURE_EVENT = 10; | |
121 static const int DELETE_EVENT = 11; | |
122 static const int DELETE_RANGE = 12; | |
123 static const int DELETE_TEXT = 13; | |
124 static const int ENTER_NOTIFY_EVENT = 14; | |
125 static const int EVENT = 15; | |
126 static const int EVENT_AFTER = 16; | |
127 static const int EXPAND_COLLAPSE_CURSOR_ROW = 17; | |
128 static const int EXPOSE_EVENT = 18; | |
129 static const int EXPOSE_EVENT_INVERSE = 19; | |
130 static const int FOCUS = 20; | |
131 static const int FOCUS_IN_EVENT = 21; | |
132 static const int FOCUS_OUT_EVENT = 22; | |
133 static const int GRAB_FOCUS = 23; | |
134 static const int HIDE = 24; | |
135 static const int INPUT = 25; | |
136 static const int INSERT_TEXT = 26; | |
137 static const int KEY_PRESS_EVENT = 27; | |
138 static const int KEY_RELEASE_EVENT = 28; | |
139 static const int LEAVE_NOTIFY_EVENT = 29; | |
140 static const int MAP = 30; | |
141 static const int MAP_EVENT = 31; | |
142 static const int MNEMONIC_ACTIVATE = 32; | |
143 static const int MOTION_NOTIFY_EVENT = 33; | |
144 static const int MOTION_NOTIFY_EVENT_INVERSE = 34; | |
145 static const int MOVE_FOCUS = 35; | |
146 static const int OUTPUT = 36; | |
147 static const int POPUP_MENU = 37; | |
148 static const int PREEDIT_CHANGED = 38; | |
149 static const int REALIZE = 39; | |
150 static const int ROW_ACTIVATED = 40; | |
151 static const int SCROLL_CHILD = 41; | |
152 static const int SCROLL_EVENT = 42; | |
153 static const int SELECT = 43; | |
154 static const int SHOW = 44; | |
155 static const int SHOW_HELP = 45; | |
156 static const int SIZE_ALLOCATE = 46; | |
157 static const int STYLE_SET = 47; | |
158 static const int SWITCH_PAGE = 48; | |
159 static const int TEST_COLLAPSE_ROW = 49; | |
160 static const int TEST_EXPAND_ROW = 50; | |
161 static const int TEXT_BUFFER_INSERT_TEXT = 51; | |
162 static const int TOGGLED = 52; | |
163 static const int UNMAP = 53; | |
164 static const int UNMAP_EVENT = 54; | |
165 static const int UNREALIZE = 55; | |
166 static const int VALUE_CHANGED = 56; | |
167 static const int VISIBILITY_NOTIFY_EVENT = 57; | |
168 static const int WINDOW_STATE_EVENT = 58; | |
169 static const int ACTIVATE_INVERSE = 59; | |
170 static const int DAY_SELECTED = 60; | |
171 static const int MONTH_CHANGED = 61; | |
172 static const int LAST_SIGNAL = 62; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
173 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
174 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
175 * 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
|
176 */ |
28 | 177 this () {} |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
178 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
179 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
180 * 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
|
181 * 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
|
182 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
183 * 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
|
184 * 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
|
185 * 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
|
186 * (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
|
187 * 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
|
188 * 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
|
189 * 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
|
190 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
191 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
192 * @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
|
193 * @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
|
194 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
195 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
196 * <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
|
197 * <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
|
198 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
199 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
200 * <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
|
201 * <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
|
202 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
203 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
204 * @see SWT |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
205 * @see #checkSubclass |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
206 * @see #getStyle |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
207 */ |
28 | 208 public this (Widget parent, int style) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
209 checkSubclass (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
210 checkParent (parent); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
211 this.style = style; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
212 display = parent.display; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
213 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
214 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
215 void _addListener (int eventType, Listener listener) { |
28 | 216 if (eventTable is null) eventTable = new EventTable (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
217 eventTable.hook (eventType, listener); |
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 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
220 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
221 * 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
|
222 * 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
|
223 * 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
|
224 * 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
|
225 * 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
|
226 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
227 * @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
|
228 * @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
|
229 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
230 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
231 * <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
|
232 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
233 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
234 * <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
|
235 * <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
|
236 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
237 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
238 * @see Listener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
239 * @see SWT |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
240 * @see #removeListener(int, Listener) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
241 * @see #notifyListeners |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
242 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
243 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
|
244 checkWidget (); |
28 | 245 if (listener is null) error (SWT.ERROR_NULL_ARGUMENT); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
246 _addListener (eventType, listener); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
247 } |
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 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
250 * 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
|
251 * 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
|
252 * 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
|
253 * <code>widgetDisposed()</code> message. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
254 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
255 * @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
|
256 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
257 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
258 * <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
|
259 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
260 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
261 * <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
|
262 * <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
|
263 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
264 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
265 * @see DisposeListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
266 * @see #removeDisposeListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
267 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
268 public void addDisposeListener (DisposeListener listener) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
269 checkWidget (); |
28 | 270 if (listener is null) error (SWT.ERROR_NULL_ARGUMENT); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
271 TypedListener typedListener = new TypedListener (listener); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
272 addListener (SWT.Dispose, typedListener); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
273 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
274 |
28 | 275 GdkWindow* paintWindow () { |
276 return null; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
277 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
278 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
279 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
|
280 int mask = int0 | int1 | int2 | int3 | int4 | int5; |
28 | 281 if ((style & mask) is 0) style |= int0; |
282 if ((style & int0) !is 0) style = (style & ~mask) | int0; | |
283 if ((style & int1) !is 0) style = (style & ~mask) | int1; | |
284 if ((style & int2) !is 0) style = (style & ~mask) | int2; | |
285 if ((style & int3) !is 0) style = (style & ~mask) | int3; | |
286 if ((style & int4) !is 0) style = (style & ~mask) | int4; | |
287 if ((style & int5) !is 0) style = (style & ~mask) | int5; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
288 return style; |
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 |
28 | 291 int /*long*/ cellDataProc (int /*long*/ tree_column, int /*long*/ cell, int /*long*/ tree_model, int /*long*/ iter, GtkWidget* data) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
292 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
293 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
294 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
295 void checkOpen () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
296 /* Do nothing */ |
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 void checkOrientation (Widget parent) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
300 style &= ~SWT.MIRRORED; |
28 | 301 if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) is 0) { |
302 if (parent !is null) { | |
303 if ((parent.style & SWT.LEFT_TO_RIGHT) !is 0) style |= SWT.LEFT_TO_RIGHT; | |
304 if ((parent.style & SWT.RIGHT_TO_LEFT) !is 0) style |= SWT.RIGHT_TO_LEFT; | |
25
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 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
307 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
|
308 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
309 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
310 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
311 * 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
|
312 * 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
|
313 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
314 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
315 * <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
|
316 * <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
|
317 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
318 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
319 * <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
|
320 * </ul> |
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 void checkParent (Widget parent) { |
28 | 323 if (parent is null) error (SWT.ERROR_NULL_ARGUMENT); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
324 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
|
325 parent.checkWidget (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
326 parent.checkOpen (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
327 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
328 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
329 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
330 * 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
|
331 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
332 * 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
|
333 * 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
|
334 * <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
|
335 * 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
|
336 * rule unless it is overridden. |
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 * <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
|
339 * 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
|
340 * 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
|
341 * 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
|
342 * 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
|
343 * 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
|
344 * 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
|
345 * </p><p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
346 * 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
|
347 * 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
|
348 * 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
|
349 * 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
|
350 * 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
|
351 * 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
|
352 * </p> |
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 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
355 * <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
|
356 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
357 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
358 protected void checkSubclass () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
359 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
|
360 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
361 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
362 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
363 * 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
|
364 * 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
|
365 * 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
|
366 * 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
|
367 * 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
|
368 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
369 * 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
|
370 * <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
|
371 * <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
|
372 * 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
|
373 * 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
|
374 * </p><p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
375 * 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
|
376 * 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
|
377 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
378 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
379 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
380 * <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
|
381 * <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
|
382 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
383 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
384 protected void checkWidget () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
385 Display display = this.display; |
28 | 386 if (display is null) error (SWT.ERROR_WIDGET_DISPOSED); |
387 if (display.thread !is Thread.getThis ()) error (SWT.ERROR_THREAD_INVALID_ACCESS); | |
388 if ((state & DISPOSED) !is 0) error (SWT.ERROR_WIDGET_DISPOSED); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
389 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
390 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
391 void createHandle (int index) { |
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 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
394 void createWidget (int index) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
395 createHandle (index); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
396 setOrientation (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
397 hookEvents (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
398 register (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
399 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
400 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
401 void deregister () { |
28 | 402 if (handle is null) return; |
403 if ((state & HANDLE) !is 0) display.removeWidget (handle); | |
25
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 void destroyWidget () { |
28 | 407 GtkWidget* h = topHandle (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
408 releaseHandle (); |
28 | 409 if (h !is null && (state & HANDLE) !is 0) { |
410 OS.gtk_widget_destroy (h); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
411 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
412 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
413 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
414 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
415 * 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
|
416 * 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
|
417 * 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
|
418 * <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
|
419 * 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
|
420 * 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
|
421 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
422 * 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
|
423 * 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
|
424 * 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
|
425 * 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
|
426 * event. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
427 * </p> |
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 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
430 * <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
|
431 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
432 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
433 * @see #addDisposeListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
434 * @see #removeDisposeListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
435 * @see #checkWidget |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
436 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
437 public void dispose () { |
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 * 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
|
440 * 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
|
441 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
442 if (isDisposed ()) return; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
443 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
|
444 release (true); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
445 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
446 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
447 void error (int code) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
448 SWT.error (code); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
449 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
450 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
451 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
452 * 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
|
453 * 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
|
454 * <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
|
455 * stored with every widget. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
456 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
457 * 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
|
458 * 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
|
459 * 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
|
460 * 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
|
461 * do so. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
462 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
463 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
464 * @return the widget data |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
465 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
466 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
467 * <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
|
468 * <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
|
469 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
470 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
471 * @see #setData(Object) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
472 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
473 public Object getData () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
474 checkWidget(); |
28 | 475 return (state & KEYED_DATA) !is 0 ? (cast(ArrayWrapperObject)data).array[0] : data; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
476 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
477 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
478 * 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
|
479 * 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
|
480 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
481 * 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
|
482 * 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
|
483 * 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
|
484 * 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
|
485 * 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
|
486 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
487 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
488 * @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
|
489 * @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
|
490 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
491 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
492 * <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
|
493 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
494 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
495 * <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
|
496 * <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
|
497 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
498 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
499 * @see #setData(String, Object) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
500 */ |
28 | 501 public Object getData (char[] key) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
502 checkWidget(); |
28 | 503 if (key is null) error (SWT.ERROR_NULL_ARGUMENT); |
504 if ((state & KEYED_DATA) !is 0) { | |
505 char[][] table = (cast(ArrayWrapperString2) data).array; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
506 for (int i=1; i<table.length; i+=2) { |
28 | 507 if (key ==/*eq*/ table [i] ) return new ArrayWrapperString( table [i+1] ); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
508 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
509 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
510 return null; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
511 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
512 |
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 * 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
|
515 * the receiver. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
516 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
517 * 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
|
518 * (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
|
519 * 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
|
520 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
521 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
522 * @return the receiver's display |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
523 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
524 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
525 * <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
|
526 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
527 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
528 public Display getDisplay () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
529 Display display = this.display; |
28 | 530 if (display is null) error (SWT.ERROR_WIDGET_DISPOSED); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
531 return display; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
532 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
533 |
28 | 534 char[] getName () { |
535 // char[] str = getClass ().getName (); | |
536 // int index = str.lastIndexOf ('.'); | |
537 // if (index is -1) return str; | |
538 char[] str = this.classinfo.name; | |
539 int index = str.length; | |
540 while ((--index > 0) && (str[index] !is '.')) {} | |
541 return str[index + 1 .. $ ]; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
542 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
543 |
28 | 544 char[] getNameText () { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
545 return ""; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
546 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
547 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
548 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
549 * 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
|
550 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
551 * 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
|
552 * 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
|
553 * 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
|
554 * 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
|
555 * 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
|
556 * 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
|
557 * 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
|
558 * <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
|
559 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
560 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
561 * @return the style bits |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
562 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
563 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
564 * <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
|
565 * <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
|
566 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
567 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
568 public int getStyle () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
569 checkWidget (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
570 return style; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
571 } |
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 |
28 | 574 int /*long*/ gtk_activate (GtkWidget* widget) { |
25
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 |
28 | 578 int /*long*/ gtk_button_press_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 582 int /*long*/ gtk_button_release_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 586 int /*long*/ gtk_changed (GtkWidget* widget) { |
25
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 |
28 | 590 int /*long*/ gtk_change_value (GtkWidget* widget, int /*long*/ scroll, int /*long*/ value1, int /*long*/ value2) { |
25
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 |
28 | 594 int /*long*/ gtk_clicked (GtkWidget* widget) { |
25
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_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
|
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 |
28 | 602 int /*long*/ gtk_configure_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 606 int /*long*/ gtk_day_selected (GtkWidget* widget) { |
25
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 |
28 | 610 int /*long*/ gtk_delete_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 614 int /*long*/ gtk_delete_range (GtkWidget* widget, int /*long*/ iter1, int /*long*/ iter2) { |
25
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 |
28 | 618 int /*long*/ gtk_delete_text (GtkWidget* widget, int /*long*/ start_pos, int /*long*/ end_pos) { |
25
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 |
28 | 622 int /*long*/ gtk_enter_notify_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 626 int /*long*/ gtk_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 630 int /*long*/ gtk_event_after (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 634 int /*long*/ gtk_expand_collapse_cursor_row (GtkWidget* widget, int /*long*/ logical, int /*long*/ expand, int /*long*/ open_all) { |
25
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 |
28 | 638 int /*long*/ gtk_expose_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 642 int /*long*/ gtk_focus (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 646 int /*long*/ gtk_focus_in_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 650 int /*long*/ gtk_focus_out_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 654 int /*long*/ gtk_grab_focus (GtkWidget* widget) { |
25
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 |
28 | 658 int /*long*/ gtk_hide (GtkWidget* widget) { |
25
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 |
28 | 662 int /*long*/ gtk_input (GtkWidget* widget, int /*long*/ arg1) { |
663 return 0; | |
664 } | |
665 | |
666 int /*long*/ gtk_insert_text (GtkWidget* widget, int /*long*/ new_text, int /*long*/ new_text_length, int /*long*/ position) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
667 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
668 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
669 |
28 | 670 int /*long*/ gtk_key_press_event (GtkWidget* widget, GdkEventKey* event) { |
671 return sendKeyEvent (SWT.KeyDown, event) ? 0 : 1; | |
25
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 |
28 | 674 int /*long*/ gtk_key_release_event (GtkWidget* widget, GdkEventKey* event) { |
675 return sendKeyEvent (SWT.KeyUp, event) ? 0 : 1; | |
25
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 |
28 | 678 int /*long*/ gtk_leave_notify_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 682 int /*long*/ gtk_map (GtkWidget* widget) { |
25
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 |
28 | 686 int /*long*/ gtk_map_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 690 int /*long*/ gtk_mnemonic_activate (GtkWidget* widget, int /*long*/ arg1) { |
25
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 |
28 | 694 int /*long*/ gtk_month_changed (GtkWidget* widget) { |
25
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 |
28 | 698 int /*long*/ gtk_motion_notify_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 702 int /*long*/ gtk_move_focus (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 706 int /*long*/ gtk_output (GtkWidget* widget) { |
25
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 |
28 | 710 int /*long*/ gtk_popup_menu (GtkWidget* widget) { |
25
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 |
28 | 714 int /*long*/ gtk_preedit_changed (GtkWidget* imcontext) { |
25
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 |
28 | 718 int /*long*/ gtk_realize (GtkWidget* widget) { |
25
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_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
|
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 |
28 | 726 int /*long*/ gtk_scroll_child (GtkWidget* widget, int /*long*/ scrollType, int /*long*/ horizontal) { |
25
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 |
28 | 730 int /*long*/ gtk_scroll_event (GtkWidget* widget, int /*long*/ event) { |
25
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_select (int /*long*/ item) { |
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 |
28 | 738 int /*long*/ gtk_show (GtkWidget* widget) { |
25
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 |
28 | 742 int /*long*/ gtk_show_help (GtkWidget* widget, int /*long*/ helpType) { |
25
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 |
28 | 746 int /*long*/ gtk_size_allocate (GtkWidget* widget, int /*long*/ allocation) { |
25
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 |
28 | 750 int /*long*/ gtk_style_set (GtkWidget* widget, int /*long*/ previousStyle) { |
25
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 |
28 | 754 int /*long*/ gtk_switch_page (GtkWidget* widget, int /*long*/ page, int /*long*/ page_num) { |
25
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_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
|
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_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
|
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 |
28 | 766 int /*long*/ gtk_text_buffer_insert_text (GtkWidget* widget, int /*long*/ iter, int /*long*/ text, int /*long*/ length) { |
25
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_timer () { |
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_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
|
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 |
28 | 778 int /*long*/ gtk_unmap (GtkWidget* widget) { |
25
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 |
28 | 782 int /*long*/ gtk_unmap_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 786 int /*long*/ gtk_unrealize (GtkWidget* widget) { |
25
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_value_changed (int /*long*/ adjustment) { |
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 |
28 | 794 int /*long*/ gtk_visibility_notify_event (GtkWidget* widget, int /*long*/ event) { |
25
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 |
28 | 798 int /*long*/ gtk_window_state_event (GtkWidget* widget, int /*long*/ event) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
799 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
800 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
801 |
28 | 802 int fontHeight ( PangoFontDescription* font, GtkWidget* widgetHandle ) { |
803 auto context = OS.gtk_widget_get_pango_context (widgetHandle); | |
804 auto lang = OS.pango_context_get_language (context); | |
805 auto metrics = OS.pango_context_get_metrics (context, font, lang); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
806 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
|
807 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
|
808 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
|
809 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
|
810 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
811 |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
812 int filterProc (GdkXEvent* xEvent, GdkEvent* gdkEvent, void* data) { |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
813 return 0; |
25
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 |
28 | 816 bool filters (int eventType) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
817 return display.filters (eventType); |
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 |
28 | 820 int /*long*/ fixedMapProc (GtkWidget* widget) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
821 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
822 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
823 |
28 | 824 char [] fixMnemonic (char[] str) { |
825 int len = str.length; | |
826 char [] text = new char [len]; | |
827 text = str[0 .. len]; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
828 int i = 0, j = 0; |
28 | 829 char [] result = new char [len * 2]; |
830 while (i < len) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
831 switch (text [i]) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
832 case '&': |
28 | 833 if (i + 1 < len && text [i + 1] is '&') { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
834 i++; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
835 } else { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
836 text [i] = '_'; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
837 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
838 break; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
839 case '_': |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
840 result [j++] = '_'; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
841 break; |
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 result [j++] = text [i++]; |
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 return result; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
846 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
847 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
848 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
849 * 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
|
850 * and <code>false</code> otherwise. |
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 * 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
|
853 * 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
|
854 * 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
|
855 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
856 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
857 * @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
|
858 */ |
28 | 859 public bool isDisposed () { |
860 return (state & DISPOSED) !is 0; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
861 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
862 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
863 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
864 * 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
|
865 * 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
|
866 * 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
|
867 * 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
|
868 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
869 * @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
|
870 * @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
|
871 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
872 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
873 * <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
|
874 * <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
|
875 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
876 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
877 * @see SWT |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
878 */ |
28 | 879 public bool isListening (int eventType) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
880 checkWidget (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
881 return hooks (eventType); |
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 |
28 | 884 bool isValidThread () { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
885 return getDisplay ().isValidThread (); |
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 |
28 | 888 bool isValidSubclass() { |
889 return true;//Display.isValidClass(getClass()); | |
25
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 void hookEvents () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
893 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
894 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
895 /* |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
896 * 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
|
897 * 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
|
898 * 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
|
899 * 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
|
900 * 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
|
901 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
902 * @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
|
903 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
904 * @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
|
905 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
906 * @see #isListening |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
907 */ |
28 | 908 bool hooks (int eventType) { |
909 if (eventTable is null) return false; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
910 return eventTable.hooks (eventType); |
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 |
28 | 913 int /*long*/ hoverProc (GtkWidget* widget) { |
25
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 |
28 | 917 int /*long*/ menuPositionProc (GtkWidget * menu, int /*long*/ x, int /*long*/ y, int /*long*/ push_in, int /*long*/ user_data) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
918 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
919 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
920 |
28 | 921 bool mnemonicHit (int /*long*/ mnemonicHandle, char key) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
922 if (!mnemonicMatch (mnemonicHandle, key)) return false; |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
923 OS.g_signal_handlers_block_matched ( cast(void*)mnemonicHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, cast(void*)MNEMONIC_ACTIVATE); |
28 | 924 bool result = cast(bool)OS.gtk_widget_mnemonic_activate (cast(GtkWidget*)mnemonicHandle, false); |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
925 OS.g_signal_handlers_unblock_matched (cast(void*)mnemonicHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, cast(void*)MNEMONIC_ACTIVATE); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
926 return result; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
927 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
928 |
28 | 929 bool mnemonicMatch (int /*long*/ mnemonicHandle, char key) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
930 int keyval1 = OS.gdk_keyval_to_lower (OS.gdk_unicode_to_keyval (key)); |
28 | 931 int keyval2 = OS.gdk_keyval_to_lower (OS.gtk_label_get_mnemonic_keyval (cast(GtkLabel*)mnemonicHandle)); |
932 return keyval1 is keyval2; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
933 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
934 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
935 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
936 * 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
|
937 * 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
|
938 * 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
|
939 * 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
|
940 * <code>SWT</code>. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
941 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
942 * @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
|
943 * @param event the event data |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
944 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
945 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
946 * <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
|
947 * <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
|
948 * </ul> |
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 * @see SWT |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
951 * @see #addListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
952 * @see #removeListener(int, Listener) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
953 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
954 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
|
955 checkWidget(); |
28 | 956 if (event is null) event = new Event (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
957 sendEvent (eventType, event); |
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) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
961 sendEvent (eventType, null, 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 postEvent (int eventType, Event event) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
965 sendEvent (eventType, event, false); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
966 } |
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 void register () { |
28 | 969 if (handle is null) return; |
970 if ((state & HANDLE) !is 0) display.addWidget (handle, this); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
971 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
972 |
28 | 973 void release (bool destroy) { |
974 if ((state & DISPOSE_SENT) is 0) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
975 state |= DISPOSE_SENT; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
976 sendEvent (SWT.Dispose); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
977 } |
28 | 978 if ((state & DISPOSED) is 0) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
979 releaseChildren (destroy); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
980 } |
28 | 981 if ((state & RELEASED) is 0) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
982 state |= RELEASED; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
983 if (destroy) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
984 releaseParent (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
985 releaseWidget (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
986 destroyWidget (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
987 } else { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
988 releaseWidget (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
989 releaseHandle (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
990 } |
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 |
28 | 994 void releaseChildren (bool destroy) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
995 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
996 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
997 void releaseHandle () { |
28 | 998 handle = null; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
999 state |= DISPOSED; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1000 display = null; |
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 releaseParent () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1004 /* Do nothing */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1005 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1006 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1007 void releaseWidget () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1008 deregister (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1009 eventTable = null; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1010 data = null; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1011 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1012 |
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 * 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
|
1015 * 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
|
1016 * 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
|
1017 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1018 * @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
|
1019 * @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
|
1020 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1021 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1022 * <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
|
1023 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1024 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1025 * <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
|
1026 * <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
|
1027 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1028 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1029 * @see Listener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1030 * @see SWT |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1031 * @see #addListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1032 * @see #notifyListeners |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1033 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1034 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
|
1035 checkWidget (); |
28 | 1036 if (handler is null) error (SWT.ERROR_NULL_ARGUMENT); |
1037 if (eventTable is null) return; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1038 eventTable.unhook (eventType, handler); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1039 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1040 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1041 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1042 * 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
|
1043 * 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
|
1044 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1045 * <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
|
1046 * 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
|
1047 * 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
|
1048 * referenced from application code. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1049 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1050 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1051 * @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
|
1052 * @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
|
1053 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1054 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1055 * <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
|
1056 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1057 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1058 * <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
|
1059 * <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
|
1060 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1061 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1062 * @see Listener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1063 * @see #addListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1064 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1065 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
|
1066 checkWidget (); |
28 | 1067 if (handler is null) error (SWT.ERROR_NULL_ARGUMENT); |
1068 if (eventTable is null) return; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1069 eventTable.unhook (eventType, handler); |
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 |
28 | 1072 void rendererGetSizeProc(GtkCellRenderer *cell, GtkWidget *handle, GdkRectangle *cell_area, int *x_offset, int *y_offset, int *width, int *height) { |
25
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 |
28 | 1076 void rendererRenderProc (GtkCellRenderer * cell, GdkDrawable * window, GtkWidget * handle, GdkRectangle *background_area, GdkRectangle *cell_area, GdkRectangle *expose_area, int flags){ |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1077 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1078 } |
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 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1081 * 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
|
1082 * 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
|
1083 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1084 * @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
|
1085 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1086 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1087 * <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
|
1088 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1089 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1090 * <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
|
1091 * <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
|
1092 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1093 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1094 * @see DisposeListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1095 * @see #addDisposeListener |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1096 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1097 public void removeDisposeListener (DisposeListener listener) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1098 checkWidget (); |
28 | 1099 if (listener is null) error (SWT.ERROR_NULL_ARGUMENT); |
1100 if (eventTable is null) return; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1101 eventTable.unhook (SWT.Dispose, listener); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1102 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1103 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1104 void sendEvent (Event event) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1105 Display display = event.display; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1106 if (!display.filterEvent (event)) { |
28 | 1107 if (eventTable !is null) eventTable.sendEvent (event); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1108 } |
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) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1112 sendEvent (eventType, null, 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) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1116 sendEvent (eventType, event, true); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1117 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1118 |
28 | 1119 void sendEvent (int eventType, Event event, bool send) { |
1120 if (eventTable is null && !display.filters (eventType)) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1121 return; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1122 } |
28 | 1123 if (event is null) event = new Event (); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1124 event.type = eventType; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1125 event.display = display; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1126 event.widget = this; |
28 | 1127 if (event.time is 0) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1128 event.time = display.getLastEventTime (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1129 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1130 if (send) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1131 sendEvent (event); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1132 } else { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1133 display.postEvent (event); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1134 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1135 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1136 |
28 | 1137 bool sendKeyEvent (int type, GdkEventKey* keyEvent) { |
1138 int len = keyEvent.length; | |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
1139 if (keyEvent.string is null || OS.g_utf8_strlen (keyEvent.string, len) <= 1) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1140 Event event = new Event (); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1141 event.time = keyEvent.time; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1142 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
|
1143 sendEvent (type, event); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1144 // 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
|
1145 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1146 /* |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1147 * 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
|
1148 * 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
|
1149 * 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
|
1150 * the key by returning false. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1151 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1152 if (isDisposed ()) return false; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1153 return event.doit; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1154 } |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
1155 char [] chars = fromUtf8z( keyEvent.string ); |
28 | 1156 return sendIMKeyEvent (type, keyEvent, chars) !is null; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1157 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1158 |
28 | 1159 char [] sendIMKeyEvent (int type, GdkEventKey* keyEvent, char [] chars) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1160 int index = 0, count = 0, state = 0; |
28 | 1161 GdkEvent* ptr = null; |
1162 if (keyEvent is null) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1163 ptr = OS.gtk_get_current_event (); |
28 | 1164 if (ptr !is null) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1165 keyEvent = new GdkEventKey (); |
28 | 1166 memmove (keyEvent, ptr, GdkEventKey.sizeof); |
1167 switch (cast(int)keyEvent.type) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1168 case OS.GDK_KEY_PRESS: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1169 case OS.GDK_KEY_RELEASE: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1170 state = keyEvent.state; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1171 break; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1172 default: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1173 keyEvent = null; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1174 break; |
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 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1177 } |
28 | 1178 if (keyEvent is null) { |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
1179 int buffer; |
28 | 1180 OS.gtk_get_current_event_state (&buffer); |
1181 state = buffer; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1182 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1183 while (index < chars.length) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1184 Event event = new Event (); |
28 | 1185 if (keyEvent !is null && chars.length <= 1) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1186 setKeyState (event, keyEvent); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1187 } else { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1188 setInputState (event, state); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1189 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1190 event.character = chars [index]; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1191 sendEvent (type, event); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1192 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1193 /* |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1194 * 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
|
1195 * 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
|
1196 * 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
|
1197 * the key by returning null. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1198 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1199 if (isDisposed ()) { |
28 | 1200 if (ptr !is null) OS.gdk_event_free (ptr); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1201 return null; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1202 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1203 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
|
1204 index++; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1205 } |
28 | 1206 if (ptr !is null) OS.gdk_event_free (ptr); |
1207 if (count is 0) return null; | |
1208 if (index !is count) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1209 char [] result = new char [count]; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1210 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
|
1211 return result; |
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 return chars; |
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 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1216 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1217 * 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
|
1218 * 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
|
1219 * 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
|
1220 * with every widget. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1221 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1222 * 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
|
1223 * 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
|
1224 * 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
|
1225 * 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
|
1226 * do so. |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1227 * </p> |
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 * @param data the widget data |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1230 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1231 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1232 * <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
|
1233 * <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
|
1234 * </ul> |
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 * @see #getData() |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1237 */ |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1238 public void setData (Object data) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1239 checkWidget(); |
28 | 1240 if ((state & KEYED_DATA) !is 0) { |
1241 (cast(ArrayWrapperObject) this.data).array[0] = data; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1242 } else { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1243 this.data = data; |
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 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1247 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1248 * 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
|
1249 * 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
|
1250 * <p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1251 * 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
|
1252 * 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
|
1253 * 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
|
1254 * 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
|
1255 * 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
|
1256 * </p> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1257 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1258 * @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
|
1259 * @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
|
1260 * |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1261 * @exception IllegalArgumentException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1262 * <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
|
1263 * </ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1264 * @exception SWTException <ul> |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1265 * <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
|
1266 * <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
|
1267 * </ul> |
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 * @see #getData(String) |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1270 */ |
28 | 1271 public void setData (char[] key, Object value) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1272 checkWidget(); |
28 | 1273 if (key is null) error (SWT.ERROR_NULL_ARGUMENT); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1274 int index = 1; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1275 Object [] table = null; |
28 | 1276 if ((state & KEYED_DATA) !is 0) { |
1277 auto arr = (cast(ArrayWrapperString2) data).array; | |
1278 ArrayWrapperString[] strtable; | |
1279 foreach( str; arr ){ | |
1280 strtable ~= new ArrayWrapperString( str ); | |
1281 } | |
1282 while (index < strtable.length) { | |
1283 if (key ==/*eq*/ strtable [index].array ) break; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1284 index += 2; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1285 } |
28 | 1286 table = cast(Object[])strtable; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1287 } |
28 | 1288 if (value !is null) { |
1289 if ((state & KEYED_DATA) !is 0) { | |
1290 if (index is table.length) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1291 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
|
1292 System.arraycopy (table, 0, newTable, 0, table.length); |
28 | 1293 table = newTable; |
1294 data = new ArrayWrapperObject( table ); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1295 } |
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 table = new Object [3]; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1298 table [0] = data; |
28 | 1299 data = new ArrayWrapperObject( table ); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1300 state |= KEYED_DATA; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1301 } |
28 | 1302 table [index] = new ArrayWrapperString( key ); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1303 table [index + 1] = value; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1304 } else { |
28 | 1305 if ((state & KEYED_DATA) !is 0) { |
1306 if (index !is table.length) { | |
1307 int len = table.length - 2; | |
1308 if (len is 1) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1309 data = table [0]; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1310 state &= ~KEYED_DATA; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1311 } else { |
28 | 1312 Object [] newTable = new Object [len]; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1313 System.arraycopy (table, 0, newTable, 0, index); |
28 | 1314 System.arraycopy (table, index + 2, newTable, index, len - index); |
1315 data = new ArrayWrapperObject( newTable ); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1316 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1317 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1318 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1319 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1320 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1321 |
28 | 1322 void setForegroundColor (GtkWidget* handle, GdkColor* color) { |
1323 auto style = OS.gtk_widget_get_modifier_style (handle); | |
25
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_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
|
1325 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
|
1326 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
|
1327 int flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL); |
28 | 1328 flags = (color is null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG; |
25
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_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
|
1330 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_ACTIVE); |
28 | 1331 flags = (color is null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1332 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
|
1333 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_PRELIGHT); |
28 | 1334 flags = (color is null) ? flags & ~OS.GTK_RC_FG: flags | OS.GTK_RC_FG; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1335 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
|
1336 |
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_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
|
1338 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
|
1339 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
|
1340 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_NORMAL); |
28 | 1341 flags = (color is null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1342 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
|
1343 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_PRELIGHT); |
28 | 1344 flags = (color is null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1345 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
|
1346 flags = OS.gtk_rc_style_get_color_flags (style, OS.GTK_STATE_ACTIVE); |
28 | 1347 flags = (color is null) ? flags & ~OS.GTK_RC_TEXT: flags | OS.GTK_RC_TEXT; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1348 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
|
1349 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
|
1350 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1351 |
28 | 1352 bool setInputState (Event event, int state) { |
1353 if ((state & OS.GDK_MOD1_MASK) !is 0) event.stateMask |= SWT.ALT; | |
1354 if ((state & OS.GDK_SHIFT_MASK) !is 0) event.stateMask |= SWT.SHIFT; | |
1355 if ((state & OS.GDK_CONTROL_MASK) !is 0) event.stateMask |= SWT.CONTROL; | |
1356 if ((state & OS.GDK_BUTTON1_MASK) !is 0) event.stateMask |= SWT.BUTTON1; | |
1357 if ((state & OS.GDK_BUTTON2_MASK) !is 0) event.stateMask |= SWT.BUTTON2; | |
1358 if ((state & OS.GDK_BUTTON3_MASK) !is 0) event.stateMask |= SWT.BUTTON3; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1359 return true; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1360 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1361 |
28 | 1362 bool setKeyState (Event event, GdkEventKey* keyEvent) { |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
1363 if (keyEvent.string !is null && OS.g_utf8_strlen (keyEvent.string, keyEvent.length) > 1) return false; |
28 | 1364 bool isNull = false; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1365 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
|
1366 switch (keyEvent.keyval) { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1367 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
|
1368 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
|
1369 case OS.GDK_KP_Enter: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1370 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
|
1371 case OS.GDK_KP_Delete: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1372 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
|
1373 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
|
1374 case OS.GDK_Tab: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1375 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
|
1376 default: { |
28 | 1377 if (event.keyCode is 0) { |
1378 uint keyval; | |
1379 int effective_group, level; | |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
1380 int consumed_modifiers; |
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
29
diff
changeset
|
1381 if (OS.gdk_keymap_translate_keyboard_state(OS.gdk_keymap_get_default (), keyEvent.hardware_keycode, 0, keyEvent.group, &keyval, &effective_group, &level, &consumed_modifiers)) { |
28 | 1382 event.keyCode = OS.gdk_keyval_to_unicode (keyval ); |
25
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 int key = keyEvent.keyval; |
28 | 1386 if ((keyEvent.state & OS.GDK_CONTROL_MASK) !is 0 && (0 <= key && key <= 0x7F)) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1387 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
|
1388 if (64 <= key && key <= 95) key -= 64; |
28 | 1389 event.character = cast(char) key; |
1390 isNull = keyEvent.keyval is '@' && key is 0; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1391 } else { |
28 | 1392 event.character = cast(char) OS.gdk_keyval_to_unicode (key); |
25
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 } |
28 | 1396 if (event.keyCode is 0 && event.character is 0) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1397 if (!isNull) return false; |
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 return setInputState (event, keyEvent.state); |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1400 } |
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 void setOrientation () { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1403 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1404 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1405 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
|
1406 return 0; |
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 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1409 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
|
1410 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1411 } |
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 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
|
1414 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1415 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1416 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1417 /** |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1418 * 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
|
1419 * description of the receiver. |
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 * @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
|
1422 */ |
28 | 1423 public char[] toString () { |
1424 char[] str = "*Disposed*"; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1425 if (!isDisposed ()) { |
28 | 1426 str = "*Wrong Thread*"; |
1427 if (isValidThread ()) str = getNameText (); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1428 } |
28 | 1429 return getName () ~ " {" ~ str ~ "}"; |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1430 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1431 |
28 | 1432 GtkWidget* topHandle () { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1433 return handle; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1434 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1435 |
28 | 1436 int /*long*/ timerProc (GtkWidget* widget) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1437 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1438 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1439 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1440 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
|
1441 return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1442 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1443 |
28 | 1444 bool translateTraversal (int event) { |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1445 return false; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1446 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1447 |
28 | 1448 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ user_data) { |
1449 switch (cast(int)/*64*/user_data) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1450 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
|
1451 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
|
1452 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
|
1453 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
|
1454 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
|
1455 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
|
1456 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
|
1457 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
|
1458 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
|
1459 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
|
1460 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
|
1461 case REALIZE: return gtk_realize (handle); |
28 | 1462 case SELECT: return gtk_select (cast(int)handle); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1463 case SHOW: return gtk_show (handle); |
28 | 1464 case VALUE_CHANGED: return gtk_value_changed (cast(int)handle); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1465 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
|
1466 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
|
1467 default: return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1468 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1469 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1470 |
28 | 1471 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ user_data) { |
1472 switch (cast(int)/*64*/user_data) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1473 case EXPOSE_EVENT_INVERSE: { |
28 | 1474 GdkEventExpose* gdkEvent = new GdkEventExpose (); |
1475 memmove (gdkEvent, cast(void*)arg0, GdkEventExpose.sizeof); | |
1476 auto paintWindow = paintWindow(); | |
1477 auto window = gdkEvent.window; | |
1478 if (window !is paintWindow) return 0; | |
1479 return (state & OBSCURED) !is 0 ? 1 : 0; | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1480 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1481 case BUTTON_PRESS_EVENT_INVERSE: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1482 case BUTTON_RELEASE_EVENT_INVERSE: |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1483 case MOTION_NOTIFY_EVENT_INVERSE: { |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1484 return 1; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1485 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1486 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
|
1487 case BUTTON_RELEASE_EVENT: return gtk_button_release_event (handle, arg0); |
28 | 1488 case COMMIT: return gtk_commit (cast(int)handle, arg0); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1489 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
|
1490 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
|
1491 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
|
1492 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
|
1493 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
|
1494 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
|
1495 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
|
1496 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
|
1497 case FOCUS_OUT_EVENT: return gtk_focus_out_event (handle, arg0); |
28 | 1498 case KEY_PRESS_EVENT: return gtk_key_press_event (handle, cast(GdkEventKey*)arg0); |
1499 case KEY_RELEASE_EVENT: return gtk_key_release_event (handle, cast(GdkEventKey*)arg0); | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1500 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
|
1501 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
|
1502 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
|
1503 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
|
1504 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
|
1505 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
|
1506 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
|
1507 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
|
1508 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
|
1509 case STYLE_SET: return gtk_style_set (handle, arg0); |
28 | 1510 case TOGGLED: return gtk_toggled (cast(int)handle, arg0); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1511 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
|
1512 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
|
1513 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
|
1514 default: return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1515 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1516 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1517 |
28 | 1518 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ user_data) { |
1519 switch (cast(int)/*64*/user_data) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1520 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
|
1521 case DELETE_TEXT: return gtk_delete_text (handle, arg0, arg1); |
28 | 1522 case ROW_ACTIVATED: return gtk_row_activated (cast(int)handle, arg0, arg1); |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1523 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
|
1524 case SWITCH_PAGE: return gtk_switch_page (handle, arg0, arg1); |
28 | 1525 case TEST_COLLAPSE_ROW: return gtk_test_collapse_row (cast(int)handle, arg0, arg1); |
1526 case TEST_EXPAND_ROW: return gtk_test_expand_row(cast(int)handle, arg0, arg1); | |
25
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 |
28 | 1531 int /*long*/ windowProc (GtkWidget* handle, int /*long*/ arg0, int /*long*/ arg1, int /*long*/ arg2, int /*long*/ user_data) { |
1532 switch (cast(int)/*64*/user_data) { | |
25
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1533 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
|
1534 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
|
1535 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
|
1536 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
|
1537 default: return 0; |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1538 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1539 } |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1540 |
fc2b263b8a3f
Merged back the System.arraycopy and use a System class
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1541 } |