const gchar *primary_text,
const gchar *secondary_text)
{
- GtkWidget *dialog, *hbox, *image, *label;
- gchar *label_text;
- const gchar *stock_id = NULL;
- GtkStockItem item;
+ GtkWidget *dialog, *hbox, *image, *label;
+ gchar *label_text;
+ const gchar *stock_id = NULL;
+ GtkStockItem item;
/* Create bare dialog */
dialog = gtk_dialog_new_with_buttons ("", parent, flags, NULL);
#include <gtk/gtk.h>
-extern GtkWidget* gl_alert_dialog_new (GtkWindow *parent,
- GtkDialogFlags flags,
- GtkMessageType type,
- GtkButtonsType buttons,
- const gchar *primary_text,
- const gchar *secondary_text);
+G_BEGIN_DECLS
+
+GtkWidget* gl_alert_dialog_new (GtkWindow *parent,
+ GtkDialogFlags flags,
+ GtkMessageType type,
+ GtkButtonsType buttons,
+ const gchar *primary_text,
+ const gchar *secondary_text);
+
+G_END_DECLS
#endif /* __ALERT_H__ */
#include "bc.h"
#include "bc-gnubarcode.h"
-
#include "barcode.h"
#include "debug.h"
+/*========================================================*/
+/* Private macros and constants. */
+/*========================================================*/
#define SHRINK_AMOUNT 0.15 /* shrink bars to account for ink spreading */
#define FONT_SCALE 0.95 /* Shrink fonts just a hair */
+/*===========================================*/
+/* Local function prototypes */
+/*===========================================*/
static glBarcode *render_pass1 (struct Barcode_Item *bci,
- gboolean text_flag,
- gdouble scale);
+ gboolean text_flag,
+ gdouble scale);
\f
/*****************************************************************************/
/* Generate intermediate representation of barcode. */
/*****************************************************************************/
glBarcode *
-gl_barcode_gnubarcode_new (glBarcodeStyle style,
- gboolean text_flag,
- gdouble scale,
- gchar * digits)
+gl_barcode_gnubarcode_new (glBarcodeStyle style,
+ gboolean text_flag,
+ gdouble scale,
+ gchar *digits)
{
- glBarcode *gbc;
+ glBarcode *gbc;
struct Barcode_Item *bci;
- gint flags;
+ gint flags;
bci = Barcode_Create (digits);
*--------------------------------------------------------------------------*/
static glBarcode *
render_pass1 (struct Barcode_Item *bci,
- gboolean text_flag,
- gdouble scale)
+ gboolean text_flag,
+ gdouble scale)
{
- glBarcode *gbc;
+ glBarcode *gbc;
glBarcodeLine *line;
glBarcodeChar *bchar;
- gdouble x;
- gint i, j, barlen;
- gdouble f1, f2;
- gint mode = '-'; /* text below bars */
- gdouble x0, y0, yr;
- guchar *p, c;
+ gdouble x;
+ gint i, j, barlen;
+ gdouble f1, f2;
+ gint mode = '-'; /* text below bars */
+ gdouble x0, y0, yr;
+ guchar *p, c;
/* First calculate barlen */
barlen = bci->partial[0] - '0';
#include "bc.h"
-extern glBarcode *gl_barcode_gnubarcode_new (glBarcodeStyle style,
- gboolean text_flag,
- gdouble scale,
- gchar * digits);
+G_BEGIN_DECLS
-#endif
+glBarcode *gl_barcode_gnubarcode_new (glBarcodeStyle style,
+ gboolean text_flag,
+ gdouble scale,
+ gchar *digits);
+
+G_END_DECLS
+
+#endif /* __BC_GNUBARCODE_H__ */
#include "debug.h"
+/*========================================================*/
+/* Private macros and constants. */
+/*========================================================*/
+#define POSTNET_BAR_WIDTH 1.25
+#define POSTNET_FULLBAR_HEIGHT 9.00
+#define POSTNET_HALFBAR_HEIGHT 3.50
+#define POSTNET_BAR_PITCH 3.25
+#define POSTNET_HORIZ_MARGIN 9.00
+#define POSTNET_VERT_MARGIN 3.00
+
+/*===========================================*/
+/* Private globals */
+/*===========================================*/
static gchar *symbols[] = {
/* 0 */ "11000",
/* 1 */ "00011",
static gchar *frame_symbol = "1";
-#define POSTNET_BAR_WIDTH 1.25
-#define POSTNET_FULLBAR_HEIGHT 9.00
-#define POSTNET_HALFBAR_HEIGHT 3.50
-#define POSTNET_BAR_PITCH 3.25
-#define POSTNET_HORIZ_MARGIN 9.00
-#define POSTNET_VERT_MARGIN 3.00
+/*===========================================*/
+/* Local function prototypes */
+/*===========================================*/
+static gchar *postnet_code (gchar *digits);
-static gchar *postnet_code (gchar * digits);
\f
/****************************************************************************/
/* Generate list of lines that form the barcode for the given digits. */
/****************************************************************************/
glBarcode *
-gl_barcode_postnet_new (gchar * digits)
+gl_barcode_postnet_new (gchar *digits)
{
- gchar *code, *p;
- glBarcode *gbc;
+ gchar *code, *p;
+ glBarcode *gbc;
glBarcodeLine *line;
- gdouble x;
+ gdouble x;
gbc = g_new0 (glBarcode, 1);
/* PRIVATE. Generate string of symbols, representing barcode. */
/*--------------------------------------------------------------------------*/
static gchar *
-postnet_code (gchar * digits)
+postnet_code (gchar *digits)
{
- gchar *p;
- gint len;
- gint d, sum;
+ gchar *p;
+ gint len;
+ gint d, sum;
GString *code;
- gchar *ret;
+ gchar *ret;
/* Left frame bar */
code = g_string_new (frame_symbol);
#ifndef __BC_POSTNET_H__
#define __BC_POSTNET_H__
-#include <glib.h>
+#include "bc.h"
-glBarcode *gl_barcode_postnet_new (gchar * digits);
+G_BEGIN_DECLS
-#endif
+glBarcode *gl_barcode_postnet_new (gchar *digits);
+
+G_END_DECLS
+
+#endif /* __BC_POSTNET_H__ */
/* Call appropriate barcode backend to create barcode in intermediate format.*/
/*****************************************************************************/
glBarcode *
-gl_barcode_new (glBarcodeStyle style,
- gboolean text_flag,
- gdouble scale,
- gchar * digits)
+gl_barcode_new (glBarcodeStyle style,
+ gboolean text_flag,
+ gdouble scale,
+ gchar *digits)
{
glBarcode *gbc;
default:
/* Use the GNU barcode library backend */
- gbc = gl_barcode_gnubarcode_new (style, text_flag, scale, digits);
+ gbc = gl_barcode_gnubarcode_new (style,
+ text_flag,
+ scale,
+ digits);
break;
}
/* Free previously created barcode. */
/*****************************************************************************/
void
-gl_barcode_free (glBarcode ** gbc)
+gl_barcode_free (glBarcode **gbc)
{
GList *p;
/* Convert text to style. */
/*****************************************************************************/
glBarcodeStyle
-gl_barcode_text_to_style (const gchar * text)
+gl_barcode_text_to_style (const gchar *text)
{
if (g_strcasecmp (text, "POSTNET") == 0) {
#include <glib.h>
+G_BEGIN_DECLS
+
typedef enum {
GL_BARCODE_STYLE_POSTNET,
GL_BARCODE_STYLE_EAN,
#define GL_BARCODE_FONT_FAMILY "Helvetica"
#define GL_BARCODE_FONT_WEIGHT GNOME_FONT_BOOK
-extern glBarcode *gl_barcode_new (glBarcodeStyle style,
- gboolean text_flag,
- gdouble scale,
- gchar * digits);
-extern void
- gl_barcode_free (glBarcode ** bc);
+glBarcode *gl_barcode_new (glBarcodeStyle style,
+ gboolean text_flag,
+ gdouble scale,
+ gchar *digits);
+
+void gl_barcode_free (glBarcode **bc);
+
+gchar *gl_barcode_default_digits (glBarcodeStyle style);
+
+const gchar *gl_barcode_style_to_text (glBarcodeStyle style);
+glBarcodeStyle gl_barcode_text_to_style (const gchar *text);
+
+G_END_DECLS
-extern gchar *gl_barcode_default_digits (glBarcodeStyle style);
-extern const gchar *gl_barcode_style_to_text (glBarcodeStyle style);
-extern glBarcodeStyle gl_barcode_text_to_style (const gchar * text);
+#endif /* __BC_H__ */
-#endif
* Copyright (C) 1998-1999 The Free Software Foundation
* Copyright (C) 2000-2002 Ximian Inc.
*
- */
-
-/*
- * TODO:
- * - Clipping
+ *
+ * Modified by Jim Evins <evins@snaught.com> for gLabels.
*/
#include <config.h>
*
* Authors: Federico Mena <federico@nuclecu.unam.mx>
* Raph Levien <raph@acm.org>
+ *
+ * Modified by Jim Evins <evins@snaught.com> for gLabels.
*/
#include <glib.h>
/* Apply given opacity to given color. */
/*****************************************************************************/
guint
-gl_color_set_opacity (guint color,
+gl_color_set_opacity (guint color,
gdouble opacity)
{
guint new_color;
#include <libgnomecanvas/gnome-canvas.h>
+G_BEGIN_DECLS
+
#define GL_COLOR(r,g,b) GNOME_CANVAS_COLOR(r,g,b)
#define GL_COLOR_A(r,g,b,a) GNOME_CANVAS_COLOR_A(r,g,b,a)
#define GL_COLOR_F_BLUE(x) ( (((x)>>8) & 0xff) / 255.0 )
#define GL_COLOR_F_ALPHA(x) ( ( (x) & 0xff) / 255.0 )
-extern guint gl_color_set_opacity (guint color, gdouble opacity);
+guint gl_color_set_opacity (guint color, gdouble opacity);
+G_END_DECLS
#endif /* __COLOR_H__ */
/****************************************************************************/
void
gl_cmd_file_new (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
gl_debug (DEBUG_COMMANDS, "verbname: %s", verbname);
/****************************************************************************/
void
gl_cmd_file_open (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
BonoboMDIChild *active_child;
/****************************************************************************/
void
gl_cmd_file_save (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glMDIChild *active_child;
/****************************************************************************/
void
gl_cmd_file_save_as (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glMDIChild *active_child;
/****************************************************************************/
void
gl_cmd_file_print (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
- glLabel *label = glabels_get_active_label ();
+ glLabel *label = glabels_get_active_label ();
BonoboWindow *win = glabels_get_active_window ();
gl_debug (DEBUG_COMMANDS, "");
/****************************************************************************/
void
gl_cmd_file_close (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
GtkWidget *active_view;
gl_debug (DEBUG_COMMANDS, "");
- active_view = bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi));
+ active_view = GTK_WIDGET (glabels_get_active_view ());
if (active_view == NULL)
return;
/****************************************************************************/
void
gl_cmd_file_close_all (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
gl_debug (DEBUG_COMMANDS, "");
/****************************************************************************/
void
gl_cmd_file_exit (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
gl_debug (DEBUG_COMMANDS, "");
/****************************************************************************/
void
gl_cmd_edit_cut (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glView* active_view;
- active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi)));
+ active_view = glabels_get_active_view ();
g_return_if_fail (active_view);
gl_view_cut (active_view);
/****************************************************************************/
void
gl_cmd_edit_copy (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glView* active_view;
- active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi)));
+ active_view = glabels_get_active_view ();
g_return_if_fail (active_view);
gl_view_copy (active_view);
/****************************************************************************/
void
gl_cmd_edit_paste (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glView* active_view;
- active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi)));
+ active_view = glabels_get_active_view ();
g_return_if_fail (active_view);
gl_view_paste (active_view);
/****************************************************************************/
void
gl_cmd_edit_delete (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glView* active_view;
- active_view = GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI (glabels_mdi)));
+ active_view = glabels_get_active_view ();
g_return_if_fail (active_view);
gl_view_delete_selection (active_view);
/****************************************************************************/
void
gl_cmd_edit_select_all (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glView* active_view;
- active_view =
- GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI(glabels_mdi)));
+ active_view = glabels_get_active_view ();
g_return_if_fail (active_view);
/****************************************************************************/
void
gl_cmd_edit_unselect_all (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
glView* active_view;
- active_view =
- GL_VIEW (bonobo_mdi_get_active_view (BONOBO_MDI(glabels_mdi)));
+ active_view = glabels_get_active_view ();
g_return_if_fail (active_view);
/****************************************************************************/
void
gl_cmd_settings_preferences (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
static GtkWidget *dlg = NULL;
/****************************************************************************/
void
gl_cmd_help_contents (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
GError *error = NULL;
/****************************************************************************/
void
gl_cmd_help_about (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname)
+ gpointer user_data,
+ const gchar *verbname)
{
static GtkWidget *about = NULL;
- GdkPixbuf* pixbuf = NULL;
+ GdkPixbuf *pixbuf = NULL;
gchar *copy_text = "Copyright 2001-2002 Jim Evins";
gchar *about_text =
#include <bonobo/bonobo-ui-component.h>
-extern void gl_cmd_file_new (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+G_BEGIN_DECLS
-extern void gl_cmd_file_open (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_new (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_file_save (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_open (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_file_save_as (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_save (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_file_print (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_save_as (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_file_print_preview (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_print (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_file_close (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_print_preview (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_file_close_all (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_close (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_file_exit (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_file_close_all (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
+void gl_cmd_file_exit (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_edit_undo (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
-extern void gl_cmd_edit_redo (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_edit_undo (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_edit_cut (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_edit_redo (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_edit_copy (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_edit_cut (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_edit_paste (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_edit_copy (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_edit_delete (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_edit_paste (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_edit_select_all (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_edit_delete (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_edit_unselect_all (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_edit_select_all (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
+void gl_cmd_edit_unselect_all (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_settings_preferences (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_settings_preferences (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
-extern void gl_cmd_help_contents (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
-extern void gl_cmd_help_about (BonoboUIComponent *uic,
- gpointer user_data,
- const gchar* verbname);
+void gl_cmd_help_contents (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
+
+void gl_cmd_help_about (BonoboUIComponent *uic,
+ gpointer user_data,
+ const gchar *verbname);
+G_END_DECLS
#endif /* __COMMANDS_H__ */
/* Print debugging information. */
/****************************************************************************/
void
-gl_debug (gint section,
+gl_debug (gint section,
gchar *file,
- gint line,
- gchar* function,
- gchar* format,
+ gint line,
+ gchar *function,
+ gchar *format,
...)
{
- va_list args;
- gchar *msg;
+ va_list args;
+ gchar *msg;
g_return_if_fail (format != NULL);
#ifndef __DEBUG_H__
#define __DEBUG_H__
+G_BEGIN_DECLS
+
typedef enum {
GL_DEBUG_VIEW,
GL_DEBUG_ITEM,
#define DEBUG_MINI_PREVIEW GL_DEBUG_MINI_PREVIEW, __FILE__, __LINE__, __FUNCTION__
#define DEBUG_WDGT GL_DEBUG_WDGT, __FILE__, __LINE__, __FUNCTION__
-extern void gl_debug (gint section, gchar *file,
- gint line, gchar* function, gchar* format, ...);
+void gl_debug (gint section, gchar *file,
+ gint line, gchar* function, gchar* format, ...);
+
+G_END_DECLS
#endif /* __DEBUG_H__ */
/*===========================================*/
/* Saved state for new dialog */
-static gchar *page_size = NULL;
-static gchar *sheet_name = NULL;
+static gchar *page_size = NULL;
+static gchar *sheet_name = NULL;
static gboolean rotate_flag = FALSE;
/* Saved state of file selectors */
/*===========================================*/
/* Local function prototypes. */
/*===========================================*/
-static void create_new_dialog_widgets (GtkDialog *dlg);
-static void new_template_changed (glWdgtMediaSelect *select,
- gpointer data);
-static void new_response (GtkDialog *dlg,
- gint response,
- gpointer user_data);
-static void open_ok (GtkWidget * widget,
- GtkFileSelection * fsel);
-
-static void save_as_ok_cb (GtkWidget * widget, GtkFileSelection * fsel);
-static void save_as_cancel_cb (GtkWidget * widget, GtkFileSelection * fsel);
-static void save_as_destroy_cb (GtkWidget * widget, gboolean * destroy_flag);
+static void create_new_dialog_widgets (GtkDialog *dlg);
+static void new_template_changed (glWdgtMediaSelect *select,
+ gpointer data);
+static void new_response (GtkDialog *dlg,
+ gint response,
+ gpointer user_data);
+static void open_ok (GtkWidget *widget,
+ GtkFileSelection *fsel);
+
+static void save_as_ok_cb (GtkWidget *widget,
+ GtkFileSelection *fsel);
+static void save_as_cancel_cb (GtkWidget *widget,
+ GtkFileSelection *fsel);
+static void save_as_destroy_cb (GtkWidget *widget,
+ gboolean *destroy_flag);
\f
/*****************************************************************************/
void
gl_file_new (void)
{
- GtkWidget *dlg;
+ GtkWidget *dlg;
BonoboWindow *win = glabels_get_active_window ();
gl_debug (DEBUG_FILE, "START");
/* PRIVATE. Create widgets. */
/*---------------------------------------------------------------------------*/
static void
-create_new_dialog_widgets (GtkDialog * dlg)
+create_new_dialog_widgets (GtkDialog *dlg)
{
GtkWidget *wframe, *wvbox, *template_entry, *rotate_sel;
/* PRIVATE. New template changed callback. */
/*---------------------------------------------------------------------------*/
static void
-new_template_changed (glWdgtMediaSelect * select,
- gpointer data)
+new_template_changed (glWdgtMediaSelect *select,
+ gpointer data)
{
glWdgtRotateLabel *rotate_sel = GL_WDGT_ROTATE_LABEL (data);
- gchar *name;
+ gchar *name;
gl_debug (DEBUG_FILE, "START");
name = gl_wdgt_media_select_get_name (GL_WDGT_MEDIA_SELECT (select));
gl_wdgt_rotate_label_set_template_name (GL_WDGT_ROTATE_LABEL (rotate_sel),
- name);
+ name);
g_free (name);
/*---------------------------------------------------------------------------*/
static void
new_response (GtkDialog *dlg,
- gint response,
- gpointer user_data)
+ gint response,
+ gpointer user_data)
{
- GtkWidget *template_entry, *rotate_sel;
+ GtkWidget *template_entry, *rotate_sel;
glMDIChild *new_child = NULL;
- gint ret;
+ gint ret;
gl_debug (DEBUG_FILE, "START");
gl_file_open (glMDIChild *active_child)
{
GtkFileSelection *fsel;
- BonoboWindow *app = glabels_get_active_window ();
+ BonoboWindow *app = glabels_get_active_window ();
gl_debug (DEBUG_FILE, "START");
/* PRIVATE. Open "O.K." button callback. */
/*---------------------------------------------------------------------------*/
static void
-open_ok (GtkWidget * widget,
- GtkFileSelection * fsel)
+open_ok (GtkWidget *widget,
+ GtkFileSelection *fsel)
{
- gchar *filename;
- GtkWidget *dlg;
- glMDIChild *new_child = NULL;
- gint ret;
+ gchar *filename;
+ GtkWidget *dlg;
+ glMDIChild *new_child = NULL;
+ gint ret;
GnomeRecentModel *recent;
gl_debug (DEBUG_FILE, "START");
gl_file_open_real (const gchar *filename,
GtkWindow *win)
{
- gchar *abs_filename;
- glMDIChild *new_child = NULL;
+ gchar *abs_filename;
+ glMDIChild *new_child = NULL;
GnomeRecentModel *recent;
- gint ret;
+ gint ret;
gl_debug (DEBUG_FILE, "START");
gboolean
gl_file_save (glMDIChild *child)
{
- glXMLLabelStatus status;
- glLabel *label = NULL;
- GError *error = NULL;
- gchar *filename = NULL;
+ glXMLLabelStatus status;
+ glLabel *label = NULL;
+ GError *error = NULL;
+ gchar *filename = NULL;
GnomeRecentModel *recent;
gl_debug (DEBUG_FILE, "");
gl_file_save_as (glMDIChild *child)
{
GtkFileSelection *fsel;
- BonoboWindow *app = glabels_get_active_window ();
- gboolean saved_flag = FALSE;
- gboolean destroy_flag = FALSE;
+ BonoboWindow *app = glabels_get_active_window ();
+ gboolean saved_flag = FALSE;
+ gboolean destroy_flag = FALSE;
gl_debug (DEBUG_FILE, "START");
/* PRIVATE. "Save As" ok button callback. */
/*---------------------------------------------------------------------------*/
static void
-save_as_ok_cb (GtkWidget * widget,
- GtkFileSelection * fsel)
+save_as_ok_cb (GtkWidget *widget,
+ GtkFileSelection *fsel)
{
- gchar *raw_filename, *filename;
- GtkWidget *dlg;
- glMDIChild *child;
- glLabel *label;
- glXMLLabelStatus status;
+ gchar *raw_filename, *filename;
+ GtkWidget *dlg;
+ glMDIChild *child;
+ glLabel *label;
+ glXMLLabelStatus status;
GnomeRecentModel *recent;
- gboolean *saved_flag;
- gchar *primary_msg;
- gboolean cancel_flag = FALSE;
+ gboolean *saved_flag;
+ gchar *primary_msg;
+ gboolean cancel_flag = FALSE;
gl_debug (DEBUG_FILE, "START");
/* PRIVATE. "Save As" cancel button callback. */
/*---------------------------------------------------------------------------*/
static void
-save_as_cancel_cb (GtkWidget * widget,
- GtkFileSelection * fsel)
+save_as_cancel_cb (GtkWidget *widget,
+ GtkFileSelection *fsel)
{
gboolean *saved_flag = g_object_get_data (G_OBJECT (fsel), "saved_flag");
/* PRIVATE. "Save As" destroy callback. */
/*---------------------------------------------------------------------------*/
static void
-save_as_destroy_cb (GtkWidget * widget,
- gboolean * destroy_flag)
+save_as_destroy_cb (GtkWidget *widget,
+ gboolean *destroy_flag)
{
*destroy_flag = TRUE;
gtk_main_quit ();
/* "Close" menu callback. */
/*****************************************************************************/
void
-gl_file_close (GtkWidget * view)
+gl_file_close (GtkWidget *view)
{
- gint ret;
- BonoboMDIChild* child;
+ gint ret;
+ BonoboMDIChild *child;
gl_debug (DEBUG_FILE, "START");
gl_file_close_all (void)
{
gboolean ret;
- gl_debug (DEBUG_FILE, "");
gl_debug (DEBUG_FILE, "START");
void
gl_file_exit (void)
{
- gl_debug (DEBUG_FILE, "");
+ gl_debug (DEBUG_FILE, "START");
if (!gl_file_close_all ())
return;
#include "mdi-child.h"
#include "gnome-recent-view.h"
-extern void gl_file_new (void);
+G_BEGIN_DECLS
-extern void gl_file_open (glMDIChild *active_child);
-extern gboolean gl_file_open_recent (GnomeRecentView *view,
- const gchar *filename,
- BonoboWindow *win);
-extern gboolean gl_file_open_real (const gchar *filename,
- GtkWindow *win);
+void gl_file_new (void);
-extern gboolean gl_file_save (glMDIChild *child);
-extern gboolean gl_file_save_as (glMDIChild *child);
-extern void gl_file_close (GtkWidget *view);
-extern gboolean gl_file_close_all (void);
-extern void gl_file_exit (void);
+void gl_file_open (glMDIChild *active_child);
-#endif /* __FILE_H__ */
+gboolean gl_file_open_recent (GnomeRecentView *view,
+ const gchar *filename,
+ BonoboWindow *win);
+
+gboolean gl_file_open_real (const gchar *filename,
+ GtkWindow *win);
+
+
+gboolean gl_file_save (glMDIChild *child);
+
+gboolean gl_file_save_as (glMDIChild *child);
+
+
+void gl_file_close (GtkWidget *view);
+
+gboolean gl_file_close_all (void);
+
+void gl_file_exit (void);
+
+G_END_DECLS
+
+#endif /* __FILE_H__ */
int
main (int argc, char **argv)
{
- GValue value = { 0, };
- GnomeProgram *program;
- poptContext ctx;
- char **args;
- GList *file_list = NULL, *p;
- gint i;
+ GValue value = { 0, };
+ GnomeProgram *program;
+ poptContext ctx;
+ char **args;
+ GList *file_list = NULL, *p;
+ gint i;
bindtextdomain (GETTEXT_PACKAGE, GLABELS_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#include "label.h"
#include "view.h"
+G_BEGIN_DECLS
+
extern glMDI* glabels_mdi;
extern gboolean glabels_close_x_button_pressed;
extern gboolean glabels_exit_button_pressed;
glView* glabels_get_active_view (void);
GList* glabels_get_top_windows (void);
+G_END_DECLS
#endif /* __GLABELS_H__ */