Mercurial > projects > dwt-linux
annotate dwt/internal/accessibility/gtk/ATK.d @ 42:787b5413b0ce
accessibility package
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Jan 2008 05:07:22 +0100 |
parents | 27324bbbac70 |
children | 8f049b136add |
rev | line source |
---|---|
30 | 1 /******************************************************************************* |
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 | |
14 *******************************************************************************/ | |
15 module dwt.internal.accessibility.gtk.ATK; | |
16 | |
17 | |
18 import dwt.internal.Library; | |
19 import dwt.internal.gtk.OS; | |
33
27324bbbac70
changed to regenerated BCD bindings
Frank Benoit <benoit@tionex.de>
parents:
30
diff
changeset
|
20 import dwt.internal.c.atk; |
42 | 21 import dwt.internal.c.gtk; |
30 | 22 |
23 import tango.core.Traits; | |
24 | |
42 | 25 alias dwt.internal.c.atk.AtkObjectFactory AtkObjectFactory; |
26 alias dwt.internal.c.atk.AtkObjectClass AtkObjectClass; | |
27 alias dwt.internal.c.atk.AtkActionIface AtkActionIface; | |
28 alias dwt.internal.c.atk.AtkComponentIface AtkComponentIface; | |
29 alias dwt.internal.c.atk.AtkHypertextIface AtkHypertextIface; | |
30 alias dwt.internal.c.atk.AtkSelectionIface AtkSelectionIface; | |
31 alias dwt.internal.c.atk.AtkTextIface AtkTextIface; | |
32 alias dwt.internal.c.atk.AtkObject AtkObject; | |
33 alias dwt.internal.c.atk.AtkStateSet AtkStateSet; | |
34 alias dwt.internal.c.atk.AtkObjectFactoryClass AtkObjectFactoryClass; | |
35 alias dwt.internal.c.atk.AtkHyperlink AtkHyperlink; | |
36 | |
37 alias dwt.internal.c.gtk.GtkAccessible GtkAccessible; | |
38 | |
39 private AtkActionIface* ATK_ACTION_GET_IFACE( AtkObject* ); | |
40 private AtkComponentIface* ATK_COMPONENT_GET_IFACE( AtkObject* ); | |
41 private AtkObjectFactoryClass* ATK_OBJECT_FACTORY_CLASS( void* ); | |
42 private AtkSelectionIface* ATK_SELECTION_GET_IFACE( AtkObject* ); | |
43 private AtkTextIface* ATK_TEXT_GET_IFACE(AtkObject*); | |
44 private GtkAccessible* GTK_ACCESSIBLE(AtkObject*); | |
45 | |
46 | |
47 | |
48 | |
30 | 49 template NameOfFunc(alias f) { |
50 // Note: highly dependent on the .stringof formatting | |
51 // the value begins with "& " which is why the first two chars are cut off | |
52 const char[] NameOfFunc = (&f).stringof[2 .. $]; | |
53 } | |
54 | |
55 template ForwardGtkAtkCFunc( alias cFunc ) { | |
56 alias ParameterTupleOf!(cFunc) P; | |
57 alias ReturnTypeOf!(cFunc) R; | |
58 mixin("public static R " ~ NameOfFunc!(cFunc) ~ "( P p ){ | |
59 lock.lock(); | |
60 scope(exit) lock.unlock(); | |
61 return cFunc(p); | |
62 }"); | |
63 } | |
64 /+ | |
65 // alternative template implementation, might be more stable | |
66 template ForwardGtkOsCFunc(char[] name) { | |
67 alias typeof(mixin(name)) func; | |
68 alias ParameterTupleOf!(func) Params; | |
69 alias ReturnTypeOf!(func) Ret; | |
70 mixin("public static Ret "~name~"( Params p ) { | |
71 return ."~name~"(p); | |
72 }"); | |
73 } | |
74 +/ | |
75 | |
76 public class ATK : OS { | |
77 | |
78 /** Constants */ | |
79 public static const int ATK_RELATION_LABELLED_BY = 4; | |
80 public static const int ATK_ROLE_CHECK_BOX = 7; | |
81 public static const int ATK_ROLE_COMBO_BOX = 11; | |
82 public static const int ATK_ROLE_DIALOG = 16; | |
83 public static const int ATK_ROLE_DRAWING_AREA = 18; | |
84 public static const int ATK_ROLE_WINDOW = 68; | |
85 public static const int ATK_ROLE_LABEL = 28; | |
86 public static const int ATK_ROLE_LIST = 30; | |
87 public static const int ATK_ROLE_LIST_ITEM = 31; | |
88 public static const int ATK_ROLE_MENU = 32; | |
89 public static const int ATK_ROLE_MENU_BAR = 33; | |
90 public static const int ATK_ROLE_MENU_ITEM = 34; | |
91 public static const int ATK_ROLE_PAGE_TAB = 36; | |
92 public static const int ATK_ROLE_PAGE_TAB_LIST = 37; | |
93 public static const int ATK_ROLE_PROGRESS_BAR = 41; | |
94 public static const int ATK_ROLE_PUSH_BUTTON = 42; | |
95 public static const int ATK_ROLE_RADIO_BUTTON = 43; | |
96 public static const int ATK_ROLE_SCROLL_BAR = 47; | |
97 public static const int ATK_ROLE_SEPARATOR = 49; | |
98 public static const int ATK_ROLE_SLIDER = 50; | |
99 public static const int ATK_ROLE_TABLE = 54; | |
100 public static const int ATK_ROLE_TABLE_CELL = 55; | |
101 public static const int ATK_ROLE_TABLE_COLUMN_HEADER = 56; | |
102 public static const int ATK_ROLE_TABLE_ROW_HEADER = 57; | |
103 public static const int ATK_ROLE_TEXT = 60; | |
104 public static const int ATK_ROLE_TOOL_BAR = 62; | |
105 public static const int ATK_ROLE_TOOL_TIP = 63; | |
106 public static const int ATK_ROLE_TREE = 64; | |
107 public static const int ATK_STATE_ARMED = 2; | |
108 public static const int ATK_STATE_BUSY = 3; | |
109 public static const int ATK_STATE_CHECKED = 4; | |
110 public static const int ATK_STATE_DEFUNCT = 5; | |
111 public static const int ATK_STATE_EDITABLE = 6; | |
112 public static const int ATK_STATE_ENABLED = 7; | |
113 public static const int ATK_STATE_EXPANDED = 9; | |
114 public static const int ATK_STATE_FOCUSABLE = 10; | |
115 public static const int ATK_STATE_FOCUSED = 11; | |
116 public static const int ATK_STATE_MULTISELECTABLE = 16; | |
117 public static const int ATK_STATE_PRESSED = 18; | |
118 public static const int ATK_STATE_RESIZABLE = 19; | |
119 public static const int ATK_STATE_SELECTABLE = 20; | |
120 public static const int ATK_STATE_SELECTED = 21; | |
121 public static const int ATK_STATE_SHOWING = 23; | |
122 public static const int ATK_STATE_TRANSIENT = 26; | |
123 public static const int ATK_STATE_VISIBLE = 28; | |
124 public static const int ATK_TEXT_BOUNDARY_CHAR = 0; | |
125 public static const int ATK_TEXT_BOUNDARY_WORD_START = 1; | |
126 public static const int ATK_TEXT_BOUNDARY_WORD_END = 2; | |
127 public static const int ATK_TEXT_BOUNDARY_SENTENCE_START = 3; | |
128 public static const int ATK_TEXT_BOUNDARY_SENTENCE_END = 4; | |
129 public static const int ATK_TEXT_BOUNDARY_LINE_START = 5; | |
130 public static const int ATK_TEXT_BOUNDARY_LINE_END = 6; | |
131 public static const int ATK_XY_WINDOW = 1; | |
132 | |
133 /** Signals */ | |
134 public static const char[] selection_changed = "selection_changed"; | |
135 public static const char[] text_changed_insert = "text_changed::insert"; | |
136 public static const char[] text_changed_delete = "text_changed::delete"; | |
137 public static const char[] text_caret_moved = "text_caret_moved"; | |
138 public static const char[] text_selection_changed = "text_selection_changed"; | |
139 | |
42 | 140 mixin ForwardGtkAtkCFunc!(.ATK_ACTION_GET_IFACE ); |
141 mixin ForwardGtkAtkCFunc!(.ATK_COMPONENT_GET_IFACE); | |
142 mixin ForwardGtkAtkCFunc!(.ATK_OBJECT_FACTORY_CLASS ); | |
143 mixin ForwardGtkAtkCFunc!(.ATK_SELECTION_GET_IFACE ); | |
144 mixin ForwardGtkAtkCFunc!(.ATK_TEXT_GET_IFACE ); | |
145 mixin ForwardGtkAtkCFunc!(.GTK_ACCESSIBLE ); | |
30 | 146 mixin ForwardGtkAtkCFunc!(.atk_focus_tracker_notify ); |
147 mixin ForwardGtkAtkCFunc!(.atk_get_default_registry ); | |
148 mixin ForwardGtkAtkCFunc!(.atk_object_factory_create_accessible ); | |
149 mixin ForwardGtkAtkCFunc!(.atk_object_factory_get_accessible_type ); | |
150 mixin ForwardGtkAtkCFunc!(.atk_object_initialize ); | |
151 mixin ForwardGtkAtkCFunc!(.atk_object_ref_relation_set ); | |
152 mixin ForwardGtkAtkCFunc!(.atk_registry_get_factory ); | |
153 mixin ForwardGtkAtkCFunc!(.atk_registry_set_factory_type ); | |
154 mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_n_relations ); | |
155 mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_relation ); | |
156 mixin ForwardGtkAtkCFunc!(.atk_relation_set_remove ); | |
157 mixin ForwardGtkAtkCFunc!(.atk_state_set_add_state ); | |
158 mixin ForwardGtkAtkCFunc!(.atk_state_set_new ); | |
159 | |
160 } | |
42 | 161 |
162 |