[pygtk] Add Gtk-2.22 API (new accessors)



commit c81821811783352c64530ad07ee9ff60aef88bec
Author: John Stowers <john stowers gmail com>
Date:   Mon Jul 12 15:15:04 2010 +1200

    Add Gtk-2.22 API (new accessors)

 configure.ac            |   18 ++++++
 gtk/Makefile.am         |   12 ++++
 gtk/gtk-2.22.defs       |  145 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 175 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e9b07ae..9374eb1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -351,6 +351,23 @@ if test "x$have_pycairo" = "xtrue"; then
   AC_SUBST(HAVE_GTK_2_20)
   AC_DEFINE([HAVE_GTK_2_20], [$have_gtk_220], [If Gtk 2.20 was found])
 
+  dnl check for gtk 2.22
+  PKG_CHECK_MODULES(GTK222, gtk+-2.0 >= 2.21.0,
+	  HAVE_GTK_222="yes", HAVE_GTK_222="no")
+
+  if test "x$HAVE_GTK_222" = "xyes"; then
+     gtk_version="2.22"
+     have_gtk_222=true
+     PYGTK_CODEGEN_DEFINES="$PYGTK_CODEGEN_DEFINES -DHAVE_GTK_2_22"
+  else
+     AC_MSG_RESULT(no)
+     have_gtk_222=false
+  fi
+
+  AM_CONDITIONAL(HAVE_GTK_2_22, $have_gtk_222)
+  AC_SUBST(HAVE_GTK_2_22)
+  AC_DEFINE([HAVE_GTK_2_22], [$have_gtk_222], [If Gtk 2.22 was found])
+
   dnl libglade
   PKG_CHECK_MODULES(LIBGLADE, [libglade-2.0 >= libglade_required_version],
 	  have_libglade=true, have_libglade=false)
@@ -382,6 +399,7 @@ else
   AM_CONDITIONAL(HAVE_GTK_2_16, false)
   AM_CONDITIONAL(HAVE_GTK_2_18, false)
   AM_CONDITIONAL(HAVE_GTK_2_20, false)
+  AM_CONDITIONAL(HAVE_GTK_2_22, false)
   AM_CONDITIONAL(BUILD_LIBGLADE, false)
   AM_CONDITIONAL(BUILD_GTKUNIXPRINT, false)
   have_pangocairo=false
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index a5e3a5d..3806f54 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -78,6 +78,11 @@ GTK_2_20_DEFS =
 	gtk-2.20-types.defs	\
 	gtkunixprint-2.20.defs
 
+GTK_2_22_DEFS =
+	gdk-2.22.defs		\
+	gtk-2.22.defs		\
+	gtk-2.22-types.defs
+
 if HAVE_GTK_2_10
 GDK_DEFS += gdk-2.10.defs 
 GTK_DEFS += gtk-2.10.defs 
@@ -117,6 +122,12 @@ GTK_DEFS += gtk-2.20.defs
 GTK_TYPES_DEFS += gtk-2.20-types.defs
 endif
 
+if HAVE_GTK_2_22
+GDK_DEFS += gdk-2.22.defs
+GTK_DEFS += gtk-2.22.defs
+GTK_TYPES_DEFS += gtk-2.22-types.defs
+endif
+
 CREATEDEFS = $(PYTHON) $(CODEGENDIR)/createdefs.py
 
 GDK_OVERRIDES = \
@@ -169,6 +180,7 @@ EXTRA_DIST += 			\
 	$(GTK_2_16_DEFS)	\
 	$(GTK_2_18_DEFS)	\
 	$(GTK_2_20_DEFS)	\
+	$(GTK_2_22_DEFS)	\
 	$(GTK_OVERRIDES)
 
 
diff --git a/gtk/gdk-2.22.defs b/gtk/gdk-2.22.defs
new file mode 100644
index 0000000..e69de29
diff --git a/gtk/gtk-2.22-types.defs b/gtk/gtk-2.22-types.defs
new file mode 100644
index 0000000..e69de29
diff --git a/gtk/gtk-2.22.defs b/gtk/gtk-2.22.defs
new file mode 100644
index 0000000..890504a
--- /dev/null
+++ b/gtk/gtk-2.22.defs
@@ -0,0 +1,145 @@
+(define-method set_widget
+  (of-object "GtkAccessible")
+  (c-name "gtk_accessible_set_widget")
+  (return-type "none")
+  (parameters
+    '("GtkWidget*" "widget")
+  )
+)
+
+(define-method get_widget
+  (of-object "GtkAccessible")
+  (c-name "gtk_accessible_get_widget")
+  (return-type "GtkWidget*")
+)
+
+(define-method commit
+  (of-object "GtkAssistant")
+  (c-name "gtk_assistant_commit")
+  (return-type "none")
+)
+
+(define-method get_event_window
+  (of-object "GtkButton")
+  (c-name "gtk_button_get_event_window")
+  (return-type "GdkWindow*")
+)
+
+(define-method im_context_filter_keypress
+  (of-object "GtkEntry")
+  (c-name "gtk_entry_im_context_filter_keypress")
+  (return-type "gboolean")
+  (parameters
+    '("GdkEventKey*" "event")
+  )
+)
+
+(define-method reset_im_context
+  (of-object "GtkEntry")
+  (c-name "gtk_entry_reset_im_context")
+  (return-type "none")
+)
+
+(define-method get_font_selection
+  (of-object "GtkFontSelectionDialog")
+  (c-name "gtk_font_selection_dialog_get_font_selection")
+  (return-type "GtkWidget*")
+)
+
+(define-method get_item_row
+  (of-object "GtkIconView")
+  (c-name "gtk_icon_view_get_item_row")
+  (return-type "gint")
+  (parameters
+    '("GtkTreePath*" "path")
+  )
+)
+
+(define-method get_item_column
+  (of-object "GtkIconView")
+  (c-name "gtk_icon_view_get_item_column")
+  (return-type "gint")
+  (parameters
+    '("GtkTreePath*" "path")
+  )
+)
+
+(define-method get_message_area
+  (of-object "GtkMessageDialog")
+  (c-name "gtk_message_dialog_get_message_area")
+  (return-type "GtkWidget*")
+)
+
+(define-method remove_all
+  (of-object "GtkStatusbar")
+  (c-name "gtk_statusbar_remove_all")
+  (return-type "none")
+  (parameters
+    '("guint" "context_id")
+  )
+)
+
+(define-method get_size
+  (of-object "GtkTable")
+  (c-name "gtk_table_get_size")
+  (return-type "none")
+  (parameters
+    '("guint*" "rows")
+    '("guint*" "columns")
+  )
+)
+
+(define-method get_hadjustment
+  (of-object "GtkTextView")
+  (c-name "gtk_text_view_get_hadjustment")
+  (return-type "GtkAdjustment*")
+)
+
+(define-method get_vadjustment
+  (of-object "GtkTextView")
+  (c-name "gtk_text_view_get_vadjustment")
+  (return-type "GtkAdjustment*")
+)
+
+(define-method im_context_filter_keypress
+  (of-object "GtkTextView")
+  (c-name "gtk_text_view_im_context_filter_keypress")
+  (return-type "gboolean")
+  (parameters
+    '("GdkEventKey*" "event")
+  )
+)
+
+(define-method reset_im_context
+  (of-object "GtkTextView")
+  (c-name "gtk_text_view_reset_im_context")
+  (return-type "none")
+)
+
+(define-method get_view_window
+  (of-object "GtkViewport")
+  (c-name "gtk_viewport_get_view_window")
+  (return-type "GdkWindow*")
+)
+
+(define-method send_focus_change
+  (of-object "GtkWidget")
+  (c-name "gtk_widget_send_focus_change")
+  (return-type "gboolean")
+  (parameters
+    '("GdkEvent*" "event")
+  )
+)
+
+(define-method has_group
+  (of-object "GtkWindow")
+  (c-name "gtk_window_has_group")
+  (return-type "gboolean")
+)
+
+(define-method get_current_grab
+  (of-object "GtkWindowGroup")
+  (c-name "gtk_window_group_get_current_grab")
+  (return-type "GtkWidget*")
+)
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]