From: Jim Evins Date: Mon, 16 Sep 2002 01:42:38 +0000 (+0000) Subject: Assorted code cleanup. Mostly formatting. X-Git-Tag: glabels-2_3_0~767 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8d70e8fa1820def464881c72f0bf3c47c285234d;p=glabels Assorted code cleanup. Mostly formatting. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@118 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/src/alert.c b/glabels2/src/alert.c index 4719633e..9c2792ca 100644 --- a/glabels2/src/alert.c +++ b/glabels2/src/alert.c @@ -38,10 +38,10 @@ GtkWidget* gl_alert_dialog_new (GtkWindow *parent, const gchar *primary_text, const gchar *secondary_text) { - GtkWidget *dialog, *hbox, *image, *label; - gchar *label_text; - const gchar *stock_id = NULL; - GtkStockItem item; + GtkWidget *dialog, *hbox, *image, *label; + gchar *label_text; + const gchar *stock_id = NULL; + GtkStockItem item; /* Create bare dialog */ dialog = gtk_dialog_new_with_buttons ("", parent, flags, NULL); diff --git a/glabels2/src/alert.h b/glabels2/src/alert.h index a1e89d84..6877943c 100644 --- a/glabels2/src/alert.h +++ b/glabels2/src/alert.h @@ -25,11 +25,15 @@ #include -extern GtkWidget* gl_alert_dialog_new (GtkWindow *parent, - GtkDialogFlags flags, - GtkMessageType type, - GtkButtonsType buttons, - const gchar *primary_text, - const gchar *secondary_text); +G_BEGIN_DECLS + +GtkWidget* gl_alert_dialog_new (GtkWindow *parent, + GtkDialogFlags flags, + GtkMessageType type, + GtkButtonsType buttons, + const gchar *primary_text, + const gchar *secondary_text); + +G_END_DECLS #endif /* __ALERT_H__ */ diff --git a/glabels2/src/bc-gnubarcode.c b/glabels2/src/bc-gnubarcode.c index 8199ecf9..c97f56ff 100644 --- a/glabels2/src/bc-gnubarcode.c +++ b/glabels2/src/bc-gnubarcode.c @@ -33,30 +33,35 @@ #include "bc.h" #include "bc-gnubarcode.h" - #include "barcode.h" #include "debug.h" +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ #define SHRINK_AMOUNT 0.15 /* shrink bars to account for ink spreading */ #define FONT_SCALE 0.95 /* Shrink fonts just a hair */ +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ static glBarcode *render_pass1 (struct Barcode_Item *bci, - gboolean text_flag, - gdouble scale); + gboolean text_flag, + gdouble scale); /*****************************************************************************/ /* Generate intermediate representation of barcode. */ /*****************************************************************************/ glBarcode * -gl_barcode_gnubarcode_new (glBarcodeStyle style, - gboolean text_flag, - gdouble scale, - gchar * digits) +gl_barcode_gnubarcode_new (glBarcodeStyle style, + gboolean text_flag, + gdouble scale, + gchar *digits) { - glBarcode *gbc; + glBarcode *gbc; struct Barcode_Item *bci; - gint flags; + gint flags; bci = Barcode_Create (digits); @@ -127,18 +132,18 @@ gl_barcode_gnubarcode_new (glBarcodeStyle style, *--------------------------------------------------------------------------*/ static glBarcode * render_pass1 (struct Barcode_Item *bci, - gboolean text_flag, - gdouble scale) + gboolean text_flag, + gdouble scale) { - glBarcode *gbc; + glBarcode *gbc; glBarcodeLine *line; glBarcodeChar *bchar; - gdouble x; - gint i, j, barlen; - gdouble f1, f2; - gint mode = '-'; /* text below bars */ - gdouble x0, y0, yr; - guchar *p, c; + gdouble x; + gint i, j, barlen; + gdouble f1, f2; + gint mode = '-'; /* text below bars */ + gdouble x0, y0, yr; + guchar *p, c; /* First calculate barlen */ barlen = bci->partial[0] - '0'; diff --git a/glabels2/src/bc-gnubarcode.h b/glabels2/src/bc-gnubarcode.h index 4cedd618..3dc8cf6c 100644 --- a/glabels2/src/bc-gnubarcode.h +++ b/glabels2/src/bc-gnubarcode.h @@ -24,9 +24,13 @@ #include "bc.h" -extern glBarcode *gl_barcode_gnubarcode_new (glBarcodeStyle style, - gboolean text_flag, - gdouble scale, - gchar * digits); +G_BEGIN_DECLS -#endif +glBarcode *gl_barcode_gnubarcode_new (glBarcodeStyle style, + gboolean text_flag, + gdouble scale, + gchar *digits); + +G_END_DECLS + +#endif /* __BC_GNUBARCODE_H__ */ diff --git a/glabels2/src/bc-postnet.c b/glabels2/src/bc-postnet.c index 90b463d2..2bea1ae3 100644 --- a/glabels2/src/bc-postnet.c +++ b/glabels2/src/bc-postnet.c @@ -34,6 +34,19 @@ #include "debug.h" +/*========================================================*/ +/* Private macros and constants. */ +/*========================================================*/ +#define POSTNET_BAR_WIDTH 1.25 +#define POSTNET_FULLBAR_HEIGHT 9.00 +#define POSTNET_HALFBAR_HEIGHT 3.50 +#define POSTNET_BAR_PITCH 3.25 +#define POSTNET_HORIZ_MARGIN 9.00 +#define POSTNET_VERT_MARGIN 3.00 + +/*===========================================*/ +/* Private globals */ +/*===========================================*/ static gchar *symbols[] = { /* 0 */ "11000", /* 1 */ "00011", @@ -49,25 +62,22 @@ static gchar *symbols[] = { static gchar *frame_symbol = "1"; -#define POSTNET_BAR_WIDTH 1.25 -#define POSTNET_FULLBAR_HEIGHT 9.00 -#define POSTNET_HALFBAR_HEIGHT 3.50 -#define POSTNET_BAR_PITCH 3.25 -#define POSTNET_HORIZ_MARGIN 9.00 -#define POSTNET_VERT_MARGIN 3.00 +/*===========================================*/ +/* Local function prototypes */ +/*===========================================*/ +static gchar *postnet_code (gchar *digits); -static gchar *postnet_code (gchar * digits); /****************************************************************************/ /* Generate list of lines that form the barcode for the given digits. */ /****************************************************************************/ glBarcode * -gl_barcode_postnet_new (gchar * digits) +gl_barcode_postnet_new (gchar *digits) { - gchar *code, *p; - glBarcode *gbc; + gchar *code, *p; + glBarcode *gbc; glBarcodeLine *line; - gdouble x; + gdouble x; gbc = g_new0 (glBarcode, 1); @@ -111,13 +121,13 @@ gl_barcode_postnet_new (gchar * digits) /* PRIVATE. Generate string of symbols, representing barcode. */ /*--------------------------------------------------------------------------*/ static gchar * -postnet_code (gchar * digits) +postnet_code (gchar *digits) { - gchar *p; - gint len; - gint d, sum; + gchar *p; + gint len; + gint d, sum; GString *code; - gchar *ret; + gchar *ret; /* Left frame bar */ code = g_string_new (frame_symbol); diff --git a/glabels2/src/bc-postnet.h b/glabels2/src/bc-postnet.h index c54a31c0..63c17265 100644 --- a/glabels2/src/bc-postnet.h +++ b/glabels2/src/bc-postnet.h @@ -22,8 +22,12 @@ #ifndef __BC_POSTNET_H__ #define __BC_POSTNET_H__ -#include +#include "bc.h" -glBarcode *gl_barcode_postnet_new (gchar * digits); +G_BEGIN_DECLS -#endif +glBarcode *gl_barcode_postnet_new (gchar *digits); + +G_END_DECLS + +#endif /* __BC_POSTNET_H__ */ diff --git a/glabels2/src/bc.c b/glabels2/src/bc.c index a83a3336..93215e11 100644 --- a/glabels2/src/bc.c +++ b/glabels2/src/bc.c @@ -31,10 +31,10 @@ /* Call appropriate barcode backend to create barcode in intermediate format.*/ /*****************************************************************************/ glBarcode * -gl_barcode_new (glBarcodeStyle style, - gboolean text_flag, - gdouble scale, - gchar * digits) +gl_barcode_new (glBarcodeStyle style, + gboolean text_flag, + gdouble scale, + gchar *digits) { glBarcode *gbc; @@ -47,7 +47,10 @@ gl_barcode_new (glBarcodeStyle style, default: /* Use the GNU barcode library backend */ - gbc = gl_barcode_gnubarcode_new (style, text_flag, scale, digits); + gbc = gl_barcode_gnubarcode_new (style, + text_flag, + scale, + digits); break; } @@ -58,7 +61,7 @@ gl_barcode_new (glBarcodeStyle style, /* Free previously created barcode. */ /*****************************************************************************/ void -gl_barcode_free (glBarcode ** gbc) +gl_barcode_free (glBarcode **gbc) { GList *p; @@ -155,7 +158,7 @@ gl_barcode_style_to_text (glBarcodeStyle style) /* Convert text to style. */ /*****************************************************************************/ glBarcodeStyle -gl_barcode_text_to_style (const gchar * text) +gl_barcode_text_to_style (const gchar *text) { if (g_strcasecmp (text, "POSTNET") == 0) { diff --git a/glabels2/src/bc.h b/glabels2/src/bc.h index 01b3b890..a8bbf5d0 100644 --- a/glabels2/src/bc.h +++ b/glabels2/src/bc.h @@ -24,6 +24,8 @@ #include +G_BEGIN_DECLS + typedef enum { GL_BARCODE_STYLE_POSTNET, GL_BARCODE_STYLE_EAN, @@ -58,16 +60,20 @@ typedef struct { #define GL_BARCODE_FONT_FAMILY "Helvetica" #define GL_BARCODE_FONT_WEIGHT GNOME_FONT_BOOK -extern glBarcode *gl_barcode_new (glBarcodeStyle style, - gboolean text_flag, - gdouble scale, - gchar * digits); -extern void - gl_barcode_free (glBarcode ** bc); +glBarcode *gl_barcode_new (glBarcodeStyle style, + gboolean text_flag, + gdouble scale, + gchar *digits); + +void gl_barcode_free (glBarcode **bc); + +gchar *gl_barcode_default_digits (glBarcodeStyle style); + +const gchar *gl_barcode_style_to_text (glBarcodeStyle style); +glBarcodeStyle gl_barcode_text_to_style (const gchar *text); + +G_END_DECLS -extern gchar *gl_barcode_default_digits (glBarcodeStyle style); -extern const gchar *gl_barcode_style_to_text (glBarcodeStyle style); -extern glBarcodeStyle gl_barcode_text_to_style (const gchar * text); +#endif /* __BC_H__ */ -#endif diff --git a/glabels2/src/canvas-hacktext.c b/glabels2/src/canvas-hacktext.c index 75ccd4f0..8db1ef4c 100644 --- a/glabels2/src/canvas-hacktext.c +++ b/glabels2/src/canvas-hacktext.c @@ -25,11 +25,8 @@ * Copyright (C) 1998-1999 The Free Software Foundation * Copyright (C) 2000-2002 Ximian Inc. * - */ - -/* - * TODO: - * - Clipping + * + * Modified by Jim Evins for gLabels. */ #include diff --git a/glabels2/src/canvas-hacktext.h b/glabels2/src/canvas-hacktext.h index fcb4d5a1..09f1c698 100644 --- a/glabels2/src/canvas-hacktext.h +++ b/glabels2/src/canvas-hacktext.h @@ -10,6 +10,8 @@ * * Authors: Federico Mena * Raph Levien + * + * Modified by Jim Evins for gLabels. */ #include diff --git a/glabels2/src/color.c b/glabels2/src/color.c index 7a49f02e..ad84ea48 100644 --- a/glabels2/src/color.c +++ b/glabels2/src/color.c @@ -27,7 +27,7 @@ /* Apply given opacity to given color. */ /*****************************************************************************/ guint -gl_color_set_opacity (guint color, +gl_color_set_opacity (guint color, gdouble opacity) { guint new_color; diff --git a/glabels2/src/color.h b/glabels2/src/color.h index d146345d..22fe359d 100644 --- a/glabels2/src/color.h +++ b/glabels2/src/color.h @@ -25,6 +25,8 @@ #include +G_BEGIN_DECLS + #define GL_COLOR(r,g,b) GNOME_CANVAS_COLOR(r,g,b) #define GL_COLOR_A(r,g,b,a) GNOME_CANVAS_COLOR_A(r,g,b,a) @@ -38,7 +40,8 @@ #define GL_COLOR_F_BLUE(x) ( (((x)>>8) & 0xff) / 255.0 ) #define GL_COLOR_F_ALPHA(x) ( ( (x) & 0xff) / 255.0 ) -extern guint gl_color_set_opacity (guint color, gdouble opacity); +guint gl_color_set_opacity (guint color, gdouble opacity); +G_END_DECLS #endif /* __COLOR_H__ */ diff --git a/glabels2/src/commands.c b/glabels2/src/commands.c index 9e59fa78..7d7b34d0 100644 --- a/glabels2/src/commands.c +++ b/glabels2/src/commands.c @@ -47,8 +47,8 @@ /****************************************************************************/ void gl_cmd_file_new (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { gl_debug (DEBUG_COMMANDS, "verbname: %s", verbname); @@ -60,8 +60,8 @@ gl_cmd_file_new (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_file_open (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { BonoboMDIChild *active_child; @@ -77,8 +77,8 @@ gl_cmd_file_open (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_file_save (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glMDIChild *active_child; @@ -96,8 +96,8 @@ gl_cmd_file_save (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_file_save_as (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glMDIChild *active_child; @@ -115,10 +115,10 @@ gl_cmd_file_save_as (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_file_print (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { - glLabel *label = glabels_get_active_label (); + glLabel *label = glabels_get_active_label (); BonoboWindow *win = glabels_get_active_window (); gl_debug (DEBUG_COMMANDS, ""); @@ -135,14 +135,14 @@ gl_cmd_file_print (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_file_close (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { GtkWidget *active_view; gl_debug (DEBUG_COMMANDS, ""); - active_view = bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi)); + active_view = GTK_WIDGET (glabels_get_active_view ()); if (active_view == NULL) return; @@ -159,8 +159,8 @@ gl_cmd_file_close (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_file_close_all (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { gl_debug (DEBUG_COMMANDS, ""); @@ -176,8 +176,8 @@ gl_cmd_file_close_all (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_file_exit (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { gl_debug (DEBUG_COMMANDS, ""); @@ -194,12 +194,12 @@ gl_cmd_file_exit (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_edit_cut (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glView* active_view; - active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi))); + active_view = glabels_get_active_view (); g_return_if_fail (active_view); gl_view_cut (active_view); @@ -210,12 +210,12 @@ gl_cmd_edit_cut (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_edit_copy (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glView* active_view; - active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi))); + active_view = glabels_get_active_view (); g_return_if_fail (active_view); gl_view_copy (active_view); @@ -226,12 +226,12 @@ gl_cmd_edit_copy (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_edit_paste (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glView* active_view; - active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi))); + active_view = glabels_get_active_view (); g_return_if_fail (active_view); gl_view_paste (active_view); @@ -243,12 +243,12 @@ gl_cmd_edit_paste (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_edit_delete (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glView* active_view; - active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi))); + active_view = glabels_get_active_view (); g_return_if_fail (active_view); gl_view_delete_selection (active_view); @@ -260,13 +260,12 @@ gl_cmd_edit_delete (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_edit_select_all (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glView* active_view; - active_view = - GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI(glabels_mdi))); + active_view = glabels_get_active_view (); g_return_if_fail (active_view); @@ -278,13 +277,12 @@ gl_cmd_edit_select_all (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_edit_unselect_all (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { glView* active_view; - active_view = - GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI(glabels_mdi))); + active_view = glabels_get_active_view (); g_return_if_fail (active_view); @@ -296,8 +294,8 @@ gl_cmd_edit_unselect_all (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_settings_preferences (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { static GtkWidget *dlg = NULL; @@ -325,8 +323,8 @@ gl_cmd_settings_preferences (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_help_contents (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { GError *error = NULL; @@ -347,11 +345,11 @@ gl_cmd_help_contents (BonoboUIComponent *uic, /****************************************************************************/ void gl_cmd_help_about (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname) + gpointer user_data, + const gchar *verbname) { static GtkWidget *about = NULL; - GdkPixbuf* pixbuf = NULL; + GdkPixbuf *pixbuf = NULL; gchar *copy_text = "Copyright 2001-2002 Jim Evins"; gchar *about_text = diff --git a/glabels2/src/commands.h b/glabels2/src/commands.h index 8bc19c75..d2aca54b 100644 --- a/glabels2/src/commands.h +++ b/glabels2/src/commands.h @@ -25,87 +25,90 @@ #include -extern void gl_cmd_file_new (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +G_BEGIN_DECLS -extern void gl_cmd_file_open (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_new (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_file_save (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_open (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_file_save_as (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_save (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_file_print (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_save_as (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_file_print_preview (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_print (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_file_close (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_print_preview (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_file_close_all (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_close (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_file_exit (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_file_close_all (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); +void gl_cmd_file_exit (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_edit_undo (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); -extern void gl_cmd_edit_redo (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_edit_undo (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_edit_cut (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_edit_redo (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_edit_copy (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_edit_cut (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_edit_paste (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_edit_copy (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_edit_delete (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_edit_paste (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_edit_select_all (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_edit_delete (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_edit_unselect_all (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_edit_select_all (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); +void gl_cmd_edit_unselect_all (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_settings_preferences (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_settings_preferences (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); -extern void gl_cmd_help_contents (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); -extern void gl_cmd_help_about (BonoboUIComponent *uic, - gpointer user_data, - const gchar* verbname); +void gl_cmd_help_contents (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); + +void gl_cmd_help_about (BonoboUIComponent *uic, + gpointer user_data, + const gchar *verbname); +G_END_DECLS #endif /* __COMMANDS_H__ */ diff --git a/glabels2/src/debug.c b/glabels2/src/debug.c index de92feac..53b2440f 100644 --- a/glabels2/src/debug.c +++ b/glabels2/src/debug.c @@ -54,15 +54,15 @@ gint gl_debug_wdgt = 0; /* Print debugging information. */ /****************************************************************************/ void -gl_debug (gint section, +gl_debug (gint section, gchar *file, - gint line, - gchar* function, - gchar* format, + gint line, + gchar *function, + gchar *format, ...) { - va_list args; - gchar *msg; + va_list args; + gchar *msg; g_return_if_fail (format != NULL); diff --git a/glabels2/src/debug.h b/glabels2/src/debug.h index b9023cff..0b51ecc2 100644 --- a/glabels2/src/debug.h +++ b/glabels2/src/debug.h @@ -30,6 +30,8 @@ #ifndef __DEBUG_H__ #define __DEBUG_H__ +G_BEGIN_DECLS + typedef enum { GL_DEBUG_VIEW, GL_DEBUG_ITEM, @@ -88,7 +90,9 @@ extern gint gl_debug_wdgt; #define DEBUG_MINI_PREVIEW GL_DEBUG_MINI_PREVIEW, __FILE__, __LINE__, __FUNCTION__ #define DEBUG_WDGT GL_DEBUG_WDGT, __FILE__, __LINE__, __FUNCTION__ -extern void gl_debug (gint section, gchar *file, - gint line, gchar* function, gchar* format, ...); +void gl_debug (gint section, gchar *file, + gint line, gchar* function, gchar* format, ...); + +G_END_DECLS #endif /* __DEBUG_H__ */ diff --git a/glabels2/src/file.c b/glabels2/src/file.c index 53e47b5c..cb6900f6 100644 --- a/glabels2/src/file.c +++ b/glabels2/src/file.c @@ -41,8 +41,8 @@ /*===========================================*/ /* Saved state for new dialog */ -static gchar *page_size = NULL; -static gchar *sheet_name = NULL; +static gchar *page_size = NULL; +static gchar *sheet_name = NULL; static gboolean rotate_flag = FALSE; /* Saved state of file selectors */ @@ -52,18 +52,21 @@ static gchar *save_path = NULL; /*===========================================*/ /* Local function prototypes. */ /*===========================================*/ -static void create_new_dialog_widgets (GtkDialog *dlg); -static void new_template_changed (glWdgtMediaSelect *select, - gpointer data); -static void new_response (GtkDialog *dlg, - gint response, - gpointer user_data); -static void open_ok (GtkWidget * widget, - GtkFileSelection * fsel); - -static void save_as_ok_cb (GtkWidget * widget, GtkFileSelection * fsel); -static void save_as_cancel_cb (GtkWidget * widget, GtkFileSelection * fsel); -static void save_as_destroy_cb (GtkWidget * widget, gboolean * destroy_flag); +static void create_new_dialog_widgets (GtkDialog *dlg); +static void new_template_changed (glWdgtMediaSelect *select, + gpointer data); +static void new_response (GtkDialog *dlg, + gint response, + gpointer user_data); +static void open_ok (GtkWidget *widget, + GtkFileSelection *fsel); + +static void save_as_ok_cb (GtkWidget *widget, + GtkFileSelection *fsel); +static void save_as_cancel_cb (GtkWidget *widget, + GtkFileSelection *fsel); +static void save_as_destroy_cb (GtkWidget *widget, + gboolean *destroy_flag); /*****************************************************************************/ @@ -72,7 +75,7 @@ static void save_as_destroy_cb (GtkWidget * widget, gboolean * destroy_flag); void gl_file_new (void) { - GtkWidget *dlg; + GtkWidget *dlg; BonoboWindow *win = glabels_get_active_window (); gl_debug (DEBUG_FILE, "START"); @@ -101,7 +104,7 @@ gl_file_new (void) /* PRIVATE. Create widgets. */ /*---------------------------------------------------------------------------*/ static void -create_new_dialog_widgets (GtkDialog * dlg) +create_new_dialog_widgets (GtkDialog *dlg) { GtkWidget *wframe, *wvbox, *template_entry, *rotate_sel; @@ -158,18 +161,18 @@ create_new_dialog_widgets (GtkDialog * dlg) /* PRIVATE. New template changed callback. */ /*---------------------------------------------------------------------------*/ static void -new_template_changed (glWdgtMediaSelect * select, - gpointer data) +new_template_changed (glWdgtMediaSelect *select, + gpointer data) { glWdgtRotateLabel *rotate_sel = GL_WDGT_ROTATE_LABEL (data); - gchar *name; + gchar *name; gl_debug (DEBUG_FILE, "START"); name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (select)); gl_wdgt_rotate_label_set_template_name (GL_WDGT_ROTATE_LABEL (rotate_sel), - name); + name); g_free (name); @@ -181,12 +184,12 @@ new_template_changed (glWdgtMediaSelect * select, /*---------------------------------------------------------------------------*/ static void new_response (GtkDialog *dlg, - gint response, - gpointer user_data) + gint response, + gpointer user_data) { - GtkWidget *template_entry, *rotate_sel; + GtkWidget *template_entry, *rotate_sel; glMDIChild *new_child = NULL; - gint ret; + gint ret; gl_debug (DEBUG_FILE, "START"); @@ -240,7 +243,7 @@ void gl_file_open (glMDIChild *active_child) { GtkFileSelection *fsel; - BonoboWindow *app = glabels_get_active_window (); + BonoboWindow *app = glabels_get_active_window (); gl_debug (DEBUG_FILE, "START"); @@ -272,13 +275,13 @@ gl_file_open (glMDIChild *active_child) /* PRIVATE. Open "O.K." button callback. */ /*---------------------------------------------------------------------------*/ static void -open_ok (GtkWidget * widget, - GtkFileSelection * fsel) +open_ok (GtkWidget *widget, + GtkFileSelection *fsel) { - gchar *filename; - GtkWidget *dlg; - glMDIChild *new_child = NULL; - gint ret; + gchar *filename; + GtkWidget *dlg; + glMDIChild *new_child = NULL; + gint ret; GnomeRecentModel *recent; gl_debug (DEBUG_FILE, "START"); @@ -350,10 +353,10 @@ gboolean gl_file_open_real (const gchar *filename, GtkWindow *win) { - gchar *abs_filename; - glMDIChild *new_child = NULL; + gchar *abs_filename; + glMDIChild *new_child = NULL; GnomeRecentModel *recent; - gint ret; + gint ret; gl_debug (DEBUG_FILE, "START"); @@ -424,10 +427,10 @@ gl_file_open_real (const gchar *filename, gboolean gl_file_save (glMDIChild *child) { - glXMLLabelStatus status; - glLabel *label = NULL; - GError *error = NULL; - gchar *filename = NULL; + glXMLLabelStatus status; + glLabel *label = NULL; + GError *error = NULL; + gchar *filename = NULL; GnomeRecentModel *recent; gl_debug (DEBUG_FILE, ""); @@ -502,9 +505,9 @@ gboolean gl_file_save_as (glMDIChild *child) { GtkFileSelection *fsel; - BonoboWindow *app = glabels_get_active_window (); - gboolean saved_flag = FALSE; - gboolean destroy_flag = FALSE; + BonoboWindow *app = glabels_get_active_window (); + gboolean saved_flag = FALSE; + gboolean destroy_flag = FALSE; gl_debug (DEBUG_FILE, "START"); @@ -559,18 +562,18 @@ gl_file_save_as (glMDIChild *child) /* PRIVATE. "Save As" ok button callback. */ /*---------------------------------------------------------------------------*/ static void -save_as_ok_cb (GtkWidget * widget, - GtkFileSelection * fsel) +save_as_ok_cb (GtkWidget *widget, + GtkFileSelection *fsel) { - gchar *raw_filename, *filename; - GtkWidget *dlg; - glMDIChild *child; - glLabel *label; - glXMLLabelStatus status; + gchar *raw_filename, *filename; + GtkWidget *dlg; + glMDIChild *child; + glLabel *label; + glXMLLabelStatus status; GnomeRecentModel *recent; - gboolean *saved_flag; - gchar *primary_msg; - gboolean cancel_flag = FALSE; + gboolean *saved_flag; + gchar *primary_msg; + gboolean cancel_flag = FALSE; gl_debug (DEBUG_FILE, "START"); @@ -683,8 +686,8 @@ save_as_ok_cb (GtkWidget * widget, /* PRIVATE. "Save As" cancel button callback. */ /*---------------------------------------------------------------------------*/ static void -save_as_cancel_cb (GtkWidget * widget, - GtkFileSelection * fsel) +save_as_cancel_cb (GtkWidget *widget, + GtkFileSelection *fsel) { gboolean *saved_flag = g_object_get_data (G_OBJECT (fsel), "saved_flag"); @@ -699,8 +702,8 @@ save_as_cancel_cb (GtkWidget * widget, /* PRIVATE. "Save As" destroy callback. */ /*---------------------------------------------------------------------------*/ static void -save_as_destroy_cb (GtkWidget * widget, - gboolean * destroy_flag) +save_as_destroy_cb (GtkWidget *widget, + gboolean *destroy_flag) { *destroy_flag = TRUE; gtk_main_quit (); @@ -711,10 +714,10 @@ save_as_destroy_cb (GtkWidget * widget, /* "Close" menu callback. */ /*****************************************************************************/ void -gl_file_close (GtkWidget * view) +gl_file_close (GtkWidget *view) { - gint ret; - BonoboMDIChild* child; + gint ret; + BonoboMDIChild *child; gl_debug (DEBUG_FILE, "START"); @@ -752,7 +755,6 @@ gboolean gl_file_close_all (void) { gboolean ret; - gl_debug (DEBUG_FILE, ""); gl_debug (DEBUG_FILE, "START"); @@ -774,7 +776,7 @@ gl_file_close_all (void) void gl_file_exit (void) { - gl_debug (DEBUG_FILE, ""); + gl_debug (DEBUG_FILE, "START"); if (!gl_file_close_all ()) return; diff --git a/glabels2/src/file.h b/glabels2/src/file.h index 4d3709cb..ed91748d 100644 --- a/glabels2/src/file.h +++ b/glabels2/src/file.h @@ -26,20 +26,32 @@ #include "mdi-child.h" #include "gnome-recent-view.h" -extern void gl_file_new (void); +G_BEGIN_DECLS -extern void gl_file_open (glMDIChild *active_child); -extern gboolean gl_file_open_recent (GnomeRecentView *view, - const gchar *filename, - BonoboWindow *win); -extern gboolean gl_file_open_real (const gchar *filename, - GtkWindow *win); +void gl_file_new (void); -extern gboolean gl_file_save (glMDIChild *child); -extern gboolean gl_file_save_as (glMDIChild *child); -extern void gl_file_close (GtkWidget *view); -extern gboolean gl_file_close_all (void); -extern void gl_file_exit (void); +void gl_file_open (glMDIChild *active_child); -#endif /* __FILE_H__ */ +gboolean gl_file_open_recent (GnomeRecentView *view, + const gchar *filename, + BonoboWindow *win); + +gboolean gl_file_open_real (const gchar *filename, + GtkWindow *win); + + +gboolean gl_file_save (glMDIChild *child); + +gboolean gl_file_save_as (glMDIChild *child); + + +void gl_file_close (GtkWidget *view); + +gboolean gl_file_close_all (void); + +void gl_file_exit (void); + +G_END_DECLS + +#endif /* __FILE_H__ */ diff --git a/glabels2/src/glabels.c b/glabels2/src/glabels.c index 7687fb84..455a075c 100644 --- a/glabels2/src/glabels.c +++ b/glabels2/src/glabels.c @@ -112,12 +112,12 @@ static const struct poptOption options [] = int main (int argc, char **argv) { - GValue value = { 0, }; - GnomeProgram *program; - poptContext ctx; - char **args; - GList *file_list = NULL, *p; - gint i; + GValue value = { 0, }; + GnomeProgram *program; + poptContext ctx; + char **args; + GList *file_list = NULL, *p; + gint i; bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); diff --git a/glabels2/src/glabels.h b/glabels2/src/glabels.h index 2d633c5b..1ac54b2c 100644 --- a/glabels2/src/glabels.h +++ b/glabels2/src/glabels.h @@ -38,6 +38,8 @@ #include "label.h" #include "view.h" +G_BEGIN_DECLS + extern glMDI* glabels_mdi; extern gboolean glabels_close_x_button_pressed; extern gboolean glabels_exit_button_pressed; @@ -47,6 +49,7 @@ glLabel* glabels_get_active_label (void); glView* glabels_get_active_view (void); GList* glabels_get_top_windows (void); +G_END_DECLS #endif /* __GLABELS_H__ */