]> git.sur5r.net Git - glabels/commitdiff
Some coding style cleanup.
authorJim Evins <evins@snaught.com>
Sun, 19 Dec 2010 19:10:22 +0000 (14:10 -0500)
committerJim Evins <evins@snaught.com>
Sun, 19 Dec 2010 19:10:22 +0000 (14:10 -0500)
58 files changed:
libglabels/lgl-template.h
libglabels/lgl-units.h
libglbarcode/lgl-barcode-render-to-cairo.c
libglbarcode/lgl-barcode.h
src/bc-builtin.c
src/bc-gnubarcode.c
src/bc-iec16022.c
src/bc-iec18004.c
src/bc-zint.c
src/color-combo-button.c
src/color-combo-color-menu-item.c
src/color-combo-menu.c
src/color-combo.c
src/color-history-model.c
src/color-swatch.c
src/debug.h
src/field-button-menu.c
src/field-button.c
src/font-combo-menu-item.c
src/font-combo-menu.c
src/font-combo.c
src/font-history-model.c
src/font-sample.c
src/label-barcode.c
src/label-box.c
src/label-ellipse.c
src/label-image.c
src/label-line.c
src/label-object.c
src/label-object.h
src/label-text.c
src/label.c
src/media-select.c
src/merge-evolution.c
src/merge-properties-dialog.c
src/merge-text.c
src/merge-vcard.c
src/merge.c
src/merge.h
src/message-bar.c
src/mini-label-preview.c
src/mini-preview.c
src/new-label-dialog.c
src/object-editor.c
src/prefs-dialog.c
src/prefs-model.c
src/print-op-dialog.c
src/print-op.c
src/print.c
src/template-designer.c
src/template-history-model.c
src/ui-property-bar.c
src/ui-sidebar.c
src/view.c
src/view.h
src/wdgt-chain-button.c
src/window.c
src/xml-label.h

index 83c8f0a3248dd7191688478a377fdf444c7f432d..b475f2b7664870f86d46b13c2e24c446a14a5d64 100644 (file)
@@ -79,7 +79,7 @@ typedef enum {
         LGL_TEMPLATE_FRAME_SHAPE_RECT,
         LGL_TEMPLATE_FRAME_SHAPE_ELLIPSE,
         LGL_TEMPLATE_FRAME_SHAPE_ROUND,
-        LGL_TEMPLATE_FRAME_SHAPE_CD,
+        LGL_TEMPLATE_FRAME_SHAPE_CD
 } lglTemplateFrameShape;
 
 
@@ -197,7 +197,7 @@ typedef enum {
         LGL_TEMPLATE_MARKUP_LINE,
         LGL_TEMPLATE_MARKUP_CIRCLE,
         LGL_TEMPLATE_MARKUP_RECT,
-        LGL_TEMPLATE_MARKUP_ELLIPSE,
+        LGL_TEMPLATE_MARKUP_ELLIPSE
 } lglTemplateMarkupType;
 
 
index 617f8652a135023d3943077cf71b872b5441615a..e3b2beb999a0158412180d62602e2eac977c9ecf 100644 (file)
@@ -39,7 +39,7 @@ typedef enum {
         LGL_UNITS_FIRST = LGL_UNITS_POINT,
         LGL_UNITS_LAST  = LGL_UNITS_PICA,
 
-        LGL_UNITS_INVALID = -1,
+        LGL_UNITS_INVALID = -1
 } lglUnits;
 
 
index 530c55f681a442191c8b15d1f1b04416896176a1..e83175d002a2b4ee8b7c13d719194ae5e3440b32 100644 (file)
@@ -163,7 +163,7 @@ lgl_barcode_render_to_cairo (const lglBarcode  *bc,
                 case LGL_BARCODE_SHAPE_RING:
                         ring = (lglBarcodeShapeRing *) shape;
 
-                        cairo_arc (cr, ring->x, ring->y, ring->radius, 0.0, 2 * M_PI);
+                        cairo_arc (cr, ring->x, ring->y, ring->radius, 0.0, 2 * G_PI);
                         cairo_set_line_width (cr, ring->line_width);
                         cairo_stroke (cr);
 
@@ -305,10 +305,10 @@ lgl_barcode_render_to_cairo_path (const lglBarcode  *bc,
                         ring = (lglBarcodeShapeRing *) shape;
 
                         cairo_new_sub_path (cr);
-                        cairo_arc (cr, ring->x, ring->y, ring->radius + ring->line_width/2, 0.0, 2 * M_PI);
+                        cairo_arc (cr, ring->x, ring->y, ring->radius + ring->line_width/2, 0.0, 2 * G_PI);
                         cairo_close_path (cr);
                         cairo_new_sub_path (cr);
-                        cairo_arc (cr, ring->x, ring->y, ring->radius - ring->line_width/2, 0.0, 2 * M_PI);
+                        cairo_arc (cr, ring->x, ring->y, ring->radius - ring->line_width/2, 0.0, 2 * G_PI);
                         cairo_close_path (cr);
                         break;
 
index 02177d2dd60d478477ce6f79b7bc351d7684b3a4..f94b265be9cc246c216e07b32b5cf070d70f3c8f 100644 (file)
@@ -107,7 +107,7 @@ typedef enum {
         LGL_BARCODE_SHAPE_CHAR,
         LGL_BARCODE_SHAPE_STRING,
         LGL_BARCODE_SHAPE_RING,
-        LGL_BARCODE_SHAPE_HEXAGON,
+        LGL_BARCODE_SHAPE_HEXAGON
 } lglBarcodeShapeType;
 
 
index e50ebc8e3b94c94e04e859d961fa86f1033e9124..5b7fe5f2fddc00a15090a07496609a4b6aaf3752 100644 (file)
 /****************************************************************************/
 lglBarcode *
 gl_barcode_builtin_new (const gchar    *id,
-                       gboolean        text_flag,
-                       gboolean        checksum_flag,
-                       gdouble         w,
-                       gdouble         h,
-                       const gchar    *digits)
+                        gboolean        text_flag,
+                        gboolean        checksum_flag,
+                        gdouble         w,
+                        gdouble         h,
+                        const gchar    *digits)
 {
-       if ( (g_ascii_strcasecmp (id, "POSTNET") == 0) ) {
+        if ( (g_ascii_strcasecmp (id, "POSTNET") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_POSTNET, text_flag, checksum_flag, w, h, digits);
-       }
-       if ( (g_ascii_strcasecmp (id, "POSTNET-5") == 0) ) {
+        }
+        if ( (g_ascii_strcasecmp (id, "POSTNET-5") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_POSTNET_5, text_flag, checksum_flag, w, h, digits);
-       }
-       if ( (g_ascii_strcasecmp (id, "POSTNET-9") == 0) ) {
+        }
+        if ( (g_ascii_strcasecmp (id, "POSTNET-9") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_POSTNET_9, text_flag, checksum_flag, w, h, digits);
-       }
-       if ( (g_ascii_strcasecmp (id, "POSTNET-11") == 0) ) {
+        }
+        if ( (g_ascii_strcasecmp (id, "POSTNET-11") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_POSTNET_11, text_flag, checksum_flag, w, h, digits);
-       }
-       if ( (g_ascii_strcasecmp (id, "CEPNET") == 0) ) {
+        }
+        if ( (g_ascii_strcasecmp (id, "CEPNET") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_CEPNET, text_flag, checksum_flag, w, h, digits);
-       }
-       if ( (g_ascii_strcasecmp (id, "ONECODE") == 0) ) {
+        }
+        if ( (g_ascii_strcasecmp (id, "ONECODE") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_ONECODE, text_flag, checksum_flag, w, h, digits);
-       }
-       if ( (g_ascii_strcasecmp (id, "Code39") == 0) ) {
+        }
+        if ( (g_ascii_strcasecmp (id, "Code39") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_CODE39, text_flag, checksum_flag, w, h, digits);
-       }
-       if ( (g_ascii_strcasecmp (id, "Code39Ext") == 0) ) {
+        }
+        if ( (g_ascii_strcasecmp (id, "Code39Ext") == 0) )
+        {
                 return lgl_barcode_create (LGL_BARCODE_TYPE_CODE39_EXT, text_flag, checksum_flag, w, h, digits);
-       }
+        }
 
         g_message ("Invalid builtin barcode ID: \"%s\"\n", id);
         return NULL;
index 88b9e280834ad7846d06d13b710d0b7988a2099e..f3be2a3d7fcf8e4a8d17400e907a1324f94bb20f 100644 (file)
@@ -35,8 +35,8 @@
 /*========================================================*/
 /* 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 */
+#define SHRINK_AMOUNT 0.15        /* shrink bars to account for ink spreading */
+#define FONT_SCALE    0.95        /* Shrink fonts just a hair */
 
 
 /*===========================================*/
@@ -46,16 +46,16 @@ static lglBarcode *render_pass1     (struct Barcode_Item *bci,
                                      gint                 flags);
 
 static gboolean   is_length_valid  (const gchar         *digits,
-                                   gint                 n1,
-                                   gint                 n2);
+                                    gint                 n1,
+                                    gint                 n2);
 
 static gboolean   is_length1_valid (const gchar         *digits,
-                                   gint                 n1,
-                                   gint                 n2);
+                                    gint                 n1,
+                                    gint                 n2);
 
 static gboolean   is_length2_valid (const gchar         *digits,
-                                   gint                 n1,
-                                   gint                 n2);
+                                    gint                 n1,
+                                    gint                 n2);
 
 
 /*****************************************************************************/
@@ -63,141 +63,209 @@ static gboolean   is_length2_valid (const gchar         *digits,
 /*****************************************************************************/
 lglBarcode *
 gl_barcode_gnubarcode_new (const gchar    *id,
-                          gboolean        text_flag,
-                          gboolean        checksum_flag,
-                          gdouble         w,
-                          gdouble         h,
-                          const gchar    *digits)
+                           gboolean        text_flag,
+                           gboolean        checksum_flag,
+                           gdouble         w,
+                           gdouble         h,
+                           const gchar    *digits)
 {
-       lglBarcode          *gbc;
-       struct Barcode_Item *bci;
-       gint                 flags;
-
-       /* Assign type flag.  Pre-filter by length for subtypes. */
-       if (g_ascii_strcasecmp (id, "EAN") == 0) {
-               flags = BARCODE_EAN;
-       } else if (g_ascii_strcasecmp (id, "EAN-8") == 0) {
-               if (!is_length_valid (digits, 7, 8)) {
-                       return NULL;
-               }
-               flags = BARCODE_EAN;
-       } else if (g_ascii_strcasecmp (id, "EAN-8+2") == 0) {
-               if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 2, 2)) {
-                       return NULL;
-               }
-               flags = BARCODE_EAN;
-       } else if (g_ascii_strcasecmp (id, "EAN-8+5") == 0) {
-               if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 5, 5)) {
-                       return NULL;
-               }
-               flags = BARCODE_EAN;
-       } else if (g_ascii_strcasecmp (id, "EAN-13") == 0) {
-               if (!is_length_valid (digits, 12, 13)) {
-                       return NULL;
-               }
-               flags = BARCODE_EAN;
-       } else if (g_ascii_strcasecmp (id, "EAN-13+2") == 0) {
-               if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 2,2)) {
-                       return NULL;
-               }
-               flags = BARCODE_EAN;
-       } else if (g_ascii_strcasecmp (id, "EAN-13+5") == 0) {
-               if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 5,5)) {
-                       return NULL;
-               }
-               flags = BARCODE_EAN;
-       } else if (g_ascii_strcasecmp (id, "UPC") == 0) {
-               flags = BARCODE_UPC;
-       } else if (g_ascii_strcasecmp (id, "UPC-A") == 0) {
-               if (!is_length_valid (digits, 11, 12)) {
-                       return NULL;
-               }
-               flags = BARCODE_UPC;
-       } else if (g_ascii_strcasecmp (id, "UPC-A+2") == 0) {
-               if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 2,2)) {
-                       return NULL;
-               }
-               flags = BARCODE_UPC;
-       } else if (g_ascii_strcasecmp (id, "UPC-A+5") == 0) {
-               if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 5,5)) {
-                       return NULL;
-               }
-               flags = BARCODE_UPC;
-       } else if (g_ascii_strcasecmp (id, "UPC-E") == 0) {
-               if (!is_length_valid (digits, 6, 8)) {
-                       return NULL;
-               }
-               flags = BARCODE_UPC;
-       } else if (g_ascii_strcasecmp (id, "UPC-E+2") == 0) {
-               if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 2,2)) {
-                       return NULL;
-               }
-               flags = BARCODE_UPC;
-       } else if (g_ascii_strcasecmp (id, "UPC-E+5") == 0) {
-               if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 5,5)) {
-                       return NULL;
-               }
-               flags = BARCODE_UPC;
-       } else if (g_ascii_strcasecmp (id, "ISBN") == 0) {
-               if (!is_length_valid (digits, 9, 10)) {
-                       return NULL;
-               }
-               flags = BARCODE_ISBN;
-       } else if (g_ascii_strcasecmp (id, "ISBN+5") == 0) {
-               if (!is_length1_valid (digits, 9, 10) || !is_length2_valid (digits, 5,5)) {
-                       return NULL;
-               }
-               flags = BARCODE_ISBN;
-       } else if (g_ascii_strcasecmp (id, "Code39") == 0) {
-               flags = BARCODE_39;
-       } else if (g_ascii_strcasecmp (id, "Code128") == 0) {
-               flags = BARCODE_128;
-       } else if (g_ascii_strcasecmp (id, "Code128C") == 0) {
-               flags = BARCODE_128C;
-       } else if (g_ascii_strcasecmp (id, "Code128B") == 0) {
-               flags = BARCODE_128B;
-       } else if (g_ascii_strcasecmp (id, "I25") == 0) {
-               flags = BARCODE_I25;
-       } else if (g_ascii_strcasecmp (id, "CBR") == 0) {
-               flags = BARCODE_CBR;
-       } else if (g_ascii_strcasecmp (id, "MSI") == 0) {
-               flags = BARCODE_MSI;
-       } else if (g_ascii_strcasecmp (id, "PLS") == 0) {
-               flags = BARCODE_PLS;
-       } else if (g_ascii_strcasecmp (id, "Code93") == 0) {
-               flags = BARCODE_93;
-       } else {
-               g_message( "Illegal barcode id %s", id );
-               flags = BARCODE_ANY;
-       }
-
-
-       bci = Barcode_Create ((char *)digits);
-
-       /* First encode using GNU Barcode library */
-       if (!text_flag) {
-               flags |= BARCODE_NO_ASCII;
-       }
-       if (!checksum_flag) {
-               flags |= BARCODE_NO_CHECKSUM;
-       }
-
-       bci->scalef = 0.0;
-       bci->width  = w;
-       bci->height = h;
-
-       Barcode_Encode (bci, flags);
-       if (!bci->partial || !bci->textinfo) {
-               Barcode_Delete (bci);
-               return NULL;
-       }
-
-       /* now render with our custom back-end,
-          to create appropriate intermdediate format */
-       gbc = render_pass1 (bci, flags);
-
-       Barcode_Delete (bci);
-       return gbc;
+        lglBarcode          *gbc;
+        struct Barcode_Item *bci;
+        gint                 flags;
+
+        /* Assign type flag.  Pre-filter by length for subtypes. */
+        if (g_ascii_strcasecmp (id, "EAN") == 0)
+        {
+                flags = BARCODE_EAN;
+        }
+        else if (g_ascii_strcasecmp (id, "EAN-8") == 0)
+        {
+                if (!is_length_valid (digits, 7, 8))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_EAN;
+        }
+        else if (g_ascii_strcasecmp (id, "EAN-8+2") == 0)
+        {
+                if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 2, 2))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_EAN;
+        }
+        else if (g_ascii_strcasecmp (id, "EAN-8+5") == 0)
+        {
+                if (!is_length1_valid (digits, 7, 8) || !is_length2_valid (digits, 5, 5))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_EAN;
+        }
+        else if (g_ascii_strcasecmp (id, "EAN-13") == 0)
+        {
+                if (!is_length_valid (digits, 12, 13))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_EAN;
+        }
+        else if (g_ascii_strcasecmp (id, "EAN-13+2") == 0)
+        {
+                if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 2,2))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_EAN;
+        }
+        else if (g_ascii_strcasecmp (id, "EAN-13+5") == 0)
+        {
+                if (!is_length1_valid (digits, 12,13) || !is_length2_valid (digits, 5,5))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_EAN;
+        }
+        else if (g_ascii_strcasecmp (id, "UPC") == 0)
+        {
+                flags = BARCODE_UPC;
+        }
+        else if (g_ascii_strcasecmp (id, "UPC-A") == 0)
+        {
+                if (!is_length_valid (digits, 11, 12))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_UPC;
+        }
+        else if (g_ascii_strcasecmp (id, "UPC-A+2") == 0)
+        {
+                if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 2,2))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_UPC;
+        }
+        else if (g_ascii_strcasecmp (id, "UPC-A+5") == 0)
+        {
+                if (!is_length1_valid (digits, 11,12) || !is_length2_valid (digits, 5,5))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_UPC;
+        }
+        else if (g_ascii_strcasecmp (id, "UPC-E") == 0)
+        {
+                if (!is_length_valid (digits, 6, 8))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_UPC;
+        }
+        else if (g_ascii_strcasecmp (id, "UPC-E+2") == 0)
+        {
+                if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 2,2))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_UPC;
+        }
+        else if (g_ascii_strcasecmp (id, "UPC-E+5") == 0)
+        {
+                if (!is_length1_valid (digits, 6, 8) || !is_length2_valid (digits, 5,5))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_UPC;
+        }
+        else if (g_ascii_strcasecmp (id, "ISBN") == 0)
+        {
+                if (!is_length_valid (digits, 9, 10))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_ISBN;
+        }
+        else if (g_ascii_strcasecmp (id, "ISBN+5") == 0)
+        {
+                if (!is_length1_valid (digits, 9, 10) || !is_length2_valid (digits, 5,5))
+                {
+                        return NULL;
+                }
+                flags = BARCODE_ISBN;
+        }
+        else if (g_ascii_strcasecmp (id, "Code39") == 0)
+        {
+                flags = BARCODE_39;
+        }
+        else if (g_ascii_strcasecmp (id, "Code128") == 0)
+        {
+                flags = BARCODE_128;
+        }
+        else if (g_ascii_strcasecmp (id, "Code128C") == 0)
+        {
+                flags = BARCODE_128C;
+        }
+        else if (g_ascii_strcasecmp (id, "Code128B") == 0)
+        {
+                flags = BARCODE_128B;
+        }
+        else if (g_ascii_strcasecmp (id, "I25") == 0)
+        {
+                flags = BARCODE_I25;
+        }
+        else if (g_ascii_strcasecmp (id, "CBR") == 0)
+        {
+                flags = BARCODE_CBR;
+        }
+        else if (g_ascii_strcasecmp (id, "MSI") == 0)
+        {
+                flags = BARCODE_MSI;
+        }
+        else if (g_ascii_strcasecmp (id, "PLS") == 0)
+        {
+                flags = BARCODE_PLS;
+        }
+        else if (g_ascii_strcasecmp (id, "Code93") == 0)
+        {
+                flags = BARCODE_93;
+        }
+        else
+        {
+                g_message( "Illegal barcode id %s", id );
+                flags = BARCODE_ANY;
+        }
+
+
+        bci = Barcode_Create ((char *)digits);
+
+        /* First encode using GNU Barcode library */
+        if (!text_flag)
+        {
+                flags |= BARCODE_NO_ASCII;
+        }
+        if (!checksum_flag)
+        {
+                flags |= BARCODE_NO_CHECKSUM;
+        }
+
+        bci->scalef = 0.0;
+        bci->width  = w;
+        bci->height = h;
+
+        Barcode_Encode (bci, flags);
+        if (!bci->partial || !bci->textinfo)
+        {
+                Barcode_Delete (bci);
+                return NULL;
+        }
+
+        /* now render with our custom back-end,
+           to create appropriate intermdediate format */
+        gbc = render_pass1 (bci, flags);
+
+        Barcode_Delete (bci);
+        return gbc;
 }
 
 
@@ -213,143 +281,188 @@ gl_barcode_gnubarcode_new (const gchar    *id,
  *--------------------------------------------------------------------------*/
 static lglBarcode *
 render_pass1 (struct Barcode_Item *bci,
-             gint                 flags)
+              gint                 flags)
 {
-       gint                 validbits = BARCODE_NO_ASCII;
-       lglBarcode          *gbc;
-       gdouble              scalef = 1.0;
-       gdouble              x;
-       gint                 i, j, barlen;
-       gdouble              f1, f2;
-       gint                 mode = '-'; /* text below bars */
-       gdouble              x0, y0, yr;
-       gchar               *p, c;
-
-       if (bci->width > (2*bci->margin)) {
-               bci->width -= 2*bci->margin;
-       }
-       if (bci->height > (2*bci->margin)) {
-               bci->height -= 2*bci->margin;
-       }
-
-       /* If any flag is clear in "flags", inherit it from "bci->flags" */
-       if (!(flags & BARCODE_NO_ASCII)) {
-               flags |= bci->flags & BARCODE_NO_ASCII;
-       }
-       flags = bci->flags = (flags & validbits) | (bci->flags & ~validbits);
-
-       /* First calculate barlen */
-       barlen = bci->partial[0] - '0';
-       for (p = bci->partial + 1; *p != 0; p++) {
-               if (isdigit (*p)) {
-                       barlen += *p - '0';
-               } else {
-                       if ((*p != '+') && (*p != '-')) {
-                               barlen += *p - 'a' + 1;
-                       }
-               }
-       }
-
-       /* The scale factor depends on bar length */
-       if (!bci->scalef) {
-               if (!bci->width) bci->width = barlen; /* default */
-               scalef = bci->scalef = (double)bci->width / (double)barlen;
-               if (scalef < 0.5) scalef = 0.5;
-       }
-
-       /* The width defaults to "just enough" */
-       bci->width = barlen * scalef + 1;
-
-       /* But it can be too small, in this case enlarge and center the area */
-       if (bci->width < barlen * scalef) {
-               int wid = barlen * scalef + 1;
-               bci->xoff -= (wid - bci->width)/2 ;
-               bci->width = wid;
-               /* Can't extend too far on the left */
-               if (bci->xoff < 0) {
-                       bci->width += -bci->xoff;
-                       bci->xoff = 0;
-               }
-       }
-
-       /* The height defaults to 80 points (rescaled) */
-       if (!bci->height)
-               bci->height = 80 * scalef;
-
-       /* If too small (5 + text), reduce the scale factor and center */
-       i = 5 + 10 * ((bci->flags & BARCODE_NO_ASCII)==0);
-       if (bci->height < i * scalef ) {
-               bci->height = i * scalef;
-       }
-
-       gbc = lgl_barcode_new ();
-
-       /* Now traverse the code string and create a list of lines */
-       x = bci->margin + (bci->partial[0] - '0') * scalef;
-       for (p = bci->partial + 1, i = 1; *p != 0; p++, i++) {
-               /* special cases: '+' and '-' */
-               if (*p == '+' || *p == '-') {
-                       mode = *p;      /* don't count it */
-                       i++;
-                       continue;
-               }
-               /* j is the width of this bar/space */
-               if (isdigit (*p))
-                       j = *p - '0';
-               else
-                       j = *p - 'a' + 1;
-               if (i % 2) {    /* bar */
-                       x0 = x + (j * scalef) / 2;
-                       y0 = bci->margin;
-                       yr = bci->height;
-                       if (!(bci->flags & BARCODE_NO_ASCII)) { /* leave space for text */
-                               if (mode == '-') {
-                                       /* text below bars: 10 or 5 points */
-                                       yr -= (isdigit (*p) ? 10 : 5) * scalef;
-                               } else {        /* '+' */
-                                       /* above bars: 10 or 0 from bottom,
-                                          and 10 from top */
-                                       y0 += 10 * scalef;
-                                       yr -= (isdigit (*p) ? 20 : 10) * scalef;
-                               }
-                       }
+        gint                 validbits = BARCODE_NO_ASCII;
+        lglBarcode          *gbc;
+        gdouble              scalef = 1.0;
+        gdouble              x;
+        gint                 i, j, barlen;
+        gdouble              f1, f2;
+        gint                 mode = '-'; /* text below bars */
+        gdouble              x0, y0, yr;
+        gchar               *p, c;
+
+        if (bci->width > (2*bci->margin))
+        {
+                bci->width -= 2*bci->margin;
+        }
+        if (bci->height > (2*bci->margin))
+        {
+                bci->height -= 2*bci->margin;
+        }
+
+        /* If any flag is clear in "flags", inherit it from "bci->flags" */
+        if (!(flags & BARCODE_NO_ASCII))
+        {
+                flags |= bci->flags & BARCODE_NO_ASCII;
+        }
+        flags = bci->flags = (flags & validbits) | (bci->flags & ~validbits);
+
+        /* First calculate barlen */
+        barlen = bci->partial[0] - '0';
+        for (p = bci->partial + 1; *p != 0; p++)
+        {
+                if (isdigit (*p))
+                {
+                        barlen += *p - '0';
+                }
+                else
+                {
+                        if ((*p != '+') && (*p != '-'))
+                        {
+                                barlen += *p - 'a' + 1;
+                        }
+                }
+        }
+
+        /* The scale factor depends on bar length */
+        if (!bci->scalef)
+        {
+                if (!bci->width)
+                {
+                        bci->width = barlen; /* default */
+                }
+                scalef = bci->scalef = (double)bci->width / (double)barlen;
+                if (scalef < 0.5)
+                {
+                        scalef = 0.5;
+                }
+        }
+
+        /* The width defaults to "just enough" */
+        bci->width = barlen * scalef + 1;
+
+        /* But it can be too small, in this case enlarge and center the area */
+        if (bci->width < barlen * scalef)
+        {
+                int wid = barlen * scalef + 1;
+                bci->xoff -= (wid - bci->width)/2 ;
+                bci->width = wid;
+                /* Can't extend too far on the left */
+                if (bci->xoff < 0)
+                {
+                        bci->width += -bci->xoff;
+                        bci->xoff = 0;
+                }
+        }
+
+        /* The height defaults to 80 points (rescaled) */
+        if (!bci->height)
+        {
+                bci->height = 80 * scalef;
+        }
+
+        /* If too small (5 + text), reduce the scale factor and center */
+        i = 5 + 10 * ((bci->flags & BARCODE_NO_ASCII)==0);
+        if (bci->height < i * scalef )
+        {
+                bci->height = i * scalef;
+        }
+
+        gbc = lgl_barcode_new ();
+
+        /* Now traverse the code string and create a list of lines */
+        x = bci->margin + (bci->partial[0] - '0') * scalef;
+        for (p = bci->partial + 1, i = 1; *p != 0; p++, i++)
+        {
+                /* special cases: '+' and '-' */
+                if (*p == '+' || *p == '-')
+                {
+                        mode = *p;        /* don't count it */
+                        i++;
+                        continue;
+                }
+                /* j is the width of this bar/space */
+                if (isdigit (*p))
+                {
+                        j = *p - '0';
+                }
+                else
+                {
+                        j = *p - 'a' + 1;
+                }
+                if (i % 2)
+                {
+                        /* bar */
+                        x0 = x + (j * scalef) / 2;
+                        y0 = bci->margin;
+                        yr = bci->height;
+                        if (!(bci->flags & BARCODE_NO_ASCII))
+                        {
+                                /* leave space for text */
+                                if (mode == '-')
+                                {
+                                        /* text below bars: 10 or 5 points */
+                                        yr -= (isdigit (*p) ? 10 : 5) * scalef;
+                                }
+                                else
+                                {
+                                        /* '+' */
+                                        /* above bars: 10 or 0 from bottom,
+                                           and 10 from top */
+                                        y0 += 10 * scalef;
+                                        yr -= (isdigit (*p) ? 20 : 10) * scalef;
+                                }
+                        }
                         lgl_barcode_add_line (gbc, x0, y0, yr, (j * scalef) - SHRINK_AMOUNT);
-               }
-               x += j * scalef;
-
-       }
-
-       /* Now the text */
-       mode = '-';             /* reinstantiate default */
-       if (!(bci->flags & BARCODE_NO_ASCII)) {
-               for (p = bci->textinfo; p; p = strchr (p, ' ')) {
-                       while (*p == ' ')
-                               p++;
-                       if (!*p)
-                               break;
-                       if (*p == '+' || *p == '-') {
-                               mode = *p;
-                               continue;
-                       }
-                       if (sscanf (p, "%lf:%lf:%c", &f1, &f2, &c) != 3) {
-                               g_message ("impossible data: %s", p);
-                               continue;
-                       }
-                       x0 = f1 * scalef + bci->margin;
-                       if (mode == '-') {
-                               y0 = bci->margin + bci->height - 8 * scalef;
-                       } else {
-                               y0 = bci->margin;
-                       }
+                }
+                x += j * scalef;
+
+        }
+
+        /* Now the text */
+        mode = '-';                /* reinstantiate default */
+        if (!(bci->flags & BARCODE_NO_ASCII))
+        {
+                for (p = bci->textinfo; p; p = strchr (p, ' '))
+                {
+                        while (*p == ' ')
+                        {
+                                p++;
+                        }
+                        if (!*p)
+                        {
+                                break;
+                        }
+                        if (*p == '+' || *p == '-')
+                        {
+                                mode = *p;
+                                continue;
+                        }
+                        if (sscanf (p, "%lf:%lf:%c", &f1, &f2, &c) != 3)
+                        {
+                                g_message ("impossible data: %s", p);
+                                continue;
+                        }
+                        x0 = f1 * scalef + bci->margin;
+                        if (mode == '-')
+                        {
+                                y0 = bci->margin + bci->height - 8 * scalef;
+                        }
+                        else
+                        {
+                                y0 = bci->margin;
+                        }
                         lgl_barcode_add_char (gbc, x0, y0, (f2 * FONT_SCALE * scalef), c);
-               }
-       }
+                }
+        }
 
-       /* Fill in other info */
-       gbc->height = bci->height + 2.0 * bci->margin;
-       gbc->width = bci->width + 2.0 * bci->margin;
+        /* Fill in other info */
+        gbc->height = bci->height + 2.0 * bci->margin;
+        gbc->width = bci->width + 2.0 * bci->margin;
 
-       return gbc;
+        return gbc;
 }
 
 
@@ -358,23 +471,26 @@ render_pass1 (struct Barcode_Item *bci,
 /*--------------------------------------------------------------------------*/
 static gboolean
 is_length_valid (const gchar *digits,
-                gint         n1,
-                gint         n2)
+                 gint         n1,
+                 gint         n2)
 {
-       gchar *p;
-       gint   i;
-
-       if (!digits) {
-               return FALSE;
-       }
-
-       for (p = (gchar *)digits, i=0; *p != 0; p++) {
-               if (g_ascii_isdigit (*p)) {
-                       i++;
-               }
-       }
-
-       return (i >= n1) && (i <= n2);
+        gchar *p;
+        gint   i;
+
+        if (!digits)
+        {
+                return FALSE;
+        }
+
+        for (p = (gchar *)digits, i=0; *p != 0; p++)
+        {
+                if (g_ascii_isdigit (*p))
+                {
+                        i++;
+                }
+        }
+
+        return (i >= n1) && (i <= n2);
 }
 
 
@@ -383,23 +499,26 @@ is_length_valid (const gchar *digits,
 /*--------------------------------------------------------------------------*/
 static gboolean
 is_length1_valid (const gchar *digits,
-                 gint         n1,
-                 gint         n2)
+                  gint         n1,
+                  gint         n2)
 {
-       gchar *p;
-       gint   i;
-
-       if (!digits) {
-               return FALSE;
-       }
-
-       for (p = (gchar *)digits, i=0; !g_ascii_isspace (*p) && *p != 0; p++) {
-               if (g_ascii_isdigit (*p)) {
-                       i++;
-               }
-       }
-
-       return (i >= n1) && (i <= n2);
+        gchar *p;
+        gint   i;
+
+        if (!digits)
+        {
+                return FALSE;
+        }
+
+        for (p = (gchar *)digits, i=0; !g_ascii_isspace (*p) && *p != 0; p++)
+        {
+                if (g_ascii_isdigit (*p))
+                {
+                        i++;
+                }
+        }
+
+        return (i >= n1) && (i <= n2);
 }
 
 
@@ -408,27 +527,31 @@ is_length1_valid (const gchar *digits,
 /*--------------------------------------------------------------------------*/
 static gboolean
 is_length2_valid (const gchar *digits,
-                 gint         n1,
-                 gint         n2)
+                  gint         n1,
+                  gint         n2)
 {
-       gchar *p;
-       gint   i;
-
-       if (!digits) {
-               return FALSE;
-       }
-
-       for (p = (gchar *)digits; !g_ascii_isspace (*p) && (*p != 0); p++) {
-               /* Skip over 1st string */
-       }
-
-       for (i=0; *p != 0; p++) {
-               if (g_ascii_isdigit (*p)) {
-                       i++;
-               }
-       }
-
-       return (i >= n1) && (i <= n2);
+        gchar *p;
+        gint   i;
+
+        if (!digits)
+        {
+                return FALSE;
+        }
+
+        for (p = (gchar *)digits; !g_ascii_isspace (*p) && (*p != 0); p++)
+        {
+                /* Skip over 1st string */
+        }
+
+        for (i=0; *p != 0; p++)
+        {
+                if (g_ascii_isdigit (*p))
+                {
+                        i++;
+                }
+        }
+
+        return (i >= n1) && (i <= n2);
 }
 
 #endif /* HAVE_LIBBARCODE */
index 0719ed5d36afec3743f513592316ac81d689f447..a031ef3ab4ca3c8564e3747409bc5699fbce526b 100644 (file)
@@ -64,7 +64,7 @@ gl_barcode_iec16022_new (const gchar    *id,
         gint                 i_width, i_height;
         lglBarcode          *gbc;
 
-        if ( strlen (digits) == 0 )
+        if ( *digits == '\0' )
         {
                 return NULL;
         }
@@ -99,14 +99,17 @@ render_iec16022 (const gchar *grid,
         gint                x, y;
         gdouble             aspect_ratio, pixel_size;
 
-       /* Treat requested size as a bounding box, scale to maintain aspect
-        * ratio while fitting it in this bounding box. */
-       aspect_ratio = (gdouble)i_height / (gdouble)i_width;
-       if ( h > w*aspect_ratio ) {
-               h = w * aspect_ratio;
-       } else {
-               w = h / aspect_ratio;
-       }
+        /* Treat requested size as a bounding box, scale to maintain aspect
+         * ratio while fitting it in this bounding box. */
+        aspect_ratio = (gdouble)i_height / (gdouble)i_width;
+        if ( h > w*aspect_ratio )
+        {
+                h = w * aspect_ratio;
+        }
+        else
+        {
+                w = h / aspect_ratio;
+        }
 
         /* Now determine pixel size. */
         pixel_size = w / i_width;
index 396b55bcbf0d426318c85e77d687541038c0c196..e27db05cb41a104e74f655714c135f49101fd9e4 100644 (file)
@@ -63,9 +63,9 @@ gl_barcode_iec18004_new (const gchar    *id,
 {
         gint             i_width, i_height;
         lglBarcode      *gbc;
-       QRcode          *qrcode;
+        QRcode          *qrcode;
 
-        if ( strlen (digits) == 0 )
+        if ( *digits == '\0' )
         {
                 return NULL;
         }
@@ -80,12 +80,12 @@ gl_barcode_iec18004_new (const gchar    *id,
                 return NULL;
         }
         
-       i_width = i_height = qrcode->width;
-       gbc = render_iec18004 ((const gchar *)qrcode->data, i_width, i_height,
+        i_width = i_height = qrcode->width;
+        gbc = render_iec18004 ((const gchar *)qrcode->data, i_width, i_height,
                                w, h);
 
-       QRcode_free ( qrcode );
-        
+        QRcode_free ( qrcode );
+
         return gbc;
 }
 
@@ -104,14 +104,17 @@ render_iec18004 (const gchar *grid,
         gint                x, y;
         gdouble             aspect_ratio, pixel_size;
 
-       /* Treat requested size as a bounding box, scale to maintain aspect
-        * ratio while fitting it in this bounding box. */
-       aspect_ratio = (gdouble)i_height / (gdouble)i_width;
-       if ( h > w*aspect_ratio ) {
-               h = w * aspect_ratio;
-       } else {
-               w = h / aspect_ratio;
-       }
+        /* Treat requested size as a bounding box, scale to maintain aspect
+         * ratio while fitting it in this bounding box. */
+        aspect_ratio = (gdouble)i_height / (gdouble)i_width;
+        if ( h > w*aspect_ratio )
+        {
+                h = w * aspect_ratio;
+        }
+        else
+        {
+                w = h / aspect_ratio;
+        }
 
         /* Now determine pixel size. */
         pixel_size = w / i_width;
index e68efc811a6776a93cedf3aaeecc8f2d3b242f0e..015196e3623446b6467de82802afd451dccd81e5 100644 (file)
@@ -51,17 +51,17 @@ static lglBarcode *render_zint     (struct zint_symbol *symbol, gboolean text_fl
 /*****************************************************************************/
 lglBarcode *
 gl_barcode_zint_new (const gchar          *id,
-                          gboolean        text_flag,
-                          gboolean        checksum_flag,
-                          gdouble         w,
-                          gdouble         h,
-                          const gchar    *digits)
+                           gboolean        text_flag,
+                           gboolean        checksum_flag,
+                           gdouble         w,
+                           gdouble         h,
+                           const gchar    *digits)
 {
-       lglBarcode          *gbc;
-       struct zint_symbol  *symbol;
-       gint                 result;
+        lglBarcode          *gbc;
+        struct zint_symbol  *symbol;
+        gint                 result;
 
-       symbol = ZBarcode_Create();
+        symbol = ZBarcode_Create();
 
         /* Auto set to default size */
         if ( (w == 0) && (h == 0) )
@@ -70,105 +70,102 @@ gl_barcode_zint_new (const gchar          *id,
                 h = DEFAULT_H;
         }
 
-       /* Assign type flag.  Pre-filter by length for subtypes. */
-       if (g_ascii_strcasecmp (id, "AUSP") == 0) { symbol->symbology = BARCODE_AUSPOST; }
-       if (g_ascii_strcasecmp (id, "AUSRP") == 0) { symbol->symbology = BARCODE_AUSREPLY; }
-       if (g_ascii_strcasecmp (id, "AUSRT") == 0) { symbol->symbology = BARCODE_AUSROUTE; }
-       if (g_ascii_strcasecmp (id, "AUSRD") == 0) { symbol->symbology = BARCODE_AUSREDIRECT; }
-       if (g_ascii_strcasecmp (id, "AZTEC") == 0) { symbol->symbology = BARCODE_AZTEC; }
-       if (g_ascii_strcasecmp (id, "AZRUN") == 0) { symbol->symbology = BARCODE_AZRUNE; }
-       if (g_ascii_strcasecmp (id, "CBR") == 0) { symbol->symbology = BARCODE_CODABAR; }
-       if (g_ascii_strcasecmp (id, "Code1") == 0) { symbol->symbology = BARCODE_CODEONE; }
-       if (g_ascii_strcasecmp (id, "Code11") == 0) { symbol->symbology = BARCODE_CODE11; }
-       if (g_ascii_strcasecmp (id, "C16K") == 0) { symbol->symbology = BARCODE_CODE16K; }
-       if (g_ascii_strcasecmp (id, "C25M") == 0) { symbol->symbology = BARCODE_C25MATRIX; }
-       if (g_ascii_strcasecmp (id, "C25I") == 0) { symbol->symbology = BARCODE_C25IATA; }
-       if (g_ascii_strcasecmp (id, "C25DL") == 0) { symbol->symbology = BARCODE_C25LOGIC; }
-       if (g_ascii_strcasecmp (id, "Code32") == 0) { symbol->symbology = BARCODE_CODE32; }
-       if (g_ascii_strcasecmp (id, "Code39") == 0) { symbol->symbology = BARCODE_CODE39; }
-       if (g_ascii_strcasecmp (id, "Code39E") == 0) { symbol->symbology = BARCODE_EXCODE39; }
-       if (g_ascii_strcasecmp (id, "Code49") == 0) { symbol->symbology = BARCODE_CODE49; }
-       if (g_ascii_strcasecmp (id, "Code93") == 0) { symbol->symbology = BARCODE_CODE93; }
-       if (g_ascii_strcasecmp (id, "Code128") == 0) { symbol->symbology = BARCODE_CODE128; }
-       if (g_ascii_strcasecmp (id, "Code128B") == 0) { symbol->symbology = BARCODE_CODE128B; }
-       if (g_ascii_strcasecmp (id, "DAFT") == 0) { symbol->symbology = BARCODE_DAFT; }
-       if (g_ascii_strcasecmp (id, "DMTX") == 0) { symbol->symbology = BARCODE_DATAMATRIX; }
-       if (g_ascii_strcasecmp (id, "DPL") == 0) { symbol->symbology = BARCODE_DPLEIT; }
-       if (g_ascii_strcasecmp (id, "DPI") == 0) { symbol->symbology = BARCODE_DPIDENT; }
-       if (g_ascii_strcasecmp (id, "KIX") == 0) { symbol->symbology = BARCODE_KIX; }
-       if (g_ascii_strcasecmp (id, "EAN") == 0) { symbol->symbology = BARCODE_EANX; }
-       if (g_ascii_strcasecmp (id, "HIBC128") == 0) { symbol->symbology = BARCODE_HIBC_128; }
-       if (g_ascii_strcasecmp (id, "HIBC39") == 0) { symbol->symbology = BARCODE_HIBC_39; }
-       if (g_ascii_strcasecmp (id, "HIBCDM") == 0) { symbol->symbology = BARCODE_HIBC_DM; }
-       if (g_ascii_strcasecmp (id, "HIBCQR") == 0) { symbol->symbology = BARCODE_HIBC_QR; }
-       if (g_ascii_strcasecmp (id, "HIBCPDF") == 0) { symbol->symbology = BARCODE_HIBC_MICPDF; }
-       if (g_ascii_strcasecmp (id, "HIBCMPDF") == 0) { symbol->symbology = BARCODE_HIBC_AZTEC; }
-       if (g_ascii_strcasecmp (id, "HIBCAZ") == 0) { symbol->symbology = BARCODE_C25INTER; }
-       if (g_ascii_strcasecmp (id, "I25") == 0) { symbol->symbology = BARCODE_C25INTER; }
-       if (g_ascii_strcasecmp (id, "ISBN") == 0) { symbol->symbology = BARCODE_ISBNX; }
-       if (g_ascii_strcasecmp (id, "ITF14") == 0) { symbol->symbology = BARCODE_ITF14; }
-       if (g_ascii_strcasecmp (id, "GMTX") == 0) { symbol->symbology = BARCODE_GRIDMATRIX; }
-       if (g_ascii_strcasecmp (id, "GS1-128") == 0) { symbol->symbology = BARCODE_EAN128; }
-       if (g_ascii_strcasecmp (id, "LOGM") == 0) { symbol->symbology = BARCODE_LOGMARS; }
-       if (g_ascii_strcasecmp (id, "RSS14") == 0) { symbol->symbology = BARCODE_RSS14; }
-       if (g_ascii_strcasecmp (id, "RSSLTD") == 0) { symbol->symbology = BARCODE_RSS_LTD; }
-       if (g_ascii_strcasecmp (id, "RSSEXP") == 0) { symbol->symbology = BARCODE_RSS_EXP; }
-       if (g_ascii_strcasecmp (id, "RSSS") == 0) { symbol->symbology = BARCODE_RSS14STACK; }
-       if (g_ascii_strcasecmp (id, "RSSSO") == 0) { symbol->symbology = BARCODE_RSS14STACK_OMNI; }
-       if (g_ascii_strcasecmp (id, "RSSSE") == 0) { symbol->symbology = BARCODE_RSS_EXPSTACK; }
-       if (g_ascii_strcasecmp (id, "PHARMA") == 0) { symbol->symbology = BARCODE_PHARMA; }
-       if (g_ascii_strcasecmp (id, "PHARMA2") == 0) { symbol->symbology = BARCODE_PHARMA_TWO; }
-       if (g_ascii_strcasecmp (id, "PZN") == 0) { symbol->symbology = BARCODE_PZN; }
-       if (g_ascii_strcasecmp (id, "TELE") == 0) { symbol->symbology = BARCODE_TELEPEN; }
-       if (g_ascii_strcasecmp (id, "TELEX") == 0) { symbol->symbology = BARCODE_TELEPEN_NUM; }
-       if (g_ascii_strcasecmp (id, "JAPAN") == 0) { symbol->symbology = BARCODE_JAPANPOST; }
-       if (g_ascii_strcasecmp (id, "KOREA") == 0) { symbol->symbology = BARCODE_KOREAPOST; }
-       if (g_ascii_strcasecmp (id, "MAXI") == 0) { symbol->symbology = BARCODE_MAXICODE; }
-       if (g_ascii_strcasecmp (id, "MPDF") == 0) { symbol->symbology = BARCODE_MICROPDF417; }
-       if (g_ascii_strcasecmp (id, "MSI") == 0) { symbol->symbology = BARCODE_MSI_PLESSEY; }
-       if (g_ascii_strcasecmp (id, "MQR") == 0) { symbol->symbology = BARCODE_MICROQR; }
-       if (g_ascii_strcasecmp (id, "NVE") == 0) { symbol->symbology = BARCODE_NVE18; }
-       if (g_ascii_strcasecmp (id, "PLAN") == 0) { symbol->symbology = BARCODE_PLANET; }
-       if (g_ascii_strcasecmp (id, "POSTNET") == 0) { symbol->symbology = BARCODE_POSTNET; }
-       if (g_ascii_strcasecmp (id, "PDF") == 0) { symbol->symbology = BARCODE_PDF417; }
-       if (g_ascii_strcasecmp (id, "PDFT") == 0) { symbol->symbology = BARCODE_PDF417TRUNC; }
-       if (g_ascii_strcasecmp (id, "QR") == 0) { symbol->symbology = BARCODE_QRCODE; }
-       if (g_ascii_strcasecmp (id, "RM4") == 0) { symbol->symbology = BARCODE_RM4SCC; }
-       if (g_ascii_strcasecmp (id, "UPC-A") == 0) { symbol->symbology = BARCODE_UPCA; }
-       if (g_ascii_strcasecmp (id, "UPC-E") == 0) { symbol->symbology = BARCODE_UPCE; }
-       if (g_ascii_strcasecmp (id, "USPS") == 0) { symbol->symbology = BARCODE_ONECODE; }
-       if (g_ascii_strcasecmp (id, "PLS") == 0) { symbol->symbology = BARCODE_PLESSEY; }
-
-
-       /* Checksum not supported yet!! 
-       if (!checksum_flag) {
-               flags |= BARCODE_NO_CHECKSUM;
-       }
-       */
-
-       result = ZBarcode_Encode(symbol, (unsigned char *)digits, 0);
-       if (result) {
-               gl_debug (DEBUG_BARCODE, "Zint Error: %s", symbol->errtxt);
-               ZBarcode_Delete (symbol);
-               return NULL;
-       }
-       
-       if(!text_flag) {
-               symbol->show_hrt = 0;
-       }
-
-       if (!ZBarcode_Render(symbol, (float) w, (float) h)) {
-               g_message("Zint Rendering Error: %s", symbol->errtxt);
-               ZBarcode_Delete(symbol);
-               return NULL;
-       }
-
-       /* Convert Sums provided by zint encode */
-       gbc = render_zint(symbol, text_flag);
-
-       ZBarcode_Delete(symbol);
-
-       return gbc;
+        /* Assign type flag.  Pre-filter by length for subtypes. */
+        if (g_ascii_strcasecmp (id, "AUSP") == 0)     { symbol->symbology = BARCODE_AUSPOST; }
+        if (g_ascii_strcasecmp (id, "AUSRP") == 0)    { symbol->symbology = BARCODE_AUSREPLY; }
+        if (g_ascii_strcasecmp (id, "AUSRT") == 0)    { symbol->symbology = BARCODE_AUSROUTE; }
+        if (g_ascii_strcasecmp (id, "AUSRD") == 0)    { symbol->symbology = BARCODE_AUSREDIRECT; }
+        if (g_ascii_strcasecmp (id, "AZTEC") == 0)    { symbol->symbology = BARCODE_AZTEC; }
+        if (g_ascii_strcasecmp (id, "AZRUN") == 0)    { symbol->symbology = BARCODE_AZRUNE; }
+        if (g_ascii_strcasecmp (id, "CBR") == 0)      { symbol->symbology = BARCODE_CODABAR; }
+        if (g_ascii_strcasecmp (id, "Code1") == 0)    { symbol->symbology = BARCODE_CODEONE; }
+        if (g_ascii_strcasecmp (id, "Code11") == 0)   { symbol->symbology = BARCODE_CODE11; }
+        if (g_ascii_strcasecmp (id, "C16K") == 0)     { symbol->symbology = BARCODE_CODE16K; }
+        if (g_ascii_strcasecmp (id, "C25M") == 0)     { symbol->symbology = BARCODE_C25MATRIX; }
+        if (g_ascii_strcasecmp (id, "C25I") == 0)     { symbol->symbology = BARCODE_C25IATA; }
+        if (g_ascii_strcasecmp (id, "C25DL") == 0)    { symbol->symbology = BARCODE_C25LOGIC; }
+        if (g_ascii_strcasecmp (id, "Code32") == 0)   { symbol->symbology = BARCODE_CODE32; }
+        if (g_ascii_strcasecmp (id, "Code39") == 0)   { symbol->symbology = BARCODE_CODE39; }
+        if (g_ascii_strcasecmp (id, "Code39E") == 0)  { symbol->symbology = BARCODE_EXCODE39; }
+        if (g_ascii_strcasecmp (id, "Code49") == 0)   { symbol->symbology = BARCODE_CODE49; }
+        if (g_ascii_strcasecmp (id, "Code93") == 0)   { symbol->symbology = BARCODE_CODE93; }
+        if (g_ascii_strcasecmp (id, "Code128") == 0)  { symbol->symbology = BARCODE_CODE128; }
+        if (g_ascii_strcasecmp (id, "Code128B") == 0) { symbol->symbology = BARCODE_CODE128B; }
+        if (g_ascii_strcasecmp (id, "DAFT") == 0)     { symbol->symbology = BARCODE_DAFT; }
+        if (g_ascii_strcasecmp (id, "DMTX") == 0)     { symbol->symbology = BARCODE_DATAMATRIX; }
+        if (g_ascii_strcasecmp (id, "DPL") == 0)      { symbol->symbology = BARCODE_DPLEIT; }
+        if (g_ascii_strcasecmp (id, "DPI") == 0)      { symbol->symbology = BARCODE_DPIDENT; }
+        if (g_ascii_strcasecmp (id, "KIX") == 0)      { symbol->symbology = BARCODE_KIX; }
+        if (g_ascii_strcasecmp (id, "EAN") == 0)      { symbol->symbology = BARCODE_EANX; }
+        if (g_ascii_strcasecmp (id, "HIBC128") == 0)  { symbol->symbology = BARCODE_HIBC_128; }
+        if (g_ascii_strcasecmp (id, "HIBC39") == 0)   { symbol->symbology = BARCODE_HIBC_39; }
+        if (g_ascii_strcasecmp (id, "HIBCDM") == 0)   { symbol->symbology = BARCODE_HIBC_DM; }
+        if (g_ascii_strcasecmp (id, "HIBCQR") == 0)   { symbol->symbology = BARCODE_HIBC_QR; }
+        if (g_ascii_strcasecmp (id, "HIBCPDF") == 0)  { symbol->symbology = BARCODE_HIBC_MICPDF; }
+        if (g_ascii_strcasecmp (id, "HIBCMPDF") == 0) { symbol->symbology = BARCODE_HIBC_AZTEC; }
+        if (g_ascii_strcasecmp (id, "HIBCAZ") == 0)   { symbol->symbology = BARCODE_C25INTER; }
+        if (g_ascii_strcasecmp (id, "I25") == 0)      { symbol->symbology = BARCODE_C25INTER; }
+        if (g_ascii_strcasecmp (id, "ISBN") == 0)     { symbol->symbology = BARCODE_ISBNX; }
+        if (g_ascii_strcasecmp (id, "ITF14") == 0)    { symbol->symbology = BARCODE_ITF14; }
+        if (g_ascii_strcasecmp (id, "GMTX") == 0)     { symbol->symbology = BARCODE_GRIDMATRIX; }
+        if (g_ascii_strcasecmp (id, "GS1-128") == 0)  { symbol->symbology = BARCODE_EAN128; }
+        if (g_ascii_strcasecmp (id, "LOGM") == 0)     { symbol->symbology = BARCODE_LOGMARS; }
+        if (g_ascii_strcasecmp (id, "RSS14") == 0)    { symbol->symbology = BARCODE_RSS14; }
+        if (g_ascii_strcasecmp (id, "RSSLTD") == 0)   { symbol->symbology = BARCODE_RSS_LTD; }
+        if (g_ascii_strcasecmp (id, "RSSEXP") == 0)   { symbol->symbology = BARCODE_RSS_EXP; }
+        if (g_ascii_strcasecmp (id, "RSSS") == 0)     { symbol->symbology = BARCODE_RSS14STACK; }
+        if (g_ascii_strcasecmp (id, "RSSSO") == 0)    { symbol->symbology = BARCODE_RSS14STACK_OMNI; }
+        if (g_ascii_strcasecmp (id, "RSSSE") == 0)    { symbol->symbology = BARCODE_RSS_EXPSTACK; }
+        if (g_ascii_strcasecmp (id, "PHARMA") == 0)   { symbol->symbology = BARCODE_PHARMA; }
+        if (g_ascii_strcasecmp (id, "PHARMA2") == 0)  { symbol->symbology = BARCODE_PHARMA_TWO; }
+        if (g_ascii_strcasecmp (id, "PZN") == 0)      { symbol->symbology = BARCODE_PZN; }
+        if (g_ascii_strcasecmp (id, "TELE") == 0)     { symbol->symbology = BARCODE_TELEPEN; }
+        if (g_ascii_strcasecmp (id, "TELEX") == 0)    { symbol->symbology = BARCODE_TELEPEN_NUM; }
+        if (g_ascii_strcasecmp (id, "JAPAN") == 0)    { symbol->symbology = BARCODE_JAPANPOST; }
+        if (g_ascii_strcasecmp (id, "KOREA") == 0)    { symbol->symbology = BARCODE_KOREAPOST; }
+        if (g_ascii_strcasecmp (id, "MAXI") == 0)     { symbol->symbology = BARCODE_MAXICODE; }
+        if (g_ascii_strcasecmp (id, "MPDF") == 0)     { symbol->symbology = BARCODE_MICROPDF417; }
+        if (g_ascii_strcasecmp (id, "MSI") == 0)      { symbol->symbology = BARCODE_MSI_PLESSEY; }
+        if (g_ascii_strcasecmp (id, "MQR") == 0)      { symbol->symbology = BARCODE_MICROQR; }
+        if (g_ascii_strcasecmp (id, "NVE") == 0)      { symbol->symbology = BARCODE_NVE18; }
+        if (g_ascii_strcasecmp (id, "PLAN") == 0)     { symbol->symbology = BARCODE_PLANET; }
+        if (g_ascii_strcasecmp (id, "POSTNET") == 0)  { symbol->symbology = BARCODE_POSTNET; }
+        if (g_ascii_strcasecmp (id, "PDF") == 0)      { symbol->symbology = BARCODE_PDF417; }
+        if (g_ascii_strcasecmp (id, "PDFT") == 0)     { symbol->symbology = BARCODE_PDF417TRUNC; }
+        if (g_ascii_strcasecmp (id, "QR") == 0)       { symbol->symbology = BARCODE_QRCODE; }
+        if (g_ascii_strcasecmp (id, "RM4") == 0)      { symbol->symbology = BARCODE_RM4SCC; }
+        if (g_ascii_strcasecmp (id, "UPC-A") == 0)    { symbol->symbology = BARCODE_UPCA; }
+        if (g_ascii_strcasecmp (id, "UPC-E") == 0)    { symbol->symbology = BARCODE_UPCE; }
+        if (g_ascii_strcasecmp (id, "USPS") == 0)     { symbol->symbology = BARCODE_ONECODE; }
+        if (g_ascii_strcasecmp (id, "PLS") == 0)      { symbol->symbology = BARCODE_PLESSEY; }
+
+
+        result = ZBarcode_Encode(symbol, (unsigned char *)digits, 0);
+        if (result)
+        {
+                gl_debug (DEBUG_BARCODE, "Zint Error: %s", symbol->errtxt);
+                ZBarcode_Delete (symbol);
+                return NULL;
+        }
+
+        if(!text_flag)
+        {
+                symbol->show_hrt = 0;
+        }
+
+        if (!ZBarcode_Render(symbol, (float) w, (float) h))
+        {
+                g_message("Zint Rendering Error: %s", symbol->errtxt);
+                ZBarcode_Delete(symbol);
+                return NULL;
+        }
+
+        /* Convert Sums provided by zint encode */
+        gbc = render_zint(symbol, text_flag);
+
+        ZBarcode_Delete(symbol);
+
+        return gbc;
 }
 
 
@@ -187,7 +184,7 @@ static lglBarcode *render_zint(struct zint_symbol *symbol, gboolean text_flag)
 
         render = symbol->rendered;
         gbc = lgl_barcode_new ();
-       
+
         for ( zline = render->lines; zline != NULL; zline = zline->next )
         {
                 lgl_barcode_add_box (gbc, zline->x, zline->y, zline->width, zline->length);
index 04186f6189106936c729bdfefb1463939e512020..8a5e988d46524db7de11f9cf941b88048188ade2 100644 (file)
@@ -98,7 +98,7 @@ menu_selection_done_cb (GtkMenuShell               *object,
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glColorComboButton, gl_color_combo_button, GTK_TYPE_HBOX);
+G_DEFINE_TYPE (glColorComboButton, gl_color_combo_button, GTK_TYPE_HBOX)
 
 
 /*****************************************************************************/
index bdaca24afd7a79af4420f603644207b3b96f6f1d..334fd1982e8db39b771be264b0e488c900ccc059 100644 (file)
@@ -65,7 +65,7 @@ static void gl_color_combo_color_menu_item_finalize    (GObject                *
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glColorComboColorMenuItem, gl_color_combo_color_menu_item, GTK_TYPE_MENU_ITEM);
+G_DEFINE_TYPE (glColorComboColorMenuItem, gl_color_combo_color_menu_item, GTK_TYPE_MENU_ITEM)
 
 
 /*****************************************************************************/
index ec24fab293750f08650f7dd253b4745ddf1f3f20..e08f4b22f24c809115d1a820345a020468f0a6e6 100644 (file)
@@ -154,7 +154,7 @@ static void history_menu_item_activate_cb (GtkMenuItem      *item,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glColorComboMenu, gl_color_combo_menu, GTK_TYPE_MENU);
+G_DEFINE_TYPE (glColorComboMenu, gl_color_combo_menu, GTK_TYPE_MENU)
 
 
 /*****************************************************************************/
index c833f19343e264bca65b1c5d5b0c42cadb4a2542..ea29ebe10c630bcbc45968927730f61731d11a11 100644 (file)
@@ -90,7 +90,7 @@ menu_selection_done_cb (GtkMenuShell      *object,
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glColorCombo, gl_color_combo, GTK_TYPE_TOGGLE_BUTTON);
+G_DEFINE_TYPE (glColorCombo, gl_color_combo, GTK_TYPE_TOGGLE_BUTTON)
 
 
 /*****************************************************************************/
index 8069fa3d6a4bfc8850f70fe1c94d140416b6d06e..7f129bcf805bf25057bc8fe3e169578d3a0fdf96 100644 (file)
@@ -69,7 +69,7 @@ static void    set_color_array                  (glColorHistoryModel *this,
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glColorHistoryModel, gl_color_history_model, G_TYPE_OBJECT);
+G_DEFINE_TYPE (glColorHistoryModel, gl_color_history_model, G_TYPE_OBJECT)
 
 
 /*****************************************************************************/
index 6856e21958f210c6082ce89ba9684751bcddf5a4..7e97beec9c85daaea56342c20e9e56e55d55ded5 100644 (file)
@@ -69,7 +69,7 @@ static void       draw_swatch                 (glColorSwatch  *this,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glColorSwatch, gl_color_swatch, GTK_TYPE_DRAWING_AREA);
+G_DEFINE_TYPE (glColorSwatch, gl_color_swatch, GTK_TYPE_DRAWING_AREA)
 
 
 /*****************************************************************************/
index 25825a818583fd0bed41750c30fefaac33f9c937..a1aad56dcee7280be868149bdada429e4c799abe 100644 (file)
@@ -64,7 +64,7 @@ typedef enum {
        GLABELS_DEBUG_WDGT         = 1 << 21,
         GLABELS_DEBUG_PATH         = 1 << 22,
        GLABELS_DEBUG_FIELD_BUTTON = 1 << 23,
-        GLABELS_DEBUG_BARCODE      = 1 << 24,
+        GLABELS_DEBUG_BARCODE      = 1 << 24
 } glDebugSection;
 
 
index 37509f22644a0e3821758c86fd444a810052b867..9177abb2502139c00a394b12e38a883ce45062e7 100644 (file)
@@ -66,7 +66,7 @@ static void gl_field_button_menu_finalize      (GObject              *object);
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glFieldButtonMenu, gl_field_button_menu, GTK_TYPE_MENU);
+G_DEFINE_TYPE (glFieldButtonMenu, gl_field_button_menu, GTK_TYPE_MENU)
 
 
 static void
index aad5f5105c3d3038584feb9402ec9f82ca63dda8..8b8c4e5b379e8560bef886ce3ffe73a91b5c493b 100644 (file)
@@ -83,7 +83,7 @@ menu_selection_done_cb (GtkMenuShell      *object,
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glFieldButton, gl_field_button, GTK_TYPE_TOGGLE_BUTTON);
+G_DEFINE_TYPE (glFieldButton, gl_field_button, GTK_TYPE_TOGGLE_BUTTON)
 
 
 /*****************************************************************************/
index 5f30765f20a9050833bc20c5591f26bc80d9a9f8..6d958d6d535deead8326fee08b0537fba1c2f0a0 100644 (file)
@@ -64,7 +64,7 @@ static void gl_font_combo_menu_item_finalize    (GObject                *object)
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glFontComboMenuItem, gl_font_combo_menu_item, GTK_TYPE_MENU_ITEM);
+G_DEFINE_TYPE (glFontComboMenuItem, gl_font_combo_menu_item, GTK_TYPE_MENU_ITEM)
 
 
 /*****************************************************************************/
index 6df363af8251769bfe4c13970e292d600ebd9754..f56d500022563b106b78dd73840c676070bd4d2a 100644 (file)
@@ -82,7 +82,7 @@ static void       font_history_changed_cb     (glFontComboMenu     *this);
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glFontComboMenu, gl_font_combo_menu, GTK_TYPE_MENU);
+G_DEFINE_TYPE (glFontComboMenu, gl_font_combo_menu, GTK_TYPE_MENU)
 
 
 /*****************************************************************************/
index 993089f2e09c7174cbbca47f3358c8443c45123c..3c9480f5965a69c05decd378b87f041aa0b4cb2d 100644 (file)
@@ -81,7 +81,7 @@ menu_selection_done_cb (GtkMenuShell     *object,
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glFontCombo, gl_font_combo, GTK_TYPE_TOGGLE_BUTTON);
+G_DEFINE_TYPE (glFontCombo, gl_font_combo, GTK_TYPE_TOGGLE_BUTTON)
 
 
 /*****************************************************************************/
index 9710f2927a708dc41dd113214bcd454f037b3260..3ae9a8696376152b29a751cb8c908f64f36edb9c 100644 (file)
@@ -65,7 +65,7 @@ static void history_changed_cb                  (glFontHistoryModel  *this);
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glFontHistoryModel, gl_font_history_model, G_TYPE_OBJECT);
+G_DEFINE_TYPE (glFontHistoryModel, gl_font_history_model, G_TYPE_OBJECT)
 
 
 /*****************************************************************************/
index cbdc6d627c8b350a3bf6f8616be371fb703b2427..13d524df478a204729fc463024b1db62fb35eb20 100644 (file)
@@ -72,7 +72,7 @@ static void       draw_sample                 (glFontSample   *this,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glFontSample, gl_font_sample, GTK_TYPE_DRAWING_AREA);
+G_DEFINE_TYPE (glFontSample, gl_font_sample, GTK_TYPE_DRAWING_AREA)
 
 
 /*****************************************************************************/
index 5a709f68e56a819a11fbe23bb40691b436ba645a..9a98187ea3e57427e34356454d46418335c332ae 100644 (file)
@@ -113,7 +113,7 @@ static void     create_alt_msg_path         (cairo_t             *cr,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabelBarcode, gl_label_barcode, GL_TYPE_LABEL_OBJECT);
+G_DEFINE_TYPE (glLabelBarcode, gl_label_barcode, GL_TYPE_LABEL_OBJECT)
 
 
 static void
index c84b0aa8570a5f9c6050f1f4670354c476467fff..fd63e24f762fb600b8c62e8341538e2a33e2a16d 100644 (file)
@@ -88,7 +88,7 @@ static gboolean object_at                 (glLabelObject     *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabelBox, gl_label_box, GL_TYPE_LABEL_OBJECT);
+G_DEFINE_TYPE (glLabelBox, gl_label_box, GL_TYPE_LABEL_OBJECT)
 
 
 static void
index 0d38e3e25a25aeba8c50105a9af8c725798fdc17..5b89f3b8f6fcf6a99717be1ea012d5b6b907f2fb 100644 (file)
@@ -92,7 +92,7 @@ static gboolean object_at                 (glLabelObject     *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabelEllipse, gl_label_ellipse, GL_TYPE_LABEL_OBJECT);
+G_DEFINE_TYPE (glLabelEllipse, gl_label_ellipse, GL_TYPE_LABEL_OBJECT)
 
 
 static void
index 6201e26a4dd74d0ddb4e5b6542e5f826fd776da2..f5e458559ea87149080b91e1e2e91dd8fb37679b 100644 (file)
@@ -100,7 +100,7 @@ static gboolean object_at                (glLabelObject     *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabelImage, gl_label_image, GL_TYPE_LABEL_OBJECT);
+G_DEFINE_TYPE (glLabelImage, gl_label_image, GL_TYPE_LABEL_OBJECT)
 
 
 static void
index e8b66e95c819e9494aba30c4398376640b3334bc..c88e2ed352ca4396fe1155f979ca4aea044e5fb9 100644 (file)
@@ -81,7 +81,7 @@ static gboolean object_at                 (glLabelObject     *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabelLine, gl_label_line, GL_TYPE_LABEL_OBJECT);
+G_DEFINE_TYPE (glLabelLine, gl_label_line, GL_TYPE_LABEL_OBJECT)
 
 
 static void
index 0ccce7cb396ddc6247e1d801b2308686464974ba..92a8ec20862771f6fbc530086f0a93c40fecffcb 100644 (file)
@@ -102,7 +102,7 @@ static void     set_size                  (glLabelObject      *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabelObject, gl_label_object, G_TYPE_OBJECT);
+G_DEFINE_TYPE (glLabelObject, gl_label_object, G_TYPE_OBJECT)
 
 
 static void
index 859641a8a6605005e6683ca4f0de227facbaf537..8e898a576cc99d0a78af9075d25e9853de16092d 100644 (file)
@@ -51,7 +51,7 @@ typedef enum {
         GL_LABEL_OBJECT_HANDLE_SE,
         GL_LABEL_OBJECT_HANDLE_SW,
         GL_LABEL_OBJECT_HANDLE_P1,
-        GL_LABEL_OBJECT_HANDLE_P2,
+        GL_LABEL_OBJECT_HANDLE_P2
 } glLabelObjectHandle;
 
 
index 403c7df49fe88bce8667074ec5ed1628ed0a402a..d9146c420aaa35c413ccd1c0dd5c01884a2ebc2b 100644 (file)
@@ -179,7 +179,7 @@ static void            draw_handles                (glLabelObject    *object,
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabelText, gl_label_text, GL_TYPE_LABEL_OBJECT);
+G_DEFINE_TYPE (glLabelText, gl_label_text, GL_TYPE_LABEL_OBJECT)
 
 
 /*****************************************************************************/
index 2fb3c7f68d97de8bdd8579981871ae5c70cd201e..efa117f0b8a33c3920f94c9d3661fc1d5993e622 100644 (file)
@@ -189,7 +189,7 @@ static void   state_restore        (State            *state,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glLabel, gl_label, G_TYPE_OBJECT);
+G_DEFINE_TYPE (glLabel, gl_label, G_TYPE_OBJECT)
 
 
 static void
index ded93194ed6e95696fe9895eb602b81e71d2024d..11ecda00ac51413d0d3101c3b2088cff6025824b 100644 (file)
@@ -160,7 +160,7 @@ static void   load_search_all_list       (glMediaSelect          *this,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glMediaSelect, gl_media_select, GTK_TYPE_VBOX);
+G_DEFINE_TYPE (glMediaSelect, gl_media_select, GTK_TYPE_VBOX)
 
 
 static void
@@ -827,7 +827,7 @@ gl_media_select_set_name (glMediaSelect *this,
               flag = gtk_tree_model_iter_next(model, &iter) )
         {
                 gtk_tree_model_get (model, &iter, NAME_COLUMN, &name_i, -1); 
-                if (strcasecmp(name, name_i) == 0)
+                if (lgl_str_utf8_casecmp(name, name_i) == 0)
                 {
                         gtk_tree_selection_select_iter (selection, &iter);
                         path = gtk_tree_model_get_path (model, &iter);
index aea860193004b7ee5c94afadcb7ad200d34e017b..bd1448338f94bc469599340e4952d162dd51add9 100644 (file)
@@ -58,7 +58,7 @@ enum {
 
 enum {
         ARG_0,
-        ARG_QUERY,
+        ARG_QUERY
 };
 
 
@@ -97,7 +97,7 @@ static void           free_field_list                    (GList *fields);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glMergeEvolution, gl_merge_evolution, GL_TYPE_MERGE);
+G_DEFINE_TYPE (glMergeEvolution, gl_merge_evolution, GL_TYPE_MERGE)
 
 static void
 gl_merge_evolution_class_init (glMergeEvolutionClass *class)
@@ -271,26 +271,26 @@ gl_merge_evolution_get_primary_key (const glMerge *merge)
  */
 static gint sort_contact_by_file_as(gconstpointer *a, gconstpointer *b)
 {
-  /* 
-   * Returns :         negative value if a < b; zero if a = b; positive value if a > b 
-   */
+        /*
+         * Returns :   negative value if a < b; zero if a = b; positive value if a > b 
+         */
 
-  // Check and cast a and b to EContact
-  EContact *contact_a = E_CONTACT(a);
-  EContact *contact_b = E_CONTACT(b);
+        /* Check and cast a and b to EContact */
+        EContact *contact_a = E_CONTACT(a);
+        EContact *contact_b = E_CONTACT(b);
 
-  // Extract file_as for each contact and compare...
-  gchar *a_file_as = e_contact_get (contact_a, E_CONTACT_FILE_AS);
-  gchar *b_file_as = e_contact_get (contact_b, E_CONTACT_FILE_AS);
-  gint res = lgl_str_utf8_casecmp(a_file_as, b_file_as);
+        /* Extract file_as for each contact and compare... */
+        gchar *a_file_as = e_contact_get (contact_a, E_CONTACT_FILE_AS);
+        gchar *b_file_as = e_contact_get (contact_b, E_CONTACT_FILE_AS);
+        gint res = lgl_str_utf8_casecmp(a_file_as, b_file_as);
 
-  gl_debug(DEBUG_MERGE, "Sort comparing contacts '%s' and '%s' = %d", a_file_as, b_file_as, res);
+        gl_debug(DEBUG_MERGE, "Sort comparing contacts '%s' and '%s' = %d", a_file_as, b_file_as, res);
 
-  // free file_as strings created earlier....
-  g_free (a_file_as);
-  g_free (b_file_as);
+        /* free file_as strings created earlier.... */
+        g_free (a_file_as);
+        g_free (b_file_as);
 
-  return res;
+        return res;
 }
 
 
@@ -505,11 +505,11 @@ gl_merge_evolution_copy (glMerge       *dst_merge,
 {
         GList *src_iter, *dst_iter;
 
-        gl_debug (DEBUG_MERGE, "BEGIN");
-
         glMergeEvolution *dst_merge_evolution;
         glMergeEvolution *src_merge_evolution;
 
+        gl_debug (DEBUG_MERGE, "BEGIN");
+
         dst_merge_evolution = GL_MERGE_EVOLUTION (dst_merge);
         src_merge_evolution = GL_MERGE_EVOLUTION (src_merge);
 
index eac35a552531bdfe1be013b39b0098b76d196c52..064223b055e849a0186c7a74e2721f15e6e07c6f 100644 (file)
@@ -117,7 +117,7 @@ static void unselect_all_button_clicked_cb        (GtkWidget
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glMergePropertiesDialog, gl_merge_properties_dialog, GTK_TYPE_DIALOG);
+G_DEFINE_TYPE (glMergePropertiesDialog, gl_merge_properties_dialog, GTK_TYPE_DIALOG)
 
 
 /*****************************************************************************/
index c4c0a6c67b96ee83f5462a764d39b644e639d1bb..a702c3d57cb098adbf967da869948e023eefdf83 100644 (file)
@@ -51,7 +51,7 @@ enum {
 enum {
        ARG_0,
        ARG_DELIM,
-       ARG_LINE1_HAS_KEYS,
+       ARG_LINE1_HAS_KEYS
 };
 
 
@@ -98,7 +98,7 @@ static void           free_fields                   (GList           **fields);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glMergeText, gl_merge_text, GL_TYPE_MERGE);
+G_DEFINE_TYPE (glMergeText, gl_merge_text, GL_TYPE_MERGE)
 
 
 static void
index 253bb89711c2645249d8edab6afd54ae692d1922..da1deff300b7713b2a876fadf009eb8bcf3f53b1 100644 (file)
@@ -48,7 +48,7 @@ enum {
 };
 
 enum {
-        ARG_0,
+        ARG_0
 };
 
 
@@ -86,7 +86,7 @@ static char *         parse_next_vcard               (FILE             *fp);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glMergeVCard, gl_merge_vcard, GL_TYPE_MERGE);
+G_DEFINE_TYPE (glMergeVCard, gl_merge_vcard, GL_TYPE_MERGE)
 
 
 static void
@@ -152,11 +152,10 @@ gl_merge_vcard_set_property (GObject      *object,
                              const GValue *value,
                              GParamSpec   *pspec)
 {
-        glMergeVCard *merge_vcard;
+        switch (param_id) {
 
-        merge_vcard = GL_MERGE_VCARD (object);
+        /* Currently no vcard specific properties. */
 
-        switch (param_id) {
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
                 break;
@@ -173,11 +172,10 @@ gl_merge_vcard_get_property (GObject     *object,
                              GValue      *value,
                              GParamSpec  *pspec)
 {
-        glMergeVCard *merge_vcard;
+        switch (param_id) {
 
-        merge_vcard = GL_MERGE_VCARD (object);
+        /* Currently no vcard specific properties. */
 
-        switch (param_id) {
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
                 break;
@@ -192,14 +190,11 @@ gl_merge_vcard_get_property (GObject     *object,
 static GList *
 gl_merge_vcard_get_key_list (const glMerge *merge)
 {
-        glMergeVCard   *merge_vcard;
         GList          *key_list = NULL;
         EContactField   field_id;
         
         gl_debug (DEBUG_MERGE, "BEGIN");
 
-        merge_vcard = GL_MERGE_VCARD (merge);
-
         for ( field_id = E_CONTACT_FIELD_FIRST; field_id <= E_CONTACT_LAST_SIMPLE_STRING; field_id++ )
         {
                 key_list = g_list_append (key_list, g_strdup (e_contact_pretty_name (field_id)));
@@ -324,11 +319,7 @@ static void
 gl_merge_vcard_copy (glMerge       *dst_merge,
                      const glMerge *src_merge)
 {
-        glMergeVCard *dst_merge_vcard;
-        glMergeVCard *src_merge_vcard;
-
-        dst_merge_vcard = GL_MERGE_VCARD (dst_merge);
-        src_merge_vcard = GL_MERGE_VCARD (src_merge);
+        /* Currently nothing to copy. */
 }
 
 
index 18379a05167c3f629e6d2de9d2aa16b232fbe007..7076c134a44e5e17452acbbbeeff227c8d34bea1 100644 (file)
@@ -226,7 +226,7 @@ gl_merge_description_to_name (gchar *description)
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glMerge, gl_merge, G_TYPE_OBJECT);
+G_DEFINE_TYPE (glMerge, gl_merge, G_TYPE_OBJECT)
 
 static void
 gl_merge_class_init (glMergeClass *class)
index 23233ee7a782d8892ed7448ccb46ec690239739a..ecaf0ff257a65683ab724ab7915b097d28643c12 100644 (file)
@@ -27,7 +27,7 @@ G_BEGIN_DECLS
 
 typedef enum {
        GL_MERGE_SRC_IS_FIXED,
-       GL_MERGE_SRC_IS_FILE,
+       GL_MERGE_SRC_IS_FILE
 } glMergeSrcType;
 
 typedef struct {
index 507afacb575658e5844c4ab9afba1540f52eca46..376082181be56628746f4ee55a1cb010887b1a9d 100644 (file)
@@ -60,7 +60,7 @@ static void       gl_message_bar_construct      (glMessageBar          *this,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glMessageBar, gl_message_bar, GTK_TYPE_INFO_BAR);
+G_DEFINE_TYPE (glMessageBar, gl_message_bar, GTK_TYPE_INFO_BAR)
 
 
 /*****************************************************************************/
index ad7565e83d4e2c0f89a57495b1faf9f41f1e1139..72f6f49decb6f6cce20ec209513e1d28985ff607 100644 (file)
@@ -73,7 +73,7 @@ static void       draw_preview                   (glMiniLabelPreview   *this,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glMiniLabelPreview, gl_mini_label_preview, GTK_TYPE_DRAWING_AREA);
+G_DEFINE_TYPE (glMiniLabelPreview, gl_mini_label_preview, GTK_TYPE_DRAWING_AREA)
 
 
 /*****************************************************************************/
index 3ea0956d6b0f786a26e8d7a6f44e34b6c5dd6f30..dc92d6e4b7a8ab64d71981bcded5fb2c32e5ddc7 100644 (file)
@@ -164,7 +164,7 @@ static gdouble  set_transform_and_get_scale    (glMiniPreview          *this,
 /****************************************************************************/
 /* Object infrastructure.                                                   */
 /****************************************************************************/
-G_DEFINE_TYPE (glMiniPreview, gl_mini_preview, GTK_TYPE_EVENT_BOX);
+G_DEFINE_TYPE (glMiniPreview, gl_mini_preview, GTK_TYPE_EVENT_BOX)
 
 
 /*****************************************************************************/
@@ -1077,7 +1077,7 @@ draw_arrow  (glMiniPreview      *this,
                 cairo_scale (cr, 1, -1);
                 if ( this->priv->rotate_flag )
                 {
-                        cairo_rotate (cr, -M_PI/2.0);
+                        cairo_rotate (cr, -G_PI/2.0);
                 }
 
                 cairo_new_path (cr);
index 9ba06853aca6ff9b61503e56d61f4bbcb2a59173..be122b5ab7a4f4d833c60f74f4fc42d45b793fff 100644 (file)
@@ -117,7 +117,7 @@ static void       set_info                            (glNewLabelDialog  *this,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glNewLabelDialog, gl_new_label_dialog, GTK_TYPE_ASSISTANT);
+G_DEFINE_TYPE (glNewLabelDialog, gl_new_label_dialog, GTK_TYPE_ASSISTANT)
 
 
 /*****************************************************************************/
index b258f4e8b47605f7735d3d65ba04e536d15982f9..68cfa4930b9944c1d0c755704e9f14112aa7860a 100644 (file)
@@ -95,7 +95,7 @@ static void object_moved_cb                     (glLabelObject        *object,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glObjectEditor, gl_object_editor, GTK_TYPE_VBOX);
+G_DEFINE_TYPE (glObjectEditor, gl_object_editor, GTK_TYPE_VBOX)
 
 
 static void
index dd3bcca152165a7c2988236c0fd0ecd89fbd0f47..2e16074441996c3fcec814628f75a0dfe1b4ed81 100644 (file)
@@ -119,7 +119,7 @@ static void update_prefs_from_object_page (glPrefsDialog      *dialog);
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glPrefsDialog, gl_prefs_dialog, GTK_TYPE_DIALOG);
+G_DEFINE_TYPE (glPrefsDialog, gl_prefs_dialog, GTK_TYPE_DIALOG)
 
 
 static void
@@ -529,11 +529,11 @@ update_object_page_from_prefs (glPrefsDialog *dialog)
                                   gl_prefs_model_get_default_text_color (gl_prefs));
 
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_left_toggle),
-                                 (gl_prefs_model_get_default_text_alignment (gl_prefs) == GTK_JUSTIFY_LEFT));
+                                 (gl_prefs_model_get_default_text_alignment (gl_prefs) == PANGO_ALIGN_LEFT));
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_center_toggle),
-                                 (gl_prefs_model_get_default_text_alignment (gl_prefs) == GTK_JUSTIFY_CENTER));
+                                 (gl_prefs_model_get_default_text_alignment (gl_prefs) == PANGO_ALIGN_CENTER));
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->priv->text_right_toggle),
-                                 (gl_prefs_model_get_default_text_alignment (gl_prefs) == GTK_JUSTIFY_RIGHT));
+                                 (gl_prefs_model_get_default_text_alignment (gl_prefs) == PANGO_ALIGN_RIGHT));
 
         gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->priv->text_line_spacing_spin),
                                    gl_prefs_model_get_default_text_line_spacing (gl_prefs));
index 167d3271b42aa79981d6142600672583306836b8..b9232a797228b08de33b2568146c0a4275cd225a 100644 (file)
@@ -83,7 +83,7 @@ static void           gsettings_changed_cb         (glPrefsModel        *prefs_m
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glPrefsModel, gl_prefs_model, G_TYPE_OBJECT);
+G_DEFINE_TYPE (glPrefsModel, gl_prefs_model, G_TYPE_OBJECT)
 
 
 static void
@@ -201,7 +201,7 @@ gl_prefs_model_get_units (glPrefsModel     *this)
         string = g_settings_get_string (this->priv->locale, "units");
         
         /* If not set, make educated guess about locale default. */
-        if ( !string || !strlen(string) )
+        if ( !string || (*string == '\0') )
         {
                 pgsize = gtk_paper_size_get_default ();
                 if ( strcmp (pgsize, GTK_PAPER_NAME_LETTER) == 0 )
@@ -261,7 +261,7 @@ gl_prefs_model_get_default_page_size (glPrefsModel     *this)
         page_size = g_settings_get_string (this->priv->locale, "default-page-size");
 
         /* If not set, make educated guess about locale default. */
-        if ( !page_size || !strlen(page_size) )
+        if ( !page_size || (*page_size == '\0') )
         {
                 pgsize = gtk_paper_size_get_default ();
                 if ( strcmp (pgsize, GTK_PAPER_NAME_LETTER) == 0 )
index 412bf17a9815a5f165c1fa2d664cccd161b4f317..fdcc45a74e367d7ea527de18e172361413151ef3 100644 (file)
@@ -69,8 +69,6 @@ struct _glPrintOpDialogPrivate {
 
         GtkWidget  *preview;
 
-        gboolean   force_outline_flag;
-
         gint       labels_per_sheet;
         gboolean   merge_flag;
         gint       n_records;
@@ -135,7 +133,7 @@ static void     option_toggled_cb             (GtkToggleButton   *togglebutton,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glPrintOpDialog, gl_print_op_dialog, GL_TYPE_PRINT_OP);
+G_DEFINE_TYPE (glPrintOpDialog, gl_print_op_dialog, GL_TYPE_PRINT_OP)
 
 
 static void
index 71113adee92f1d9992c864320a01af0cc1b839bb..e7a964801c295f407daa38f29c7e73a9fdc0469c 100644 (file)
@@ -106,7 +106,7 @@ static void     draw_page_cb                  (GtkPrintOperation *operation,
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glPrintOp, gl_print_op, GTK_TYPE_PRINT_OPERATION);
+G_DEFINE_TYPE (glPrintOp, gl_print_op, GTK_TYPE_PRINT_OPERATION)
 
 
 static void
index be58b10ee38de1ef7698b07f8999812012b3e68d..d2a3b66f3682d7bc05f18d68c6bb111203e48af3 100644 (file)
@@ -499,13 +499,10 @@ print_label (PrintInfo     *pi,
             gboolean       outline_flag,
             gboolean       reverse_flag)
 {
-       const lglTemplateFrame *frame;
        gdouble                 width, height;
 
        gl_debug (DEBUG_PRINT, "START");
 
-        frame = (lglTemplateFrame *)pi->template->frames->data;
-
        gl_label_get_size (label, &width, &height);
 
        cairo_save (pi->cr);
@@ -523,7 +520,7 @@ print_label (PrintInfo     *pi,
         /* Special transformations. */
        if (pi->rotate_flag) {
                gl_debug (DEBUG_PRINT, "Rotate flag set");
-               cairo_rotate (pi->cr, M_PI/2.0);
+               cairo_rotate (pi->cr, G_PI/2.0);
                cairo_translate (pi->cr, 0.0, -height);
        }
        if ( reverse_flag ) {
index 936bfb1d0c602930cb0492dea1986637b4c87f5e..2719958eca2fbfd8890e11aee58dd701b1010256 100644 (file)
@@ -292,7 +292,7 @@ static lglTemplate *build_template                (glTemplateDesigner      *dial
 /*****************************************************************************/
 /* Boilerplate object stuff.                                                 */
 /*****************************************************************************/
-G_DEFINE_TYPE (glTemplateDesigner, gl_template_designer, GTK_TYPE_ASSISTANT);
+G_DEFINE_TYPE (glTemplateDesigner, gl_template_designer, GTK_TYPE_ASSISTANT)
 
 
 static void
index 7c1cc473c1128e9e282d6bed6858bcf2702fd16a..9105a8ff751a87fbfd5a9e2db87a3b5f79c5c111 100644 (file)
@@ -64,7 +64,7 @@ static void history_changed_cb                 (glTemplateHistoryModel  *this);
 /*****************************************************************************/
 /* Object infrastructure.                                                    */
 /*****************************************************************************/
-G_DEFINE_TYPE (glTemplateHistoryModel, gl_template_history_model, G_TYPE_OBJECT);
+G_DEFINE_TYPE (glTemplateHistoryModel, gl_template_history_model, G_TYPE_OBJECT)
 
 
 /*****************************************************************************/
index 927dae2f76a8ae2f053cf1e132fe2128c965eb86..4e26f5c856a9cf92354766e81df8e2452e093c76 100644 (file)
@@ -148,7 +148,7 @@ static void     set_line_width_items_sensitive   (glUIPropertyBar      *this,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glUIPropertyBar, gl_ui_property_bar, GTK_TYPE_HBOX);
+G_DEFINE_TYPE (glUIPropertyBar, gl_ui_property_bar, GTK_TYPE_HBOX)
 
 
 static void
@@ -860,14 +860,12 @@ font_family_changed_cb (GtkComboBox     *combo,
        gl_debug (DEBUG_PROPERTY_BAR, "START");
 
        font_family = gl_font_combo_get_family (GL_FONT_COMBO (combo));
-       if ( strlen(font_family) )
+       if ( *font_family != '\0' )
         {
-               gl_label_set_selection_font_family (this->priv->label,
-                                                    font_family);
-               gl_label_set_default_font_family   (this->priv->label,
-                                                    font_family);
-       }
-       g_free (font_family);
+                gl_label_set_selection_font_family (this->priv->label, font_family);
+                gl_label_set_default_font_family   (this->priv->label, font_family);
+        }
+        g_free (font_family);
 
        gl_debug (DEBUG_PROPERTY_BAR, "END");
 
index ad0cba5c1591ca54d06830ff1b9714e94f587b12..d12f8121319f4d41febe817be5fda01387580980 100644 (file)
@@ -63,7 +63,7 @@ static void     gl_ui_sidebar_construct     (glUISidebar          *sidebar);
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glUISidebar, gl_ui_sidebar, GTK_TYPE_VBOX);
+G_DEFINE_TYPE (glUISidebar, gl_ui_sidebar, GTK_TYPE_VBOX)
 
 
 static void
index b1550b4be3339c4e31a7d76b949a5582715f4dff..020713db46b37e602878c048eb3930319fe8a343 100644 (file)
@@ -193,7 +193,7 @@ static void       resize_event                    (glView            *view,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glView, gl_view, GTK_TYPE_VBOX);
+G_DEFINE_TYPE (glView, gl_view, GTK_TYPE_VBOX)
 
 
 static void
@@ -867,7 +867,7 @@ draw_markup_layer (glView  *view,
                 if (rotate_flag)
                 {
                         lgl_template_frame_get_size (frame, &width, &height);
-                        cairo_rotate (cr, -M_PI/2.0);
+                        cairo_rotate (cr, -G_PI/2.0);
                         cairo_translate (cr, -width, 0.0);
                 }
 
index 8d6ae7ce41c36838d406d5cd0b21fe6b608776c8..a23efa7bbe2bba0ec4e9f6f0bdaacd1bbde6189f 100644 (file)
@@ -35,7 +35,7 @@ typedef enum {
         GL_VIEW_ARROW_SELECT_REGION,
         GL_VIEW_ARROW_MOVE,
         GL_VIEW_ARROW_RESIZE,
-        GL_VIEW_CREATE_DRAG,
+        GL_VIEW_CREATE_DRAG
 } glViewState;
 
 #define GL_TYPE_VIEW            (gl_view_get_type ())
index 565f8bc4a1602328ae42d5545f83038d136d3483..e3cd8c01ae85c1bc58fc3d732b16d97bb356ac5b 100644 (file)
@@ -49,17 +49,10 @@ static gboolean  gl_wdgt_chain_button_draw_lines       (GtkWidget          *widg
 
 static const gchar *gl_wdgt_chain_stock_items[] =
 {
-#if 0
-  "glabels-hchain",
-  "glabels-hchain-broken",
-  "glabels-vchain",
-  "glabels-vchain-broken"
-#else
   "changes-prevent",
   "changes-allow",
   "changes-prevent",
-  "changes-allow",
-#endif
+  "changes-allow"
 };
 
 
@@ -67,7 +60,7 @@ static guint gl_wdgt_chain_button_signals[LAST_SIGNAL] = { 0 };
 
 
 
-G_DEFINE_TYPE (glWdgtChainButton, gl_wdgt_chain_button, GTK_TYPE_TABLE);
+G_DEFINE_TYPE (glWdgtChainButton, gl_wdgt_chain_button, GTK_TYPE_TABLE)
 
 
 static void
index 98df0c93649f93e5f52c291a95064909cb4c7035..f2883dc04b7fc6ebe20b70874122dfd139a99e20 100644 (file)
@@ -112,7 +112,7 @@ static void     label_changed_cb       (glLabel       *label,
 /****************************************************************************/
 /* Boilerplate Object stuff.                                                */
 /****************************************************************************/
-G_DEFINE_TYPE (glWindow, gl_window, GTK_TYPE_WINDOW);
+G_DEFINE_TYPE (glWindow, gl_window, GTK_TYPE_WINDOW)
 
 
 static void
index 21730c51bd989f0c20f4e91245be7586ae8344e0..6429d4b82dd2d019ed7d4ce3a451d2eb13d9e997 100644 (file)
@@ -30,7 +30,7 @@ typedef enum {
        XML_LABEL_UNKNOWN_MEDIA = 1,
        XML_LABEL_OK = 0,
        XML_LABEL_ERROR_OPEN_PARSE = -10,
-       XML_LABEL_ERROR_SAVE_FILE = -20,
+       XML_LABEL_ERROR_SAVE_FILE = -20
 } glXMLLabelStatus;