X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=glabels2%2Fsrc%2Fprefs-model.c;fp=glabels2%2Fsrc%2Fprefs-model.c;h=a274824788e1d88b08f1c375aa603135d8381f54;hb=7e55e35f41dbbbbb2dcf285fa5fbcc9007628457;hp=72a043b6e3ce4f6457e778c7bfd7729bd0b9055c;hpb=83898579197af3dbe8fecb57c729770cd7e34694;p=glabels diff --git a/glabels2/src/prefs-model.c b/glabels2/src/prefs-model.c index 72a043b6..a2748247 100644 --- a/glabels2/src/prefs-model.c +++ b/glabels2/src/prefs-model.c @@ -1,42 +1,39 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ - /* - * (GLABELS) Label and Business Card Creation program for GNOME - * - * prefs-model.c: Application preferences model module + * prefs-model.h + * Copyright (C) 2001-2009 Jim Evins . * - * Copyright (C) 2001-2003 Jim Evins . + * This file is part of gLabels. * - * This program is free software; you can redistribute it and/or modify + * gLabels 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 + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, + * gLabels 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 + * along with gLabels. If not, see . */ + #include #include "prefs-model.h" -#include -#include -#include +#include +#include #include -#include +#include #include "marshal.h" #include "util.h" #include "color.h" #include "debug.h" + /*========================================================*/ /* Private macros and constants. */ /*========================================================*/ @@ -95,6 +92,7 @@ #define DEFAULT_FILL_COLOR GL_COLOR_A (0, 255, 0, 255) + /*========================================================*/ /* Private types. */ /*========================================================*/ @@ -105,13 +103,13 @@ enum { }; - /*========================================================*/ /* Private globals. */ /*========================================================*/ static guint signals[LAST_SIGNAL] = {0}; + /*========================================================*/ /* Private function prototypes. */ /*========================================================*/ @@ -143,12 +141,12 @@ static lglUnitsType string_to_units (const gchar *string) static const gchar *units_to_string (lglUnitsType units); - /*****************************************************************************/ /* Boilerplate object stuff. */ /*****************************************************************************/ G_DEFINE_TYPE (glPrefsModel, gl_prefs_model, G_TYPE_OBJECT); + static void gl_prefs_model_class_init (glPrefsModelClass *class) { @@ -173,6 +171,7 @@ gl_prefs_model_class_init (glPrefsModelClass *class) gl_debug (DEBUG_PREFS, "END"); } + static void gl_prefs_model_init (glPrefsModel *prefs_model) { @@ -195,6 +194,7 @@ gl_prefs_model_init (glPrefsModel *prefs_model) gl_debug (DEBUG_PREFS, "END"); } + static void gl_prefs_model_finalize (GObject *object) { @@ -213,6 +213,7 @@ gl_prefs_model_finalize (GObject *object) gl_debug (DEBUG_PREFS, "END"); } + /*****************************************************************************/ /* New prefs_model object. */ /*****************************************************************************/ @@ -231,7 +232,6 @@ gl_prefs_model_new (void) } - /*****************************************************************************/ /* Save all settings. */ /*****************************************************************************/ @@ -367,6 +367,7 @@ gl_prefs_model_save_settings (glPrefsModel *prefs_model) gl_debug (DEBUG_PREFS, "END"); } + /*****************************************************************************/ /* Load all settings. */ /*****************************************************************************/ @@ -556,6 +557,7 @@ gl_prefs_model_load_settings (glPrefsModel *prefs_model) gl_debug (DEBUG_PREFS, "END"); } + /*---------------------------------------------------------------------------*/ /* PRIVATE. Key changed callback. */ /*---------------------------------------------------------------------------*/ @@ -570,6 +572,7 @@ notify_cb (GConfClient *client, gl_prefs_model_load_settings (prefs_model); } + /*---------------------------------------------------------------------------*/ /* PRIVATE. Utilities to get values with defaults. */ /*---------------------------------------------------------------------------*/ @@ -593,6 +596,7 @@ get_string (GConfClient *client, } } + static gboolean get_bool (GConfClient *client, const gchar *key, @@ -622,6 +626,7 @@ get_bool (GConfClient *client, } } + static gint get_int (GConfClient *client, const gchar *key, @@ -651,6 +656,7 @@ get_int (GConfClient *client, } } + static gdouble get_float (GConfClient *client, const gchar *key, @@ -679,6 +685,7 @@ get_float (GConfClient *client, } } + /*---------------------------------------------------------------------------*/ /* PRIVATE. Utilities to deal with units. */ /*---------------------------------------------------------------------------*/ @@ -700,6 +707,7 @@ string_to_units (const gchar *string) return units; } + static const gchar *units_to_string (lglUnitsType units) { @@ -720,3 +728,14 @@ gchar *units_to_string (lglUnitsType units) } + + + +/* + * Local Variables: -- emacs + * mode: C -- emacs + * c-basic-offset: 8 -- emacs + * tab-width: 8 -- emacs + * indent-tabs-mode: nil -- emacs + * End: -- emacs + */