From f7b2b3a80ccaef72f9c26b6adbae7d949a0d79a0 Mon Sep 17 00:00:00 2001 From: obache Date: Fri, 14 May 2010 11:02:20 +0000 Subject: Enable gucharmap support again. Bump PKGREVISION. --- inputmethod/tomoe-gtk/Makefile | 13 +- inputmethod/tomoe-gtk/PLIST | 3 +- inputmethod/tomoe-gtk/buildlink3.mk | 5 +- inputmethod/tomoe-gtk/distinfo | 3 +- inputmethod/tomoe-gtk/patches/patch-aa | 229 +++++++++++++++++++++++++++++++++ 5 files changed, 244 insertions(+), 9 deletions(-) create mode 100644 inputmethod/tomoe-gtk/patches/patch-aa (limited to 'inputmethod/tomoe-gtk') diff --git a/inputmethod/tomoe-gtk/Makefile b/inputmethod/tomoe-gtk/Makefile index c0beba8a6b6..3a4fcba684f 100644 --- a/inputmethod/tomoe-gtk/Makefile +++ b/inputmethod/tomoe-gtk/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.4 2009/08/26 19:56:57 sno Exp $ +# $NetBSD: Makefile,v 1.5 2010/05/14 11:02:20 obache Exp $ # DISTNAME= tomoe-gtk-0.6.0 -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= inputmethod MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tomoe/} @@ -20,10 +20,13 @@ USE_PKGLOCALEDIR= yes PKGCONFIG_OVERRIDE+= tomoe-gtk.pc.in CONFIGURE_ARGS+= --without-python -# enable again once upstream supports gucharmap-2, or a -# gucharmap-1 package was created -CONFIGURE_ARGS+= --without-gucharmap + +SUBST_CLASSES+= gucharmap2 +SUBST_STAGE.gucharmap2= pre-configure +SUBST_FILES.gucharmap2= configure +SUBST_SED.gucharmap2= -e 's|gucharmap >= 1.4.0|gucharmap-2|g' .include "../../inputmethod/tomoe/buildlink3.mk" +.include "../../fonts/gucharmap/buildlink3.mk" .include "../../x11/gtk2/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/inputmethod/tomoe-gtk/PLIST b/inputmethod/tomoe-gtk/PLIST index 5510ac52b5e..1eecd8bb358 100644 --- a/inputmethod/tomoe-gtk/PLIST +++ b/inputmethod/tomoe-gtk/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.3 2009/06/14 18:01:33 joerg Exp $ +@comment $NetBSD: PLIST,v 1.4 2010/05/14 11:02:20 obache Exp $ include/tomoe/gtk/tomoe-canvas.h include/tomoe/gtk/tomoe-char-table.h include/tomoe/gtk/tomoe-details.h @@ -8,6 +8,7 @@ include/tomoe/gtk/tomoe-edit-strokes.h include/tomoe/gtk/tomoe-gtk-config.h include/tomoe/gtk/tomoe-gtk-enum-types.h include/tomoe/gtk/tomoe-gtk.h +include/tomoe/gtk/tomoe-gucharmap.h include/tomoe/gtk/tomoe-handwriting.h include/tomoe/gtk/tomoe-reading-search.h include/tomoe/gtk/tomoe-scrollable.h diff --git a/inputmethod/tomoe-gtk/buildlink3.mk b/inputmethod/tomoe-gtk/buildlink3.mk index d79b61afea4..acf52358d2f 100644 --- a/inputmethod/tomoe-gtk/buildlink3.mk +++ b/inputmethod/tomoe-gtk/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.4 2009/08/26 19:56:57 sno Exp $ +# $NetBSD: buildlink3.mk,v 1.5 2010/05/14 11:02:20 obache Exp $ BUILDLINK_TREE+= tomoe-gtk @@ -6,10 +6,11 @@ BUILDLINK_TREE+= tomoe-gtk TOMOE_GTK_BUILDLINK3_MK:= BUILDLINK_API_DEPENDS.tomoe-gtk+= tomoe-gtk>=0.6.0 -BUILDLINK_ABI_DEPENDS.tomoe-gtk?= tomoe-gtk>=0.6.0nb2 +BUILDLINK_ABI_DEPENDS.tomoe-gtk+= tomoe-gtk>=0.6.0nb3 BUILDLINK_PKGSRCDIR.tomoe-gtk?= ../../inputmethod/tomoe-gtk .include "../../inputmethod/tomoe/buildlink3.mk" +.include "../../fonts/gucharmap/buildlink3.mk" .include "../../x11/gtk2/buildlink3.mk" .endif # TOMOE_GTK_BUILDLINK3_MK diff --git a/inputmethod/tomoe-gtk/distinfo b/inputmethod/tomoe-gtk/distinfo index db8904d11cf..82d9a2934f5 100644 --- a/inputmethod/tomoe-gtk/distinfo +++ b/inputmethod/tomoe-gtk/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.1.1.1 2008/04/13 06:06:40 obache Exp $ +$NetBSD: distinfo,v 1.2 2010/05/14 11:02:20 obache Exp $ SHA1 (tomoe-gtk-0.6.0.tar.gz) = dddb1178c437380a92b59dbc273dafdd2045e1d1 RMD160 (tomoe-gtk-0.6.0.tar.gz) = 72e0954b8994d1e62acb7d4cb0c478dadb54b8f0 Size (tomoe-gtk-0.6.0.tar.gz) = 448058 bytes +SHA1 (patch-aa) = 7b185b3ec670661c5bcd85f3e1ef91729348b19c diff --git a/inputmethod/tomoe-gtk/patches/patch-aa b/inputmethod/tomoe-gtk/patches/patch-aa new file mode 100644 index 00000000000..71b54ee75a7 --- /dev/null +++ b/inputmethod/tomoe-gtk/patches/patch-aa @@ -0,0 +1,229 @@ +$NetBSD: patch-aa,v 1.1 2010/05/14 11:02:20 obache Exp $ + +support gucharmap-2 (taken from upstream revision 1627). + +--- src/tomoe-gucharmap.c.orig 2007-04-27 05:41:40.000000000 +0000 ++++ src/tomoe-gucharmap.c +@@ -24,6 +24,10 @@ + #include + #include "tomoe-gucharmap.h" + ++#ifdef GUCHARMAP_TYPE_CHAPTERS ++# define GUCHARMAP_CHAPTERS_MODEL_COLUMN_LABEL CHAPTERS_LABEL_COL ++#endif ++ + enum { + SELECTED_SIGNAL, + LAST_SIGNAL +@@ -34,7 +38,11 @@ struct _TomoeGucharmapPrivate + { + GtkWidget *chapters_type_combobox; + GtkWidget *chapters_combobox; ++#ifdef GUCHARMAP_TYPE_CHAPTERS + GucharmapChapters *chapters; ++#else ++ GucharmapChaptersModel *chapters_model; ++#endif + GucharmapCharmap *charmap; + gchar *selected; + }; +@@ -50,7 +58,9 @@ static void on_chapters_type_combo_chang + static void on_chapters_combo_changed (GtkComboBox *combobox, + gpointer data); + static void on_gucharmap_activate (GucharmapCharmap *charmap, ++#ifdef GUCHARMAP_TABLE + gunichar ch, ++#endif + gpointer data); + static void on_gucharmap_button_release (GtkWidget *widget, + GdkEventButton *event, +@@ -90,6 +100,7 @@ tomoe_gucharmap_init (TomoeGucharmap *pa + { + TomoeGucharmapPrivate *priv = TOMOE_GUCHARMAP_GET_PRIVATE (page); + GtkWidget *vbox, *hbox, *combobox, *widget; ++ GtkCellRenderer *cell; + + priv->selected = NULL; + +@@ -114,20 +125,35 @@ tomoe_gucharmap_init (TomoeGucharmap *pa + gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, FALSE, 2); + gtk_widget_show (combobox); + +- combobox = gtk_combo_box_new_text (); ++ combobox = gtk_combo_box_new (); ++ cell = gtk_cell_renderer_text_new (); ++ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), cell, TRUE); ++ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), cell, ++ "text", GUCHARMAP_CHAPTERS_MODEL_COLUMN_LABEL, ++ NULL); + priv->chapters_combobox = combobox; + gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, FALSE, 2); + gtk_widget_show (combobox); + + /* gucharmap */ ++#ifdef GUCHARMAP_TYPE_CHAPTERS + priv->chapters = GUCHARMAP_CHAPTERS (gucharmap_block_chapters_new ()); + priv->charmap = GUCHARMAP_CHARMAP (gucharmap_charmap_new (priv->chapters)); ++#else ++ priv->chapters_model = gucharmap_block_chapters_model_new (); ++ priv->charmap = GUCHARMAP_CHARMAP (gucharmap_charmap_new ()); ++ gucharmap_charmap_set_chapters_model (priv->charmap, priv->chapters_model); ++#endif + widget = GTK_WIDGET (priv->charmap); + gtk_box_pack_start (GTK_BOX (vbox), widget, TRUE, TRUE, 2); + gtk_widget_show (widget); + + /* Hide chapters page by default. Usually use combo box instead. */ ++#ifdef GUCHARMAP_TYPE_CHAPTERS + gtk_widget_hide (GTK_WIDGET (priv->chapters)); ++#else ++ gtk_widget_hide (gtk_paned_get_child1 (GTK_PANED (priv->charmap))); ++#endif + + #if 0 + /* CharDetails view will be here */ +@@ -139,20 +165,21 @@ tomoe_gucharmap_init (TomoeGucharmap *pa + #endif + + /* setup */ +- setup_chapters_combo_box (page); + g_signal_connect (G_OBJECT (priv->chapters_type_combobox), "changed", + G_CALLBACK (on_chapters_type_combo_changed), + (gpointer) page); + g_signal_connect (G_OBJECT (priv->chapters_combobox), "changed", + G_CALLBACK (on_chapters_combo_changed), + (gpointer) page); +- g_signal_connect (G_OBJECT (priv->charmap->chartable), "activate", ++ g_signal_connect (G_OBJECT (gucharmap_charmap_get_chartable (priv->charmap)), ++ "activate", + G_CALLBACK (on_gucharmap_activate), + (gpointer) page); +- g_signal_connect (G_OBJECT (priv->charmap->chartable), ++ g_signal_connect (G_OBJECT (gucharmap_charmap_get_chartable (priv->charmap)), + "button-release-event", + G_CALLBACK (on_gucharmap_button_release), + (gpointer) page); ++ setup_chapters_combo_box (page); + } + + static void +@@ -162,7 +189,11 @@ dispose (GObject *object) + + priv->chapters_type_combobox = NULL; + priv->chapters_combobox = NULL; ++#ifdef GUCHARMAP_TYPE_CHAPTERS + priv->chapters = NULL; ++#else ++ priv->chapters_model = NULL; ++#endif + priv->charmap = NULL; + if (priv->selected) { + g_free (priv->selected); +@@ -188,7 +219,11 @@ const gchar * + tomoe_gucharmap_get_selected_char (TomoeGucharmap *page) + { + TomoeGucharmapPrivate *priv; ++#ifdef GUCHARMAP_TABLE + GucharmapTable *table; ++#else ++ GucharmapChartable *table; ++#endif + gunichar c; + gchar buf[7]; + gint bytes; +@@ -196,10 +231,18 @@ tomoe_gucharmap_get_selected_char (Tomoe + g_return_val_if_fail (TOMOE_IS_GUCHARMAP (page), NULL); + + priv = TOMOE_GUCHARMAP_GET_PRIVATE (page); ++#ifdef GUCHARMAP_TABLE + table = GUCHARMAP_TABLE (priv->charmap->chartable); ++#else ++ table = gucharmap_charmap_get_chartable (priv->charmap); ++#endif + ++#ifdef GUCHARMAP_TABLE + c = gucharmap_table_get_active_character (table); +- bytes = g_unichar_to_utf8(c, buf); ++#else ++ c = gucharmap_chartable_get_active_character (table); ++#endif ++ bytes = g_unichar_to_utf8 (c, buf); + + if (bytes > 0 && bytes < 7) { + buf[bytes] = '\0'; +@@ -222,7 +265,13 @@ static void + setup_chapters_combo_box (TomoeGucharmap *page) + { + TomoeGucharmapPrivate *priv = TOMOE_GUCHARMAP_GET_PRIVATE (page); +- GtkTreeModel *model = priv->chapters->tree_model; ++ GtkTreeModel *model; ++ ++#ifdef GUCHARMAP_TYPE_CHAPTERS ++ model = priv->chapters->tree_model; ++#else ++ model = GTK_TREE_MODEL (priv->chapters_model); ++#endif + + gtk_combo_box_set_model (GTK_COMBO_BOX (priv->chapters_combobox), model); + gtk_combo_box_set_active (GTK_COMBO_BOX (priv->chapters_combobox), 0); +@@ -235,12 +284,25 @@ on_chapters_type_combo_changed (GtkCombo + TomoeGucharmapPrivate *priv = TOMOE_GUCHARMAP_GET_PRIVATE (page); + gint idx = gtk_combo_box_get_active (combobox); + +- if (idx == 1) ++ if (idx == 1) { ++#ifdef GUCHARMAP_TYPE_CHAPTERS + priv->chapters = GUCHARMAP_CHAPTERS (gucharmap_script_chapters_new ()); +- else ++#else ++ priv->chapters_model = gucharmap_script_chapters_model_new (); ++#endif ++ } else { ++#ifdef GUCHARMAP_TYPE_CHAPTERS + priv->chapters = GUCHARMAP_CHAPTERS (gucharmap_block_chapters_new ()); ++#else ++ priv->chapters_model = gucharmap_block_chapters_model_new (); ++#endif ++ } ++#ifdef GUCHARMAP_TYPE_CHAPTERS + gucharmap_charmap_set_chapters (priv->charmap, priv->chapters); + gtk_widget_hide (GTK_WIDGET (priv->chapters)); ++#else ++ gucharmap_charmap_set_chapters_model (priv->charmap, priv->chapters_model); ++#endif + setup_chapters_combo_box (page); + } + +@@ -249,6 +311,7 @@ on_chapters_combo_changed (GtkComboBox * + { + TomoeGucharmap *page = data; + TomoeGucharmapPrivate *priv = TOMOE_GUCHARMAP_GET_PRIVATE (page); ++ GtkTreeView *tree_view; + GtkTreePath *path; + gchar buf[8]; + gint idx; +@@ -256,13 +319,21 @@ on_chapters_combo_changed (GtkComboBox * + idx = gtk_combo_box_get_active (combobox); + g_snprintf (buf, 8 , "%d", idx); + path = gtk_tree_path_new_from_string (buf); +- gtk_tree_view_set_cursor (GTK_TREE_VIEW (priv->chapters->tree_view), +- path, NULL, FALSE); ++#ifdef GUCHARMAP_TYPE_CHAPTERS ++ tree_view = GTK_TREE_VIEW (priv->chapters->tree_view); ++#else ++ tree_view = ++ GTK_TREE_VIEW (gucharmap_charmap_get_chapters_view (priv->charmap)); ++#endif ++ gtk_tree_view_set_cursor (tree_view, path, NULL, FALSE); + gtk_tree_path_free (path); + } + + static void +-on_gucharmap_activate (GucharmapCharmap *charmap, gunichar ch, ++on_gucharmap_activate (GucharmapCharmap *charmap, ++#ifdef GUCHARMAP_TABLE ++ gunichar ch, ++#endif + gpointer data) + { + TomoeGucharmap *gucharmap = TOMOE_GUCHARMAP (data); -- cgit v1.2.3