From e47e07d74933c39641c56bfa2f66fd9b31007993 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 30 Sep 2010 11:51:19 +0200 Subject: remove EmpathyKludgeLabel It shouldn't be needed any more with GTK-3. --- libempathy-gtk/Makefile.am | 2 - libempathy-gtk/empathy-contact-widget.c | 4 +- libempathy-gtk/empathy-individual-widget.c | 4 +- libempathy-gtk/empathy-kludge-label.c | 92 ------------------------------ libempathy-gtk/empathy-kludge-label.h | 53 ----------------- 5 files changed, 2 insertions(+), 153 deletions(-) delete mode 100644 libempathy-gtk/empathy-kludge-label.c delete mode 100644 libempathy-gtk/empathy-kludge-label.h diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am index 1cc65532c..6cc6c0992 100644 --- a/libempathy-gtk/Makefile.am +++ b/libempathy-gtk/Makefile.am @@ -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 \ diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index a02b0838e..eaacc6316 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -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 @@ -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), diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c index 36cea8a5e..f30343638 100644 --- a/libempathy-gtk/empathy-individual-widget.c +++ b/libempathy-gtk/empathy-individual-widget.c @@ -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 index 7ed4be62f..000000000 --- a/libempathy-gtk/empathy-kludge-label.c +++ /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 - */ - -#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 index f2ea1e938..000000000 --- a/libempathy-gtk/empathy-kludge-label.h +++ /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 - */ - -#ifndef __EMPATHY_KLUDGE_LABEL_H__ -#define __EMPATHY_KLUDGE_LABEL_H__ - -#include - -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 -- cgit v1.2.3