From 033fc708aa6455d661066f2114bfe67d042f0546 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 18 May 2011 16:03:22 +0200 Subject: [PATCH] Changes to compile it under win32 and without libgtkform. --- .gitignore | 1 + configure.ac | 14 ++ docs/reference/gtkmaskedentry-decl-list.txt | 57 ----- docs/reference/gtkmaskedentry-decl.txt | 207 ------------------ docs/reference/gtkmaskedentry-undeclared.txt | 0 .../reference/gtkmaskedentry-undocumented.txt | 19 -- docs/reference/gtkmaskedentry-unused.txt | 13 -- docs/reference/gtkmaskedentry.args | 30 --- docs/reference/gtkmaskedentry.hierarchy | 28 --- docs/reference/gtkmaskedentry.interfaces | 6 - docs/reference/gtkmaskedentry.prerequisites | 2 - docs/reference/gtkmaskedentry.signals | 0 glade/Makefile.am | 22 +- src/Makefile.am | 18 +- src/gtkmaskedentry.c | 31 +-- tests/plugin_gtkform.c | 4 + 16 files changed, 54 insertions(+), 398 deletions(-) delete mode 100644 docs/reference/gtkmaskedentry-decl-list.txt delete mode 100644 docs/reference/gtkmaskedentry-decl.txt delete mode 100644 docs/reference/gtkmaskedentry-undeclared.txt delete mode 100644 docs/reference/gtkmaskedentry-undocumented.txt delete mode 100644 docs/reference/gtkmaskedentry-unused.txt delete mode 100644 docs/reference/gtkmaskedentry.args delete mode 100644 docs/reference/gtkmaskedentry.hierarchy delete mode 100644 docs/reference/gtkmaskedentry.interfaces delete mode 100644 docs/reference/gtkmaskedentry.prerequisites delete mode 100644 docs/reference/gtkmaskedentry.signals diff --git a/.gitignore b/.gitignore index d5b4dc4..e12f377 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ stamp-it intltool-* Rules-quot tests/plugin_gtkform +tests/*.exe diff --git a/configure.ac b/configure.ac index 38915ce..311fac7 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,20 @@ AC_SUBST(GTKFORM_CFLAGS) AC_SUBST(GTKFORM_LIBS) fi +dnl ****************************** +dnl Check for Operating System +dnl ****************************** + +platform_win32=no + +case "$host" in +*-mingw*) + platform_win32=yes + ;; +esac + +AM_CONDITIONAL(PLATFORM_WIN32, [test $platform_win32 = yes]) + # Output files AC_CONFIG_FILES([ libgtkmaskedentry.pc diff --git a/docs/reference/gtkmaskedentry-decl-list.txt b/docs/reference/gtkmaskedentry-decl-list.txt deleted file mode 100644 index 8072024..0000000 --- a/docs/reference/gtkmaskedentry-decl-list.txt +++ /dev/null @@ -1,57 +0,0 @@ -
-gtkmaskedentry -GtkMaskedEntry -GtkMaskedEntry -GtkMaskedEntryClass -gtk_masked_entry_new -gtk_masked_entry_new_with_mask -gtk_masked_entry_set_mask -gtk_masked_entry_get_mask -gtk_masked_entry_get_text - -GTK_MASKED_ENTRY -GTK_IS_MASKED_ENTRY -GTK_TYPE_MASKED_ENTRY -gtk_masked_entry_get_type -GTK_MASKED_ENTRY_CLASS -GTK_IS_MASKED_ENTRY_CLASS -GTK_MASKED_ENTRY_GET_CLASS -
- -
-gtkformwidgetmaskedentry -GtkFormWidgetMaskedEntry -GtkFormWidgetMaskedEntry -GtkFormWidgetMaskedEntryClass -gtk_form_widget_masked_entry_new -gtk_form_widget_masked_entry_get_value_stringify -gtk_form_widget_masked_entry_set_value_stringify -gtk_form_widget_masked_entry_set_editable - -GTK_FORM_WIDGET_MASKED_ENTRY -GTK_FORM_IS_WIDGET_MASKED_ENTRY -GTK_FORM_TYPE_WIDGET_MASKED_ENTRY -gtk_form_widget_masked_entry_get_type -GTK_FORM_WIDGET_MASKED_ENTRY_CLASS -GTK_FORM_IS_WIDGET_MASKED_ENTRY_CLASS -GTK_FORM_WIDGET_MASKED_ENTRY_GET_CLASS -
- -
-gtkcellrenderermasked -GtkCellRendererMasked -GtkCellRendererMasked -GtkCellRendererMaskedClass -gtk_cell_renderer_masked_new -gtk_cell_renderer_masked_new_with_mask -gtk_cell_renderer_masked_set_mask - -GTK_CELL_RENDERER_MASKED -GTK_IS_CELL_RENDERER_MASKED -GTK_TYPE_CELL_RENDERER_MASKED -gtk_cell_renderer_masked_get_type -GTK_CELL_RENDERER_MASKED_CLASS -GTK_IS_CELL_RENDERER_MASKED_CLASS -GTK_CELL_RENDERER_MASKED_GET_CLASS -
- diff --git a/docs/reference/gtkmaskedentry-decl.txt b/docs/reference/gtkmaskedentry-decl.txt deleted file mode 100644 index 1f77ab1..0000000 --- a/docs/reference/gtkmaskedentry-decl.txt +++ /dev/null @@ -1,207 +0,0 @@ - -GTK_TYPE_MASKED_ENTRY -#define GTK_TYPE_MASKED_ENTRY (gtk_masked_entry_get_type ()) - - -GTK_MASKED_ENTRY -#define GTK_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntry)) - - -GTK_MASKED_ENTRY_CLASS -#define GTK_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntry)) - - -GTK_IS_MASKED_ENTRY -#define GTK_IS_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MASKED_ENTRY)) - - -GTK_IS_MASKED_ENTRY_CLASS -#define GTK_IS_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MASKED_ENTRY)) - - -GTK_MASKED_ENTRY_GET_CLASS -#define GTK_MASKED_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntry)) - - -GtkMaskedEntry - - -GtkMaskedEntryClass - - -GtkMaskedEntry -struct _GtkMaskedEntry -{ - GtkEntry entry; -}; - - -GtkMaskedEntryClass -struct _GtkMaskedEntryClass -{ - GtkEntryClass parent_class; -}; - - -gtk_masked_entry_get_type -GType -void - - -gtk_masked_entry_new -GtkWidget * -void - - -gtk_masked_entry_new_with_mask -GtkWidget * -const gchar *mask - - -gtk_masked_entry_set_mask -void -GtkMaskedEntry *masked_entry, const gchar *mask - - -gtk_masked_entry_get_mask -G_CONST_RETURN gchar * -GtkMaskedEntry *masked_entry - - -gtk_masked_entry_get_text -G_CONST_RETURN gchar * -GtkMaskedEntry *masked_entry - - -GTK_FORM_TYPE_WIDGET_MASKED_ENTRY -#define GTK_FORM_TYPE_WIDGET_MASKED_ENTRY (gtk_form_widget_masked_entry_get_type ()) - - -GTK_FORM_WIDGET_MASKED_ENTRY -#define GTK_FORM_WIDGET_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_FORM_TYPE_WIDGET_MASKED_ENTRY, GtkFormWidgetMaskedEntry)) - - -GTK_FORM_WIDGET_MASKED_ENTRY_CLASS -#define GTK_FORM_WIDGET_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_FORM_TYPE_WIDGET_MASKED_ENTRY, GtkFormWidgetMaskedEntryClass)) - - -GTK_FORM_IS_WIDGET_MASKED_ENTRY -#define GTK_FORM_IS_WIDGET_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_FORM_TYPE_WIDGET_MASKED_ENTRY)) - - -GTK_FORM_IS_WIDGET_MASKED_ENTRY_CLASS -#define GTK_FORM_IS_WIDGET_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_FORM_TYPE_WIDGET_MASKED_ENTRY)) - - -GTK_FORM_WIDGET_MASKED_ENTRY_GET_CLASS -#define GTK_FORM_WIDGET_MASKED_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_FORM_TYPE_WIDGET_MASKED_ENTRY, GtkFormWidgetMaskedEntryClass)) - - -GtkFormWidgetMaskedEntry - - -GtkFormWidgetMaskedEntryClass - - -GtkFormWidgetMaskedEntry -struct _GtkFormWidgetMaskedEntry - { - GtkFormWidget parent; - }; - - -GtkFormWidgetMaskedEntryClass -struct _GtkFormWidgetMaskedEntryClass - { - GtkFormWidgetClass parent_class; - }; - - -gtk_form_widget_masked_entry_get_type -GType -void - - -gtk_form_widget_masked_entry_new -GtkFormWidget * -void - - -gtk_form_widget_masked_entry_get_value_stringify -gchar * -GtkFormWidget *widget - - -gtk_form_widget_masked_entry_set_value_stringify -gboolean -GtkFormWidget *fwidget, const gchar *value - - -gtk_form_widget_masked_entry_set_editable -void -GtkFormWidget *fwidget, gboolean editable - - -GTK_TYPE_CELL_RENDERER_MASKED -#define GTK_TYPE_CELL_RENDERER_MASKED (gtk_cell_renderer_masked_get_type ()) - - -GTK_CELL_RENDERER_MASKED -#define GTK_CELL_RENDERER_MASKED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMasked)) - - -GTK_CELL_RENDERER_MASKED_CLASS -#define GTK_CELL_RENDERER_MASKED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMasked)) - - -GTK_IS_CELL_RENDERER_MASKED -#define GTK_IS_CELL_RENDERER_MASKED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_RENDERER_MASKED)) - - -GTK_IS_CELL_RENDERER_MASKED_CLASS -#define GTK_IS_CELL_RENDERER_MASKED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_RENDERER_MASKED)) - - -GTK_CELL_RENDERER_MASKED_GET_CLASS -#define GTK_CELL_RENDERER_MASKED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMasked)) - - -GtkCellRendererMasked - - -GtkCellRendererMaskedClass - - -GtkCellRendererMasked -struct _GtkCellRendererMasked -{ - GtkCellRendererText parent; -}; - - -GtkCellRendererMaskedClass -struct _GtkCellRendererMaskedClass -{ - GtkCellRendererTextClass parent_class; -}; - - -gtk_cell_renderer_masked_get_type -GType -void - - -gtk_cell_renderer_masked_new -GtkCellRenderer * -void - - -gtk_cell_renderer_masked_new_with_mask -GtkCellRenderer * -const gchar *mask - - -gtk_cell_renderer_masked_set_mask -void -GtkCellRendererMasked *renderer, const gchar *mask - diff --git a/docs/reference/gtkmaskedentry-undeclared.txt b/docs/reference/gtkmaskedentry-undeclared.txt deleted file mode 100644 index e69de29..0000000 diff --git a/docs/reference/gtkmaskedentry-undocumented.txt b/docs/reference/gtkmaskedentry-undocumented.txt deleted file mode 100644 index cdaec98..0000000 --- a/docs/reference/gtkmaskedentry-undocumented.txt +++ /dev/null @@ -1,19 +0,0 @@ -48% symbol docs coverage. -10 symbols documented. -0 symbols incomplete. -11 not documented. - - -GtkCellRendererMasked -GtkMaskedEntry -gtk_form_widget_masked_entry_get_value_stringify -gtk_form_widget_masked_entry_new -gtk_form_widget_masked_entry_set_value_stringify -gtk_form_widget_set_editable -gtk_masked_entry_get_mask -gtk_masked_entry_get_text - - -gtkcellrenderermasked:Short_Description -gtkmaskedentry:Long_Description -gtkmaskedentry:Short_Description diff --git a/docs/reference/gtkmaskedentry-unused.txt b/docs/reference/gtkmaskedentry-unused.txt deleted file mode 100644 index 4b5f0f9..0000000 --- a/docs/reference/gtkmaskedentry-unused.txt +++ /dev/null @@ -1,13 +0,0 @@ -GTK_FORM_IS_WIDGET_MASKED_ENTRY -GTK_FORM_IS_WIDGET_MASKED_ENTRY_CLASS -GTK_FORM_TYPE_WIDGET_MASKED_ENTRY -GTK_FORM_WIDGET_MASKED_ENTRY -GTK_FORM_WIDGET_MASKED_ENTRY_CLASS -GTK_FORM_WIDGET_MASKED_ENTRY_GET_CLASS -GtkFormWidgetMaskedEntry -GtkFormWidgetMaskedEntryClass -gtk_form_widget_masked_entry_get_type -gtk_form_widget_masked_entry_get_value_stringify -gtk_form_widget_masked_entry_new -gtk_form_widget_masked_entry_set_editable -gtk_form_widget_masked_entry_set_value_stringify diff --git a/docs/reference/gtkmaskedentry.args b/docs/reference/gtkmaskedentry.args deleted file mode 100644 index 3f5fd46..0000000 --- a/docs/reference/gtkmaskedentry.args +++ /dev/null @@ -1,30 +0,0 @@ - -GtkMaskedEntry::mask -gchar* - -rw -The mask -The mask. -"" - - - -GtkMaskedEntry::tab-inside -gboolean - -rw -Tabulation inside the widget -Whether pressing tab moves between mask's parts or outside the widget. -FALSE - - - -GtkCellRendererMasked::mask -gchar* - -rw -Mask -Mask. -NULL - - diff --git a/docs/reference/gtkmaskedentry.hierarchy b/docs/reference/gtkmaskedentry.hierarchy deleted file mode 100644 index 1c316eb..0000000 --- a/docs/reference/gtkmaskedentry.hierarchy +++ /dev/null @@ -1,28 +0,0 @@ -GObject - GInitiallyUnowned - GtkObject - GtkWidget - GtkEntry - GtkMaskedEntry - GtkContainer - GtkMenuShell - GtkMenu - GtkCellRenderer - GtkCellRendererText - GtkCellRendererMasked - GtkStyle - GdkDrawable - GdkWindow - GdkDragContext - GtkTooltip - GdkScreen - GtkEntryBuffer - GdkPixbuf - GtkSettings -GInterface - GTypePlugin - AtkImplementorIface - GtkBuildable - GtkEditable - GtkCellEditable - GIcon diff --git a/docs/reference/gtkmaskedentry.interfaces b/docs/reference/gtkmaskedentry.interfaces deleted file mode 100644 index 8c1b33d..0000000 --- a/docs/reference/gtkmaskedentry.interfaces +++ /dev/null @@ -1,6 +0,0 @@ -GtkWidget AtkImplementorIface GtkBuildable -GtkEntry AtkImplementorIface GtkBuildable GtkEditable GtkCellEditable -GtkMaskedEntry AtkImplementorIface GtkBuildable GtkEditable GtkCellEditable -GtkContainer AtkImplementorIface GtkBuildable -GtkMenuShell AtkImplementorIface GtkBuildable -GtkMenu AtkImplementorIface GtkBuildable diff --git a/docs/reference/gtkmaskedentry.prerequisites b/docs/reference/gtkmaskedentry.prerequisites deleted file mode 100644 index 5c1f531..0000000 --- a/docs/reference/gtkmaskedentry.prerequisites +++ /dev/null @@ -1,2 +0,0 @@ -GtkCellEditable GtkWidget -GIcon GObject diff --git a/docs/reference/gtkmaskedentry.signals b/docs/reference/gtkmaskedentry.signals deleted file mode 100644 index e69de29..0000000 diff --git a/glade/Makefile.am b/glade/Makefile.am index 681c242..53a54ef 100644 --- a/glade/Makefile.am +++ b/glade/Makefile.am @@ -1,16 +1,24 @@ SUBDIRS = icons -moduledir = `pkg-config --variable=moduledir gladeui-1.0` +glademodulesdir = `pkg-config --variable=moduledir gladeui-1.0` -catalogsdir = `pkg-config --variable=catalogdir gladeui-1.0` +gladecatalogsdir = `pkg-config --variable=catalogdir gladeui-1.0` -catalogs_DATA = gtkmaskedentry.xml +gladecatalogs_DATA = gtkmaskedentry.xml -EXTRA_DIST = $(catalogs_DATA) +EXTRA_DIST = $(gladecatalogs_DATA) + +if PLATFORM_WIN32 +libmodulesext = -0.dll +libmodulesdir = $(bindir) +else +libmodulesext = .so +libmodulesdir = $(libdir) +endif install-exec-hook: - cd $(moduledir) && \ - ln -s -f $(libdir)/libgtkmaskedentry.so . + cd $(glademodulesdir) && \ + ln -s -f $(libmodulesdir)/libgtkmaskedentry$(libmodulesext) . uninstall-hook: - rm -f $(moduledir)/libgtkmaskedentry.so + rm -f $(glademodulesdir)/libgtkmaskedentry$(libmodulesext) diff --git a/src/Makefile.am b/src/Makefile.am index 12b0eda..3abeab0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = $(WARN_CFLAGS) \ +AM_CPPFLAGS = $(WARN_CFLAGS) \ $(DISABLE_DEPRECATED_CFLAGS) \ $(GTK_CFLAGS) \ $(GTKFORM_CFLAGS) @@ -18,6 +18,14 @@ GTKFORM_H = libgtkformmodulesdir = endif +if PLATFORM_WIN32 +libmodulesext = -0.dll +libmodulesdir = $(bindir) +else +libmodulesext = .so +libmodulesdir = $(libdir) +endif + libgtkmaskedentry_la_SOURCES = gtkmaskedentry.c \ gtkcellrenderermasked.c \ $(GTKFORM_C) @@ -28,9 +36,13 @@ include_HEADERS = gtkmaskedentry.h \ gtkcellrenderermasked.h \ $(GTKFORM_H) +if LIBGTKFORM_FOUND install-exec-hook: cd $(libgtkformmodulesdir) && \ - ln -s -f $(libdir)/libgtkmaskedentry.so . + ln -s -f $(libmodulesdir)/libgtkmaskedentry$(libmodulesext) . +endif +if LIBGTKFORM_FOUND uninstall-hook: - rm -f $(libgtkformmodulesdir)/libgtkmaskedentry.so + rm -f $(libgtkformmodulesdir)/libgtkmaskedentry$(libmodulesext) +endif \ No newline at end of file diff --git a/src/gtkmaskedentry.c b/src/gtkmaskedentry.c index b1cd903..bcab164 100644 --- a/src/gtkmaskedentry.c +++ b/src/gtkmaskedentry.c @@ -18,6 +18,10 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + #include #include @@ -83,32 +87,7 @@ struct _GtkMaskedEntryPrivate gboolean tab_inside; }; -GType -gtk_masked_entry_get_type (void) -{ - static GType masked_entry_type = 0; - - if (!masked_entry_type) - { - static const GTypeInfo masked_entry_info = - { - sizeof (GtkMaskedEntryClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_masked_entry_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkMaskedEntry), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_masked_entry_init, - }; - - masked_entry_type = g_type_register_static (GTK_TYPE_ENTRY, "GtkMaskedEntry", - &masked_entry_info, 0); - } - - return masked_entry_type; -} +G_DEFINE_TYPE (GtkMaskedEntry, gtk_masked_entry, GTK_TYPE_ENTRY) static void gtk_masked_entry_class_init (GtkMaskedEntryClass *klass) diff --git a/tests/plugin_gtkform.c b/tests/plugin_gtkform.c index 3b251b7..d7fd864 100644 --- a/tests/plugin_gtkform.c +++ b/tests/plugin_gtkform.c @@ -58,6 +58,10 @@ main (int argc, char **argv) error = NULL; builder = gtk_builder_new (); gtk_builder_add_from_file (builder, "plugin_gtkform.ui", &error); + if (error != NULL && error->message != NULL) + { + g_warning ("%s", error->message); + } gtk_builder_connect_signals (builder, NULL); -- 2.49.0