diff options
23 files changed, 98 insertions, 93 deletions
@@ -1,3 +1,15 @@ +2007-02-06 Vincent Geddes <vincent.geddes@gmail.com> + + * gladeui/*.[ch]: Replaced C++ style comments with the more portable ISO C syntax. + + * gladeui/glade-app.[ch]: Use the G_DEFINE_TYPE() and + g_type_class_add_private() idioms for registering the class. + + * README.cvs: Renamed to 'README.svn'. + + * plugins/gtk+/icons/16x16/Makefile.am, plugins/gtk+/icons/22x22/Makefile.am: + Added some icons. + 2007-02-07 Paul <ephraim_owns@hotmail.com> * bindings/python/Makefile.am: Removed $(top_srcdir) from CFLAGS. @@ -30,7 +30,7 @@ About Glade-3 This version of Glade (Glade-3) is a complete rewrite of the original Glade codebase. - One of the main differnces from glade-2 is that C code generation has been removed from +One of the main differences from glade-2 is that C code generation has been removed from glade-3: this has been done on purpose, since using generated code is deprecated; the preferred way to use glade files is with libglade (if code generation is needed, this can be provided as another tool or plugin, code generation is simply not a part of the glade-3 project). @@ -45,7 +45,7 @@ It has a few useful new features such as stacked Undo/Redo and Multiple Project and respects the same XML format as glade-2. For a more details on what has changed, what still needs work, etc. see -the NEWS file & the glade-3 product at bugzilla.gnome.org. +the NEWS file & the glade3 product at bugzilla.gnome.org. Comments, bug reports and patches are more than welcome. @@ -62,7 +62,7 @@ generated by Glade. (We do not consider the code generated by Glade to be Requirements ~~~~~~~~~~~~ - o GTK+ 2.8.0 or above - http://www.gtk.org + o GTK+ 2.10.0 or above - http://www.gtk.org You also need the glib, pango and atk libraries. Make sure you have the devel packages as well, as these will contain the header files which you will need to compile C applications. diff --git a/gladeui/glade-app.c b/gladeui/glade-app.c index 70ff7958..a7b518b8 100644 --- a/gladeui/glade-app.c +++ b/gladeui/glade-app.c @@ -20,14 +20,7 @@ * Naba Kumar <naba@gnome.org> */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif - -#include <string.h> -#include <glib.h> -#include <glib/gstdio.h> -#include <glib/gi18n-lib.h> #include "glade.h" #include "glade-clipboard-view.h" @@ -39,12 +32,30 @@ #include "glade-marshallers.h" #include "glade-accumulators.h" +#include <string.h> +#include <glib.h> +#include <glib/gstdio.h> +#include <glib/gi18n-lib.h> #include <gdk/gdkkeysyms.h> #include <gtk/gtkstock.h> -struct _GladeAppPriv { - - /* Class private member data */ +#define GLADE_APP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GLADE_TYPE_APP, GladeAppPrivate)) + +enum +{ + WIDGET_EVENT, + UPDATE_UI, + LAST_SIGNAL +}; + +enum +{ + PROP_0, + PROP_ACTIVE_PROJECT +}; + +struct _GladeAppPrivate +{ GtkWidget *window; GladePalette *palette; /* See glade-palette */ @@ -67,20 +78,6 @@ struct _GladeAppPriv { GList *undo_list, *redo_list; /* Lists of buttons to refresh in update-ui signal */ }; -enum -{ - WIDGET_EVENT, - UPDATE_UI, - LAST_SIGNAL -}; - - -enum -{ - PROP_0, - PROP_ACTIVE_PROJECT -}; - static guint glade_app_signals[LAST_SIGNAL] = { 0 }; gchar *glade_scripts_dir = GLADE_SCRIPTSDIR; @@ -92,8 +89,9 @@ gchar *glade_pixmaps_dir = GLADE_PIXMAPSDIR; gchar *glade_locale_dir = GLADE_LOCALEDIR; gboolean glade_verbose = FALSE; -static GObjectClass * parent_class = NULL; -static GladeApp * the_app = NULL; +static GladeApp *singleton_app = NULL; + +G_DEFINE_TYPE (GladeApp, glade_app, G_TYPE_OBJECT); /***************************************************************** @@ -104,15 +102,22 @@ glade_app_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { - - /* Singleton */ - if (!the_app) - the_app = (GladeApp *)parent_class->constructor - (type, n_construct_properties, construct_properties); + GObject *object; + + /* singleton */ + if (!singleton_app) + { + object = G_OBJECT_CLASS (glade_app_parent_class)->constructor (type, + n_construct_properties, + construct_properties); + singleton_app = GLADE_APP (object); + } else - g_object_ref (the_app); - - return G_OBJECT (the_app); + { + g_object_ref (singleton_app); + } + + return G_OBJECT (singleton_app); } @@ -120,7 +125,7 @@ glade_app_constructor (GType type, static void glade_app_dispose (GObject *app) { - GladeAppPriv *priv = GLADE_APP (app)->priv; + GladeAppPrivate *priv = GLADE_APP_GET_PRIVATE (app); if (priv->editor) { @@ -145,8 +150,7 @@ glade_app_dispose (GObject *app) priv->config = NULL; } - if (parent_class->dispose) - parent_class->dispose (app); + G_OBJECT_CLASS (glade_app_parent_class)->dispose (app); } static void @@ -167,9 +171,7 @@ glade_app_finalize (GObject *app) glade_catalog_modules_close (); - g_free (GLADE_APP (app)->priv); - if (parent_class->finalize) - parent_class->finalize (app); + G_OBJECT_CLASS (glade_app_parent_class)->finalize (app); } static void @@ -310,6 +312,8 @@ glade_app_init (GladeApp *app) { static gboolean initialized = FALSE; + app->priv = GLADE_APP_GET_PRIVATE (app); + if (!initialized) { #ifdef G_OS_WIN32 @@ -334,7 +338,6 @@ glade_app_init (GladeApp *app) initialized = TRUE; } - app->priv = g_new0 (GladeAppPriv, 1); app->priv->accel_group = NULL; @@ -375,10 +378,8 @@ static void glade_app_class_init (GladeAppClass * klass) { GObjectClass *object_class; - g_return_if_fail (klass != NULL); - parent_class = g_type_class_peek_parent (klass); - object_class = (GObjectClass *) klass; + object_class = G_OBJECT_CLASS (klass); object_class->constructor = glade_app_constructor; object_class->dispose = glade_app_dispose; @@ -437,32 +438,8 @@ glade_app_class_init (GladeAppClass * klass) _("The active project"), GLADE_TYPE_PROJECT, G_PARAM_READWRITE)); -} - -GType -glade_app_get_type () -{ - static GType obj_type = 0; - if (!obj_type) - { - static const GTypeInfo obj_info = - { - sizeof (GladeAppClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) glade_app_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (GladeApp), - 0, /* n_preallocs */ - (GInstanceInitFunc) glade_app_init, - NULL /* value_table */ - }; - obj_type = g_type_register_static (G_TYPE_OBJECT, - "GladeApp", &obj_info, 0); - } - return obj_type; + g_type_class_add_private (klass, sizeof (GladeAppPrivate)); } /***************************************************************** @@ -630,9 +607,9 @@ glade_app_set_transient_parent (GtkWindow *parent) /* Loop over all projects/widgets and set_transient_for the toplevels. */ - for (projects = glade_app_get_projects (); // projects + for (projects = glade_app_get_projects (); /* projects */ projects; projects = projects->next) - for (objects = GLADE_PROJECT (projects->data)->objects; // widgets + for (objects = GLADE_PROJECT (projects->data)->objects; /* widgets */ objects; objects = objects->next) if (GTK_IS_WINDOW (objects->data)) gtk_window_set_transient_for @@ -653,9 +630,9 @@ glade_app_get_transient_parent (void) GladeApp * glade_app_get (void) { - if (!the_app) + if (!singleton_app) g_critical ("No available GladeApp"); - return the_app; + return singleton_app; } void diff --git a/gladeui/glade-app.h b/gladeui/glade-app.h index 4e7c4408..745d8e74 100644 --- a/gladeui/glade-app.h +++ b/gladeui/glade-app.h @@ -19,6 +19,7 @@ * Authors: * Naba Kumar <naba@gnome.org> */ + #ifndef __GLADE_APP_H__ #define __GLADE_APP_H__ @@ -38,14 +39,16 @@ G_BEGIN_DECLS #define GLADE_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_APP)) #define GLADE_APP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GLADE_APP, GladeAppClass)) -typedef struct _GladeApp GladeApp; -typedef struct _GladeAppClass GladeAppClass; -typedef struct _GladeAppPriv GladeAppPriv; +typedef struct _GladeApp GladeApp; +typedef struct _GladeAppPrivate GladeAppPrivate; +typedef struct _GladeAppClass GladeAppClass; struct _GladeApp { - GObject parent; - GladeAppPriv *priv; + /*< private >*/ + GObject parent_instance; + + GladeAppPrivate *priv; }; struct _GladeAppClass @@ -53,14 +56,15 @@ struct _GladeAppClass GObjectClass parent_class; /* class methods */ - void (* show_properties) (GladeApp* app, gboolean raise); + void (* show_properties) (GladeApp* app, + gboolean raise); void (* hide_properties) (GladeApp* app); /* signals */ void (* widget_event) (GladeApp *app, GladeWidget *toplevel, GdkEvent *event); - void (* update_ui_signal) (GladeApp *app); + void (* update_ui_signal) (GladeApp *app); }; LIBGLADEUI_API diff --git a/gladeui/glade-builtins.c b/gladeui/glade-builtins.c index 6f04b40b..523b9cf6 100644 --- a/gladeui/glade-builtins.c +++ b/gladeui/glade-builtins.c @@ -104,7 +104,7 @@ list_stock_items (gboolean include_images) /* Add first "no stock" element */ - value.value_nick = g_strdup ("glade-none"); // Passing ownership here. + value.value_nick = g_strdup ("glade-none"); /* Passing ownership here */ value.value_name = g_strdup ("None"); value.value = 0; values = g_array_append_val (values, value); @@ -124,7 +124,7 @@ list_stock_items (gboolean include_images) value.value = stock_enum++; value.value_name = g_strdup (item.label); - value.value_nick = stock_id; // Passing ownership here. + value.value_nick = stock_id; /* Passing ownership here */ values = g_array_append_val (values, value); } @@ -303,7 +303,7 @@ static gboolean param_accel_validate (GParamSpec *pspec, GValue *value) { - //GladeParamSpecAccel *aspec = GLADE_PARAM_SPEC_ACCEL (pspec); + /* GladeParamSpecAccel *aspec = GLADE_PARAM_SPEC_ACCEL (pspec); */ GList *accels, *list, *toremove = NULL; GladeAccelInfo *info; diff --git a/gladeui/glade-clipboard-view.c b/gladeui/glade-clipboard-view.c index 4e1a58b0..d10863c0 100644 --- a/gladeui/glade-clipboard-view.c +++ b/gladeui/glade-clipboard-view.c @@ -377,7 +377,7 @@ glade_clipboard_view_refresh_sel (GladeClipboardView *view) (GTK_TREE_MODEL (view->model), widget, 0)) != NULL) { gtk_tree_selection_select_iter (sel, iter); - // gtk_tree_iter_free (iter); + /* gtk_tree_iter_free (iter); */ } } view->updating = FALSE; diff --git a/gladeui/glade-command.h b/gladeui/glade-command.h index 85bb2059..c4bc6af7 100644 --- a/gladeui/glade-command.h +++ b/gladeui/glade-command.h @@ -87,7 +87,7 @@ void glade_command_set_properties (GladeProperty *property, ...); LIBGLADEUI_API void glade_command_set_properties_list (GladeProject *project, - GList *props); // list of GCSetPropData + GList *props); /* list of GCSetPropData */ /************************** name ******************************/ LIBGLADEUI_API diff --git a/gladeui/glade-custom.c b/gladeui/glade-custom.c index 079b4bd9..069593b6 100644 --- a/gladeui/glade-custom.c +++ b/gladeui/glade-custom.c @@ -179,7 +179,7 @@ glade_custom_expose (GtkWidget *widget, GdkEventExpose *event) gdk_draw_line (event->window, dark_gc, 0, h - 1, w - 1, h - 1); gdk_draw_line (event->window, dark_gc, w - 1, 0, w - 1, h - 1); - // glade_util_queue_draw_nodes (event->window); + /* glade_util_queue_draw_nodes (event->window); */ return FALSE; } diff --git a/gladeui/glade-editor-property.h b/gladeui/glade-editor-property.h index 1e3fb4a4..5759a257 100644 --- a/gladeui/glade-editor-property.h +++ b/gladeui/glade-editor-property.h @@ -2,6 +2,7 @@ #ifndef __GLADE_EDITOR_PROPERTY_H__ #define __GLADE_EDITOR_PROPERTY_H__ +G_BEGIN_DECLS #define GLADE_TYPE_EDITOR_PROPERTY (glade_editor_property_get_type()) #define GLADE_EDITOR_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EDITOR_PROPERTY, GladeEditorProperty)) @@ -99,4 +100,6 @@ void glade_editor_property_show_info (GladeEditorProperty * LIBGLADEUI_API void glade_editor_property_hide_info (GladeEditorProperty *eprop); -#endif // __GLADE_EDITOR_PROPERTY_H__ +G_END_DECLS + +#endif /* __GLADE_EDITOR_PROPERTY_H__ */ diff --git a/gladeui/glade-fixed.c b/gladeui/glade-fixed.c index a74530ea..abcf7f13 100644 --- a/gladeui/glade-fixed.c +++ b/gladeui/glade-fixed.c @@ -782,7 +782,7 @@ glade_fixed_event (GladeWidget *gwidget_fixed, switch (event->type) { - case GDK_BUTTON_PRESS: // add widget + case GDK_BUTTON_PRESS: /* add widget */ if (((GdkEventButton *) event)->button == 1) { diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c index 5cfac0f9..ad85c6cf 100644 --- a/gladeui/glade-property.c +++ b/gladeui/glade-property.c @@ -650,7 +650,7 @@ glade_property_get_type (void) { static const GTypeInfo property_info = { - sizeof (GladePropertyKlass), // Klass is our class + sizeof (GladePropertyKlass), /* Klass is our class */ (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) glade_property_klass_init, diff --git a/plugins/gtk+/icons/16x16/Makefile.am b/plugins/gtk+/icons/16x16/Makefile.am index 4af8d58a..37712fba 100644 --- a/plugins/gtk+/icons/16x16/Makefile.am +++ b/plugins/gtk+/icons/16x16/Makefile.am @@ -3,6 +3,7 @@ iconsdir = $(pkgdatadir)/pixmaps/16x16 icons_DATA = \ + assistant.png \ alignment.png \ aspectframe.png \ accellabel.png \ @@ -51,6 +52,7 @@ icons_DATA = \ layout.png \ list.png \ listitem.png \ + linkbutton.png \ menu.png \ menuitem.png \ menutoolbutton.png \ @@ -59,9 +61,11 @@ icons_DATA = \ notebook.png \ optionmenu.png \ progressbar.png \ + pagesetupdialog.png \ radiobutton.png \ radiomenuitem.png \ radiotoolbutton.png \ + recentchooser.png \ ruler.png \ scrolledwindow.png \ spinbutton.png \ diff --git a/plugins/gtk+/icons/16x16/assistant.png b/plugins/gtk+/icons/16x16/assistant.png Binary files differnew file mode 100644 index 00000000..ef1bf09d --- /dev/null +++ b/plugins/gtk+/icons/16x16/assistant.png diff --git a/plugins/gtk+/icons/16x16/linkbutton.png b/plugins/gtk+/icons/16x16/linkbutton.png Binary files differnew file mode 100644 index 00000000..cdc839e9 --- /dev/null +++ b/plugins/gtk+/icons/16x16/linkbutton.png diff --git a/plugins/gtk+/icons/16x16/pagesetupdialog.png b/plugins/gtk+/icons/16x16/pagesetupdialog.png Binary files differnew file mode 100644 index 00000000..bdaa307e --- /dev/null +++ b/plugins/gtk+/icons/16x16/pagesetupdialog.png diff --git a/plugins/gtk+/icons/16x16/recentchooser.png b/plugins/gtk+/icons/16x16/recentchooser.png Binary files differnew file mode 100644 index 00000000..39a0d618 --- /dev/null +++ b/plugins/gtk+/icons/16x16/recentchooser.png diff --git a/plugins/gtk+/icons/22x22/Makefile.am b/plugins/gtk+/icons/22x22/Makefile.am index 34975783..4564c1e1 100644 --- a/plugins/gtk+/icons/22x22/Makefile.am +++ b/plugins/gtk+/icons/22x22/Makefile.am @@ -3,6 +3,7 @@ iconsdir = $(pkgdatadir)/pixmaps/22x22 icons_DATA = \ + assistant.png \ alignment.png \ aspectframe.png \ accellabel.png \ @@ -51,6 +52,7 @@ icons_DATA = \ layout.png \ list.png \ listitem.png \ + linkbutton.png \ menu.png \ menuitem.png \ menubar.png \ @@ -59,10 +61,12 @@ icons_DATA = \ notebook.png \ optionmenu.png \ progressbar.png \ + pagesetupdialog.png \ radiobutton.png \ ruler.png \ radiomenuitem.png \ radiotoolbutton.png \ + recentchooser.png \ scrolledwindow.png \ spinbutton.png \ statusbar.png \ diff --git a/plugins/gtk+/icons/22x22/assistant.png b/plugins/gtk+/icons/22x22/assistant.png Binary files differnew file mode 100644 index 00000000..b4afafc0 --- /dev/null +++ b/plugins/gtk+/icons/22x22/assistant.png diff --git a/plugins/gtk+/icons/22x22/linkbutton.png b/plugins/gtk+/icons/22x22/linkbutton.png Binary files differnew file mode 100644 index 00000000..58a78904 --- /dev/null +++ b/plugins/gtk+/icons/22x22/linkbutton.png diff --git a/plugins/gtk+/icons/22x22/pagesetupdialog.png b/plugins/gtk+/icons/22x22/pagesetupdialog.png Binary files differnew file mode 100644 index 00000000..19e7e887 --- /dev/null +++ b/plugins/gtk+/icons/22x22/pagesetupdialog.png diff --git a/plugins/gtk+/icons/22x22/recentchooser.png b/plugins/gtk+/icons/22x22/recentchooser.png Binary files differnew file mode 100644 index 00000000..ab755f0c --- /dev/null +++ b/plugins/gtk+/icons/22x22/recentchooser.png diff --git a/src/glade-project-window.c b/src/glade-project-window.c index 83f6c069..e37b92da 100644 --- a/src/glade-project-window.c +++ b/src/glade-project-window.c @@ -1945,10 +1945,11 @@ create_selector_tool_button (GtkToolbar *toolbar) gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (button), TRUE); gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (button), image); + gtk_tool_button_set_label (GTK_TOOL_BUTTON (button), _("Select Widgets")); gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (button), toolbar->tooltips, - _("Select a widget"), + _("Select widgets in the workspace"), NULL); gtk_widget_show (GTK_WIDGET (button)); |