]> git.sur5r.net Git - glabels/commitdiff
Assorted code cleanup. Mostly formatting.
authorJim Evins <evins@snaught.com>
Mon, 16 Sep 2002 01:42:38 +0000 (01:42 +0000)
committerJim Evins <evins@snaught.com>
Mon, 16 Sep 2002 01:42:38 +0000 (01:42 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@118 f5e0f49d-192f-0410-a22d-a8d8700d0965

20 files changed:
glabels2/src/alert.c
glabels2/src/alert.h
glabels2/src/bc-gnubarcode.c
glabels2/src/bc-gnubarcode.h
glabels2/src/bc-postnet.c
glabels2/src/bc-postnet.h
glabels2/src/bc.c
glabels2/src/bc.h
glabels2/src/canvas-hacktext.c
glabels2/src/canvas-hacktext.h
glabels2/src/color.c
glabels2/src/color.h
glabels2/src/commands.c
glabels2/src/commands.h
glabels2/src/debug.c
glabels2/src/debug.h
glabels2/src/file.c
glabels2/src/file.h
glabels2/src/glabels.c
glabels2/src/glabels.h

index 4719633e86792fc95fd196351a0d986255daade0..9c2792cabe4bc4b15ea6ac612ee6bbe906703a43 100644 (file)
@@ -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);
index a1e89d84defc82a375b7045422b9cc2bbfe75afb..6877943c9b5bd409b18cb0a5da89a28eac79c4d9 100644 (file)
 
 #include <gtk/gtk.h>
 
-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__ */
index 8199ecf92a8816e8add04ab513e3572e7cfebabd..c97f56ff84647db1b3a875546352c573ec327acf 100644 (file)
 
 #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);
 \f
 /*****************************************************************************/
 /* 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';
index 4cedd6185e44159bc628ab1cadd6a5fe3056fe01..3dc8cf6cacf64793e0d60ec922e812352167a526 100644 (file)
 
 #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__ */
index 90b463d2ce405f9a862a3f49c3e6ff1a070ce69d..2bea1ae39d9d7e964b8ac68cb5b133cff11ffdc5 100644 (file)
 
 #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);
 \f
 /****************************************************************************/
 /* 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);
index c54a31c0cf9f9a7c3991f72e00c19ee3c7f58147..63c17265a7b1059f56e984875f89dcc25062dfbd 100644 (file)
 #ifndef __BC_POSTNET_H__
 #define __BC_POSTNET_H__
 
-#include <glib.h>
+#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__ */
index a83a33366304c8dfad230d38a6010eedfb3e879d..93215e113e3fb2585b727844f8366339786cf3cf 100644 (file)
 /* 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) {
index 01b3b890672310d4b5f1e586ced90d7ae2c03dc7..a8bbf5d00b98aa982d9b91e8ff9a1ca68d12630c 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <glib.h>
 
+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
index 75ccd4f0c7c2018ad9db5b498cb6c7d0c435ce89..8db1ef4c282c93258c6a64be5f9ca8b335df1e02 100644 (file)
  *  Copyright (C) 1998-1999 The Free Software Foundation
  *  Copyright (C) 2000-2002 Ximian Inc.
  *
- */
-
-/*
- * TODO:
- * - Clipping
+ *
+ *  Modified by Jim Evins <evins@snaught.com> for gLabels.
  */
 
 #include <config.h>
index fcb4d5a1da17c683cac14601fe81056ff216f345..09f1c698835d69f5b6e1db1f9a14fbe1fa267496 100644 (file)
@@ -10,6 +10,8 @@
  *
  * Authors: Federico Mena <federico@nuclecu.unam.mx>
  *          Raph Levien <raph@acm.org>
+ *
+ * Modified by Jim Evins <evins@snaught.com> for gLabels.
  */
 
 #include <glib.h>
index 7a49f02e9ac0a10d0d2d3a6884f591f2c651ff51..ad84ea481af02df651a73b738a924fe1599f4414 100644 (file)
@@ -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;
index d146345d0e99de6c9cf0d08dfe90bf25b8574e60..22fe359d5926415194c2b172989895d52a6ff199 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <libgnomecanvas/gnome-canvas.h>
 
+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__ */
index 9e59fa78eb7458de669fdb73430219dd1354cfe7..7d7b34d0fa835c965933125e5859ea3646a32f8c 100644 (file)
@@ -47,8 +47,8 @@
 /****************************************************************************/
 void 
 gl_cmd_file_new (BonoboUIComponent *uic,
-                gpointer user_data,
-                const gcharverbname)
+                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 gcharverbname)
+                 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 gcharverbname)
+                 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 gcharverbname)
+                    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 gcharverbname)
+                  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 gcharverbname)
+                  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 gcharverbname)
+                      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 gcharverbname)
+                 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 gcharverbname)
+                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 gcharverbname)
+                 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 gcharverbname)
+                  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 gcharverbname)
+                   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 gcharverbname)
+                       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 gcharverbname)
+                         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 gcharverbname)
+                            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 gcharverbname)
+                     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 gcharverbname)
+                  gpointer           user_data,
+                  const gchar       *verbname)
 {
        static GtkWidget *about = NULL;
-       GdkPixbufpixbuf = NULL;
+       GdkPixbuf        *pixbuf = NULL;
        
        gchar *copy_text = "Copyright 2001-2002 Jim Evins";
        gchar *about_text =
index 8bc19c756f0f0f7e852e228ce8e8bc084c2c8f6a..d2aca54ba6b04b054404eecf0f3300c6a3a9005f 100644 (file)
 
 #include <bonobo/bonobo-ui-component.h>
 
-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__ */ 
index de92feacc0d987cad1467f5d0ed637de784811b3..53b2440faf06c88150b9226466644fb2d780067e 100644 (file)
@@ -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,
-         gcharfunction,
-         gcharformat,
+         gint   line,
+         gchar *function,
+         gchar *format,
          ...)
 {
-       va_list args;
-       gchar *msg;
+       va_list  args;
+       gchar   *msg;
 
        g_return_if_fail (format != NULL);
 
index b9023cff41fe3394df820621bfcdc4f3853f0caf..0b51ecc2f12ce1d80b2cf5c38247da45186aedac 100644 (file)
@@ -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__ */
index 53e47b5cef9b51e7c22eb904a105be26363ae1b3..cb6900f61b7bd47da89d40be936f11a9ea90ecc8 100644 (file)
@@ -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);
 
 \f
 /*****************************************************************************/
@@ -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;
-       BonoboMDIChildchild;
+       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;
index 4d3709cb9f27e57083550e3f5451cca6f08e2ac7..ed91748dd8e06eda787ed43eb76f8cfa7825ea02 100644 (file)
 #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__ */
index 7687fb84c6d79de4436fe551c2fef5db4e66878a..455a075c2c88e58097588f315e778f9fc0aae991 100644 (file)
@@ -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");
index 2d633c5b250bfe064166c82b0b70c2bded642c19..1ac54b2c0e9be448dc8110f95a5b3dd5a26fc940 100644 (file)
@@ -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__ */