[geany/geany] fa5a00: Map GeanyWrapLabel to GtkLabel on GTK3

Colomban Wendling git-noreply at xxxxx
Sun Mar 10 16:23:31 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 08 Oct 2012 18:08:07 UTC
Commit:      fa5a00b48b0270e13662660cd9ab40fe8029de19
             https://github.com/geany/geany/commit/fa5a00b48b0270e13662660cd9ab40fe8029de19

Log Message:
-----------
Map GeanyWrapLabel to GtkLabel on GTK3

The GTK3 version of GtkLabel provides what GeanyWrapLabel is for given
the appropriate settings are set, so no need to our own widget -- that
would require being updated to support GTK3 anyway.


Modified Paths:
--------------
    src/geanywraplabel.c
    src/geanywraplabel.h

Modified: src/geanywraplabel.c
3 files changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -29,6 +29,7 @@
 #include "utils.h"
 #include "geanywraplabel.h"
 
+#if ! GTK_CHECK_VERSION(3, 0, 0)
 
 
 struct _GeanyWrapLabelClass
@@ -154,3 +155,5 @@ GtkWidget *geany_wrap_label_new(const gchar *text)
 {
 	return g_object_new(GEANY_WRAP_LABEL_TYPE, "label", text, NULL);
 }
+
+#endif


Modified: src/geanywraplabel.h
25 files changed, 25 insertions(+), 0 deletions(-)
===================================================================
@@ -25,6 +25,8 @@
 G_BEGIN_DECLS
 
 
+#if ! GTK_CHECK_VERSION(3, 0, 0)
+
 #define GEANY_WRAP_LABEL_TYPE				(geany_wrap_label_get_type())
 #define GEANY_WRAP_LABEL(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), \
 	GEANY_WRAP_LABEL_TYPE, GeanyWrapLabel))
@@ -42,6 +44,29 @@
 GType			geany_wrap_label_get_type			(void);
 GtkWidget*		geany_wrap_label_new				(const gchar *text);
 
+#else /* GTK 3.0 */
+
+#define GEANY_WRAP_LABEL_TYPE		GTK_TYPE_LABEL
+#define GEANY_WRAP_LABEL			GTK_LABEL
+#define GEANY_WRAP_LABEL_CLASS		GTK_LABEL_CLASS
+#define IS_GEANY_WRAP_LABEL			GTK_IS_LABEL
+#define IS_GEANY_WRAP_LABEL_CLASS	GTK_IS_LABEL_CLASS
+
+#define GeanyWrapLabel		GtkLabel
+#define GeanyWrapLabelClass	GtkLabelClass
+
+#define geany_wrap_label_get_type	gtk_label_get_type
+#define geany_wrap_label_new(text) \
+	g_object_new(GTK_TYPE_LABEL, \
+				 "label", (text), \
+				 "wrap", TRUE, \
+				 "wrap-mode", PANGO_WRAP_WORD_CHAR, \
+				 "xalign", 0.0, \
+				 "yalign", 0.0, \
+				 NULL)
+
+#endif
+
 
 G_END_DECLS
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list