aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-30 17:51:19 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-04 16:41:30 +0800
commite47e07d74933c39641c56bfa2f66fd9b31007993 (patch)
treee6ad72eb2c36b86c648e27962d981568338db0f6 /libempathy-gtk
parentaae6cabf7a463de9c7586fecc3d909db6b1194a9 (diff)
downloadgsoc2013-empathy-e47e07d74933c39641c56bfa2f66fd9b31007993.tar
gsoc2013-empathy-e47e07d74933c39641c56bfa2f66fd9b31007993.tar.gz
gsoc2013-empathy-e47e07d74933c39641c56bfa2f66fd9b31007993.tar.bz2
gsoc2013-empathy-e47e07d74933c39641c56bfa2f66fd9b31007993.tar.lz
gsoc2013-empathy-e47e07d74933c39641c56bfa2f66fd9b31007993.tar.xz
gsoc2013-empathy-e47e07d74933c39641c56bfa2f66fd9b31007993.tar.zst
gsoc2013-empathy-e47e07d74933c39641c56bfa2f66fd9b31007993.zip
remove EmpathyKludgeLabel
It shouldn't be needed any more with GTK-3.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/Makefile.am2
-rw-r--r--libempathy-gtk/empathy-contact-widget.c4
-rw-r--r--libempathy-gtk/empathy-individual-widget.c4
-rw-r--r--libempathy-gtk/empathy-kludge-label.c92
-rw-r--r--libempathy-gtk/empathy-kludge-label.h53
5 files changed, 2 insertions, 153 deletions
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 <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),
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 <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
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 <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