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;
|
|
20 import dwt.internal.gtk.c.atk;
|
|
21
|
|
22 import tango.core.Traits;
|
|
23
|
|
24 template NameOfFunc(alias f) {
|
|
25 // Note: highly dependent on the .stringof formatting
|
|
26 // the value begins with "& " which is why the first two chars are cut off
|
|
27 const char[] NameOfFunc = (&f).stringof[2 .. $];
|
|
28 }
|
|
29
|
|
30 template ForwardGtkAtkCFunc( alias cFunc ) {
|
|
31 alias ParameterTupleOf!(cFunc) P;
|
|
32 alias ReturnTypeOf!(cFunc) R;
|
|
33 mixin("public static R " ~ NameOfFunc!(cFunc) ~ "( P p ){
|
|
34 lock.lock();
|
|
35 scope(exit) lock.unlock();
|
|
36 return cFunc(p);
|
|
37 }");
|
|
38 }
|
|
39 /+
|
|
40 // alternative template implementation, might be more stable
|
|
41 template ForwardGtkOsCFunc(char[] name) {
|
|
42 alias typeof(mixin(name)) func;
|
|
43 alias ParameterTupleOf!(func) Params;
|
|
44 alias ReturnTypeOf!(func) Ret;
|
|
45 mixin("public static Ret "~name~"( Params p ) {
|
|
46 return ."~name~"(p);
|
|
47 }");
|
|
48 }
|
|
49 +/
|
|
50
|
|
51 public class ATK : OS {
|
|
52
|
|
53 /** Constants */
|
|
54 public static const int ATK_RELATION_LABELLED_BY = 4;
|
|
55 public static const int ATK_ROLE_CHECK_BOX = 7;
|
|
56 public static const int ATK_ROLE_COMBO_BOX = 11;
|
|
57 public static const int ATK_ROLE_DIALOG = 16;
|
|
58 public static const int ATK_ROLE_DRAWING_AREA = 18;
|
|
59 public static const int ATK_ROLE_WINDOW = 68;
|
|
60 public static const int ATK_ROLE_LABEL = 28;
|
|
61 public static const int ATK_ROLE_LIST = 30;
|
|
62 public static const int ATK_ROLE_LIST_ITEM = 31;
|
|
63 public static const int ATK_ROLE_MENU = 32;
|
|
64 public static const int ATK_ROLE_MENU_BAR = 33;
|
|
65 public static const int ATK_ROLE_MENU_ITEM = 34;
|
|
66 public static const int ATK_ROLE_PAGE_TAB = 36;
|
|
67 public static const int ATK_ROLE_PAGE_TAB_LIST = 37;
|
|
68 public static const int ATK_ROLE_PROGRESS_BAR = 41;
|
|
69 public static const int ATK_ROLE_PUSH_BUTTON = 42;
|
|
70 public static const int ATK_ROLE_RADIO_BUTTON = 43;
|
|
71 public static const int ATK_ROLE_SCROLL_BAR = 47;
|
|
72 public static const int ATK_ROLE_SEPARATOR = 49;
|
|
73 public static const int ATK_ROLE_SLIDER = 50;
|
|
74 public static const int ATK_ROLE_TABLE = 54;
|
|
75 public static const int ATK_ROLE_TABLE_CELL = 55;
|
|
76 public static const int ATK_ROLE_TABLE_COLUMN_HEADER = 56;
|
|
77 public static const int ATK_ROLE_TABLE_ROW_HEADER = 57;
|
|
78 public static const int ATK_ROLE_TEXT = 60;
|
|
79 public static const int ATK_ROLE_TOOL_BAR = 62;
|
|
80 public static const int ATK_ROLE_TOOL_TIP = 63;
|
|
81 public static const int ATK_ROLE_TREE = 64;
|
|
82 public static const int ATK_STATE_ARMED = 2;
|
|
83 public static const int ATK_STATE_BUSY = 3;
|
|
84 public static const int ATK_STATE_CHECKED = 4;
|
|
85 public static const int ATK_STATE_DEFUNCT = 5;
|
|
86 public static const int ATK_STATE_EDITABLE = 6;
|
|
87 public static const int ATK_STATE_ENABLED = 7;
|
|
88 public static const int ATK_STATE_EXPANDED = 9;
|
|
89 public static const int ATK_STATE_FOCUSABLE = 10;
|
|
90 public static const int ATK_STATE_FOCUSED = 11;
|
|
91 public static const int ATK_STATE_MULTISELECTABLE = 16;
|
|
92 public static const int ATK_STATE_PRESSED = 18;
|
|
93 public static const int ATK_STATE_RESIZABLE = 19;
|
|
94 public static const int ATK_STATE_SELECTABLE = 20;
|
|
95 public static const int ATK_STATE_SELECTED = 21;
|
|
96 public static const int ATK_STATE_SHOWING = 23;
|
|
97 public static const int ATK_STATE_TRANSIENT = 26;
|
|
98 public static const int ATK_STATE_VISIBLE = 28;
|
|
99 public static const int ATK_TEXT_BOUNDARY_CHAR = 0;
|
|
100 public static const int ATK_TEXT_BOUNDARY_WORD_START = 1;
|
|
101 public static const int ATK_TEXT_BOUNDARY_WORD_END = 2;
|
|
102 public static const int ATK_TEXT_BOUNDARY_SENTENCE_START = 3;
|
|
103 public static const int ATK_TEXT_BOUNDARY_SENTENCE_END = 4;
|
|
104 public static const int ATK_TEXT_BOUNDARY_LINE_START = 5;
|
|
105 public static const int ATK_TEXT_BOUNDARY_LINE_END = 6;
|
|
106 public static const int ATK_XY_WINDOW = 1;
|
|
107
|
|
108 /** Signals */
|
|
109 public static const char[] selection_changed = "selection_changed";
|
|
110 public static const char[] text_changed_insert = "text_changed::insert";
|
|
111 public static const char[] text_changed_delete = "text_changed::delete";
|
|
112 public static const char[] text_caret_moved = "text_caret_moved";
|
|
113 public static const char[] text_selection_changed = "text_selection_changed";
|
|
114
|
|
115 //mixin ForwardGtkAtkCFunc!(.ATK_ACTION_GET_IFACE );
|
|
116 //mixin ForwardGtkAtkCFunc!(.ATK_COMPONENT_GET_IFACE);
|
|
117 //mixin ForwardGtkAtkCFunc!(.ATK_OBJECT_FACTORY_CLASS );
|
|
118 //mixin ForwardGtkAtkCFunc!(.ATK_SELECTION_GET_IFACE );
|
|
119 //mixin ForwardGtkAtkCFunc!(.ATK_TEXT_GET_IFACE );
|
|
120 //mixin ForwardGtkAtkCFunc!(.GTK_ACCESSIBLE );
|
|
121 mixin ForwardGtkAtkCFunc!(.atk_focus_tracker_notify );
|
|
122 mixin ForwardGtkAtkCFunc!(.atk_get_default_registry );
|
|
123 mixin ForwardGtkAtkCFunc!(.atk_object_factory_create_accessible );
|
|
124 mixin ForwardGtkAtkCFunc!(.atk_object_factory_get_accessible_type );
|
|
125 mixin ForwardGtkAtkCFunc!(.atk_object_initialize );
|
|
126 mixin ForwardGtkAtkCFunc!(.atk_object_ref_relation_set );
|
|
127 mixin ForwardGtkAtkCFunc!(.atk_registry_get_factory );
|
|
128 mixin ForwardGtkAtkCFunc!(.atk_registry_set_factory_type );
|
|
129 mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_n_relations );
|
|
130 mixin ForwardGtkAtkCFunc!(.atk_relation_set_get_relation );
|
|
131 mixin ForwardGtkAtkCFunc!(.atk_relation_set_remove );
|
|
132 mixin ForwardGtkAtkCFunc!(.atk_state_set_add_state );
|
|
133 mixin ForwardGtkAtkCFunc!(.atk_state_set_new );
|
|
134
|
|
135 }
|