From 1b43c5a9b813f629d8d7e41f15c0485208d99d6d Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 18 May 2011 17:53:32 +0200 Subject: [PATCH] Adjustments to GObject file structure. --- src/gtkcellrenderermasked.c | 41 +++++++--------------------------- src/gtkcellrenderermasked.h | 8 +++---- src/gtkformwidgetmaskedentry.c | 6 ++++- src/gtkmaskedentry.c | 4 +--- src/gtkmaskedentry.h | 9 ++++---- 5 files changed, 22 insertions(+), 46 deletions(-) diff --git a/src/gtkcellrenderermasked.c b/src/gtkcellrenderermasked.c index 8c3a7ba..ccbf1ee 100644 --- a/src/gtkcellrenderermasked.c +++ b/src/gtkcellrenderermasked.c @@ -1,6 +1,6 @@ /* * GtkCellRendererMasked widget for GTK+ - * Copyright (C) 2005 Andrea Zagli + * Copyright (C) 2005-2011 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,7 +18,9 @@ * Boston, MA 02111-1307, USA. */ -#include +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif #include @@ -48,9 +50,8 @@ static GtkCellEditable *gtk_cell_renderer_masked_start_editing (GtkCellRenderer enum { - PROP_0, - - PROP_MASK + PROP_0, + PROP_MASK }; static gpointer parent_class; @@ -67,33 +68,7 @@ struct _GtkCellRendererMaskedPrivate GtkWidget *entry; }; - -GType -gtk_cell_renderer_masked_get_type (void) -{ - static GType cell_masked_type = 0; - - if (!cell_masked_type) - { - static const GTypeInfo cell_masked_info = - { - sizeof (GtkCellRendererMaskedClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_cell_renderer_masked_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkCellRendererMasked), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_cell_renderer_masked_init, - }; - - cell_masked_type = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, "GtkCellRendererMasked", - &cell_masked_info, 0); - } - - return cell_masked_type; -} +G_DEFINE_TYPE (GtkCellRendererMasked, gtk_cell_renderer_masked, GTK_TYPE_CELL_RENDERER_TEXT) static void gtk_cell_renderer_masked_init (GtkCellRendererMasked *cell) @@ -122,7 +97,7 @@ gtk_cell_renderer_masked_class_init (GtkCellRendererMaskedClass *class) "Mask", "Mask", NULL, - GTK_PARAM_READWRITE)); + G_PARAM_READWRITE)); g_type_class_add_private (object_class, sizeof (GtkCellRendererMaskedPrivate)); } diff --git a/src/gtkcellrenderermasked.h b/src/gtkcellrenderermasked.h index b400e1a..3f99fac 100644 --- a/src/gtkcellrenderermasked.h +++ b/src/gtkcellrenderermasked.h @@ -1,6 +1,6 @@ /* * GtkCellRendererMasked widget for GTK+ - * Copyright (C) 2005 Andrea Zagli + * Copyright (C) 2005-2011 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,7 +21,7 @@ #ifndef __GTK_CELL_RENDERER_MASKED_H__ #define __GTK_CELL_RENDERER_MASKED_H__ -#include +#include G_BEGIN_DECLS @@ -29,10 +29,10 @@ G_BEGIN_DECLS #define GTK_TYPE_CELL_RENDERER_MASKED (gtk_cell_renderer_masked_get_type ()) #define GTK_CELL_RENDERER_MASKED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMasked)) -#define GTK_CELL_RENDERER_MASKED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMasked)) +#define GTK_CELL_RENDERER_MASKED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMaskedClass)) #define GTK_IS_CELL_RENDERER_MASKED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_RENDERER_MASKED)) #define GTK_IS_CELL_RENDERER_MASKED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CELL_RENDERER_MASKED)) -#define GTK_CELL_RENDERER_MASKED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMasked)) +#define GTK_CELL_RENDERER_MASKED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CELL_RENDERER_MASKED, GtkCellRendererMaskedClass)) typedef struct _GtkCellRendererMasked GtkCellRendererMasked; diff --git a/src/gtkformwidgetmaskedentry.c b/src/gtkformwidgetmaskedentry.c index 985b7a3..018da91 100644 --- a/src/gtkformwidgetmaskedentry.c +++ b/src/gtkformwidgetmaskedentry.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Andrea Zagli + * Copyright (C) 2010-2011 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + #include #include "gtkmaskedentry.h" diff --git a/src/gtkmaskedentry.c b/src/gtkmaskedentry.c index bcab164..81662b5 100644 --- a/src/gtkmaskedentry.c +++ b/src/gtkmaskedentry.c @@ -1,6 +1,6 @@ /* * GtkMaskedEntry widget for GTK+ - * Copyright (C) 2005-2009 Andrea Zagli + * Copyright (C) 2005-2011 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,9 +25,7 @@ #include #include -#include #include -#include #include "gtkmaskedentry.h" diff --git a/src/gtkmaskedentry.h b/src/gtkmaskedentry.h index bbbe49f..57ea942 100644 --- a/src/gtkmaskedentry.h +++ b/src/gtkmaskedentry.h @@ -1,6 +1,6 @@ /* * GtkMaskedEntry widget for GTK+ - * Copyright (C) 2005-2007 Andrea Zagli + * Copyright (C) 2005-2011 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -21,8 +21,7 @@ #ifndef __GTK_MASKED_ENTRY_H__ #define __GTK_MASKED_ENTRY_H__ -#include -#include +#include G_BEGIN_DECLS @@ -30,10 +29,10 @@ G_BEGIN_DECLS #define GTK_TYPE_MASKED_ENTRY (gtk_masked_entry_get_type ()) #define GTK_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntry)) -#define GTK_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntry)) +#define GTK_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntryClass)) #define GTK_IS_MASKED_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MASKED_ENTRY)) #define GTK_IS_MASKED_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MASKED_ENTRY)) -#define GTK_MASKED_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntry)) +#define GTK_MASKED_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MASKED_ENTRY, GtkMaskedEntryClass)) typedef struct _GtkMaskedEntry GtkMaskedEntry; -- 2.49.0