summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorNohemi Fernandez <nf68@cornell.edu>2011-08-04 14:11:53 -0500
committerEitan Isaacson <eitan@monotonous.org>2011-08-12 09:19:40 +0200
commit2cc662a32f10ac921426a861f6f4ba453d0c9edd (patch)
tree673ba26c418e0eaf12c2867c62ce742577876d49 /modules
parent20a031bf4ebac39d7efa5dd23b5cda0ec2fb8fa9 (diff)
downloadcaribou-2cc662a32f10ac921426a861f6f4ba453d0c9edd.tar.gz
Remove get_acc_geometry
Diffstat (limited to 'modules')
-rw-r--r--modules/gtk2/Makefile.am4
l---------modules/gtk2/vapi-fixes.vapi1
-rw-r--r--modules/gtk3/Makefile.am4
-rw-r--r--modules/gtk3/caribou-gtk-module.vala56
-rw-r--r--modules/gtk3/vapi-fixes.vapi10
5 files changed, 2 insertions, 73 deletions
diff --git a/modules/gtk2/Makefile.am b/modules/gtk2/Makefile.am
index d47a6a4..57e9022 100644
--- a/modules/gtk2/Makefile.am
+++ b/modules/gtk2/Makefile.am
@@ -9,7 +9,6 @@ libcaribou_la_SOURCES = \
libcaribou_la_VALAFLAGS = \
-h caribou-gtk-module.h \
--vapidir=. \
- --pkg vapi-fixes \
--pkg gtk+-2.0 \
-D GTK2 \
$(VALAGLAFS)
@@ -28,6 +27,3 @@ libcaribou_la_LDFLAGS = \
-module \
$(NULL)
-EXTRA_DIST = \
- vapi-fixes.vapi \
- $(NULL)
diff --git a/modules/gtk2/vapi-fixes.vapi b/modules/gtk2/vapi-fixes.vapi
deleted file mode 120000
index cb1b309..0000000
--- a/modules/gtk2/vapi-fixes.vapi
+++ /dev/null
@@ -1 +0,0 @@
-../gtk3/vapi-fixes.vapi \ No newline at end of file
diff --git a/modules/gtk3/Makefile.am b/modules/gtk3/Makefile.am
index 6d95287..c25655c 100644
--- a/modules/gtk3/Makefile.am
+++ b/modules/gtk3/Makefile.am
@@ -9,7 +9,6 @@ libcaribou_la_SOURCES = \
libcaribou_la_VALAFLAGS = \
-h caribou-gtk-module.h \
--vapidir=. \
- --pkg vapi-fixes \
--pkg gtk+-3.0 \
$(VALAGLAFS)
@@ -27,6 +26,3 @@ libcaribou_la_LDFLAGS = \
-module \
$(NULL)
-EXTRA_DIST = \
- vapi-fixes.vapi \
- $(NULL)
diff --git a/modules/gtk3/caribou-gtk-module.vala b/modules/gtk3/caribou-gtk-module.vala
index c662878..5c0f062 100644
--- a/modules/gtk3/caribou-gtk-module.vala
+++ b/modules/gtk3/caribou-gtk-module.vala
@@ -52,12 +52,11 @@ namespace Caribou {
Gtk.Widget? widget = window.get_focus();
uint32 timestamp = Gtk.get_current_event_time();
if (widget != null && (widget is Gtk.Entry || widget is Gtk.TextView) && widget is Gtk.Editable) {
- Atk.Object focus_object = widget.get_accessible();
Gdk.Window current_window = widget.get_window();
int x=0, y=0, w=0, h=0;
- if (current_window != null && !get_acc_geometry (focus_object, out x, out y, out w, out h)) {
+ if (current_window != null)
get_origin_geometry (current_window, out x, out y, out w, out h);
- }
+
try {
keyboard.show (timestamp);
keyboard.set_entry_location (x, y, w, h);
@@ -85,56 +84,5 @@ namespace Caribou {
#endif
}
- private Atk.Object? find_focused_accessible (Atk.Object acc) {
- Atk.StateSet state = acc.ref_state_set ();
-
- bool match = (state.contains_state (Atk.StateType.EDITABLE) &&
- state.contains_state (Atk.StateType.FOCUSED) &&
- acc.get_n_accessible_children () == 0);
-
- if (match)
- return acc;
-
- for (int i=0;i<acc.get_n_accessible_children ();i++) {
- Atk.Object child = acc.ref_accessible_child (i);
- Atk.Object focused_child = find_focused_accessible (child);
- if (focused_child != null)
- return focused_child;
- }
-
- return null;
- }
-
- private bool get_acc_geometry (Atk.Object acc,
- out int x, out int y, out int w, out int h) {
- Atk.Object child = null;
-
-
- if (acc.get_role () == Atk.Role.REDUNDANT_OBJECT) {
- /* It is probably Gecko */
- child = Atk.get_focus_object ();
- } else {
- child = find_focused_accessible (acc);
- }
-
- if (child == null)
- return false;
-
- if (!(child is Atk.Component)) {
- stderr.printf ("Accessible is not a component\n");
- return false;
- }
-
- /* We don't want the keyboard on the paragraph in OOo */
- if (child.get_role() == Atk.Role.PARAGRAPH)
- child = child.get_parent();
-
- Atk.component_get_extents ((Atk.Component) child,
- out x, out y, out w, out h,
- Atk.CoordType.SCREEN);
-
- return true;
- }
-
}
}
diff --git a/modules/gtk3/vapi-fixes.vapi b/modules/gtk3/vapi-fixes.vapi
deleted file mode 100644
index 7b21d78..0000000
--- a/modules/gtk3/vapi-fixes.vapi
+++ /dev/null
@@ -1,10 +0,0 @@
-using Atk;
-
-[CCode (cprefix = "Atk", lower_case_cprefix = "atk_", cheader_filename = "atk/atk.h")]
-
-namespace Atk {
- [CCode (cname = "atk_component_get_extents")]
- public void component_get_extents (Atk.Component component,
- out int x, out int y, out int w, out int h,
- Atk.CoordType coord_type);
-} \ No newline at end of file