src/prefs.h
src/prefs-dialog.c
src/prefs-dialog.h
-src/alert.c
-src/alert.h
src/hig.c
src/hig.h
src/view.c
prefs.h \
prefs-dialog.c \
prefs-dialog.h \
- alert.c \
- alert.h \
hig.c \
hig.h \
view.c \
+++ /dev/null
-/*
- * (GLABELS) Label and Business Card Creation program for GNOME
- *
- * alert.c: a HIG inspired alert dialog
- *
- * Copyright (C) 2001 Jim Evins <evins@snaught.com>.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <config.h>
-
-#include <glib.h>
-
-#include "alert.h"
-
-/*========================================================*/
-/* Private macros and constants. */
-/*========================================================*/
-#define HIG_ALERT_BORDER 6
-#define HIG_ALERT_SPACING 12
-
-/*===========================================*/
-/* Private globals */
-/*===========================================*/
-static GtkDialogClass *parent_class;
-
-
-/*===========================================*/
-/* Local function prototypes */
-/*===========================================*/
-
-static void gl_alert_dialog_class_init (glAlertDialogClass *class);
-static void gl_alert_dialog_init (glAlertDialog *alert_dialog);
-static void gl_alert_dialog_finalize (GObject *object);
-
-\f
-/****************************************************************************/
-/* Boilerplate Object stuff. */
-/****************************************************************************/
-guint
-gl_alert_dialog_get_type (void)
-{
- static guint alert_dialog_type = 0;
-
- if (!alert_dialog_type) {
- GTypeInfo alert_dialog_info = {
- sizeof (glAlertDialogClass),
- NULL,
- NULL,
- (GClassInitFunc) gl_alert_dialog_class_init,
- NULL,
- NULL,
- sizeof (glAlertDialog),
- 0,
- (GInstanceInitFunc) gl_alert_dialog_init,
- };
-
- alert_dialog_type =
- g_type_register_static (gtk_dialog_get_type (),
- "glAlertDialog",
- &alert_dialog_info, 0);
- }
-
- return alert_dialog_type;
-}
-
-static void
-gl_alert_dialog_class_init (glAlertDialogClass *class)
-{
- GObjectClass *object_class = (GObjectClass *) class;
-
- parent_class = g_type_class_peek_parent (class);
-
- object_class->finalize = gl_alert_dialog_finalize;
-}
-
-static void
-gl_alert_dialog_init (glAlertDialog *alert_dialog)
-{
-}
-
-static void
-gl_alert_dialog_finalize (GObject *object)
-{
- glAlertDialog *alert_dialog;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (GL_IS_ALERT_DIALOG (object));
-
- alert_dialog = GL_ALERT_DIALOG (object);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-
-/****************************************************************************/
-/* Create a message dialog that attempts to be HIG compliant. */
-/****************************************************************************/
-GtkWidget* gl_alert_dialog_new (GtkWindow *parent,
- GtkDialogFlags flags,
- GtkMessageType type,
- GtkButtonsType buttons,
- const gchar *primary_text,
- const gchar *secondary_text)
-{
- GtkWidget *dialog, *hbox, *image, *label;
- gchar *label_text;
- const gchar *stock_id = NULL;
- GtkStockItem item;
-
- /* Bare dialog */
- dialog = g_object_new (gl_alert_dialog_get_type (), NULL);
-
- /* Parent */
- gtk_window_set_transient_for (GTK_WINDOW(dialog), parent);
-
- /* Flags */
- if ( flags & GTK_DIALOG_MODAL ) {
- gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
- }
- if ( flags & GTK_DIALOG_DESTROY_WITH_PARENT ) {
- gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
- }
-
- /* Create HBOX */
- hbox = gtk_hbox_new (FALSE, HIG_ALERT_SPACING);
- gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox),
- hbox, FALSE, FALSE, 0);
-
- /* Create image */
- switch (type) {
- case GTK_MESSAGE_INFO:
- stock_id = GTK_STOCK_DIALOG_INFO;
- break;
- case GTK_MESSAGE_QUESTION:
- stock_id = GTK_STOCK_DIALOG_QUESTION;
- break;
- case GTK_MESSAGE_WARNING:
- stock_id = GTK_STOCK_DIALOG_WARNING;
- break;
- case GTK_MESSAGE_ERROR:
- stock_id = GTK_STOCK_DIALOG_ERROR;
- break;
- default:
- stock_id = GTK_STOCK_DIALOG_INFO;
- g_warning ("Unknown GtkMessageType %d", type);
- break;
- }
- if (gtk_stock_lookup (stock_id, &item)) {
- image = gtk_image_new_from_stock (stock_id,
- GTK_ICON_SIZE_DIALOG);
- } else {
- image = gtk_image_new_from_stock (NULL,
- GTK_ICON_SIZE_DIALOG);
- g_warning ("Stock dialog ID doesn't exist?");
- }
- gtk_box_pack_start (GTK_BOX(hbox), image, FALSE, FALSE, 0);
-
- /* Create label containing primary and secondary text */
- label_text = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
- primary_text, secondary_text);
- label = gtk_label_new (label_text);
- g_free (label_text);
- gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
-
- /* Adjust dialog properties */
- gtk_window_set_title (GTK_WINDOW(dialog), "");
- gtk_container_set_border_width (GTK_CONTAINER(dialog),
- HIG_ALERT_BORDER);
- gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
-
- /* Adjust VBOX properties */
- gtk_box_set_spacing (GTK_BOX(GTK_DIALOG(dialog)->vbox),
- HIG_ALERT_SPACING);
-
- /* Adjust HBOX properties */
- gtk_box_set_spacing (GTK_BOX(hbox), HIG_ALERT_SPACING);
- gtk_container_set_border_width (GTK_CONTAINER(hbox), HIG_ALERT_BORDER);
-
- /* Adjust IMAGE properties */
- gtk_misc_set_alignment (GTK_MISC(image), 0.5, 0.0);
-
- /* Adjust LABEL properties */
- gtk_label_set_line_wrap (GTK_LABEL(label), TRUE);
- gtk_label_set_use_markup (GTK_LABEL(label), TRUE);
- gtk_misc_set_alignment (GTK_MISC(image), 0.5, 0.0);
-
- /* Add buttons */
- switch (buttons) {
- case GTK_BUTTONS_NONE:
- /* nothing */
- break;
- case GTK_BUTTONS_OK:
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- GTK_STOCK_OK, GTK_RESPONSE_OK);
- break;
- case GTK_BUTTONS_CLOSE:
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
- break;
- case GTK_BUTTONS_CANCEL:
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- break;
- case GTK_BUTTONS_YES_NO:
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- GTK_STOCK_NO, GTK_RESPONSE_NO);
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- GTK_STOCK_YES, GTK_RESPONSE_YES);
- break;
- case GTK_BUTTONS_OK_CANCEL:
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG(dialog),
- GTK_STOCK_OK, GTK_RESPONSE_OK);
- break;
- default:
- g_warning ("Unknown GtkButtonsType");
- break;
- }
-
- /* Show dialog widgets */
- gtk_widget_show_all (hbox);
-
- return dialog;
-}
-
+++ /dev/null
-/*
- * (GLABELS) Label and Business Card Creation program for GNOME
- *
- * alert.h: a HIG inspired alert dialog
- *
- * Copyright (C) 2002 Jim Evins <evins@snaught.com>.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __ALERT_H__
-#define __ALERT_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define GL_TYPE_ALERT_DIALOG (gl_alert_dialog_get_type ())
-#define GL_ALERT_DIALOG(obj) \
- (GTK_CHECK_CAST((obj), GL_TYPE_ALERT_DIALOG, glAlertDialog ))
-#define GL_ALERT_DIALOG_CLASS(klass) \
- (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_ALERT_DIALOG, glAlertDialogClass))
-#define GL_IS_ALERT_DIALOG(obj) \
- (GTK_CHECK_TYPE ((obj), GL_TYPE_ALERT_DIALOG))
-#define GL_IS_ALERT_DIALOG_CLASS(klass) \
- (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_ALERT_DIALOG))
-
-typedef struct _glAlertDialog glAlertDialog;
-typedef struct _glAlertDialogClass glAlertDialogClass;
-
-struct _glAlertDialog {
- GtkDialog parent_widget;
-};
-
-struct _glAlertDialogClass {
- GtkDialogClass parent_class;
-};
-
-guint gl_alert_dialog_get_type (void);
-
-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 "file.h"
#include "recent.h"
#include "hig.h"
-#include "alert.h"
#include "util.h"
#include "wdgt-media-select.h"
#include "wdgt-rotate-label.h"
if (!filename || g_file_test (filename, G_FILE_TEST_IS_DIR)) {
- dlg = gl_alert_dialog_new (GTK_WINDOW(fsel),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CLOSE,
- _("Empty file name selection"),
- _("Please select a file or supply a valid file name"));
+ dlg = gl_hig_alert_new (GTK_WINDOW(fsel),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_CLOSE,
+ _("Empty file name selection"),
+ _("Please select a file or supply a valid file name"));
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {
- dlg = gl_alert_dialog_new (GTK_WINDOW(fsel),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CLOSE,
- _("File does not exist"),
- _("Please select a file or supply a valid file name"));
+ dlg = gl_hig_alert_new (GTK_WINDOW(fsel),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_CLOSE,
+ _("File does not exist"),
+ _("Please select a file or supply a valid file name"));
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
primary_msg = g_strdup_printf (_("Could not open file \"%s\""),
filename);
- dlg = gl_alert_dialog_new (window,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- primary_msg,
- _("Not a supported file format"));
+ dlg = gl_hig_alert_new (window,
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ primary_msg,
+ _("Not a supported file format"));
g_free (primary_msg);
primary_msg = g_strdup_printf (_("Could not save file \"%s\""),
filename);
- dialog = gl_alert_dialog_new (window,
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- primary_msg,
- _("Error encountered during save. The file is still not saved."));
+ dialog = gl_hig_alert_new (window,
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ primary_msg,
+ _("Error encountered during save. The file is still not saved."));
g_free (primary_msg);
if (!raw_filename || g_file_test (raw_filename, G_FILE_TEST_IS_DIR)) {
- dlg = gl_alert_dialog_new (GTK_WINDOW(fsel),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CLOSE,
- _("Empty file name selection"),
- _("Please supply a valid file name"));
+ dlg = gl_hig_alert_new (GTK_WINDOW(fsel),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_CLOSE,
+ _("Empty file name selection"),
+ _("Please supply a valid file name"));
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
primary_msg = g_strdup_printf (_("Overwrite file \"%s\"?"),
filename);
- dlg = gl_alert_dialog_new (GTK_WINDOW(fsel),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO,
- primary_msg,
- _("File already exists."));
+ dlg = gl_hig_alert_new (GTK_WINDOW(fsel),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ primary_msg,
+ _("File already exists."));
g_free (primary_msg);
primary_msg = g_strdup_printf (_("Could not save file \"%s\""),
filename);
- dlg = gl_alert_dialog_new (GTK_WINDOW(fsel),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- primary_msg,
- _("Error encountered during save. The file is still not saved."));
+ dlg = gl_hig_alert_new (GTK_WINDOW(fsel),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR,
+ GTK_BUTTONS_CLOSE,
+ primary_msg,
+ _("Error encountered during save. The file is still not saved."));
g_free (primary_msg);
msg = g_strdup_printf (_("Save changes to document \"%s\" before closing?"),
fname);
- msgbox = gl_alert_dialog_new (GTK_WINDOW(window),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- msg,
- _("Your changes will be lost if you don't save them."));
+ msgbox = gl_hig_alert_new (GTK_WINDOW(window),
+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_NONE,
+ msg,
+ _("Your changes will be lost if you don't save them."));
gtk_dialog_add_button (GTK_DIALOG (msgbox),
_("Close without saving"),
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
- * hig.c: HIG inspired dialog and layout tools
+ * hig.c: HIG inspired dialogs and layout tools
*
* Copyright (C) 2001 Jim Evins <evins@snaught.com>.
*
/*========================================================*/
/* Private macros and constants. */
/*========================================================*/
+#define HIG_ALERT_BORDER 6
+#define HIG_ALERT_SPACING 12
+
#define HIG_DIALOG_BORDER 12
#define HIG_DIALOG_VBOX_SPACING 18
#define HIG_DIALOG_OUTER_VBOX_SPACING 12
/*===========================================*/
/* Private globals */
/*===========================================*/
+static GtkDialogClass *hig_alert_parent_class;
static GtkDialogClass *hig_dialog_parent_class;
static GtkVBoxClass *hig_category_parent_class;
static GtkVBoxClass *hig_vbox_parent_class;
/* Local function prototypes */
/*===========================================*/
+static void gl_hig_alert_class_init (glHigAlertClass *class);
+static void gl_hig_alert_init (glHigAlert *hig_alert);
+static void gl_hig_alert_finalize (GObject *object);
+
static void gl_hig_dialog_class_init (glHigDialogClass *class);
static void gl_hig_dialog_init (glHigDialog *hig_dialog);
static void gl_hig_dialog_finalize (GObject *object);
\f
/****************************************************************************/
+/****************************************************************************/
+/* Boilerplate Alert Object stuff. */
+/****************************************************************************/
+/****************************************************************************/
+guint
+gl_hig_alert_get_type (void)
+{
+ static guint hig_alert_type = 0;
+
+ if (!hig_alert_type) {
+ GTypeInfo hig_alert_info = {
+ sizeof (glHigAlertClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) gl_hig_alert_class_init,
+ NULL,
+ NULL,
+ sizeof (glHigAlert),
+ 0,
+ (GInstanceInitFunc) gl_hig_alert_init,
+ };
+
+ hig_alert_type =
+ g_type_register_static (gtk_dialog_get_type (),
+ "glHigAlert",
+ &hig_alert_info, 0);
+ }
+
+ return hig_alert_type;
+}
+
+static void
+gl_hig_alert_class_init (glHigAlertClass *class)
+{
+ GObjectClass *object_class = (GObjectClass *) class;
+
+ hig_alert_parent_class = g_type_class_peek_parent (class);
+
+ object_class->finalize = gl_hig_alert_finalize;
+}
+
+static void
+gl_hig_alert_init (glHigAlert *hig_alert)
+{
+}
+
+static void
+gl_hig_alert_finalize (GObject *object)
+{
+ glHigAlert *hig_alert;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (GL_IS_HIG_ALERT (object));
+
+ hig_alert = GL_HIG_ALERT (object);
+
+ G_OBJECT_CLASS (hig_alert_parent_class)->finalize (object);
+}
+
+
+/****************************************************************************/
+/* Create a message dialog that attempts to be HIG compliant. */
+/****************************************************************************/
+GtkWidget* gl_hig_alert_new (GtkWindow *parent,
+ GtkDialogFlags flags,
+ GtkMessageType type,
+ GtkButtonsType buttons,
+ const gchar *primary_text,
+ const gchar *secondary_text)
+{
+ GtkWidget *dialog, *hbox, *image, *label;
+ gchar *label_text;
+ const gchar *stock_id = NULL;
+ GtkStockItem item;
+
+ /* Bare dialog */
+ dialog = g_object_new (gl_hig_alert_get_type (), NULL);
+
+ /* Parent */
+ gtk_window_set_transient_for (GTK_WINDOW(dialog), parent);
+
+ /* Flags */
+ if ( flags & GTK_DIALOG_MODAL ) {
+ gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
+ }
+ if ( flags & GTK_DIALOG_DESTROY_WITH_PARENT ) {
+ gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
+ }
+
+ /* Create HBOX */
+ hbox = gtk_hbox_new (FALSE, HIG_ALERT_SPACING);
+ gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox),
+ hbox, FALSE, FALSE, 0);
+
+ /* Create image */
+ switch (type) {
+ case GTK_MESSAGE_INFO:
+ stock_id = GTK_STOCK_DIALOG_INFO;
+ break;
+ case GTK_MESSAGE_QUESTION:
+ stock_id = GTK_STOCK_DIALOG_QUESTION;
+ break;
+ case GTK_MESSAGE_WARNING:
+ stock_id = GTK_STOCK_DIALOG_WARNING;
+ break;
+ case GTK_MESSAGE_ERROR:
+ stock_id = GTK_STOCK_DIALOG_ERROR;
+ break;
+ default:
+ stock_id = GTK_STOCK_DIALOG_INFO;
+ g_warning ("Unknown GtkMessageType %d", type);
+ break;
+ }
+ if (gtk_stock_lookup (stock_id, &item)) {
+ image = gtk_image_new_from_stock (stock_id,
+ GTK_ICON_SIZE_DIALOG);
+ } else {
+ image = gtk_image_new_from_stock (NULL,
+ GTK_ICON_SIZE_DIALOG);
+ g_warning ("Stock dialog ID doesn't exist?");
+ }
+ gtk_box_pack_start (GTK_BOX(hbox), image, FALSE, FALSE, 0);
+
+ /* Create label containing primary and secondary text */
+ label_text = g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
+ primary_text, secondary_text);
+ label = gtk_label_new (label_text);
+ g_free (label_text);
+ gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+ /* Adjust dialog properties */
+ gtk_window_set_title (GTK_WINDOW(dialog), "");
+ gtk_container_set_border_width (GTK_CONTAINER(dialog),
+ HIG_ALERT_BORDER);
+ gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE);
+
+ /* Adjust VBOX properties */
+ gtk_box_set_spacing (GTK_BOX(GTK_DIALOG(dialog)->vbox),
+ HIG_ALERT_SPACING);
+
+ /* Adjust HBOX properties */
+ gtk_box_set_spacing (GTK_BOX(hbox), HIG_ALERT_SPACING);
+ gtk_container_set_border_width (GTK_CONTAINER(hbox), HIG_ALERT_BORDER);
+
+ /* Adjust IMAGE properties */
+ gtk_misc_set_alignment (GTK_MISC(image), 0.5, 0.0);
+
+ /* Adjust LABEL properties */
+ gtk_label_set_line_wrap (GTK_LABEL(label), TRUE);
+ gtk_label_set_use_markup (GTK_LABEL(label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC(image), 0.5, 0.0);
+
+ /* Add buttons */
+ switch (buttons) {
+ case GTK_BUTTONS_NONE:
+ /* nothing */
+ break;
+ case GTK_BUTTONS_OK:
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_OK, GTK_RESPONSE_OK);
+ break;
+ case GTK_BUTTONS_CLOSE:
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ break;
+ case GTK_BUTTONS_CANCEL:
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ break;
+ case GTK_BUTTONS_YES_NO:
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_NO, GTK_RESPONSE_NO);
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_YES, GTK_RESPONSE_YES);
+ break;
+ case GTK_BUTTONS_OK_CANCEL:
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button (GTK_DIALOG(dialog),
+ GTK_STOCK_OK, GTK_RESPONSE_OK);
+ break;
+ default:
+ g_warning ("Unknown GtkButtonsType");
+ break;
+ }
+
+ /* Show dialog widgets */
+ gtk_widget_show_all (hbox);
+
+ return dialog;
+}
+
+
+/****************************************************************************/
+/****************************************************************************/
/* Boilerplate Dialog Object stuff. */
/****************************************************************************/
+/****************************************************************************/
guint
gl_hig_dialog_get_type (void)
{
gtk_box_pack_start (GTK_BOX (dialog->vbox), widget, FALSE, FALSE, 0);
}
-\f
+
+/****************************************************************************/
/****************************************************************************/
/* Boilerplate Category Object stuff. */
/****************************************************************************/
+/****************************************************************************/
guint
gl_hig_category_get_type (void)
{
}
-\f
+/****************************************************************************/
/****************************************************************************/
/* Boilerplate VBox Object stuff. */
/****************************************************************************/
+/****************************************************************************/
guint
gl_hig_vbox_get_type (void)
{
gtk_box_pack_start (GTK_BOX (hig_vbox), widget, FALSE, FALSE, 0);
}
-\f
+
+/****************************************************************************/
/****************************************************************************/
/* Boilerplate HBox Object stuff. */
/****************************************************************************/
+/****************************************************************************/
guint
gl_hig_hbox_get_type (void)
{
/*
* (GLABELS) Label and Business Card Creation program for GNOME
*
- * hig.h: HIG inspired dialog and layout tools
+ * hig.h: HIG inspired dialogs and layout tools
*
* Copyright (C) 2002 Jim Evins <evins@snaught.com>.
*
#define GL_HIG_PAD1 6
#define GL_HIG_PAD2 12
+
+/*===========================================================================*/
+/* HIG inspired alert. */
+/*===========================================================================*/
+
+#define GL_TYPE_HIG_ALERT (gl_hig_alert_get_type ())
+#define GL_HIG_ALERT(obj) \
+ (GTK_CHECK_CAST((obj), GL_TYPE_HIG_ALERT, glHigAlert ))
+#define GL_HIG_ALERT_CLASS(klass) \
+ (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_HIG_ALERT, glHigAlertClass))
+#define GL_IS_HIG_ALERT(obj) \
+ (GTK_CHECK_TYPE ((obj), GL_TYPE_HIG_ALERT))
+#define GL_IS_HIG_ALERT_CLASS(klass) \
+ (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_HIG_ALERT))
+
+typedef struct _glHigAlert glHigAlert;
+typedef struct _glHigAlertClass glHigAlertClass;
+
+struct _glHigAlert {
+ GtkDialog parent_widget;
+};
+
+struct _glHigAlertClass {
+ GtkDialogClass parent_class;
+};
+
+guint gl_hig_alert_get_type (void);
+
+GtkWidget *gl_hig_alert_new (GtkWindow *parent,
+ GtkDialogFlags flags,
+ GtkMessageType type,
+ GtkButtonsType buttons,
+ const gchar *primary_text,
+ const gchar *secondary_text);
+
+
/*===========================================================================*/
/* HIG Dialog wrapper. */
/*===========================================================================*/
void gl_hig_category_add_widget (glHigCategory *cat,
GtkWidget *widget);
-G_END_DECLS
/*===========================================================================*/
/* HIG VBOX wrapper. */
void gl_hig_vbox_add_widget (glHigVBox *hig_vbox,
GtkWidget *widget);
+
/*===========================================================================*/
/* HIG HBOX wrapper. */
/*===========================================================================*/
void gl_hig_hbox_add_widget_justify (glHigHBox *hig_hbox,
GtkWidget *widget);
+
G_END_DECLS
#endif /* __HIG_H__ */