From d3f4831bec333b5e6726fbd87843e2bea56f5ca2 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Tue, 17 Sep 2002 03:14:15 +0000 Subject: [PATCH] Code cleanup. Mostly formatting. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@122 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/src/mdi-child.c | 22 +++++++------ glabels2/src/mdi-child.h | 29 ++++++++++------- glabels2/src/mdi.c | 69 ++++++++++++++++++++++------------------ glabels2/src/mdi.h | 20 +++++++----- 4 files changed, 79 insertions(+), 61 deletions(-) diff --git a/glabels2/src/mdi-child.c b/glabels2/src/mdi-child.c index 80fb5ba5..093f958c 100644 --- a/glabels2/src/mdi-child.c +++ b/glabels2/src/mdi-child.c @@ -48,22 +48,24 @@ enum { LAST_SIGNAL }; -static void gl_mdi_child_class_init (glMDIChildClass *klass); -static void gl_mdi_child_init (glMDIChild *mdi); -static void gl_mdi_child_finalize (GObject *obj); -static void gl_mdi_child_destroy (GtkObject *obj); +static void gl_mdi_child_class_init (glMDIChildClass *klass); +static void gl_mdi_child_init (glMDIChild *mdi); +static void gl_mdi_child_finalize (GObject *obj); +static void gl_mdi_child_destroy (GtkObject *obj); -static void gl_mdi_child_real_state_changed (glMDIChild* child); +static void gl_mdi_child_real_state_changed (glMDIChild* child); static GtkWidget *gl_mdi_child_create_view (BonoboMDIChild *child); -static void gl_mdi_child_document_state_changed_handler (glLabel *label, - glMDIChild* child); +static void gl_mdi_child_document_state_changed_handler (glLabel *label, + glMDIChild* child); -static void gl_mdi_child_document_can_undo_redo_handler (glLabel *label, - gboolean can, glMDIChild* child); +static void gl_mdi_child_document_can_undo_redo_handler (glLabel *label, + gboolean can, + glMDIChild* child); -static gchar* gl_mdi_child_get_config_string (BonoboMDIChild *child, gpointer data); +static gchar* gl_mdi_child_get_config_string (BonoboMDIChild *child, + gpointer data); static BonoboMDIChildClass *parent_class = NULL; static guint mdi_child_signals[LAST_SIGNAL] = { 0 }; diff --git a/glabels2/src/mdi-child.h b/glabels2/src/mdi-child.h index 9e00cf47..070404c0 100644 --- a/glabels2/src/mdi-child.h +++ b/glabels2/src/mdi-child.h @@ -35,11 +35,13 @@ #include "label.h" -#define GL_TYPE_MDI_CHILD (gl_mdi_child_get_type ()) -#define GL_MDI_CHILD(o) (GTK_CHECK_CAST ((o), GL_TYPE_MDI_CHILD, glMDIChild)) -#define GL_MDI_CHILD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_MDI_CHILD, \ - glMDIChildClass)) -#define GL_IS_MDI_CHILD(o) (GTK_CHECK_TYPE ((o), GL_TYPE_MDI_CHILD)) +G_BEGIN_DECLS + +#define GL_TYPE_MDI_CHILD (gl_mdi_child_get_type ()) +#define GL_MDI_CHILD(o) (GTK_CHECK_CAST ((o), GL_TYPE_MDI_CHILD, glMDIChild)) +#define GL_MDI_CHILD_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_MDI_CHILD, \ + glMDIChildClass)) +#define GL_IS_MDI_CHILD(o) (GTK_CHECK_TYPE ((o), GL_TYPE_MDI_CHILD)) #define GL_IS_MDI_CHILD_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_MDI_CHILD)) #define GL_MDI_CHILD_GET_CLASS(o) (GTK_CHECK_GET_CLASS ((o), GL_TYPE_MDI_CHILD, glMdiChildClass)) @@ -51,10 +53,10 @@ typedef struct _glMDIChildPrivate glMDIChildPrivate; struct _glMDIChild { - BonoboMDIChild child; + BonoboMDIChild child; - glLabel* label; - glMDIChildPrivate *priv; + glLabel *label; + glMDIChildPrivate *priv; }; struct _glMDIChildClass @@ -68,12 +70,15 @@ struct _glMDIChildClass }; -GtkType gl_mdi_child_get_type (void) G_GNUC_CONST; +GtkType gl_mdi_child_get_type (void) G_GNUC_CONST; + +glMDIChild* gl_mdi_child_new (const gchar *tmplt_name, + gboolean rotate_flag); -glMDIChild* gl_mdi_child_new (const gchar *tmplt_name, - gboolean rotate_flag); +glMDIChild* gl_mdi_child_new_with_uri (const gchar *uri, + GError **error); -glMDIChild* gl_mdi_child_new_with_uri (const gchar *uri, GError **error); +G_END_DECLS #endif /* __MDI_CHILD_H__ */ diff --git a/glabels2/src/mdi.c b/glabels2/src/mdi.c index a5ed4299..d2b79b6b 100644 --- a/glabels2/src/mdi.c +++ b/glabels2/src/mdi.c @@ -77,18 +77,18 @@ static BonoboMDIClass *parent_class = NULL; /* Private function prototypes. */ /*========================================================*/ -static void gl_mdi_class_init (glMDIClass *klass); -static void gl_mdi_init (glMDI *mdi); -static void gl_mdi_finalize (GObject *object); +static void gl_mdi_class_init (glMDIClass *klass); +static void gl_mdi_init (glMDI *mdi); +static void gl_mdi_finalize (GObject *object); -static void gl_mdi_app_created_cb (BonoboMDI *mdi, BonoboWindow *win); +static void gl_mdi_app_created_cb (BonoboMDI *mdi, BonoboWindow *win); -static gint gl_mdi_add_child_cb (BonoboMDI *mdi, BonoboMDIChild *child); -static gint gl_mdi_add_view_cb (BonoboMDI *mdi, GtkWidget *view); -static gint gl_mdi_remove_child_cb (BonoboMDI *mdi, BonoboMDIChild *child); -static gint gl_mdi_remove_view_cb (BonoboMDI *mdi, GtkWidget *view); +static gint gl_mdi_add_child_cb (BonoboMDI *mdi, BonoboMDIChild *child); +static gint gl_mdi_add_view_cb (BonoboMDI *mdi, GtkWidget *view); +static gint gl_mdi_remove_child_cb (BonoboMDI *mdi, BonoboMDIChild *child); +static gint gl_mdi_remove_view_cb (BonoboMDI *mdi, GtkWidget *view); -static void gl_mdi_view_changed_cb (BonoboMDI *mdi, GtkWidget *old_view); +static void gl_mdi_view_changed_cb (BonoboMDI *mdi, GtkWidget *old_view); static void gl_mdi_child_changed_cb (BonoboMDI *mdi, BonoboMDIChild *old_child); static void gl_mdi_child_state_changed_cb (glMDIChild *child); @@ -229,10 +229,11 @@ gl_mdi_new (void) /* App created callback. */ /*---------------------------------------------------------------------------*/ static void -gl_mdi_app_created_cb (BonoboMDI *mdi, BonoboWindow *win) +gl_mdi_app_created_cb (BonoboMDI *mdi, + BonoboWindow *win) { - GtkWidget *widget; - BonoboControl *control; + GtkWidget *widget; + BonoboControl *control; BonoboUIComponent *ui_component; gl_debug (DEBUG_MDI, "START"); @@ -281,7 +282,8 @@ gl_mdi_child_undo_redo_state_changed_cb (glMDIChild *child) /* Add child callback. */ /*---------------------------------------------------------------------------*/ static gint -gl_mdi_add_child_cb (BonoboMDI *mdi, BonoboMDIChild *child) +gl_mdi_add_child_cb (BonoboMDI *mdi, + BonoboMDIChild *child) { gl_debug (DEBUG_MDI, "START"); @@ -315,7 +317,8 @@ gl_mdi_view_selection_state_changed_cb (glView *view) /* Add view callback. */ /*---------------------------------------------------------------------------*/ static gint -gl_mdi_add_view_cb (BonoboMDI *mdi, GtkWidget *view) +gl_mdi_add_view_cb (BonoboMDI *mdi, + GtkWidget *view) { gl_debug (DEBUG_MDI, "START"); @@ -331,9 +334,10 @@ gl_mdi_add_view_cb (BonoboMDI *mdi, GtkWidget *view) /* Remove child callback. */ /*---------------------------------------------------------------------------*/ static gint -gl_mdi_remove_child_cb (BonoboMDI *mdi, BonoboMDIChild *child) +gl_mdi_remove_child_cb (BonoboMDI *mdi, + BonoboMDIChild *child) { - glLabel* doc; + glLabel *doc; gboolean close = TRUE; gl_debug (DEBUG_MDI, "START"); @@ -425,7 +429,8 @@ gl_mdi_remove_child_cb (BonoboMDI *mdi, BonoboMDIChild *child) /* Remove view callback. */ /*---------------------------------------------------------------------------*/ static gint -gl_mdi_remove_view_cb (BonoboMDI *mdi, GtkWidget *view) +gl_mdi_remove_view_cb (BonoboMDI *mdi, + GtkWidget *view) { gl_debug (DEBUG_MDI, ""); gl_debug (DEBUG_MDI, "END"); @@ -439,10 +444,10 @@ gl_mdi_remove_view_cb (BonoboMDI *mdi, GtkWidget *view) void gl_mdi_set_active_window_title (BonoboMDI *mdi) { - BonoboMDIChild* active_child = NULL; - glLabel* doc = NULL; - gchar* docname = NULL; - gchar* title = NULL; + BonoboMDIChild *active_child = NULL; + glLabel *doc = NULL; + gchar *docname = NULL; + gchar *title = NULL; gl_debug (DEBUG_MDI, "START"); @@ -481,7 +486,8 @@ gl_mdi_set_active_window_title (BonoboMDI *mdi) /* Child changed callback. */ /*---------------------------------------------------------------------------*/ static -void gl_mdi_child_changed_cb (BonoboMDI *mdi, BonoboMDIChild *old_child) +void gl_mdi_child_changed_cb (BonoboMDI *mdi, + BonoboMDIChild *old_child) { gl_debug (DEBUG_MDI, "START"); @@ -494,11 +500,12 @@ void gl_mdi_child_changed_cb (BonoboMDI *mdi, BonoboMDIChild *old_child) /* View changed callback. */ /*---------------------------------------------------------------------------*/ static -void gl_mdi_view_changed_cb (BonoboMDI *mdi, GtkWidget *old_view) +void gl_mdi_view_changed_cb (BonoboMDI *mdi, + GtkWidget *old_view) { BonoboWindow *win; - GtkWidget* status; - GtkWidget *active_view; + GtkWidget *status; + GtkWidget *active_view; gl_debug (DEBUG_MDI, "START"); @@ -519,8 +526,8 @@ void gl_mdi_set_active_window_verbs_sensitivity (BonoboMDI *mdi) { BonoboWindow *active_window = NULL; - BonoboMDIChild *active_child = NULL; - glView *view = NULL; + BonoboMDIChild *active_child = NULL; + glView *view = NULL; BonoboUIComponent *ui_component; gl_debug (DEBUG_MDI, "START"); @@ -555,9 +562,9 @@ gl_mdi_set_active_window_verbs_sensitivity (BonoboMDI *mdi) static void gl_mdi_set_active_window_undo_redo_verbs_sensitivity (BonoboMDI *mdi) { - BonoboWindow* active_window = NULL; - BonoboMDIChild* active_child = NULL; - glLabel* doc = NULL; + BonoboWindow *active_window = NULL; + BonoboMDIChild *active_child = NULL; + glLabel *doc = NULL; BonoboUIComponent *ui_component; gl_debug (DEBUG_MDI, "START"); @@ -584,7 +591,7 @@ static void gl_mdi_set_active_window_selection_verbs_sensitivity (BonoboMDI *mdi) { BonoboWindow *active_window = NULL; - glView *view = NULL; + glView *view = NULL; BonoboUIComponent *ui_component; gl_debug (DEBUG_MDI, "START"); diff --git a/glabels2/src/mdi.h b/glabels2/src/mdi.h index 3f215a36..5b0dfcd6 100644 --- a/glabels2/src/mdi.h +++ b/glabels2/src/mdi.h @@ -33,11 +33,13 @@ #include -#define GL_TYPE_MDI (gl_mdi_get_type ()) -#define GL_MDI(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_MDI, glMDI)) -#define GL_MDI_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_MDI, glMDIClass)) +G_BEGIN_DECLS + +#define GL_TYPE_MDI (gl_mdi_get_type ()) +#define GL_MDI(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_MDI, glMDI)) +#define GL_MDI_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_MDI, glMDIClass)) #define GL_IS_MDI(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_MDI)) -#define GL_IS_MDI_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_MDI)) +#define GL_IS_MDI_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_MDI)) #define GL_MDI_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_MDI, glMdiClass)) @@ -48,14 +50,14 @@ typedef struct _glMDIPrivate glMDIPrivate; struct _glMDI { - BonoboMDI mdi; + BonoboMDI mdi; - glMDIPrivate *priv; + glMDIPrivate *priv; }; struct _glMDIClass { - BonoboMDIClass parent_class; + BonoboMDIClass parent_class; }; @@ -65,9 +67,11 @@ glMDI* gl_mdi_new (void); void gl_mdi_set_active_window_title (BonoboMDI *mdi); -void gl_mdi_update_ui_according_to_preferences (glMDI *mdi); +void gl_mdi_update_ui_according_to_preferences (glMDI *mdi); void gl_mdi_set_active_window_verbs_sensitivity (BonoboMDI *mdi); +G_END_DECLS + #endif /* __MDI_H__ */ -- 2.39.5