pidgin/pidgin

clean up PidginCellRendererExpander

2020-11-04, Gary Kramlich
fdf04534e7d1
Parents 882884b9bc97
Children 0670e82f1f58
clean up PidginCellRendererExpander

Cleanup the PidginCellRendererExpander

Rename gtkcellrendererexpander.[ch] to pidgincellrendererexpander.[ch]

Reimplement the activate method so that the user clicking on the expander will toggle it.

Testing Done:
Connected a bonjour account, expanded buddies and groups. Also ran `ninja pidgin-pot`.

Reviewed at https://reviews.imfreedom.org/r/197/
--- a/pidgin/gtkblist.c Wed Nov 04 02:35:18 2020 -0600
+++ b/pidgin/gtkblist.c Wed Nov 04 02:41:46 2020 -0600
@@ -29,7 +29,6 @@
#include "gtkaccount.h"
#include "gtkblist.h"
-#include "gtkcellrendererexpander.h"
#include "gtkconv.h"
#include "gtkdialogs.h"
#include "gtkxfer.h"
@@ -48,6 +47,7 @@
#include "pidgin/pidginaccountstore.h"
#include "pidgin/pidginactiongroup.h"
#include "pidgin/pidginbuddylistmenu.h"
+#include "pidgin/pidgincellrendererexpander.h"
#include "pidgin/pidginclosebutton.h"
#include "pidgin/pidgincore.h"
#include "pidgin/pidgindebug.h"
@@ -5048,7 +5048,7 @@
gtk_tree_view_column_pack_start(column, rend, FALSE);
gtk_tree_view_column_set_attributes(column, rend,
"visible", GROUP_EXPANDER_VISIBLE_COLUMN,
- "expander-visible", GROUP_EXPANDER_COLUMN,
+ "is-expanded", GROUP_EXPANDER_COLUMN,
"sensitive", GROUP_EXPANDER_COLUMN,
"cell-background-rgba", BGCOLOR_COLUMN,
NULL);
@@ -5058,7 +5058,7 @@
gtk_tree_view_column_pack_start(column, rend, FALSE);
gtk_tree_view_column_set_attributes(column, rend,
"visible", CONTACT_EXPANDER_VISIBLE_COLUMN,
- "expander-visible", CONTACT_EXPANDER_COLUMN,
+ "is-expanded", CONTACT_EXPANDER_COLUMN,
"sensitive", CONTACT_EXPANDER_COLUMN,
"cell-background-rgba", BGCOLOR_COLUMN,
NULL);
--- a/pidgin/gtkcellrendererexpander.c Wed Nov 04 02:35:18 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,284 +0,0 @@
-/* pidgin
- *
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- *
- */
-
-/* This is taken largely from GtkCellRenderer[Text|Pixbuf|Toggle] by
- * Jonathon Blandford <jrb@redhat.com> for RedHat, Inc.
- */
-
-#include "gtkcellrendererexpander.h"
-
-struct _PidginCellRendererExpander {
- GtkCellRenderer parent;
-
- gboolean is_expander;
-};
-
-static void pidgin_cell_renderer_expander_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
-static void pidgin_cell_renderer_expander_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-static void pidgin_cell_renderer_expander_init (PidginCellRendererExpander *cellexpander);
-static void pidgin_cell_renderer_expander_class_init (PidginCellRendererExpanderClass *class);
-static void pidgin_cell_renderer_expander_get_size (GtkCellRenderer *cell,
- GtkWidget *widget,
- const GdkRectangle *cell_area,
- gint *x_offset,
- gint *y_offset,
- gint *width,
- gint *height);
-static void pidgin_cell_renderer_expander_render (GtkCellRenderer *cell,
- cairo_t *cr,
- GtkWidget *widget,
- const GdkRectangle *background_area,
- const GdkRectangle *cell_area,
- GtkCellRendererState flags);
-static gboolean pidgin_cell_renderer_expander_activate (GtkCellRenderer *r,
- GdkEvent *event,
- GtkWidget *widget,
- const gchar *p,
- const GdkRectangle *bg,
- const GdkRectangle *cell,
- GtkCellRendererState flags);
-static void pidgin_cell_renderer_expander_finalize (GObject *gobject);
-
-enum {
- LAST_SIGNAL
-};
-
-enum {
- PROP_0,
- PROP_IS_EXPANDER
-};
-
-/* static guint expander_cell_renderer_signals [LAST_SIGNAL]; */
-
-G_DEFINE_TYPE(PidginCellRendererExpander, pidgin_cell_renderer_expander,
- GTK_TYPE_CELL_RENDERER)
-
-static void pidgin_cell_renderer_expander_init (PidginCellRendererExpander *cellexpander)
-{
- g_object_set(G_OBJECT(cellexpander), "mode",
- GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
- gtk_cell_renderer_set_padding(GTK_CELL_RENDERER(cellexpander), 0, 2);
-}
-
-static void pidgin_cell_renderer_expander_class_init (PidginCellRendererExpanderClass *class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS(class);
- GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(class);
-
- object_class->finalize = pidgin_cell_renderer_expander_finalize;
- object_class->get_property = pidgin_cell_renderer_expander_get_property;
- object_class->set_property = pidgin_cell_renderer_expander_set_property;
-
- cell_class->get_size = pidgin_cell_renderer_expander_get_size;
- cell_class->render = pidgin_cell_renderer_expander_render;
- cell_class->activate = pidgin_cell_renderer_expander_activate;
-
- g_object_class_install_property (object_class,
- PROP_IS_EXPANDER,
- g_param_spec_boolean ("expander-visible",
- "Is Expander",
- "True if the renderer should draw an expander",
- FALSE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
-}
-
-static void pidgin_cell_renderer_expander_finalize (GObject *object)
-{
-/*
- PidginCellRendererExpander *cellexpander = PIDGIN_CELL_RENDERER_EXPANDER(object);
-*/
-
- G_OBJECT_CLASS(pidgin_cell_renderer_expander_parent_class)->finalize(object);
-}
-
-static void pidgin_cell_renderer_expander_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *psec)
-{
- PidginCellRendererExpander *cellexpander = PIDGIN_CELL_RENDERER_EXPANDER(object);
-
- switch (param_id)
- {
- case PROP_IS_EXPANDER:
- g_value_set_boolean(value, cellexpander->is_expander);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, psec);
- break;
-
- }
-}
-
-static void pidgin_cell_renderer_expander_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- PidginCellRendererExpander *cellexpander = PIDGIN_CELL_RENDERER_EXPANDER (object);
-
- switch (param_id)
- {
- case PROP_IS_EXPANDER:
- cellexpander->is_expander = g_value_get_boolean(value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, param_id, pspec);
- break;
- }
-}
-
-GtkCellRenderer *pidgin_cell_renderer_expander_new(void)
-{
- return g_object_new(PIDGIN_TYPE_CELL_RENDERER_EXPANDER, NULL);
-}
-
-static void
-pidgin_cell_renderer_expander_get_size (GtkCellRenderer *cell,
- GtkWidget *widget,
- const GdkRectangle *cell_area,
- gint *x_offset,
- gint *y_offset,
- gint *width,
- gint *height)
-{
- gint calc_width;
- gint calc_height;
- gint expander_size;
- gint xpad;
- gint ypad;
- gfloat xalign;
- gfloat yalign;
-
- gtk_widget_style_get(widget, "expander-size", &expander_size, NULL);
-
- gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
- gtk_cell_renderer_get_alignment(cell, &xalign, &yalign);
- calc_width = (gint) xpad * 2 + expander_size;
- calc_height = (gint) ypad * 2 + expander_size;
-
- if (width)
- *width = calc_width;
-
- if (height)
- *height = calc_height;
-
- if (cell_area)
- {
- if (x_offset)
- {
- *x_offset = xalign * (cell_area->width - calc_width);
- *x_offset = MAX (*x_offset, 0);
- }
- if (y_offset)
- {
- *y_offset = yalign * (cell_area->height - calc_height);
- *y_offset = MAX (*y_offset, 0);
- }
- }
-}
-
-
-static void
-pidgin_cell_renderer_expander_render(GtkCellRenderer *cell,
- cairo_t *cr,
- GtkWidget *widget,
- const GdkRectangle *background_area,
- const GdkRectangle *cell_area,
- GtkCellRendererState flags)
-{
- PidginCellRendererExpander *cellexpander = (PidginCellRendererExpander *) cell;
- gboolean set;
- gint width, height;
- GtkStateFlags state;
- gint xpad;
- gint ypad;
- gboolean is_expanded;
- GtkAllocation allocation;
- GtkStyleContext *context;
-
- if (!cellexpander->is_expander)
- return;
-
- gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
- g_object_get(G_OBJECT(cell), "is-expanded", &is_expanded, NULL);
-
- width = cell_area->width;
- height = cell_area->height;
-
- if (!gtk_widget_get_sensitive(widget))
- state = GTK_STATE_FLAG_INSENSITIVE;
- else if (flags & GTK_CELL_RENDERER_PRELIT)
- state = GTK_STATE_FLAG_PRELIGHT;
- else if (gtk_widget_has_focus(widget) && flags & GTK_CELL_RENDERER_SELECTED)
- state = GTK_STATE_FLAG_ACTIVE;
- else
- state = GTK_STATE_FLAG_NORMAL;
-
- width -= xpad*2;
- height -= ypad*2;
-
- if (is_expanded)
- state |= GTK_STATE_FLAG_CHECKED;
- else
- state &= ~GTK_STATE_FLAG_CHECKED;
-
- context = gtk_widget_get_style_context(widget);
- gtk_style_context_add_class(context, GTK_STYLE_CLASS_VIEW);
- gtk_style_context_add_class(context, GTK_STYLE_CLASS_EXPANDER);
- gtk_style_context_set_state(context, state);
- gtk_render_expander(context, cr,
- cell_area->x + xpad, cell_area->y + ypad,
- width, height);
-
- /* only draw the line if the color isn't set - this prevents a bug where the hline appears only under the expander */
- g_object_get(cellexpander, "cell-background-set", &set, NULL);
- gtk_widget_get_allocation(widget, &allocation);
-
- if (is_expanded && !set)
- gtk_render_line(context, cr, 0, cell_area->y + cell_area->height,
- allocation.width, cell_area->y + cell_area->height);
-}
-
-static gboolean
-pidgin_cell_renderer_expander_activate(GtkCellRenderer *r,
- GdkEvent *event,
- GtkWidget *widget,
- const gchar *p,
- const GdkRectangle *bg,
- const GdkRectangle *cell,
- GtkCellRendererState flags)
-{
- GtkTreePath *path = gtk_tree_path_new_from_string(p);
- if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path))
- gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
- else
- gtk_tree_view_expand_row(GTK_TREE_VIEW(widget),path,FALSE);
- gtk_tree_path_free(path);
- return FALSE;
-}
--- a/pidgin/gtkcellrendererexpander.h Wed Nov 04 02:35:18 2020 -0600
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Pidgin is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- *
- */
-
-#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
-# error "only <pidgin.h> may be included directly"
-#endif
-
-#ifndef _PIDGINCELLRENDEREREXPANDER_H_
-#define _PIDGINCELLRENDEREREXPANDER_H_
-/**
- * SECTION:gtkcellrendererexpander
- * @section_id: pidgin-gtkcellrendererexpander
- * @short_description: <filename>gtkcellrendererexpander.h</filename>
- * @title: Cell Renderer Expander
- */
-
-#include <gtk/gtk.h>
-
-#define PIDGIN_TYPE_CELL_RENDERER_EXPANDER pidgin_cell_renderer_expander_get_type()
-
-G_BEGIN_DECLS
-
-G_DECLARE_FINAL_TYPE(PidginCellRendererExpander, pidgin_cell_renderer_expander,
- PIDGIN, CELL_RENDERER_EXPANDER, GtkCellRenderer)
-GtkCellRenderer *pidgin_cell_renderer_expander_new (void);
-
-G_END_DECLS
-
-#endif /* _PIDGINCELLRENDEREREXPANDER_H_ */
--- a/pidgin/meson.build Wed Nov 04 02:35:18 2020 -0600
+++ b/pidgin/meson.build Wed Nov 04 02:41:46 2020 -0600
@@ -4,7 +4,6 @@
'gtkblist.c',
'gtkblist-theme.c',
'gtkblist-theme-loader.c',
- 'gtkcellrendererexpander.c',
'gtkconn.c',
'gtkconv.c',
'gtkdialogs.c',
@@ -43,6 +42,7 @@
'pidginapplication.c',
'pidginattachment.c',
'pidginbuddylistmenu.c',
+ 'pidgincellrendererexpander.c',
'pidginclosebutton.c',
'pidgincontactcompletion.c',
'pidginconversationwindow.c',
@@ -69,7 +69,6 @@
'gtkblist.h',
'gtkblist-theme.h',
'gtkblist-theme-loader.h',
- 'gtkcellrendererexpander.h',
'gtkconn.h',
'gtkconv.h',
'gtkconvwin.h',
@@ -110,6 +109,7 @@
'pidginapplication.h',
'pidginattachment.h',
'pidginbuddylistmenu.h',
+ 'pidgincellrendererexpander.h',
'pidginclosebutton.h',
'pidgincontactcompletion.h',
'pidginconversationwindow.h',
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidgincellrendererexpander.c Wed Nov 04 02:41:46 2020 -0600
@@ -0,0 +1,181 @@
+/*
+ * Pidgin - Internet Messenger
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "pidgin/pidgincellrendererexpander.h"
+
+struct _PidginCellRendererExpander {
+ GtkCellRenderer parent;
+};
+
+G_DEFINE_TYPE(PidginCellRendererExpander, pidgin_cell_renderer_expander,
+ GTK_TYPE_CELL_RENDERER)
+
+/******************************************************************************
+ * GtkCellRenderer Implementation
+ *****************************************************************************/
+static void
+pidgin_cell_renderer_expander_get_size(GtkCellRenderer *renderer,
+ GtkWidget *widget,
+ const GdkRectangle *cell_area,
+ gint *x_offset, gint *y_offset,
+ gint *width, gint *height)
+{
+ gint calc_width = 0, calc_height = 0;
+ gint xpad = 0, ypad = 0;
+ gint expander_size = 0;
+
+ gtk_widget_style_get(widget, "expander-size", &expander_size, NULL);
+
+ gtk_cell_renderer_get_padding(renderer, &xpad, &ypad);
+ calc_width = (xpad * 2) + expander_size;
+ calc_height = (ypad * 2) + expander_size;
+
+ if(width) {
+ *width = calc_width;
+ }
+
+ if(height) {
+ *height = calc_height;
+ }
+
+ if(cell_area) {
+ gfloat xalign = 0.0f, yalign = 0.0f;
+
+ gtk_cell_renderer_get_alignment(renderer, &xalign, &yalign);
+
+ if(x_offset) {
+ *x_offset = (gint)(xalign * (cell_area->width - calc_width));
+ *x_offset = MAX (*x_offset, 0);
+ }
+
+ if(y_offset) {
+ *y_offset = (gint)(yalign * (cell_area->height - calc_height));
+ *y_offset = MAX (*y_offset, 0);
+ }
+ }
+}
+
+static void
+pidgin_cell_renderer_expander_render(GtkCellRenderer *renderer, cairo_t *cr,
+ GtkWidget *widget,
+ const GdkRectangle *background_area,
+ const GdkRectangle *cell_area,
+ GtkCellRendererState flags)
+{
+ GtkStateFlags state;
+ GtkStyleContext *context = NULL;
+ gboolean is_expanded = FALSE, is_expander = FALSE;
+ gint xpad = 0, ypad = 0;
+ gint width = cell_area->width, height = cell_area->height;
+
+ /* if the row doesn't have children, bail out. */
+ g_object_get(G_OBJECT(renderer), "is-expander", &is_expander, NULL);
+ if(!is_expander) {
+ return;
+ }
+
+ /* Figure out the state of the renderer. */
+ if(!gtk_widget_get_sensitive(widget)) {
+ state = GTK_STATE_FLAG_INSENSITIVE;
+ } else if(flags & GTK_CELL_RENDERER_PRELIT) {
+ state = GTK_STATE_FLAG_PRELIGHT;
+ } else if(gtk_widget_has_focus(widget) && flags & GTK_CELL_RENDERER_SELECTED) {
+ state = GTK_STATE_FLAG_ACTIVE;
+ } else {
+ state = GTK_STATE_FLAG_NORMAL;
+ }
+
+ g_object_get(G_OBJECT(renderer), "is-expanded", &is_expanded, NULL);
+ if(is_expanded) {
+ state |= GTK_STATE_FLAG_CHECKED;
+ } else {
+ state &= ~GTK_STATE_FLAG_CHECKED;
+ }
+
+ /* Build our style context */
+ context = gtk_widget_get_style_context(widget);
+ gtk_style_context_add_class(context, GTK_STYLE_CLASS_VIEW);
+ gtk_style_context_add_class(context, GTK_STYLE_CLASS_EXPANDER);
+ gtk_style_context_set_state(context, state);
+
+ /* Adjust the width and height according to the padding. */
+ gtk_cell_renderer_get_padding(renderer, &xpad, &ypad);
+ width -= xpad * 2;
+ height -= ypad * 2;
+
+ /* Render the arrow. */
+ gtk_render_expander(context, cr,
+ cell_area->x + xpad, cell_area->y + ypad,
+ width, height);
+}
+
+static gboolean
+pidgin_cell_renderer_expander_activate(GtkCellRenderer *r, GdkEvent *event,
+ GtkWidget *widget, const gchar *p,
+ const GdkRectangle *bg,
+ const GdkRectangle *cell,
+ GtkCellRendererState flags)
+{
+ GtkTreePath *path = gtk_tree_path_new_from_string(p);
+
+ if(gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path)) {
+ gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
+ } else {
+ gtk_tree_view_expand_row(GTK_TREE_VIEW(widget),path,FALSE);
+ }
+
+ gtk_tree_path_free(path);
+
+ return FALSE;
+}
+
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
+static void
+pidgin_cell_renderer_expander_init (PidginCellRendererExpander *renderer) {
+ /* there's no accessor for setting the mode, so we have to set the property
+ * explicitly.
+ */
+ g_object_set(G_OBJECT(renderer), "mode",
+ GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
+
+ gtk_cell_renderer_set_padding(GTK_CELL_RENDERER(renderer), 0, 2);
+}
+
+static void
+pidgin_cell_renderer_expander_class_init(PidginCellRendererExpanderClass *klass)
+{
+ GtkCellRendererClass *renderer_class = GTK_CELL_RENDERER_CLASS(klass);
+
+ renderer_class->get_size = pidgin_cell_renderer_expander_get_size;
+ renderer_class->render = pidgin_cell_renderer_expander_render;
+ renderer_class->activate = pidgin_cell_renderer_expander_activate;
+}
+
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
+GtkCellRenderer *
+pidgin_cell_renderer_expander_new(void) {
+ return g_object_new(PIDGIN_TYPE_CELL_RENDERER_EXPANDER, NULL);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/pidgincellrendererexpander.h Wed Nov 04 02:41:46 2020 -0600
@@ -0,0 +1,58 @@
+/*
+ * Pidgin - Internet Messenger
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * Pidgin is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
+# error "only <pidgin.h> may be included directly"
+#endif
+
+#ifndef PIDGIN_CELL_RENDERER_EXPANDER_H
+#define PIDGIN_CELL_RENDERER_EXPANDER_H
+
+/**
+ * SECTION:gtkcellrendererexpander
+ * @section_id: pidgin-gtkcellrendererexpander
+ * @short_description: <filename>gtkcellrendererexpander.h</filename>
+ * @title: Cell Renderer Expander
+ *
+ * A #GtkCellRenderer that can hide its children.
+ */
+
+#include <gtk/gtk.h>
+
+#define PIDGIN_TYPE_CELL_RENDERER_EXPANDER (pidgin_cell_renderer_expander_get_type())
+G_DECLARE_FINAL_TYPE(PidginCellRendererExpander, pidgin_cell_renderer_expander,
+ PIDGIN, CELL_RENDERER_EXPANDER, GtkCellRenderer)
+
+G_BEGIN_DECLS
+
+/**
+ * pidgin_cell_renderer_expander_new:
+ *
+ * Creates a new #PidginCellRendererExpander.
+ *
+ * Returns: (transfer full): The new cell renderer.
+ */
+GtkCellRenderer *pidgin_cell_renderer_expander_new(void);
+
+G_END_DECLS
+
+#endif /* PIDGIN_CELL_RENDERER_EXPANDER_H */
--- a/po/POTFILES.in Wed Nov 04 02:35:18 2020 -0600
+++ b/po/POTFILES.in Wed Nov 04 02:41:46 2020 -0600
@@ -316,7 +316,6 @@
pidgin/gtkblist.c
pidgin/gtkblist-theme.c
pidgin/gtkblist-theme-loader.c
-pidgin/gtkcellrendererexpander.c
pidgin/gtkconn.c
pidgin/gtkconv.c
pidgin/gtkdialogs.c
@@ -350,6 +349,7 @@
pidgin/pidginaccountfilterprotocol.c
pidgin/pidginaccountstore.c
pidgin/pidginattachment.c
+pidgin/pidgincellrendererexpander.c
pidgin/pidginclosebutton.c
pidgin/pidgincontactcompletion.c
pidgin/pidginconversationwindow.c