[gnome-control-center] shell: Rename search renderer



commit 19f27721073955626171ebb42adf02ce73517016
Author: Bastien Nocera <hadess hadess net>
Date:   Fri May 18 11:48:29 2012 +0100

    shell: Rename search renderer
    
    And cc- prefix it, like the rest of our widgets.

 shell/Makefile.am                                  |    4 +-
 ...earch-renderer.c => cc-shell-search-renderer.c} |   79 ++++++++++----------
 ...earch-renderer.h => cc-shell-search-renderer.h} |   36 +++++-----
 shell/gnome-control-center.c                       |    4 +-
 4 files changed, 62 insertions(+), 61 deletions(-)
---
diff --git a/shell/Makefile.am b/shell/Makefile.am
index d59ba3a..ab9dcc6 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -21,8 +21,8 @@ gnome_control_center_SOURCES =			\
 	gnome-control-center.h			\
 	cc-notebook.c				\
 	cc-notebook.h				\
-	shell-search-renderer.c			\
-	shell-search-renderer.h			\
+	cc-shell-search-renderer.c		\
+	cc-shell-search-renderer.h		\
 	cc-shell-category-view.c		\
 	cc-shell-category-view.h		\
 	cc-shell-item-view.c			\
diff --git a/shell/shell-search-renderer.c b/shell/cc-shell-search-renderer.c
similarity index 76%
rename from shell/shell-search-renderer.c
rename to shell/cc-shell-search-renderer.c
index a64a4bf..9f1ec5a 100644
--- a/shell/shell-search-renderer.c
+++ b/shell/cc-shell-search-renderer.c
@@ -18,15 +18,16 @@
  * Author: Thomas Wood <thos gnome org>
  */
 
-#include "shell-search-renderer.h"
 #include <string.h>
 
-G_DEFINE_TYPE (ShellSearchRenderer, shell_search_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
+#include "cc-shell-search-renderer.h"
+
+G_DEFINE_TYPE (CcShellSearchRenderer, cc_shell_search_renderer, GTK_TYPE_CELL_RENDERER_TEXT)
 
 #define SEARCH_RENDERER_PRIVATE(o) \
-  (G_TYPE_INSTANCE_GET_PRIVATE ((o), SHELL_TYPE_SEARCH_RENDERER, ShellSearchRendererPrivate))
+  (G_TYPE_INSTANCE_GET_PRIVATE ((o), SHELL_TYPE_SEARCH_RENDERER, CcShellSearchRendererPrivate))
 
-struct _ShellSearchRendererPrivate
+struct _CcShellSearchRendererPrivate
 {
   gchar *title;
   gchar *search_target;
@@ -50,7 +51,7 @@ enum
 #define FIXED_SEARCH_LABEL_WIDTH ((FIXED_WIDTH - 2*MARGIN - 3*ICON_SIZE - 6*ICON_PADDING - 2*COLUMN_SPACING)/3. - 2)
 
 static void
-shell_search_renderer_get_property (GObject    *object,
+cc_shell_search_renderer_get_property (GObject    *object,
                                     guint       property_id,
                                     GValue     *value,
                                     GParamSpec *pspec)
@@ -69,12 +70,12 @@ shell_search_renderer_get_property (GObject    *object,
 }
 
 static void
-shell_search_renderer_set_property (GObject      *object,
+cc_shell_search_renderer_set_property (GObject      *object,
                                     guint         property_id,
                                     const GValue *value,
                                     GParamSpec   *pspec)
 {
-  ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (object)->priv;
+  CcShellSearchRendererPrivate *priv = CC_SHELL_SEARCH_RENDERER (object)->priv;
 
   switch (property_id)
     {
@@ -101,9 +102,9 @@ shell_search_renderer_set_property (GObject      *object,
 }
 
 static void
-shell_search_renderer_dispose (GObject *object)
+cc_shell_search_renderer_dispose (GObject *object)
 {
-  ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (object)->priv;
+  CcShellSearchRendererPrivate *priv = CC_SHELL_SEARCH_RENDERER (object)->priv;
 
   if (priv->layout)
     {
@@ -111,13 +112,13 @@ shell_search_renderer_dispose (GObject *object)
       priv->layout = NULL;
     }
 
-  G_OBJECT_CLASS (shell_search_renderer_parent_class)->dispose (object);
+  G_OBJECT_CLASS (cc_shell_search_renderer_parent_class)->dispose (object);
 }
 
 static void
-shell_search_renderer_finalize (GObject *object)
+cc_shell_search_renderer_finalize (GObject *object)
 {
-  ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (object)->priv;
+  CcShellSearchRendererPrivate *priv = CC_SHELL_SEARCH_RENDERER (object)->priv;
 
   if (priv->title)
     {
@@ -137,14 +138,14 @@ shell_search_renderer_finalize (GObject *object)
       priv->search_string = NULL;
     }
 
-  G_OBJECT_CLASS (shell_search_renderer_parent_class)->finalize (object);
+  G_OBJECT_CLASS (cc_shell_search_renderer_parent_class)->finalize (object);
 }
 
 static void
-shell_search_renderer_set_layout (ShellSearchRenderer *cell, GtkWidget *widget)
+cc_shell_search_renderer_set_layout (CcShellSearchRenderer *cell, GtkWidget *widget)
 {
   gchar *display_string;
-  ShellSearchRendererPrivate *priv = cell->priv;
+  CcShellSearchRendererPrivate *priv = cell->priv;
   gchar *needle, *haystack;
   gchar *full_string;
 
@@ -216,10 +217,10 @@ get_size (GtkCellRenderer *cell,
           gint            *width,
           gint            *height)
 {
-  ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv;
+  CcShellSearchRendererPrivate *priv = CC_SHELL_SEARCH_RENDERER (cell)->priv;
   PangoRectangle rect;
 
-  shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget);
+  cc_shell_search_renderer_set_layout (CC_SHELL_SEARCH_RENDERER (cell), widget);
 
   pango_layout_set_width (priv->layout, PANGO_SCALE * FIXED_SEARCH_LABEL_WIDTH);
   pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
@@ -229,7 +230,7 @@ get_size (GtkCellRenderer *cell,
 }
 
 static void
-shell_search_renderer_get_preferred_width (GtkCellRenderer *cell,
+cc_shell_search_renderer_get_preferred_width (GtkCellRenderer *cell,
                                            GtkWidget       *widget,
                                            gint            *minimum_size,
                                            gint            *natural_size)
@@ -242,7 +243,7 @@ shell_search_renderer_get_preferred_width (GtkCellRenderer *cell,
 }
 
 static void
-shell_search_renderer_get_preferred_height (GtkCellRenderer *cell,
+cc_shell_search_renderer_get_preferred_height (GtkCellRenderer *cell,
                                             GtkWidget       *widget,
                                             gint            *minimum_size,
                                             gint            *natural_size)
@@ -255,17 +256,17 @@ shell_search_renderer_get_preferred_height (GtkCellRenderer *cell,
 }
 
 static void
-shell_search_renderer_get_preferred_height_for_width (GtkCellRenderer *cell,
+cc_shell_search_renderer_get_preferred_height_for_width (GtkCellRenderer *cell,
                                                       GtkWidget       *widget,
                                                       gint             width,
                                                       gint            *minimum_height,
                                                       gint            *natural_height)
 {
-  shell_search_renderer_get_preferred_height (cell, widget, minimum_height, natural_height);
+  cc_shell_search_renderer_get_preferred_height (cell, widget, minimum_height, natural_height);
 }
 
 static void
-shell_search_renderer_get_aligned_area (GtkCellRenderer      *cell,
+cc_shell_search_renderer_get_aligned_area (GtkCellRenderer      *cell,
                                         GtkWidget            *widget,
                                         GtkCellRendererState  flags,
                                         const GdkRectangle   *cell_area,
@@ -277,14 +278,14 @@ shell_search_renderer_get_aligned_area (GtkCellRenderer      *cell,
 }
 
 static void
-shell_search_renderer_render (GtkCellRenderer      *cell,
+cc_shell_search_renderer_render (GtkCellRenderer      *cell,
                               cairo_t              *cr,
                               GtkWidget            *widget,
                               const GdkRectangle   *background_area,
                               const GdkRectangle   *cell_area,
                               GtkCellRendererState  flags)
 {
-  ShellSearchRendererPrivate *priv = SHELL_SEARCH_RENDERER (cell)->priv;
+  CcShellSearchRendererPrivate *priv = CC_SHELL_SEARCH_RENDERER (cell)->priv;
   PangoRectangle rect;
   GtkStyleContext *context;
   gint layout_height;
@@ -292,7 +293,7 @@ shell_search_renderer_render (GtkCellRenderer      *cell,
 
   context = gtk_widget_get_style_context (widget);
 
-  shell_search_renderer_set_layout (SHELL_SEARCH_RENDERER (cell), widget);
+  cc_shell_search_renderer_set_layout (CC_SHELL_SEARCH_RENDERER (cell), widget);
 
   pango_layout_get_pixel_extents (priv->layout, NULL, &rect);
 
@@ -310,25 +311,25 @@ shell_search_renderer_render (GtkCellRenderer      *cell,
 }
 
 static void
-shell_search_renderer_class_init (ShellSearchRendererClass *klass)
+cc_shell_search_renderer_class_init (CcShellSearchRendererClass *klass)
 {
   GParamSpec *pspec;
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
   GtkCellRendererClass *cell_renderer = GTK_CELL_RENDERER_CLASS (klass);
 
-  g_type_class_add_private (klass, sizeof (ShellSearchRendererPrivate));
+  g_type_class_add_private (klass, sizeof (CcShellSearchRendererPrivate));
 
-  object_class->get_property = shell_search_renderer_get_property;
-  object_class->set_property = shell_search_renderer_set_property;
-  object_class->dispose = shell_search_renderer_dispose;
-  object_class->finalize = shell_search_renderer_finalize;
+  object_class->get_property = cc_shell_search_renderer_get_property;
+  object_class->set_property = cc_shell_search_renderer_set_property;
+  object_class->dispose = cc_shell_search_renderer_dispose;
+  object_class->finalize = cc_shell_search_renderer_finalize;
 
-  cell_renderer->get_preferred_width = shell_search_renderer_get_preferred_width;
-  cell_renderer->get_preferred_height = shell_search_renderer_get_preferred_height;
-  cell_renderer->get_preferred_height_for_width = shell_search_renderer_get_preferred_height_for_width;
-  cell_renderer->get_aligned_area = shell_search_renderer_get_aligned_area;
+  cell_renderer->get_preferred_width = cc_shell_search_renderer_get_preferred_width;
+  cell_renderer->get_preferred_height = cc_shell_search_renderer_get_preferred_height;
+  cell_renderer->get_preferred_height_for_width = cc_shell_search_renderer_get_preferred_height_for_width;
+  cell_renderer->get_aligned_area = cc_shell_search_renderer_get_aligned_area;
 
-  cell_renderer->render = shell_search_renderer_render;
+  cell_renderer->render = cc_shell_search_renderer_render;
 
   pspec = g_param_spec_string ("title",
                                "Title",
@@ -353,13 +354,13 @@ shell_search_renderer_class_init (ShellSearchRendererClass *klass)
 }
 
 static void
-shell_search_renderer_init (ShellSearchRenderer *self)
+cc_shell_search_renderer_init (CcShellSearchRenderer *self)
 {
   self->priv = SEARCH_RENDERER_PRIVATE (self);
 }
 
-ShellSearchRenderer *
-shell_search_renderer_new (void)
+CcShellSearchRenderer *
+cc_shell_search_renderer_new (void)
 {
   return g_object_new (SHELL_TYPE_SEARCH_RENDERER, NULL);
 }
diff --git a/shell/shell-search-renderer.h b/shell/cc-shell-search-renderer.h
similarity index 59%
rename from shell/shell-search-renderer.h
rename to shell/cc-shell-search-renderer.h
index ae8ea28..5a3d638 100644
--- a/shell/shell-search-renderer.h
+++ b/shell/cc-shell-search-renderer.h
@@ -18,8 +18,8 @@
  * Author: Thomas Wood <thos gnome org>
  */
 
-#ifndef _SHELL_SEARCH_RENDERER_H
-#define _SHELL_SEARCH_RENDERER_H
+#ifndef _CC_SHELL_SEARCH_RENDERER_H
+#define _CC_SHELL_SEARCH_RENDERER_H
 
 #include <glib-object.h>
 
@@ -27,15 +27,15 @@
 
 G_BEGIN_DECLS
 
-#define SHELL_TYPE_SEARCH_RENDERER shell_search_renderer_get_type()
+#define SHELL_TYPE_SEARCH_RENDERER cc_shell_search_renderer_get_type()
 
-#define SHELL_SEARCH_RENDERER(obj) \
+#define CC_SHELL_SEARCH_RENDERER(obj) \
   (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
-  SHELL_TYPE_SEARCH_RENDERER, ShellSearchRenderer))
+  SHELL_TYPE_SEARCH_RENDERER, CcShellSearchRenderer))
 
-#define SHELL_SEARCH_RENDERER_CLASS(klass) \
+#define CC_SHELL_SEARCH_RENDERER_CLASS(klass) \
   (G_TYPE_CHECK_CLASS_CAST ((klass), \
-  SHELL_TYPE_SEARCH_RENDERER, ShellSearchRendererClass))
+  SHELL_TYPE_SEARCH_RENDERER, CcShellSearchRendererClass))
 
 #define SHELL_IS_SEARCH_RENDERER(obj) \
   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
@@ -45,30 +45,30 @@ G_BEGIN_DECLS
   (G_TYPE_CHECK_CLASS_TYPE ((klass), \
   SHELL_TYPE_SEARCH_RENDERER))
 
-#define SHELL_SEARCH_RENDERER_GET_CLASS(obj) \
+#define CC_SHELL_SEARCH_RENDERER_GET_CLASS(obj) \
   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
-  SHELL_TYPE_SEARCH_RENDERER, ShellSearchRendererClass))
+  SHELL_TYPE_SEARCH_RENDERER, CcShellSearchRendererClass))
 
-typedef struct _ShellSearchRenderer ShellSearchRenderer;
-typedef struct _ShellSearchRendererClass ShellSearchRendererClass;
-typedef struct _ShellSearchRendererPrivate ShellSearchRendererPrivate;
+typedef struct _CcShellSearchRenderer CcShellSearchRenderer;
+typedef struct _CcShellSearchRendererClass CcShellSearchRendererClass;
+typedef struct _CcShellSearchRendererPrivate CcShellSearchRendererPrivate;
 
-struct _ShellSearchRenderer
+struct _CcShellSearchRenderer
 {
   GtkCellRendererText parent;
 
-  ShellSearchRendererPrivate *priv;
+  CcShellSearchRendererPrivate *priv;
 };
 
-struct _ShellSearchRendererClass
+struct _CcShellSearchRendererClass
 {
   GtkCellRendererTextClass parent_class;
 };
 
-GType shell_search_renderer_get_type (void) G_GNUC_CONST;
+GType cc_shell_search_renderer_get_type (void) G_GNUC_CONST;
 
-ShellSearchRenderer *shell_search_renderer_new (void);
+CcShellSearchRenderer *cc_shell_search_renderer_new (void);
 
 G_END_DECLS
 
-#endif /* _SHELL_SEARCH_RENDERER_H */
+#endif /* _CC_SHELL_SEARCH_RENDERER_H */
diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c
index 621153a..1aadda4 100644
--- a/shell/gnome-control-center.c
+++ b/shell/gnome-control-center.c
@@ -34,7 +34,7 @@
 
 #include "cc-panel.h"
 #include "cc-shell.h"
-#include "shell-search-renderer.h"
+#include "cc-shell-search-renderer.h"
 #include "cc-shell-category-view.h"
 #include "cc-shell-model.h"
 #include "cc-notebook.h"
@@ -623,7 +623,7 @@ setup_search (GnomeControlCenter *shell)
   gtk_container_add (GTK_CONTAINER (priv->search_scrolled), search_view);
 
   /* add the custom renderer */
-  priv->search_renderer = (GtkCellRenderer*) shell_search_renderer_new ();
+  priv->search_renderer = (GtkCellRenderer*) cc_shell_search_renderer_new ();
   gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (search_view),
                               priv->search_renderer, TRUE);
   gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (search_view),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]