]> git.0d.be Git - empathy.git/commitdiff
remove EmpathyKludgeLabel
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 30 Sep 2010 09:51:19 +0000 (11:51 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 4 Oct 2010 08:41:30 +0000 (10:41 +0200)
It shouldn't be needed any more with GTK-3.

libempathy-gtk/Makefile.am
libempathy-gtk/empathy-contact-widget.c
libempathy-gtk/empathy-individual-widget.c
libempathy-gtk/empathy-kludge-label.c [deleted file]
libempathy-gtk/empathy-kludge-label.h [deleted file]

index 1cc65532c65e5d7e776dde85c15956d7cc33ebf9..6cc6c09927d765c5d03aefe5f36c099b39a8757f 100644 (file)
@@ -67,7 +67,6 @@ libempathy_gtk_handwritten_source =                   \
        empathy-irc-network-chooser.c \
        empathy-irc-network-chooser-dialog.c \
        empathy-irc-network-dialog.c            \
-       empathy-kludge-label.c                  \
        empathy-log-window.c                    \
        empathy-new-message-dialog.c            \
        empathy-new-call-dialog.c               \
@@ -129,7 +128,6 @@ libempathy_gtk_headers =                    \
        empathy-irc-network-chooser.h \
        empathy-irc-network-chooser-dialog.h \
        empathy-irc-network-dialog.h            \
-       empathy-kludge-label.h                  \
        empathy-log-window.h                    \
        empathy-new-message-dialog.h            \
        empathy-new-call-dialog.h               \
index a02b0838ed038e8e740288200a87a3e0bebbdb2b..eaacc631656ca207d776a872aa588695cf6e8377 100644 (file)
@@ -50,7 +50,6 @@
 #include "empathy-groups-widget.h"
 #include "empathy-ui-utils.h"
 #include "empathy-string-parser.h"
-#include "empathy-kludge-label.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
 #include <libempathy/empathy-debug.h>
@@ -1428,8 +1427,7 @@ favourite_toggled_cb (GtkToggleButton *button,
 static void
 contact_widget_contact_setup (EmpathyContactWidget *information)
 {
-  /* Setup label_status as a KludgeLabel */
-  information->label_status = empathy_kludge_label_new ("");
+  information->label_status = gtk_label_new ("");
   gtk_label_set_line_wrap_mode (GTK_LABEL (information->label_status),
                                 PANGO_WRAP_WORD_CHAR);
   gtk_label_set_line_wrap (GTK_LABEL (information->label_status),
index 36cea8a5ee72e8b3299b90d201371d55ff374660..f30343638485291273e726016c84189de2cbfb91 100644 (file)
@@ -45,7 +45,6 @@
 #include "empathy-groups-widget.h"
 #include "empathy-gtk-enum-types.h"
 #include "empathy-individual-widget.h"
-#include "empathy-kludge-label.h"
 #include "empathy-string-parser.h"
 #include "empathy-ui-utils.h"
 
@@ -1267,8 +1266,7 @@ alias_presence_avatar_favourite_set_up (EmpathyIndividualWidget *self,
       FALSE, 0);
   gtk_widget_show (image);
 
-  /* Set up status_label as a KludgeLabel */
-  label = empathy_kludge_label_new ("");
+  label = gtk_label_new ("");
   gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR);
   gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 
diff --git a/libempathy-gtk/empathy-kludge-label.c b/libempathy-gtk/empathy-kludge-label.c
deleted file mode 100644 (file)
index 7ed4be6..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/* vim: set ts=4 sts=4 sw=4 et: */
-/*
- * Copyright (C) 2009 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Authors: Davyd Madeley <davyd.madeley@collabora.co.uk>
- */
-
-#include "empathy-kludge-label.h"
-
-G_DEFINE_TYPE (EmpathyKludgeLabel, empathy_kludge_label, GTK_TYPE_LABEL);
-
-static void
-empathy_kludge_label_size_allocate (GtkWidget     *self,
-                                    GtkAllocation *allocation)
-{
-    PangoLayout *layout;
-
-    GTK_WIDGET_CLASS (empathy_kludge_label_parent_class)->size_allocate (
-            self, allocation);
-
-    /* force the width of the PangoLayout to be the width of the allocation */
-    layout = gtk_label_get_layout (GTK_LABEL (self));
-    pango_layout_set_width (layout, allocation->width * PANGO_SCALE);
-}
-
-static gboolean
-empathy_kludge_label_expose_event (GtkWidget      *self,
-                                   GdkEventExpose *event)
-{
-    PangoLayout *layout;
-    PangoRectangle rect;
-    GtkAllocation real_allocation;
-    GtkAllocation allocation;
-    gboolean r;
-
-    layout = gtk_label_get_layout (GTK_LABEL (self));
-    pango_layout_get_pixel_extents (layout, NULL, &rect);
-
-    /* this is mind-bendingly evil:
-     * get_layout_location() is going to remove rect.x from the position of the
-     * layout when painting it. This really sucks. We're going to compensate by
-     * adding this value to the allocation.
-     */
-    gtk_widget_get_allocation (self, &allocation);
-    real_allocation = allocation;
-    allocation.x += rect.x;
-    gtk_widget_set_allocation (self, &allocation);
-
-    r = GTK_WIDGET_CLASS (empathy_kludge_label_parent_class)->expose_event (
-            self, event);
-
-    gtk_widget_set_allocation (self, &real_allocation);
-
-    return r;
-}
-
-static void
-empathy_kludge_label_class_init (EmpathyKludgeLabelClass *klass)
-{
-    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
-    widget_class->size_allocate = empathy_kludge_label_size_allocate;
-    widget_class->expose_event = empathy_kludge_label_expose_event;
-}
-
-static void
-empathy_kludge_label_init (EmpathyKludgeLabel *self)
-{
-}
-
-GtkWidget *
-empathy_kludge_label_new (const char *str)
-{
-    return g_object_new (EMPATHY_TYPE_KLUDGE_LABEL,
-            "label", str,
-            "xalign", 0.,
-            NULL);
-}
diff --git a/libempathy-gtk/empathy-kludge-label.h b/libempathy-gtk/empathy-kludge-label.h
deleted file mode 100644 (file)
index f2ea1e9..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2009 Collabora Ltd.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- * Authors: Davyd Madeley <davyd.madeley@collabora.co.uk>
- */
-
-#ifndef __EMPATHY_KLUDGE_LABEL_H__
-#define __EMPATHY_KLUDGE_LABEL_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define EMPATHY_TYPE_KLUDGE_LABEL      (empathy_kludge_label_get_type ())
-#define EMPATHY_KLUDGE_LABEL(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj), EMPATHY_TYPE_KLUDGE_LABEL, EmpathyKludgeLabel))
-#define EMPATHY_KLUDGE_LABEL_CLASS(obj)        (G_TYPE_CHECK_CLASS_CAST ((obj), EMPATHY_TYPE_KLUDGE_LABEL, EmpathyKludgeLabelClass))
-#define EMPATHY_IS_KLUDGE_LABEL(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EMPATHY_TYPE_KLUDGE_LABEL))
-#define EMPATHY_IS_KLUDGE_LABEL_CLASS(obj)     (G_TYPE_CHECK_CLASS_TYPE ((obj), EMPATHY_TYPE_KLUDGE_LABEL))
-#define EMPATHY_KLUDGE_LABEL_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), EMPATHY_TYPE_KLUDGE_LABEL, EmpathyKludgeLabelClass))
-
-typedef struct _EmpathyKludgeLabel EmpathyKludgeLabel;
-typedef struct _EmpathyKludgeLabelClass EmpathyKludgeLabelClass;
-
-struct _EmpathyKludgeLabel
-{
-       GtkLabel parent;
-};
-
-struct _EmpathyKludgeLabelClass
-{
-       GtkLabelClass parent_class;
-};
-
-GType empathy_kludge_label_get_type (void);
-GtkWidget *empathy_kludge_label_new (const char *str);
-
-G_END_DECLS
-
-#endif