Mercurial > projects > dwt-linux
annotate dwt/internal/accessibility/gtk/ATK.d @ 321:ffb904674b52
Fixes for LLVMDC
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 27 Sep 2008 15:58:22 +0200 |
parents | 380bad9f6852 |
children | 174bd206cf10 |
rev | line source |
---|---|
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
1 /******************************************************************************* |
30 | 2 * Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. |
3 * The contents of this file are made available under the terms | |
4 * of the GNU Lesser General Public License (LGPL) Version 2.1 that | |
5 * accompanies this distribution (lgpl-v21.txt). The LGPL is also | |
6 * available at http://www.gnu.org/licenses/lgpl.html. If the version | |
7 * of the LGPL at http://www.gnu.org is different to the version of | |
8 * the LGPL accompanying this distribution and there is any conflict | |
9 * between the two license versions, the terms of the LGPL accompanying | |
10 * this distribution shall govern. | |
11 * | |
12 * Contributors: | |
13 * IBM Corporation - initial API and implementation | |
108 | 14 * Port to the D programming language: |
15 * Frank Benoit <benoit@tionex.de> | |
30 | 16 *******************************************************************************/ |
17 module dwt.internal.accessibility.gtk.ATK; | |
18 | |
238 | 19 import dwt.dwthelper.utils; |
20 | |
30 | 21 |
22 import dwt.internal.Library; | |
23 import dwt.internal.gtk.OS; | |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
30
diff
changeset
|
24 import dwt.internal.c.atk; |
42 | 25 import dwt.internal.c.gtk; |
30 | 26 |
27 import tango.core.Traits; | |
28 | |
42 | 29 alias dwt.internal.c.atk.AtkObjectFactory AtkObjectFactory; |
30 alias dwt.internal.c.atk.AtkObjectClass AtkObjectClass; | |
31 alias dwt.internal.c.atk.AtkActionIface AtkActionIface; | |
32 alias dwt.internal.c.atk.AtkComponentIface AtkComponentIface; | |
33 alias dwt.internal.c.atk.AtkHypertextIface AtkHypertextIface; | |
34 alias dwt.internal.c.atk.AtkSelectionIface AtkSelectionIface; | |
35 alias dwt.internal.c.atk.AtkTextIface AtkTextIface; | |
36 alias dwt.internal.c.atk.AtkObject AtkObject; | |
37 alias dwt.internal.c.atk.AtkStateSet AtkStateSet; | |
38 alias dwt.internal.c.atk.AtkObjectFactoryClass AtkObjectFactoryClass; | |
39 alias dwt.internal.c.atk.AtkHyperlink AtkHyperlink; | |
40 | |
41 alias dwt.internal.c.gtk.GtkAccessible GtkAccessible; | |
42 | |
54 | 43 private AtkActionIface* ATK_ACTION_GET_IFACE( AtkObject* ){ |
44 return null; | |
45 } | |
46 private AtkComponentIface* ATK_COMPONENT_GET_IFACE( AtkObject* ){ | |
47 return null; | |
48 } | |
49 private AtkObjectFactoryClass* ATK_OBJECT_FACTORY_CLASS( void* ){ | |
50 return null; | |
51 } | |
52 private AtkSelectionIface* ATK_SELECTION_GET_IFACE( AtkObject* ){ | |
53 return null; | |
54 } | |
55 private AtkTextIface* ATK_TEXT_GET_IFACE(AtkObject*){ | |
56 return null; | |
57 } | |
58 private GtkAccessible* GTK_ACCESSIBLE(AtkObject*){ | |
59 return null; | |
60 } | |
42 | 61 |
62 | |
30 | 63 template NameOfFunc(alias f) { |
64 // Note: highly dependent on the .stringof formatting | |
65 // the value begins with "& " which is why the first two chars are cut off | |
321 | 66 version( LLVMDC ){ |
67 // stringof in LLVMDC is "&foobar" | |
68 const char[] NameOfFunc = (&f).stringof[1 .. $]; | |
69 } | |
70 else{ | |
71 // stringof in DMD is "& foobar" | |
72 const char[] NameOfFunc = (&f).stringof[2 .. $]; | |
73 } | |
30 | 74 } |
75 | |
76 template ForwardGtkAtkCFunc( alias cFunc ) { | |
77 alias ParameterTupleOf!(cFunc) P; | |
78 alias ReturnTypeOf!(cFunc) R; | |
79 mixin("public static R " ~ NameOfFunc!(cFunc) ~ "( P p ){ | |
80 lock.lock(); | |
81 scope(exit) lock.unlock(); | |
82 return cFunc(p); | |
83 }"); | |
84 } | |
85 /+ | |
86 // alternative template implementation, might be more stable | |
238 | 87 template ForwardGtkOsCFunc(String name) { |
30 | 88 alias typeof(mixin(name)) func; |
89 alias ParameterTupleOf!(func) Params; | |
90 alias ReturnTypeOf!(func) Ret; | |
91 mixin("public static Ret "~name~"( Params p ) { | |
92 return ."~name~"(p); | |
93 }"); | |
94 } | |
95 +/ | |
96 | |
97 public class ATK : OS { | |
98 | |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
99 /** Constants */ |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
100 public static const int ATK_RELATION_LABELLED_BY = 4; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
101 public static const int ATK_ROLE_CHECK_BOX = 7; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
102 public static const int ATK_ROLE_COMBO_BOX = 11; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
103 public static const int ATK_ROLE_DIALOG = 16; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
104 public static const int ATK_ROLE_DRAWING_AREA = 18; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
105 public static const int ATK_ROLE_WINDOW = 68; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
106 public static const int ATK_ROLE_LABEL = 28; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
107 public static const int ATK_ROLE_LIST = 30; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
108 public static const int ATK_ROLE_LIST_ITEM = 31; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
109 public static const int ATK_ROLE_MENU = 32; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
110 public static const int ATK_ROLE_MENU_BAR = 33; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
111 public static const int ATK_ROLE_MENU_ITEM = 34; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
112 public static const int ATK_ROLE_PAGE_TAB = 36; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
113 public static const int ATK_ROLE_PAGE_TAB_LIST = 37; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
114 public static const int ATK_ROLE_PROGRESS_BAR = 41; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
115 public static const int ATK_ROLE_PUSH_BUTTON = 42; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
116 public static const int ATK_ROLE_RADIO_BUTTON = 43; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
117 public static const int ATK_ROLE_SCROLL_BAR = 47; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
118 public static const int ATK_ROLE_SEPARATOR = 49; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
119 public static const int ATK_ROLE_SLIDER = 50; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
120 public static const int ATK_ROLE_TABLE = 54; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
121 public static const int ATK_ROLE_TABLE_CELL = 55; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
122 public static const int ATK_ROLE_TABLE_COLUMN_HEADER = 56; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
123 public static const int ATK_ROLE_TABLE_ROW_HEADER = 57; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
124 public static const int ATK_ROLE_TEXT = 60; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
125 public static const int ATK_ROLE_TOOL_BAR = 62; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
126 public static const int ATK_ROLE_TOOL_TIP = 63; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
127 public static const int ATK_ROLE_TREE = 64; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
128 public static const int ATK_STATE_ARMED = 2; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
129 public static const int ATK_STATE_BUSY = 3; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
130 public static const int ATK_STATE_CHECKED = 4; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
131 public static const int ATK_STATE_DEFUNCT = 5; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
132 public static const int ATK_STATE_EDITABLE = 6; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
133 public static const int ATK_STATE_ENABLED = 7; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
134 public static const int ATK_STATE_EXPANDED = 9; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
135 public static const int ATK_STATE_FOCUSABLE = 10; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
136 public static const int ATK_STATE_FOCUSED = 11; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
137 public static const int ATK_STATE_MULTISELECTABLE = 16; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
138 public static const int ATK_STATE_PRESSED = 18; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
139 public static const int ATK_STATE_RESIZABLE = 19; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
140 public static const int ATK_STATE_SELECTABLE = 20; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
141 public static const int ATK_STATE_SELECTED = 21; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
142 public static const int ATK_STATE_SHOWING = 23; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
143 public static const int ATK_STATE_TRANSIENT = 26; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
144 public static const int ATK_STATE_VISIBLE = 28; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
145 public static const int ATK_TEXT_BOUNDARY_CHAR = 0; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
146 public static const int ATK_TEXT_BOUNDARY_WORD_START = 1; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
147 public static const int ATK_TEXT_BOUNDARY_WORD_END = 2; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
148 public static const int ATK_TEXT_BOUNDARY_SENTENCE_START = 3; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
149 public static const int ATK_TEXT_BOUNDARY_SENTENCE_END = 4; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
150 public static const int ATK_TEXT_BOUNDARY_LINE_START = 5; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
151 public static const int ATK_TEXT_BOUNDARY_LINE_END = 6; |
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
152 public static const int ATK_XY_WINDOW = 1; |
30 | 153 |
59
8cec8f536af3
All D sources complete gvim retab (4 spaces), bug with Composite moveAbove/moveBelow fixed.
Frank Benoit <benoit@tionex.de>
parents:
54
diff
changeset
|
154 /** Signals */ |
238 | 155 public static const String selection_changed = "selection_changed"; |
156 public static const String text_changed_insert = "text_changed::insert"; | |
157 public static const String text_changed_delete = "text_changed::delete"; | |
158 public static const String text_caret_moved = "text_caret_moved"; | |
159 public static const String text_selection_changed = "text_selection_changed"; | |
30 | 160 |
42 | 161 mixin ForwardGtkAtkCFunc!(.ATK_ACTION_GET_IFACE ); |
162 mixin ForwardGtkAtkCFunc!(.ATK_COMPONENT_GET_IFACE); | |
163 mixin ForwardGtkAtkCFunc!(.ATK_OBJECT_FACTORY_CLASS ); | |
164 mixin ForwardGtkAtkCFunc!(.ATK_SELECTION_GET_IFACE ); | |
165 mixin ForwardGtkAtkCFunc!(.ATK_TEXT_GET_IFACE ); | |
166 mixin ForwardGtkAtkCFunc!(.GTK_ACCESSIBLE ); | |
30 | 167 mixin ForwardGtkAtkCFunc!(.atk_focus_tracker_notify ); |
168 mixin ForwardGtkAtkCFunc!(.atk_get_default_registry ); | |
169 mixin ForwardGtkAtkCFunc!(.atk_object_factory_create_accessible ); | |
170 mixin ForwardGtkAtkCFunc!(.atk_object_factory_get_accessible_type ); | |
171 mixin ForwardGtkAtkCFunc!(.atk_object_initialize ); | |
172 mixin ForwardGtkAtkCFunc!(.atk_object_ref_relation_set ); | |
173 mixin ForwardGtkAtkCFunc!(.atk_registry_get_factory ); | |
174 mixin ForwardGtkAtkCFunc!(.atk_registry_set_factory_type ); | |
175 mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_n_relations ); | |
176 mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_relation ); | |
177 mixin ForwardGtkAtkCFunc!(.atk_relation_set_remove ); | |
178 mixin ForwardGtkAtkCFunc!(.atk_state_set_add_state ); | |
179 mixin ForwardGtkAtkCFunc!(.atk_state_set_new ); | |
180 | |
181 } | |
42 | 182 |
183 |