diff options
author | Bradford Hovinen <hovinen@ximian.com> | 2001-12-20 14:24:56 +0000 |
---|---|---|
committer | Bradford Hovinen (Gdict maintainer) <hovinen@src.gnome.org> | 2001-12-20 14:24:56 +0000 |
commit | a2b2b7932aa665a25a49f467dda79b2b115785a3 (patch) | |
tree | a792e963c306dc66fbb6dcb280ef8f482538ec99 /libbackground | |
parent | b65967ac90637c80ae4349c5ee05a82c866b01d8 (diff) | |
download | gnome-control-center-a2b2b7932aa665a25a49f467dda79b2b115785a3.tar.gz |
Rename preferences to bg_preferences to avoid possible namespace collision
2001-12-20 Bradford Hovinen <hovinen@ximian.com>
* libbackground/preferences.[ch]: Rename preferences to
bg_preferences to avoid possible namespace collision
* All: Update to reflect the above
Diffstat (limited to 'libbackground')
-rw-r--r-- | libbackground/ChangeLog | 5 | ||||
-rw-r--r-- | libbackground/applier.c | 60 | ||||
-rw-r--r-- | libbackground/applier.h | 16 | ||||
-rw-r--r-- | libbackground/preferences.c | 75 | ||||
-rw-r--r-- | libbackground/preferences.h | 30 |
5 files changed, 96 insertions, 90 deletions
diff --git a/libbackground/ChangeLog b/libbackground/ChangeLog index ec0603b29..7048d9de1 100644 --- a/libbackground/ChangeLog +++ b/libbackground/ChangeLog @@ -1,3 +1,8 @@ +2001-12-20 Bradford Hovinen <hovinen@ximian.com> + + * preferences.[ch]: Rename preferences to bg_preferences to avoid + possible namespace collision + 2001-12-18 Bradford Hovinen <hovinen@ximian.com> * preferences.c: Update GConf keys to use /desktop/gnome/background diff --git a/libbackground/applier.c b/libbackground/applier.c index 135464907..e39797b29 100644 --- a/libbackground/applier.c +++ b/libbackground/applier.c @@ -53,8 +53,8 @@ struct _ApplierPrivate * -- this is not used for * actual rendering; it is * returned if requested */ - Preferences *last_prefs; /* A cache of the last - * preferences structure to + BGPreferences *last_prefs; /* A cache of the last + * bg_preferences structure to * be applied */ GdkPixbuf *wallpaper_pixbuf; /* The "raw" wallpaper pixbuf */ @@ -124,17 +124,17 @@ static void applier_dispose (GObject *object); static void applier_finalize (GObject *object); static void run_render_pipeline (Applier *applier, - const Preferences *prefs); + const BGPreferences *prefs); static void draw_disabled_message (GtkWidget *widget); static void render_background (Applier *applier, - const Preferences *prefs); + const BGPreferences *prefs); static void render_wallpaper (Applier *applier, - const Preferences *prefs); + const BGPreferences *prefs); static void render_to_screen (Applier *applier, - const Preferences *prefs); + const BGPreferences *prefs); static void create_pixmap (Applier *applier, - const Preferences *prefs); + const BGPreferences *prefs); static void get_geometry (wallpaper_type_t wallpaper_type, GdkPixbuf *pixbuf, GdkRectangle *field_geom, @@ -159,12 +159,12 @@ static void fill_gradient (GdkPixbuf *pixbuf, orientation_t orientation); static gboolean need_wallpaper_load_p (const Applier *applier, - const Preferences *prefs); + const BGPreferences *prefs); static gboolean need_root_pixmap_p (const Applier *applier, - const Preferences *prefs); + const BGPreferences *prefs); static gboolean wallpaper_full_cover_p (const Applier *applier, - const Preferences *prefs); -static gboolean render_small_pixmap_p (const Preferences *prefs); + const BGPreferences *prefs); +static gboolean render_small_pixmap_p (const BGPreferences *prefs); static GdkPixmap *make_root_pixmap (gint width, gint height); @@ -355,7 +355,7 @@ applier_new (ApplierType type) void applier_apply_prefs (Applier *applier, - const Preferences *prefs) + const BGPreferences *prefs) { g_return_if_fail (applier != NULL); g_return_if_fail (IS_APPLIER (applier)); @@ -395,19 +395,19 @@ applier_apply_prefs (Applier *applier, if (applier->p->last_prefs != NULL) g_object_unref (G_OBJECT (applier->p->last_prefs)); - applier->p->last_prefs = PREFERENCES (preferences_clone (prefs)); + applier->p->last_prefs = BG_PREFERENCES (bg_preferences_clone (prefs)); if (applier->p->type == APPLIER_PREVIEW && applier->p->preview_widget != NULL) gtk_widget_queue_draw (applier->p->preview_widget); } gboolean -applier_render_color_p (const Applier *applier, const Preferences *prefs) +applier_render_color_p (const Applier *applier, const BGPreferences *prefs) { g_return_val_if_fail (applier != NULL, FALSE); g_return_val_if_fail (IS_APPLIER (applier), FALSE); g_return_val_if_fail (prefs != NULL, FALSE); - g_return_val_if_fail (IS_PREFERENCES (prefs), FALSE); + g_return_val_if_fail (IS_BG_PREFERENCES (prefs), FALSE); return prefs->enabled && !wallpaper_full_cover_p (applier, prefs); } @@ -536,12 +536,12 @@ draw_disabled_message (GtkWidget *widget) } static void -run_render_pipeline (Applier *applier, const Preferences *prefs) +run_render_pipeline (Applier *applier, const BGPreferences *prefs) { g_return_if_fail (applier != NULL); g_return_if_fail (IS_APPLIER (applier)); g_return_if_fail (prefs != NULL); - g_return_if_fail (IS_PREFERENCES (prefs)); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); g_assert (applier->p->pixbuf == NULL); @@ -578,12 +578,12 @@ run_render_pipeline (Applier *applier, const Preferences *prefs) */ static void -render_background (Applier *applier, const Preferences *prefs) +render_background (Applier *applier, const BGPreferences *prefs) { g_return_if_fail (applier != NULL); g_return_if_fail (IS_APPLIER (applier)); g_return_if_fail (prefs != NULL); - g_return_if_fail (IS_PREFERENCES (prefs)); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); if (prefs->gradient_enabled && !wallpaper_full_cover_p (applier, prefs)) { applier->p->grad_geom.x = applier->p->render_geom.width; @@ -629,7 +629,7 @@ render_background (Applier *applier, const Preferences *prefs) */ static void -render_wallpaper (Applier *applier, const Preferences *prefs) +render_wallpaper (Applier *applier, const BGPreferences *prefs) { GdkRectangle src_geom; GdkRectangle dest_geom; @@ -642,7 +642,7 @@ render_wallpaper (Applier *applier, const Preferences *prefs) g_return_if_fail (applier != NULL); g_return_if_fail (IS_APPLIER (applier)); g_return_if_fail (prefs != NULL); - g_return_if_fail (IS_PREFERENCES (prefs)); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); if (prefs->wallpaper_enabled) { if (applier->p->wallpaper_pixbuf == NULL) @@ -728,14 +728,14 @@ render_wallpaper (Applier *applier, const Preferences *prefs) */ static void -render_to_screen (Applier *applier, const Preferences *prefs) +render_to_screen (Applier *applier, const BGPreferences *prefs) { GdkGC *gc; g_return_if_fail (applier != NULL); g_return_if_fail (IS_APPLIER (applier)); g_return_if_fail (prefs != NULL); - g_return_if_fail (IS_PREFERENCES (prefs)); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); gc = gdk_gc_new (GDK_ROOT_PARENT ()); @@ -795,14 +795,14 @@ render_to_screen (Applier *applier, const Preferences *prefs) */ static void -create_pixmap (Applier *applier, const Preferences *prefs) +create_pixmap (Applier *applier, const BGPreferences *prefs) { gint width, height; g_return_if_fail (applier != NULL); g_return_if_fail (IS_APPLIER (applier)); g_return_if_fail (prefs != NULL); - g_return_if_fail (IS_PREFERENCES (prefs)); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); switch (applier->p->type) { case APPLIER_ROOT: @@ -1187,7 +1187,7 @@ fill_gradient (GdkPixbuf *pixbuf, */ static gboolean -need_wallpaper_load_p (const Applier *applier, const Preferences *prefs) +need_wallpaper_load_p (const Applier *applier, const BGPreferences *prefs) { if (applier->p->last_prefs == NULL) return TRUE; @@ -1204,7 +1204,7 @@ need_wallpaper_load_p (const Applier *applier, const Preferences *prefs) /* Return TRUE iff we need to create a new root pixmap */ static gboolean -need_root_pixmap_p (const Applier *applier, const Preferences *prefs) +need_root_pixmap_p (const Applier *applier, const BGPreferences *prefs) { if (applier->p->last_prefs == NULL) return TRUE; @@ -1222,10 +1222,10 @@ need_root_pixmap_p (const Applier *applier, const Preferences *prefs) /* Return TRUE iff the colors are equal */ /* Return TRUE iff the wallpaper completely covers the colors in the given - * preferences structure, assuming we have already loaded the wallpaper pixbuf */ + * bg_preferences structure, assuming we have already loaded the wallpaper pixbuf */ static gboolean -wallpaper_full_cover_p (const Applier *applier, const Preferences *prefs) +wallpaper_full_cover_p (const Applier *applier, const BGPreferences *prefs) { gint swidth, sheight; gint pwidth, pheight; @@ -1270,7 +1270,7 @@ wallpaper_full_cover_p (const Applier *applier, const Preferences *prefs) /* Return TRUE if we can optimize the rendering by using a small thin pixmap */ static gboolean -render_small_pixmap_p (const Preferences *prefs) +render_small_pixmap_p (const BGPreferences *prefs) { return prefs->gradient_enabled && !prefs->wallpaper_enabled; } diff --git a/libbackground/applier.h b/libbackground/applier.h index 0c99755e5..b7654edc1 100644 --- a/libbackground/applier.h +++ b/libbackground/applier.h @@ -56,17 +56,17 @@ struct _ApplierClass GObjectClass klass; }; -guint applier_get_type (void); +guint applier_get_type (void); -GObject *applier_new (ApplierType type); +GObject *applier_new (ApplierType type); -void applier_apply_prefs (Applier *applier, - const Preferences *prefs); +void applier_apply_prefs (Applier *applier, + const BGPreferences *prefs); -gboolean applier_render_color_p (const Applier *applier, - const Preferences *prefs); +gboolean applier_render_color_p (const Applier *applier, + const BGPreferences *prefs); -GtkWidget *applier_get_preview_widget (Applier *applier); -GdkPixbuf *applier_get_wallpaper_pixbuf (Applier *applier); +GtkWidget *applier_get_preview_widget (Applier *applier); +GdkPixbuf *applier_get_wallpaper_pixbuf (Applier *applier); #endif /* __APPLIER_H */ diff --git a/libbackground/preferences.c b/libbackground/preferences.c index a036ab82b..71ec4732d 100644 --- a/libbackground/preferences.c +++ b/libbackground/preferences.c @@ -34,41 +34,42 @@ static GObjectClass *parent_class; -static void preferences_init (Preferences *prefs, - PreferencesClass *class); -static void preferences_class_init (PreferencesClass *class); +static void bg_preferences_init (BGPreferences *prefs, + BGPreferencesClass *class); +static void bg_preferences_class_init (BGPreferencesClass *class); -static void preferences_finalize (GObject *object); +static void bg_preferences_finalize (GObject *object); -static GdkColor *read_color_from_string (const gchar *string); +static GdkColor *read_color_from_string (const gchar *string); GType -preferences_get_type (void) +bg_preferences_get_type (void) { - static GType preferences_type = 0; + static GType bg_preferences_type = 0; - if (!preferences_type) { - GTypeInfo preferences_info = { - sizeof (PreferencesClass), + if (!bg_preferences_type) { + GTypeInfo bg_preferences_info = { + sizeof (BGPreferencesClass), NULL, NULL, - (GClassInitFunc) preferences_class_init, + (GClassInitFunc) bg_preferences_class_init, NULL, NULL, - sizeof (Preferences), + sizeof (BGPreferences), 0, - (GInstanceInitFunc) preferences_init, + (GInstanceInitFunc) bg_preferences_init, }; - preferences_type = - g_type_register_static (G_TYPE_OBJECT, "Preferences", &preferences_info, 0); + bg_preferences_type = + g_type_register_static (G_TYPE_OBJECT, "BGPreferences", &bg_preferences_info, 0); } - return preferences_type; + return bg_preferences_type; } static void -preferences_init (Preferences *prefs, PreferencesClass *class) +bg_preferences_init (BGPreferences *prefs, + BGPreferencesClass *class) { prefs->frozen = FALSE; @@ -89,40 +90,40 @@ preferences_init (Preferences *prefs, PreferencesClass *class) } static void -preferences_class_init (PreferencesClass *class) +bg_preferences_class_init (BGPreferencesClass *class) { GObjectClass *object_class; object_class = (GObjectClass *) class; - object_class->finalize = preferences_finalize; + object_class->finalize = bg_preferences_finalize; parent_class = G_OBJECT_CLASS (g_type_class_ref (G_TYPE_OBJECT)); } GObject * -preferences_new (void) +bg_preferences_new (void) { GObject *object; - object = g_object_new (preferences_get_type (), NULL); - PREFERENCES (object)->enabled = TRUE; + object = g_object_new (bg_preferences_get_type (), NULL); + BG_PREFERENCES (object)->enabled = TRUE; return object; } GObject * -preferences_clone (const Preferences *prefs) +bg_preferences_clone (const BGPreferences *prefs) { GObject *object; - Preferences *new_prefs; + BGPreferences *new_prefs; g_return_val_if_fail (prefs != NULL, NULL); - g_return_val_if_fail (IS_PREFERENCES (prefs), NULL); + g_return_val_if_fail (IS_BG_PREFERENCES (prefs), NULL); - object = preferences_new (); + object = bg_preferences_new (); - new_prefs = PREFERENCES (object); + new_prefs = BG_PREFERENCES (object); new_prefs->enabled = prefs->enabled; new_prefs->gradient_enabled = prefs->gradient_enabled; @@ -146,14 +147,14 @@ preferences_clone (const Preferences *prefs) } static void -preferences_finalize (GObject *object) +bg_preferences_finalize (GObject *object) { - Preferences *prefs; + BGPreferences *prefs; g_return_if_fail (object != NULL); - g_return_if_fail (IS_PREFERENCES (object)); + g_return_if_fail (IS_BG_PREFERENCES (object)); - prefs = PREFERENCES (object); + prefs = BG_PREFERENCES (object); g_free (prefs->wallpaper_filename); g_free (prefs->wallpaper_sel_path); @@ -162,13 +163,13 @@ preferences_finalize (GObject *object) } void -preferences_load (Preferences *prefs) +bg_preferences_load (BGPreferences *prefs) { GConfClient *client; GError *error = NULL; g_return_if_fail (prefs != NULL); - g_return_if_fail (IS_PREFERENCES (prefs)); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); client = gconf_client_get_default (); @@ -191,18 +192,18 @@ preferences_load (Preferences *prefs) } /* Parse the event name given (the event being notification of a property having - * changed and apply that change to the preferences structure. Eliminates the + * changed and apply that change to the bg_preferences structure. Eliminates the * need to reload the structure entirely on every event notification */ void -preferences_merge_entry (Preferences *prefs, - const GConfEntry *entry) +bg_preferences_merge_entry (BGPreferences *prefs, + const GConfEntry *entry) { const GConfValue *value = gconf_entry_get_value (entry); g_return_if_fail (prefs != NULL); - g_return_if_fail (IS_PREFERENCES (prefs)); + g_return_if_fail (IS_BG_PREFERENCES (prefs)); if (!strcmp (entry->key, "/desktop/gnome/background/wallpaper_type")) { prefs->wallpaper_type = gconf_value_get_int (value); diff --git a/libbackground/preferences.h b/libbackground/preferences.h index 568993096..dcb73df80 100644 --- a/libbackground/preferences.h +++ b/libbackground/preferences.h @@ -21,19 +21,19 @@ * 02111-1307, USA. */ -#ifndef __PREFERENCES_H -#define __PREFERENCES_H +#ifndef __BGPREFERENCES_H +#define __BGPREFERENCES_H #include <glib-object.h> #include <gdk-pixbuf/gdk-pixbuf.h> #include <gconf/gconf-client.h> -#define PREFERENCES(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, preferences_get_type (), Preferences) -#define PREFERENCES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, preferences_get_type (), PreferencesClass) -#define IS_PREFERENCES(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, preferences_get_type ()) +#define BG_PREFERENCES(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, bg_preferences_get_type (), BGPreferences) +#define BG_PREFERENCES_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, bg_preferences_get_type (), BGPreferencesClass) +#define IS_BG_PREFERENCES(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, bg_preferences_get_type ()) -typedef struct _Preferences Preferences; -typedef struct _PreferencesClass PreferencesClass; +typedef struct _BGPreferences BGPreferences; +typedef struct _BGPreferencesClass BGPreferencesClass; typedef enum _orientation_t { ORIENTATION_SOLID, ORIENTATION_HORIZ, ORIENTATION_VERT @@ -44,7 +44,7 @@ typedef enum _wallpaper_type_t { WPTYPE_STRETCHED, WPTYPE_EMBOSSED } wallpaper_type_t; -struct _Preferences +struct _BGPreferences { GObject object; @@ -70,19 +70,19 @@ struct _Preferences gint opacity; }; -struct _PreferencesClass +struct _BGPreferencesClass { GObjectClass klass; }; -GType preferences_get_type (void); +GType bg_preferences_get_type (void); -GObject *preferences_new (void); -GObject *preferences_clone (const Preferences *prefs); +GObject *bg_preferences_new (void); +GObject *bg_preferences_clone (const BGPreferences *prefs); -void preferences_load (Preferences *prefs); +void bg_preferences_load (BGPreferences *prefs); -void preferences_merge_entry (Preferences *prefs, - const GConfEntry *entry); +void bg_preferences_merge_entry (BGPreferences *prefs, + const GConfEntry *entry); #endif /* __PREFERENCES_H */ |