gucharmap r1725 - in trunk: . bindings bindings/python



Author: chpe
Date: Fri Mar 21 11:02:43 2008
New Revision: 1725
URL: http://svn.gnome.org/viewvc/gucharmap?rev=1725&view=rev

Log:
Python bindings.


Added:
   trunk/bindings/
   trunk/bindings/Makefile.am
   trunk/bindings/python/
   trunk/bindings/python/Makefile.am
   trunk/bindings/python/gucharmap.defs
   trunk/bindings/python/gucharmap.override
Modified:
   trunk/Makefile.am
   trunk/configure.ac

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Fri Mar 21 11:02:43 2008
@@ -1,25 +1,8 @@
-## $Id: Makefile.am,v 1.21 2006/02/12 00:07:14 behdad Exp $
-##
-## Copyright (c) 2002  Noah Levitt <nlevitt users sourceforge net>
-##
-## This program is free software; you can redistribute it and/or modify it
-## under the terms of the GNU General Public License as published by the
-## Free Software Foundation; either version 2 of the License, or (at your
-## option) any later version.
-##
-## This program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License along
-## with this program; if not, write to the Free Software Foundation, Inc.,
-## 59 Temple Place, Suite 330, Boston, MA 02110-1301  USA
-##
+NULL =
 
-SUBDIRS = po pixmaps gucharmap
+ACLOCAL_AMFLAGS = -I m4
 
-NULL =
+SUBDIRS = po pixmaps gucharmap bindings
 
 if HAVE_GNOME_DOC_UTILS
 SUBDIRS += help

Added: trunk/bindings/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/bindings/Makefile.am	Fri Mar 21 11:02:43 2008
@@ -0,0 +1,5 @@
+SUBDIRS =
+
+if ENABLE_PYTHON_BINDINGS
+SUBDIRS += python
+endif

Added: trunk/bindings/python/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/bindings/python/Makefile.am	Fri Mar 21 11:02:43 2008
@@ -0,0 +1,85 @@
+NULL =
+
+# FIXMEchpe: keep this in sync with gucharmap/Makefile.am !
+srcdirheaders = \
+	gucharmap-block-chapters-model.h \
+	gucharmap-chapters-model.h \
+	gucharmap-chapters-view.h \
+	gucharmap-charmap.h \
+	gucharmap-chartable.h \
+	gucharmap-codepoint-list.h \
+	gucharmap.h \
+	gucharmap-script-chapters-model.h \
+	gucharmap-script-codepoint-list.h \
+	gucharmap-unicode-info.h \
+	$(NULL)
+builddirheaders = \
+	gucharmap-type-builtins.h \
+	$(NULL)
+
+defsdir = $(datadir)/pygtk/2.0/defs
+defs_DATA = gucharmap.defs
+
+pkgpyexecdir = $(pyexecdir)/gtk-2.0
+pkgpyexec_LTLIBRARIES = gucharmap.la
+
+BUILT_SOURCES = \
+	gucharmap.c \
+	$(NULL)
+
+gucharmap_la_SOURCES = \
+	gucharmap.c \
+	gucharmapmodule.c \
+	$(NULL)
+
+gucharmap_la_CPPFLAGS = \
+	-I$(top_srcdir) \
+	-I$(top_builddir) \
+	$(PYTHON_INCLUDES) \
+	$(DISABLE_DEPRECATED) \
+	$(AM_CPPFLAGS)
+
+gucharmap_la_CFLAGS = \
+	$(NO_STRICT_ALIASING_CFLAGS) \
+	$(PYGTK_CFLAGS) \
+	$(GTK_CFLAGS) \
+	$(WARN_CFLAGS) \
+	$(AM_CFLAGS)
+
+gucharmap_la_LIBADD = \
+	$(top_builddir)/gucharmap/libgucharmap.la \
+	$(PYGTK_LIBS) \
+        $(PYTHON_LIB_LOC) \
+	$(PYTHON_LIBS) \
+        $(PYTHON_EXTRA_LIBS)
+
+gucharmap_la_LDFLAGS = \
+	-module \
+	-avoid-version	\
+	-export-symbols-regex initgucharmap \
+	$(AM_LDFLAGS)
+
+CLEANFILES = \
+	$(BUILT_SOURCES) \
+	$(NULL)
+
+EXTRA_DIST = \
+	gucharmap.defs \
+	gucharmap.override \
+	$(NULL)
+
+gucharmap.c: gucharmap.defs gucharmap.override
+
+.defs.c:
+	(cd $(srcdir)\
+	 && $(PYGTK_CODEGEN) \
+	    --override $*.override \
+	    --prefix py$* $*.defs) > gen-$*.c \
+	&& cp gen-$*.c $*.c \
+	&& rm -f gen-$*.c
+
+regenerate-python-binding:
+	$(PYGTK_H2DEF) \
+		$(sort $(addprefix $(top_srcdir)/gucharmap/,$(srcdirheaders)) \
+		       $(addprefix $(top_builddir)/gucharmap/,$(builddirheaders))) \
+		> gucharmap.defs.new

Added: trunk/bindings/python/gucharmap.defs
==============================================================================
--- (empty file)
+++ trunk/bindings/python/gucharmap.defs	Fri Mar 21 11:02:43 2008
@@ -0,0 +1,753 @@
+;; -*- scheme -*-
+; object definitions ...
+(define-object ChaptersModel
+  (in-module "Gucharmap")
+  (parent "GtkListStore")
+  (c-name "GucharmapChaptersModel")
+  (gtype-id "GUCHARMAP_TYPE_CHAPTERS_MODEL")
+)
+
+(define-object BlockChaptersModel
+  (in-module "Gucharmap")
+  (parent "GucharmapChaptersModel")
+  (c-name "GucharmapBlockChaptersModel")
+  (gtype-id "GUCHARMAP_TYPE_BLOCK_CHAPTERS_MODEL")
+)
+
+(define-object ChaptersView
+  (in-module "Gucharmap")
+  (parent "GtkTreeView")
+  (c-name "GucharmapChaptersView")
+  (gtype-id "GUCHARMAP_TYPE_CHAPTERS_VIEW")
+)
+
+(define-object Charmap
+  (in-module "Gucharmap")
+  (parent "GtkHPaned")
+  (c-name "GucharmapCharmap")
+  (gtype-id "GUCHARMAP_TYPE_CHARMAP")
+)
+
+(define-object Chartable
+  (in-module "Gucharmap")
+  (parent "GtkDrawingArea")
+  (c-name "GucharmapChartable")
+  (gtype-id "GUCHARMAP_TYPE_CHARTABLE")
+)
+
+(define-object CodepointList
+  (in-module "Gucharmap")
+  (parent "GObject")
+  (c-name "GucharmapCodepointList")
+  (gtype-id "GUCHARMAP_TYPE_CODEPOINT_LIST")
+)
+
+(define-object ScriptChaptersModel
+  (in-module "Gucharmap")
+  (parent "GucharmapChaptersModel")
+  (c-name "GucharmapScriptChaptersModel")
+  (gtype-id "GUCHARMAP_TYPE_SCRIPT_CHAPTERS_MODEL")
+)
+
+(define-object ScriptCodepointList
+  (in-module "Gucharmap")
+  (parent "GucharmapCodepointList")
+  (c-name "GucharmapScriptCodepointList")
+  (gtype-id "GUCHARMAP_TYPE_SCRIPT_CODEPOINT_LIST")
+)
+
+;; Enumerations and flags ...
+
+(define-enum ChaptersMode
+  (in-module "Gucharmap")
+  (c-name "GucharmapChaptersMode")
+  (gtype-id "GUCHARMAP_TYPE_CHAPTERS_MODE")
+  (values
+    '("script" "GUCHARMAP_CHAPTERS_SCRIPT")
+    '("block" "GUCHARMAP_CHAPTERS_BLOCK")
+  )
+)
+
+(define-enum UnicodeVersion
+  (in-module "Gucharmap")
+  (c-name "GucharmapUnicodeVersion")
+  (gtype-id "GUCHARMAP_TYPE_UNICODE_VERSION")
+  (values
+    '("unassigned" "GUCHARMAP_UNICODE_VERSION_UNASSIGNED")
+    '("1-1" "GUCHARMAP_UNICODE_VERSION_1_1")
+    '("2-0" "GUCHARMAP_UNICODE_VERSION_2_0")
+    '("2-1" "GUCHARMAP_UNICODE_VERSION_2_1")
+    '("3-0" "GUCHARMAP_UNICODE_VERSION_3_0")
+    '("3-1" "GUCHARMAP_UNICODE_VERSION_3_1")
+    '("3-2" "GUCHARMAP_UNICODE_VERSION_3_2")
+    '("4-0" "GUCHARMAP_UNICODE_VERSION_4_0")
+    '("4-1" "GUCHARMAP_UNICODE_VERSION_4_1")
+    '("5-0" "GUCHARMAP_UNICODE_VERSION_5_0")
+    '("5-1" "GUCHARMAP_UNICODE_VERSION_5_1")
+    '("latest" "GUCHARMAP_UNICODE_VERSION_LATEST")
+  )
+)
+
+
+;; From gucharmap-block-chapters-model.h
+
+(define-function gucharmap_block_chapters_model_get_type
+  (c-name "gucharmap_block_chapters_model_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_block_chapters_model_new
+  (c-name "gucharmap_block_chapters_model_new")
+  (is-constructor-of "GucharmapBlockChaptersModel")
+  (return-type "GucharmapChaptersModel*")
+)
+
+
+
+;; From gucharmap-chapters-model.h
+
+(define-function gucharmap_chapters_model_get_type
+  (c-name "gucharmap_chapters_model_get_type")
+  (return-type "GType")
+)
+
+(define-method get_codepoint_list
+  (of-object "GucharmapChaptersModel")
+  (c-name "gucharmap_chapters_model_get_codepoint_list")
+  (return-type "GucharmapCodepointList*")
+  (parameters
+    '("GtkTreeIter*" "iter")
+  )
+)
+
+(define-method get_title
+  (of-object "GucharmapChaptersModel")
+  (c-name "gucharmap_chapters_model_get_title")
+  (return-type "const-char*")
+)
+
+(define-method get_book_codepoint_list
+  (of-object "GucharmapChaptersModel")
+  (c-name "gucharmap_chapters_model_get_book_codepoint_list")
+  (return-type "const-GucharmapCodepointList*")
+)
+
+(define-method character_to_iter
+  (of-object "GucharmapChaptersModel")
+  (c-name "gucharmap_chapters_model_character_to_iter")
+  (return-type "gboolean")
+  (parameters
+    '("gunichar" "wc")
+    '("GtkTreeIter*" "iter")
+  )
+)
+
+(define-method id_to_iter
+  (of-object "GucharmapChaptersModel")
+  (c-name "gucharmap_chapters_model_id_to_iter")
+  (return-type "gboolean")
+  (parameters
+    '("const-char*" "id")
+    '("GtkTreeIter*" "iter")
+  )
+)
+
+
+
+;; From gucharmap-chapters-view.h
+
+(define-function gucharmap_chapters_view_get_type
+  (c-name "gucharmap_chapters_view_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_chapters_view_new
+  (c-name "gucharmap_chapters_view_new")
+  (is-constructor-of "GucharmapChaptersView")
+  (return-type "GtkWidget*")
+)
+
+(define-method set_model
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_set_model")
+  (return-type "none")
+  (parameters
+    '("GucharmapChaptersModel*" "model")
+  )
+)
+
+(define-method get_model
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_get_model")
+  (return-type "GucharmapChaptersModel*")
+)
+
+(define-method select_character
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_select_character")
+  (return-type "gboolean")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-method get_codepoint_list
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_get_codepoint_list")
+  (return-type "GucharmapCodepointList*")
+)
+
+(define-method get_book_codepoint_list
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_get_book_codepoint_list")
+  (return-type "const-GucharmapCodepointList*")
+)
+
+(define-method next
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_next")
+  (return-type "none")
+)
+
+(define-method previous
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_previous")
+  (return-type "none")
+)
+
+(define-method get_selected
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_get_selected")
+  (return-type "gchar*")
+)
+
+(define-method set_selected
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_set_selected")
+  (return-type "gboolean")
+  (parameters
+    '("const-gchar*" "name")
+  )
+)
+
+(define-method select_locale
+  (of-object "GucharmapChaptersView")
+  (c-name "gucharmap_chapters_view_select_locale")
+  (return-type "gboolean")
+)
+
+
+
+;; From gucharmap-charmap.h
+
+(define-function gucharmap_charmap_get_type
+  (c-name "gucharmap_charmap_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_charmap_new
+  (c-name "gucharmap_charmap_new")
+  (is-constructor-of "GucharmapCharmap")
+  (return-type "GtkWidget*")
+)
+
+(define-method set_active_character
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_set_active_character")
+  (return-type "none")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-method get_active_character
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_get_active_character")
+  (return-type "gunichar")
+)
+
+(define-method set_active_chapter
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_set_active_chapter")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "chapter")
+  )
+)
+
+(define-method get_active_chapter
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_get_active_chapter")
+  (return-type "char*")
+)
+
+(define-method set_font
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_set_font")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "font_name")
+  )
+)
+
+(define-method set_font_desc
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_set_font_desc")
+  (return-type "none")
+  (parameters
+    '("PangoFontDescription*" "font_desc")
+  )
+)
+
+(define-method get_chartable
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_get_chartable")
+  (return-type "GucharmapChartable*")
+)
+
+(define-method get_chapters_view
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_get_chapters_view")
+  (return-type "GucharmapChaptersView*")
+)
+
+(define-method set_chapters_model
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_set_chapters_model")
+  (return-type "none")
+  (parameters
+    '("GucharmapChaptersModel*" "model")
+  )
+)
+
+(define-method get_chapters_model
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_get_chapters_model")
+  (return-type "GucharmapChaptersModel*")
+)
+
+(define-method get_book_codepoint_list
+  (of-object "GucharmapCharmap")
+  (c-name "gucharmap_charmap_get_book_codepoint_list")
+  (return-type "GucharmapCodepointList*")
+)
+
+
+
+;; From gucharmap-chartable.h
+
+(define-function gucharmap_chartable_get_type
+  (c-name "gucharmap_chartable_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_chartable_new
+  (c-name "gucharmap_chartable_new")
+  (is-constructor-of "GucharmapChartable")
+  (return-type "GtkWidget*")
+)
+
+(define-method set_font
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_set_font")
+  (return-type "none")
+  (parameters
+    '("const-gchar*" "font_name")
+  )
+)
+
+(define-method set_font_desc
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_set_font_desc")
+  (return-type "none")
+  (parameters
+    '("PangoFontDescription*" "font_desc")
+  )
+)
+
+(define-method get_active_character
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_get_active_character")
+  (return-type "gunichar")
+)
+
+(define-method set_active_character
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_set_active_character")
+  (return-type "none")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-method set_zoom_enabled
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_set_zoom_enabled")
+  (return-type "none")
+  (parameters
+    '("gboolean" "enabled")
+  )
+)
+
+(define-method get_zoom_enabled
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_get_zoom_enabled")
+  (return-type "gboolean")
+)
+
+(define-method set_snap_pow2
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_set_snap_pow2")
+  (return-type "none")
+  (parameters
+    '("gboolean" "snap")
+  )
+)
+
+(define-method set_codepoint_list
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_set_codepoint_list")
+  (return-type "none")
+  (parameters
+    '("GucharmapCodepointList*" "list")
+  )
+)
+
+(define-method get_codepoint_list
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_get_codepoint_list")
+  (return-type "GucharmapCodepointList*")
+)
+
+(define-method get_active_cell
+  (of-object "GucharmapChartable")
+  (c-name "gucharmap_chartable_get_active_cell")
+  (return-type "gint")
+)
+
+
+
+;; From gucharmap-codepoint-list.h
+
+(define-function gucharmap_codepoint_list_get_type
+  (c-name "gucharmap_codepoint_list_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_codepoint_list_new
+  (c-name "gucharmap_codepoint_list_new")
+  (is-constructor-of "GucharmapCodepointList")
+  (return-type "GucharmapCodepointList*")
+  (parameters
+    '("gunichar" "start")
+    '("gunichar" "end")
+  )
+)
+
+(define-method get_char
+  (of-object "GucharmapCodepointList")
+  (c-name "gucharmap_codepoint_list_get_char")
+  (return-type "gunichar")
+  (parameters
+    '("gint" "index")
+  )
+)
+
+(define-method get_index
+  (of-object "GucharmapCodepointList")
+  (c-name "gucharmap_codepoint_list_get_index")
+  (return-type "gint")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-method get_last_index
+  (of-object "GucharmapCodepointList")
+  (c-name "gucharmap_codepoint_list_get_last_index")
+  (return-type "gint")
+)
+
+
+
+;; From gucharmap-script-chapters-model.h
+
+(define-function gucharmap_script_chapters_model_get_type
+  (c-name "gucharmap_script_chapters_model_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_script_chapters_model_new
+  (c-name "gucharmap_script_chapters_model_new")
+  (is-constructor-of "GucharmapScriptChaptersModel")
+  (return-type "GucharmapChaptersModel*")
+)
+
+
+
+;; From gucharmap-script-codepoint-list.h
+
+(define-function gucharmap_script_codepoint_list_get_type
+  (c-name "gucharmap_script_codepoint_list_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_script_codepoint_list_new
+  (c-name "gucharmap_script_codepoint_list_new")
+  (is-constructor-of "GucharmapScriptCodepointList")
+  (return-type "GucharmapCodepointList*")
+)
+
+(define-method set_script
+  (of-object "GucharmapScriptCodepointList")
+  (c-name "gucharmap_script_codepoint_list_set_script")
+  (return-type "gboolean")
+  (parameters
+    '("const-gchar*" "script")
+  )
+)
+
+(define-method set_scripts
+  (of-object "GucharmapScriptCodepointList")
+  (c-name "gucharmap_script_codepoint_list_set_scripts")
+  (return-type "gboolean")
+  (parameters
+    '("const-gchar**" "scripts")
+  )
+)
+
+(define-method append_script
+  (of-object "GucharmapScriptCodepointList")
+  (c-name "gucharmap_script_codepoint_list_append_script")
+  (return-type "gboolean")
+  (parameters
+    '("const-gchar*" "script")
+  )
+)
+
+
+
+;; From gucharmap-unicode-info.h
+
+(define-function gucharmap_get_unicode_name
+  (c-name "gucharmap_get_unicode_name")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_data_name
+  (c-name "gucharmap_get_unicode_data_name")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_data_name_count
+  (c-name "gucharmap_get_unicode_data_name_count")
+  (return-type "gint")
+)
+
+(define-function gucharmap_get_unicode_version
+  (c-name "gucharmap_get_unicode_version")
+  (return-type "GucharmapUnicodeVersion")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_get_unicode_category_name
+  (c-name "gucharmap_get_unicode_category_name")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unihan_count
+  (c-name "gucharmap_get_unihan_count")
+  (return-type "gint")
+)
+
+(define-function gucharmap_get_unicode_kDefinition
+  (c-name "gucharmap_get_unicode_kDefinition")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_kCantonese
+  (c-name "gucharmap_get_unicode_kCantonese")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_kMandarin
+  (c-name "gucharmap_get_unicode_kMandarin")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_kTang
+  (c-name "gucharmap_get_unicode_kTang")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_kKorean
+  (c-name "gucharmap_get_unicode_kKorean")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_kJapaneseKun
+  (c-name "gucharmap_get_unicode_kJapaneseKun")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_unicode_kJapaneseOn
+  (c-name "gucharmap_get_unicode_kJapaneseOn")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "uc")
+  )
+)
+
+(define-function gucharmap_get_nameslist_stars
+  (c-name "gucharmap_get_nameslist_stars")
+  (return-type "const-gchar**")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_get_nameslist_equals
+  (c-name "gucharmap_get_nameslist_equals")
+  (return-type "const-gchar**")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_get_nameslist_exes
+  (c-name "gucharmap_get_nameslist_exes")
+  (return-type "gunichar*")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_get_nameslist_pounds
+  (c-name "gucharmap_get_nameslist_pounds")
+  (return-type "const-gchar**")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_get_nameslist_colons
+  (c-name "gucharmap_get_nameslist_colons")
+  (return-type "const-gchar**")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_unichar_validate
+  (c-name "gucharmap_unichar_validate")
+  (return-type "gboolean")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_unichar_to_printable_utf8
+  (c-name "gucharmap_unichar_to_printable_utf8")
+  (return-type "gint")
+  (parameters
+    '("gunichar" "wc")
+    '("gchar*" "outbuf")
+  )
+)
+
+(define-function gucharmap_unichar_type
+  (c-name "gucharmap_unichar_type")
+  (return-type "GUnicodeType")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_unichar_isdefined
+  (c-name "gucharmap_unichar_isdefined")
+  (return-type "gboolean")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_unichar_isgraph
+  (c-name "gucharmap_unichar_isgraph")
+  (return-type "gboolean")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-function gucharmap_unicode_list_scripts
+  (c-name "gucharmap_unicode_list_scripts")
+  (return-type "const-gchar**")
+)
+
+(define-function gucharmap_unicode_get_script_for_char
+  (c-name "gucharmap_unicode_get_script_for_char")
+  (return-type "const-gchar*")
+  (parameters
+    '("gunichar" "wc")
+  )
+)
+
+(define-method to_string
+  (of-object "GucharmapUnicodeVersion")
+  (c-name "gucharmap_unicode_version_to_string")
+  (return-type "const-gchar*")
+)
+
+(define-function gucharmap_unicode_get_locale_character
+  (c-name "gucharmap_unicode_get_locale_character")
+  (return-type "gunichar")
+)
+
+
+
+;; From gucharmap.h
+
+
+
+;; From gucharmap-type-builtins.h
+
+(define-function gucharmap_chapters_mode_get_type
+  (c-name "gucharmap_chapters_mode_get_type")
+  (return-type "GType")
+)
+
+(define-function gucharmap_unicode_version_get_type
+  (c-name "gucharmap_unicode_version_get_type")
+  (return-type "GType")
+)
+
+

Added: trunk/bindings/python/gucharmap.override
==============================================================================
--- (empty file)
+++ trunk/bindings/python/gucharmap.override	Fri Mar 21 11:02:43 2008
@@ -0,0 +1,26 @@
+%%
+headers
+#include <Python.h>               
+#define NO_IMPORT
+#include <config.h>
+#include <pygobject.h>
+#include <pygtk/pygtk.h>
+#include <gucharmap/gucharmap.h>
+
+void pygucharmap_register_classes(PyObject *d);
+void pygucharmap_add_constants(PyObject *module, const gchar *strip_prefix);
+
+%%
+modulename gucharmap
+%%
+import gobject.GObject as PyGObject_Type
+import gtk.Widget as PyGtkWidget_Type
+import gtk.Bin as PyGtkBin_Type
+import gtk.HPaned as PyGtkHPaned_Type
+import gtk.DrawingArea as PyGtkDrawingArea_Type
+import gtk.ListStore as PyGtkListStore_Type
+import gtk.TreeView as PyGtkTreeView_Type
+%%
+ignore-glob
+  *_get_type
+%%

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Mar 21 11:02:43 2008
@@ -37,8 +37,10 @@
 
 AC_INIT([GNOME Character Map],[gucharmap_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gucharmap],[gucharmap])
 
-AC_CONFIG_SRCDIR([gucharmap/gucharmap-charmap.h])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([gucharmap/gucharmap.h])
 AC_CONFIG_HEADERS([config.h])
+
 AM_INIT_AUTOMAKE([1.9 gnu dist-bzip2 no-dist-gzip])
 
 AM_MAINTAINER_MODE
@@ -52,11 +54,6 @@
 AM_PROG_CC_C_O
 
 # checks for stuff
-GETTEXT_PACKAGE=gucharmap
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Define the gettext package to be used])
-AM_GLIB_GNU_GETTEXT
-
 GNOME_COMMON_INIT
 GNOME_DEBUG_CHECK
 GNOME_COMPILE_WARNINGS([maximum])
@@ -80,7 +77,6 @@
 AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")
 
 GTK_REQUIRED=2.12.0
-
 PKG_CHECK_MODULES([GTK],[gtk+-2.0 >= $GTK_REQUIRED])
 
 GLIB_GENMARSHAL="$($PKG_CONFIG --variable=glib_genmarshal glib-2.0)"
@@ -108,9 +104,6 @@
 # checks for funcs 
 AC_CHECK_FUNCS([bind_textdomain_codeset])
 
-AC_SUBST(PANGO_CFLAGS)
-AC_SUBST(PANGO_LIBS)
-
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 
@@ -147,27 +140,133 @@
 #   AC_MSG_ERROR([hexdump not found])
 # fi
 
+# ****
+# i18n
+# ****
+
+GETTEXT_PACKAGE=gucharmap
+AC_SUBST([GETTEXT_PACKAGE])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[The gucharmap gettext domain])
+AM_GLIB_GNU_GETTEXT
+
+# ********
+# Bindings
+# ********
+
+AC_MSG_CHECKING([whether python bindings are requested])
+AC_ARG_ENABLE([python-bindings],
+        AS_HELP_STRING([--enable-python-bindings],[Enable python bindings]),
+        [],[enable_python_bindings=no])
+AC_MSG_RESULT([$enable_python_bindings])
+
+if test "$enable_python_bindings" = "yes"; then
+  AM_PATH_PYTHON([2.4])
+  AM_CHECK_PYTHON_HEADERS([],[AC_MSG_ERROR([Python headers not found])])
+
+  PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
+  PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
+  PYTHON_LIBS="-lpython$PYTHON_VERSION"
+  PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
+  PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
+  PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
+  PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
+  PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
+  PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
+  PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
+  AC_SUBST([PYTHON_LIBS])
+  AC_SUBST([PYTHON_LIB_LOC])
+  AC_SUBST([PYTHON_CFLAGS])
+  AC_SUBST([PYTHON_EXTRA_LIBS])
+
+  dnl FIXME: do we really need this test?
+  AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
+  rm -rf testpython
+  mkdir testpython
+  cd testpython
+  cat > testpython.c <<EOF
+#include <Python.h>
+int testpython (void)
+{
+Py_Exit (0);
+}
+EOF
+  if /bin/sh ../libtool --mode=compile ${CC} $PYTHON_CFLAGS -c testpython.c >/dev/null 2>&1 && \
+          /bin/sh ../libtool --mode=link ${CC} -o testpython.la -rpath `pwd` -module -avoid-version $PYTHON_LIB_LOC testpython.lo $PYTHON_LIBS $PYTHON_EXTRA_LIBS >/dev/null 2>&1 && \
+          grep 'dlname.*testpython' testpython.la >/dev/null 2>&1; then
+          AC_MSG_RESULT([yes])
+  else
+          AC_MSG_ERROR([Can't link to libpython])
+  fi
+  cd ..
+  rm -rf testpython
+  
+  PYGTK_REQUIRED=2.7.1
+  PKG_CHECK_MODULES([PYGTK],[pygtk-2.0 >= $PYGTK_REQUIRED])
+
+  AC_SUBST([PYGTK_CFLAGS])
+  AC_SUBST([PYGTK_LIBS])
+
+  AC_MSG_CHECKING([for pygtk defs])
+  PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
+  AC_MSG_RESULT([$PYGTK_DEFSDIR])
+
+  AC_MSG_CHECKING([for pygtk codegen])
+  PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
+  AC_MSG_RESULT([$PYGTK_CODEGEN])
+
+  AC_MSG_CHECKING([for pygtk h2def])
+  PYGTK_H2DEF="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py"
+  AC_MSG_RESULT([$PYGTK_H2DEF])
+
+  AC_SUBST([PYGTK_DEFSDIR])
+  AC_SUBST([PYGTK_CODEGEN])
+  AC_SUBST([PYGTK_H2DEF])
+
+  dnl Check for -fno-strict-aliasing
+  FLAGS="-fno-strict-aliasing"
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS $FLAGS"
+  AC_MSG_CHECKING([whether [$]CC understands $FLAGS])
+  AC_TRY_COMPILE([], [], [compiler_has_option=yes], [compiler_has_option=no])
+  CFLAGS="$save_CFLAGS"
+  AC_MSG_RESULT($compiler_has_option)
+  if test $compiler_has_option = yes; then
+          NO_STRICT_ALIASING_CFLAGS="$FLAGS"
+  fi
+  AC_SUBST([NO_STRICT_ALIASING_CFLAGS])
+fi
+
+AM_CONDITIONAL([ENABLE_PYTHON_BINDINGS],[test "$enable_python_bindings" = "yes"])
+
+# *****************************************************************************
+
 AC_SUBST([GUCHARMAP_VERSION_MAJOR],[gucharmap_version_major])
 AC_SUBST([GUCHARMAP_VERSION_MINOR],[gucharmap_version_minor])
 AC_SUBST([GUCHARMAP_VERSION_MICRO],[gucharmap_version_micro])
 AC_SUBST([LIBGUCHARMAP_LT_VERSION],[gucharmap_lt_version_info])
 AC_SUBST([LIBGUCHARMAP_LT_CURRENT_MINUS_AGE],[gucharmap_lt_current_minus_age])
 
+AC_SUBST([AM_CPPFLAGS])
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
 AC_CONFIG_FILES([
-gucharmap.desktop.in
-gucharmap-2.pc
 Makefile
+gucharmap-2.pc
+gucharmap.desktop.in
+gucharmap.nsi
+gucharmap.spec
+bindings/Makefile
+bindings/python/Makefile
 gucharmap/Makefile
 gucharmap/gucharmap.h
-po/Makefile.in
-pixmaps/Makefile
 help/Makefile
 help/it/Makefile
 help/ja/Makefile
 help/zh_CN/Makefile
 help/zh_TW/Makefile
-gucharmap.spec
-gucharmap.nsi
+pixmaps/Makefile
+po/Makefile.in
 ])
 
 AC_OUTPUT



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