[Goodies-commits] r5867 - xfce4-dict/trunk/lib

Enrico Troeger enrico at xfce.org
Wed Oct 29 23:39:30 CET 2008


Author: enrico
Date: 2008-10-29 22:39:29 +0000 (Wed, 29 Oct 2008)
New Revision: 5867

Modified:
   xfce4-dict/trunk/lib/prefs.c
   xfce4-dict/trunk/lib/wraplabel.c
   xfce4-dict/trunk/lib/wraplabel.h
Log:
Prefix the WrapLabel class with Xfd.

Modified: xfce4-dict/trunk/lib/prefs.c
===================================================================
--- xfce4-dict/trunk/lib/prefs.c	2008-10-29 22:39:27 UTC (rev 5866)
+++ xfce4-dict/trunk/lib/prefs.c	2008-10-29 22:39:29 UTC (rev 5867)
@@ -600,7 +600,7 @@
 
 		g_object_set_data(G_OBJECT(dialog), "web_entry", web_entry);
 
-		label1 = wrap_label_new(_("Enter an URL to a web site which offer translation or dictionary services. Use {word} as placeholder for the searched word."));
+		label1 = xfd_wrap_label_new(_("Enter an URL to a web site which offer translation or dictionary services. Use {word} as placeholder for the searched word."));
 		gtk_misc_set_alignment(GTK_MISC(label1), 0, 0);
 		gtk_widget_show(label1);
 		gtk_box_pack_start(GTK_BOX(inner_vbox), label1, FALSE, FALSE, 0);
@@ -640,7 +640,7 @@
 		g_signal_connect(spell_entry, "activate", G_CALLBACK(spell_entry_activate_cb), dd);
 		gtk_widget_show(spell_entry);
 
-		label_help = wrap_label_new(_(
+		label_help = xfd_wrap_label_new(_(
 	"<i>The spell check program can be 'enchant', 'aspell', 'ispell' or any other spell check "
 	"program which is compatible to the ispell command.\nThe icon shows whether the entered "
 	"command exists.</i>"));

Modified: xfce4-dict/trunk/lib/wraplabel.c
===================================================================
--- xfce4-dict/trunk/lib/wraplabel.c	2008-10-29 22:39:27 UTC (rev 5866)
+++ xfce4-dict/trunk/lib/wraplabel.c	2008-10-29 22:39:29 UTC (rev 5867)
@@ -36,15 +36,16 @@
 
 
 
-#define WRAP_LABEL_GET_PRIVATE(obj)		(G_TYPE_INSTANCE_GET_PRIVATE((obj),	WRAP_LABEL_TYPE, WrapLabelPrivate))
+#define XFD_WRAP_LABEL_GET_PRIVATE(obj)		(G_TYPE_INSTANCE_GET_PRIVATE((obj),	\
+											 XFD_WRAP_LABEL_TYPE, XfdWrapLabelPrivate))
 
 
-struct _WrapLabelClass
+struct _XfdWrapLabelClass
 {
 	GtkLabelClass parent_class;
 };
 
-struct _WrapLabel
+struct _XfdWrapLabel
 {
 	GtkLabel parent;
 };
@@ -52,65 +53,65 @@
 typedef struct
 {
 	gsize wrap_width;
-} WrapLabelPrivate;
+} XfdWrapLabelPrivate;
 
 
-static void wrap_label_class_init		(WrapLabelClass *klass);
-static void wrap_label_init				(WrapLabel *self);
-static void wrap_label_size_request		(GtkWidget *widget, GtkRequisition *req);
-static void wrap_label_size_allocate	(GtkWidget *widget, GtkAllocation *alloc);
-static void wrap_label_set_wrap_width	(GtkWidget *widget, gsize width);
+static void xfd_wrap_label_class_init		(XfdWrapLabelClass *klass);
+static void xfd_wrap_label_init				(XfdWrapLabel *self);
+static void xfd_wrap_label_size_request		(GtkWidget *widget, GtkRequisition *req);
+static void xfd_wrap_label_size_allocate	(GtkWidget *widget, GtkAllocation *alloc);
+static void xfd_wrap_label_set_wrap_width	(GtkWidget *widget, gsize width);
 
 
-GType wrap_label_get_type()
+GType xfd_wrap_label_get_type()
 {
 	static GType type = G_TYPE_INVALID;
 
 	if (G_UNLIKELY(type == G_TYPE_INVALID))
 	{
 		GTypeInfo gwl_info = {
-			sizeof (WrapLabelClass),
+			sizeof (XfdWrapLabelClass),
 			NULL, NULL,
-			(GClassInitFunc) wrap_label_class_init,
+			(GClassInitFunc) xfd_wrap_label_class_init,
 			NULL,
 			NULL,
-			sizeof (WrapLabel),
+			sizeof (XfdWrapLabel),
 			3,
-			(GInstanceInitFunc) wrap_label_init,
+			(GInstanceInitFunc) xfd_wrap_label_init,
 			NULL
 		};
 
-		type = g_type_register_static(GTK_TYPE_LABEL, "WrapLabel", &gwl_info, 0);
+		type = g_type_register_static(GTK_TYPE_LABEL, "XfdWrapLabel", &gwl_info, 0);
 	}
 
 	return type;
 }
 
 
-static void wrap_label_class_init(WrapLabelClass *klass)
+static void xfd_wrap_label_class_init(XfdWrapLabelClass *klass)
 {
 	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 
 	parent_class = g_type_class_peek_parent(klass);
-	widget_class->size_request = wrap_label_size_request;
-	widget_class->size_allocate = wrap_label_size_allocate;
+	widget_class->size_request = xfd_wrap_label_size_request;
+	widget_class->size_allocate = xfd_wrap_label_size_allocate;
 
-	g_type_class_add_private(klass, sizeof (WrapLabelPrivate));
+	g_type_class_add_private(klass, sizeof (XfdWrapLabelPrivate));
 }
 
 
-static void wrap_label_init(WrapLabel *self)
+static void xfd_wrap_label_init(XfdWrapLabel *self)
 {
-	WrapLabelPrivate *priv = WRAP_LABEL_GET_PRIVATE(self);
+	XfdWrapLabelPrivate *priv = XFD_WRAP_LABEL_GET_PRIVATE(self);
 
 	priv->wrap_width = 0;
 }
 
 
 /* Sets the point at which the text should wrap. */
-static void wrap_label_set_wrap_width(GtkWidget *widget, gsize width)
+static void xfd_wrap_label_set_wrap_width(GtkWidget *widget, gsize width)
 {
-	WrapLabelPrivate *priv;
+	XfdWrapLabelPrivate *priv;
 
 	if (width == 0)
 		return;
@@ -121,7 +122,7 @@
 	*/
 	pango_layout_set_width(gtk_label_get_layout(GTK_LABEL(widget)), width * PANGO_SCALE);
 
-	priv = WRAP_LABEL_GET_PRIVATE(widget);
+	priv = XFD_WRAP_LABEL_GET_PRIVATE(widget);
 	if (priv->wrap_width != width)
 	{
 		priv->wrap_width = width;
@@ -132,7 +133,7 @@
 
 /* Forces the height to be the size necessary for the Pango layout, while allowing the
  * width to be flexible. */
-static void wrap_label_size_request(GtkWidget *widget, GtkRequisition *req)
+static void xfd_wrap_label_size_request(GtkWidget *widget, GtkRequisition *req)
 {
 	gint height;
 
@@ -144,26 +145,26 @@
 
 
 /* Sets the wrap width to the width allocated to us. */
-static void wrap_label_size_allocate(GtkWidget *widget, GtkAllocation *alloc)
+static void xfd_wrap_label_size_allocate(GtkWidget *widget, GtkAllocation *alloc)
 {
 	(* GTK_WIDGET_CLASS(parent_class)->size_allocate)(widget, alloc);
 
-	wrap_label_set_wrap_width(widget, alloc->width);
+	xfd_wrap_label_set_wrap_width(widget, alloc->width);
 }
 
 
-void wrap_label_set_text(GtkLabel *label, const gchar *text)
+void xfd_wrap_label_set_text(GtkLabel *label, const gchar *text)
 {
-	WrapLabelPrivate *priv = WRAP_LABEL_GET_PRIVATE(label);
+	XfdWrapLabelPrivate *priv = XFD_WRAP_LABEL_GET_PRIVATE(label);
 
 	gtk_label_set_text(label, text);
-	wrap_label_set_wrap_width(GTK_WIDGET(label), priv->wrap_width);
+	xfd_wrap_label_set_wrap_width(GTK_WIDGET(label), priv->wrap_width);
 }
 
 
-GtkWidget *wrap_label_new(const gchar *text)
+GtkWidget *xfd_wrap_label_new(const gchar *text)
 {
-	GtkWidget *l = g_object_new(WRAP_LABEL_TYPE, NULL);
+	GtkWidget *l = g_object_new(XFD_WRAP_LABEL_TYPE, NULL);
 
 	if (text != NULL && text[0] != '\0')
 		gtk_label_set_text(GTK_LABEL(l), text);

Modified: xfce4-dict/trunk/lib/wraplabel.h
===================================================================
--- xfce4-dict/trunk/lib/wraplabel.h	2008-10-29 22:39:27 UTC (rev 5866)
+++ xfce4-dict/trunk/lib/wraplabel.h	2008-10-29 22:39:29 UTC (rev 5867)
@@ -27,19 +27,19 @@
 G_BEGIN_DECLS
 
 
-#define WRAP_LABEL_TYPE				(wrap_label_get_type())
-#define WRAP_LABEL(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), WRAP_LABEL_TYPE, WrapLabel))
-#define WRAP_LABEL_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), WRAP_LABEL_TYPE, WrapLabelClass))
-#define IS_WRAP_LABEL(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), WRAP_LABEL_TYPE))
-#define IS_WRAP_LABEL_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), WRAP_LABEL_TYPE))
+#define XFD_WRAP_LABEL_TYPE				(xfd_wrap_label_get_type())
+#define XFD_WRAP_LABEL(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), XFD_WRAP_LABEL_TYPE, XfdWrapLabel))
+#define XFD_WRAP_LABEL_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), XFD_WRAP_LABEL_TYPE, XfdWrapLabelClass))
+#define IS_XFD_WRAP_LABEL(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), XFD_WRAP_LABEL_TYPE))
+#define IS_XFD_WRAP_LABEL_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), XFD_WRAP_LABEL_TYPE))
 
 
-typedef struct _WrapLabel       WrapLabel;
-typedef struct _WrapLabelClass  WrapLabelClass;
+typedef struct _XfdWrapLabel       XfdWrapLabel;
+typedef struct _XfdWrapLabelClass  XfdWrapLabelClass;
 
-GType			wrap_label_get_type			(void);
-GtkWidget*		wrap_label_new				(const gchar *text);
-void			wrap_label_set_text			(GtkLabel *label, const gchar *text);
+GType			xfd_wrap_label_get_type			(void);
+GtkWidget*		xfd_wrap_label_new				(const gchar *text);
+void			xfd_wrap_label_set_text			(GtkLabel *label, const gchar *text);
 
 
 G_END_DECLS




More information about the Goodies-commits mailing list