Remove the Gtk Ticker plugin as it doesn't scale to today's IM networks
Remove the ticker plugin as it doesn't scale to todays typical IM usage.
Testing Done:
Compile and install.
Reviewed at https://reviews.imfreedom.org/r/81/
--- a/pidgin/plugins/meson.build Thu Aug 20 21:45:28 2020 -0500
+++ b/pidgin/plugins/meson.build Sat Aug 22 02:58:07 2020 -0500
@@ -6,7 +6,6 @@
--- a/pidgin/plugins/ticker/gtkticker.c Thu Aug 20 21:45:28 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,559 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02111-1301, USA.
- * GtkTicker Copyright 2000 Syd Logan
- GtkContainer container;
- guint interval; /* how often to scootch */
- gint spacing; /* inter-child horizontal spacing */
- guint scootch; /* how many pixels to move each scootch */
- gint timer; /* timer object */
- gint total; /* total width of widgets */
- gint width; /* width of containing window */
-static void gtk_ticker_compute_offsets (GtkTicker *ticker);
-static void gtk_ticker_class_init (GtkTickerClass *klass);
-static void gtk_ticker_init (GtkTicker *ticker);
-static void gtk_ticker_map (GtkWidget *widget);
-static void gtk_ticker_realize (GtkWidget *widget);
-static void gtk_ticker_get_preferred_width (GtkWidget *widget,
-static void gtk_ticker_get_preferred_height (GtkWidget *widget,
-static void gtk_ticker_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
-static void gtk_ticker_add_real (GtkContainer *container,
-static void gtk_ticker_remove_real (GtkContainer *container,
-static void gtk_ticker_forall (GtkContainer *container,
- gboolean include_internals,
- gpointer callback_data);
-static GType gtk_ticker_child_type (GtkContainer *container);
-static GtkContainerClass *parent_class = NULL;
-G_DEFINE_DYNAMIC_TYPE(GtkTicker, gtk_ticker, GTK_TYPE_CONTAINER);
-/* This exists solely because the above macro makes gtk_ticker_register_type
-gtk_ticker_register(PurplePlugin *plugin)
- gtk_ticker_register_type(G_TYPE_MODULE(plugin));
-static void gtk_ticker_finalize(GObject *object) {
- gtk_ticker_stop_scroll(GTK_TICKER(object));
- G_OBJECT_CLASS(parent_class)->finalize(object);
-static void gtk_ticker_class_init (GtkTickerClass *class)
- GObjectClass *gobject_class;
- GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
- gobject_class = (GObjectClass*) class;
- widget_class = (GtkWidgetClass*) class;
- container_class = (GtkContainerClass*) class;
- parent_class = g_type_class_ref (GTK_TYPE_CONTAINER);
- gobject_class->finalize = gtk_ticker_finalize;
- widget_class->map = gtk_ticker_map;
- widget_class->realize = gtk_ticker_realize;
- widget_class->get_preferred_width = gtk_ticker_get_preferred_width;
- widget_class->get_preferred_height = gtk_ticker_get_preferred_height;
- widget_class->size_allocate = gtk_ticker_size_allocate;
- container_class->add = gtk_ticker_add_real;
- container_class->remove = gtk_ticker_remove_real;
- container_class->forall = gtk_ticker_forall;
- container_class->child_type = gtk_ticker_child_type;
-gtk_ticker_class_finalize(G_GNUC_UNUSED GtkTickerClass *klass)
-static GType gtk_ticker_child_type (GtkContainer *container)
- return GTK_TYPE_WIDGET;
-static void gtk_ticker_init (GtkTicker *ticker)
- gtk_widget_set_has_window (GTK_WIDGET (ticker), TRUE);
- ticker->interval = (guint) 200;
- ticker->scootch = (guint) 2;
- ticker->children = NULL;
-GtkWidget* gtk_ticker_new (void)
- return GTK_WIDGET(g_object_new(GTK_TYPE_TICKER, NULL));
-static void gtk_ticker_put (GtkTicker *ticker, GtkWidget *widget)
- GtkTickerChild *child_info;
- g_return_if_fail (ticker != NULL);
- g_return_if_fail (GTK_IS_TICKER (ticker));
- g_return_if_fail (widget != NULL);
- child_info = g_new(GtkTickerChild, 1);
- child_info->widget = widget;
- gtk_widget_set_parent(widget, GTK_WIDGET (ticker));
- ticker->children = g_list_append (ticker->children, child_info);
- if (gtk_widget_get_realized (GTK_WIDGET (ticker)))
- gtk_widget_realize (widget);
- if (gtk_widget_get_visible (GTK_WIDGET (ticker)) &&
- gtk_widget_get_visible (widget))
- if (gtk_widget_get_mapped (GTK_WIDGET (ticker)))
- gtk_widget_map (widget);
- gtk_widget_queue_resize (GTK_WIDGET (ticker));
-void gtk_ticker_set_interval (GtkTicker *ticker, gint interval)
- g_return_if_fail (ticker != NULL);
- g_return_if_fail (GTK_IS_TICKER (ticker));
- ticker->interval = interval;
-guint gtk_ticker_get_interval (GtkTicker *ticker)
- g_return_val_if_fail (ticker != NULL, -1);
- g_return_val_if_fail (GTK_IS_TICKER (ticker), -1);
- return ticker->interval;
-void gtk_ticker_set_scootch (GtkTicker *ticker, gint scootch)
- g_return_if_fail (ticker != NULL);
- g_return_if_fail (GTK_IS_TICKER (ticker));
- ticker->scootch = scootch;
-guint gtk_ticker_get_scootch (GtkTicker *ticker )
- g_return_val_if_fail (ticker != NULL, -1);
- g_return_val_if_fail (GTK_IS_TICKER (ticker), -1);
- return ticker->scootch;
-void gtk_ticker_set_spacing (GtkTicker *ticker, gint spacing )
- g_return_if_fail (ticker != NULL);
- g_return_if_fail (GTK_IS_TICKER (ticker));
- ticker->spacing = spacing;
-static int ticker_timeout(gpointer data)
- GtkTicker *ticker = (GtkTicker *) data;
- if (gtk_widget_get_visible (GTK_WIDGET (ticker)))
- gtk_widget_queue_resize (GTK_WIDGET (ticker));
-void gtk_ticker_start_scroll(GtkTicker *ticker)
- g_return_if_fail (ticker != NULL);
- g_return_if_fail (GTK_IS_TICKER (ticker));
- if ( ticker->timer != 0 )
- ticker->timer = g_timeout_add(ticker->interval, ticker_timeout, ticker);
-void gtk_ticker_stop_scroll(GtkTicker *ticker)
- g_return_if_fail (ticker != NULL);
- g_return_if_fail (GTK_IS_TICKER (ticker));
- if ( ticker->timer == 0 )
- g_source_remove(ticker->timer);
-guint gtk_ticker_get_spacing (GtkTicker *ticker )
- g_return_val_if_fail (ticker != NULL, -1);
- g_return_val_if_fail (GTK_IS_TICKER (ticker), -1);
- return ticker->spacing;
-static void gtk_ticker_map (GtkWidget *widget)
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_TICKER (widget));
- gtk_widget_set_mapped (widget, TRUE);
- ticker = GTK_TICKER (widget);
- children = ticker->children;
- child = children->data;
- children = children->next;
- if (gtk_widget_get_visible (child->widget) &&
- !gtk_widget_get_mapped (child->widget))
- gtk_widget_map (child->widget);
- gdk_window_show (gtk_widget_get_window (widget));
-static void gtk_ticker_realize (GtkWidget *widget)
- GdkWindowAttr attributes;
- GtkStyleContext *context;
- GtkAllocation allocation;
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_TICKER (widget));
- gtk_widget_set_realized (widget, TRUE);
- attributes.window_type = GDK_WINDOW_CHILD;
- gtk_widget_get_allocation (widget, &allocation);
- attributes.x = allocation.x;
- attributes.y = allocation.y;
- attributes.width = allocation.width;
- attributes.height = allocation.height;
- attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.visual = gtk_widget_get_visual (widget);
- attributes.event_mask = gtk_widget_get_events (widget);
- attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
- window = gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes, attributes_mask);
- gtk_widget_set_window (widget, window);
- gdk_window_set_user_data (window, widget);
- context = gtk_widget_get_style_context(widget);
- gtk_style_context_add_class(context, GTK_STYLE_CLASS_BACKGROUND);
- gtk_style_context_set_state(context, GTK_STATE_FLAG_NORMAL);
- gtk_style_context_set_background(context, window);
-gtk_ticker_get_preferred_width (GtkWidget *widget,
- gint child_min_width, child_nat_width;
- ticker = GTK_TICKER (widget);
- *minimal_width = width = 0;
- children = ticker->children;
- child = children->data;
- children = children->next;
- if (gtk_widget_get_visible (child->widget))
- gtk_widget_get_preferred_width (child->widget, &child_min_width, &child_nat_width);
- width += child_nat_width + ticker->spacing;
- *minimal_width = MAX(*minimal_width, child_min_width);
- if ( width > ticker->spacing )
- width -= ticker->spacing;
- border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
- width += border_width * 2;
- *natural_width = width;
-gtk_ticker_get_preferred_height (GtkWidget *widget,
- gint child_min_height, child_nat_height;
- ticker = GTK_TICKER (widget);
- children = ticker->children;
- child = children->data;
- children = children->next;
- if (gtk_widget_get_visible (child->widget))
- gtk_widget_get_preferred_height (child->widget, &child_min_height, &child_nat_height);
- height = MAX (height, child_nat_height);
- border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
- height += border_width * 2;
- *minimal_height = *natural_height = height;
-static void gtk_ticker_compute_offsets (GtkTicker *ticker)
- GtkAllocation allocation;
- GtkRequisition child_requisition;
- g_return_if_fail (ticker != NULL);
- g_return_if_fail (GTK_IS_TICKER(ticker));
- border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
- gtk_widget_get_allocation (GTK_WIDGET (ticker), &allocation);
- ticker->width = allocation.width;
- children = ticker->children;
- child = children->data;
- if (gtk_widget_get_visible (child->widget)) {
- gtk_widget_get_preferred_size (child->widget, NULL, &child_requisition);
- child->offset = ticker->total;
- child_requisition.width + border_width + ticker->spacing;
- children = children->next;
-static void gtk_ticker_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
- GtkAllocation child_allocation;
- GtkRequisition child_requisition;
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_TICKER(widget));
- g_return_if_fail (allocation != NULL);
- ticker = GTK_TICKER (widget);
- gtk_widget_get_allocation (GTK_WIDGET (ticker), &a);
- if ( a.width != ticker->width )
- if ( ticker->dirty == TRUE ) {
- gtk_ticker_compute_offsets( ticker );
- gtk_widget_set_allocation (widget, allocation);
- if (gtk_widget_get_realized (widget))
- gdk_window_move_resize (gtk_widget_get_window (widget),
- border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
- children = ticker->children;
- child = children->data;
- child->x -= ticker->scootch;
- if (gtk_widget_get_visible (child->widget)) {
- gtk_widget_get_preferred_size (child->widget, NULL, &child_requisition);
- child_allocation.width = child_requisition.width;
- child_allocation.x = child->offset + border_width + child->x;
- if ( ( child_allocation.x + child_allocation.width ) < allocation->x ) {
- if ( ticker->total >= allocation->width ) {
- child->x += allocation->x + allocation->width + ( ticker->total - ( allocation->x + allocation->width ) );
- child->x += allocation->x + allocation->width;
- child_allocation.y = border_width;
- child_allocation.height = child_requisition.height;
- gtk_widget_size_allocate (child->widget, &child_allocation);
- children = children->next;
-void gtk_ticker_add(GtkTicker *ticker, GtkWidget *widget)
- gtk_ticker_add_real( GTK_CONTAINER( ticker ), widget );
-void gtk_ticker_remove(GtkTicker *ticker, GtkWidget *widget)
- gtk_ticker_remove_real( GTK_CONTAINER( ticker ), widget );
-static void gtk_ticker_add_real(GtkContainer *container, GtkWidget *widget)
- g_return_if_fail (container != NULL);
- g_return_if_fail (GTK_IS_TICKER (container));
- g_return_if_fail (widget != NULL);
- gtk_ticker_put(GTK_TICKER (container), widget);
-static void gtk_ticker_remove_real(GtkContainer *container, GtkWidget *widget)
- g_return_if_fail (container != NULL);
- g_return_if_fail (GTK_IS_TICKER (container));
- g_return_if_fail (widget != NULL);
- ticker = GTK_TICKER (container);
- children = ticker->children;
- child = children->data;
- if (child->widget == widget)
- gboolean was_visible = gtk_widget_get_visible (widget);
- gtk_widget_unparent (widget);
- ticker->children = g_list_remove_link (ticker->children, children);
- g_list_free (children);
- if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container)))
- gtk_widget_queue_resize (GTK_WIDGET (container));
- children = children->next;
-static void gtk_ticker_forall (GtkContainer *container,
- gboolean include_internals,
- gpointer callback_data)
- g_return_if_fail (container != NULL);
- g_return_if_fail (GTK_IS_TICKER (container));
- g_return_if_fail (callback != NULL);
- ticker = GTK_TICKER (container);
- children = ticker->children;
- child = children->data;
- children = children->next;
- (* callback) (child->widget, callback_data);
--- a/pidgin/plugins/ticker/gtkticker.h Thu Aug 20 21:45:28 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02111-1301, USA.
- * Copyright 2000 Syd Logan
-#ifndef __GTK_TICKER_H__
-#define __GTK_TICKER_H__
-#define GTK_TYPE_TICKER gtk_ticker_get_type()
-typedef struct _GtkTickerChild GtkTickerChild;
-/* XXX children move from right to left, should be able to go other way */
- gint x; /* current position */
- gint offset; /* offset in list */
-G_DECLARE_FINAL_TYPE(GtkTicker, gtk_ticker, GTK, TICKER, GtkContainer)
-void gtk_ticker_register(PurplePlugin *plugin);
-GtkWidget* gtk_ticker_new (void);
-void gtk_ticker_add (GtkTicker *ticker,
-void gtk_ticker_remove (GtkTicker *ticker,
-void gtk_ticker_set_interval (GtkTicker *ticker,
-guint gtk_ticker_get_interval (GtkTicker *ticker);
-void gtk_ticker_set_spacing (GtkTicker *ticker,
-guint gtk_ticker_get_spacing (GtkTicker *ticker);
-void gtk_ticker_set_scootch (GtkTicker *ticker,
-guint gtk_ticker_get_scootch (GtkTicker *ticker);
-void gtk_ticker_start_scroll (GtkTicker *ticker);
-void gtk_ticker_stop_scroll (GtkTicker *ticker);
-#endif /* __GTK_TICKER_H__ */
--- a/pidgin/plugins/ticker/meson.build Thu Aug 20 21:45:28 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
- ticker = library('ticker', ticker_SOURCES,
- dependencies : [libpurple_dep, libpidgin_dep, glib],
- install : true, install_dir : PIDGIN_PLUGINDIR)
--- a/pidgin/plugins/ticker/ticker.c Thu Aug 20 21:45:28 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,366 +0,0 @@
- * The line below doesn't apply at all, does it? It should be Syd, Sean, and
- * maybe Nathan, I believe.
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02111-1301, USA.
- * ticker.c -- Syd Logan, Summer 2000
- * pluginized- Sean Egan, Summer 2002
-#include <glib/gi18n-lib.h>
-#define TICKER_PLUGIN_ID "gtk-ticker"
-static GtkWidget *tickerwindow = NULL;
-static GtkWidget *ticker;
- PurpleContact *contact;
-static GList *tickerbuds = NULL;
-static void buddy_ticker_update_contact(PurpleContact *contact);
-static gboolean buddy_ticker_destroy_window(GtkWidget *window,
- GdkEventAny *event, gpointer data) {
- gtk_widget_hide(window);
- return TRUE; /* don't actually destroy the window */
-static void buddy_ticker_create_window(void) {
- gtk_widget_show(tickerwindow);
- tickerwindow = pidgin_create_window(_("Buddy Ticker"), 0, "ticker", TRUE);
- gtk_window_set_default_size(GTK_WINDOW(tickerwindow), 500, -1);
- g_signal_connect(G_OBJECT(tickerwindow), "delete_event",
- G_CALLBACK (buddy_ticker_destroy_window), NULL);
- ticker = gtk_ticker_new();
- gtk_ticker_set_spacing(GTK_TICKER(ticker), 20);
- gtk_container_add(GTK_CONTAINER(tickerwindow), ticker);
- gtk_ticker_set_interval(GTK_TICKER(ticker), 500);
- gtk_ticker_set_scootch(GTK_TICKER(ticker), 10);
- gtk_ticker_start_scroll(GTK_TICKER(ticker));
- gtk_widget_set_size_request(ticker, 1, -1);
- gtk_widget_show_all(tickerwindow);
-static gboolean buddy_click_cb(GtkWidget *widget, GdkEventButton *event, gpointer user_data) {
- PurpleContact *contact = user_data;
- PurpleBuddy *b = purple_contact_get_priority_buddy(contact);
- PurpleIMConversation *im = purple_im_conversation_new(purple_buddy_get_account(b),
- purple_buddy_get_name(b));
- purple_conversation_present(PURPLE_CONVERSATION(im));
-static TickerData *buddy_ticker_find_contact(PurpleContact *c) {
- for(tb = tickerbuds; tb; tb = tb->next) {
- TickerData *td = tb->data;
-static void buddy_ticker_set_pixmap(PurpleContact *c)
- TickerData *td = buddy_ticker_find_contact(c);
- PurplePresence *presence;
- buddy = purple_contact_get_priority_buddy(c);
- presence = purple_buddy_get_presence(buddy);
- stock = pidgin_stock_id_from_presence(presence);
- td->icon = gtk_image_new();
- g_object_set(G_OBJECT(td->icon), "stock", stock,
- "icon-size", gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MICROSCOPIC),
- g_object_set(G_OBJECT(td->icon), "stock", stock, NULL);
-static gboolean buddy_ticker_set_pixmap_cb(gpointer data) {
- if (g_list_find(tickerbuds, td) != NULL) {
- buddy_ticker_update_contact(td->contact);
-static void buddy_ticker_add_buddy(PurpleBuddy *b) {
- PurpleContact *contact;
- contact = purple_buddy_get_contact(b);
- buddy_ticker_create_window();
- if (buddy_ticker_find_contact(contact))
- buddy_ticker_update_contact(contact);
- td = g_new0(TickerData, 1);
- tickerbuds = g_list_append(tickerbuds, td);
- td->ebox = gtk_event_box_new();
- gtk_ticker_add(GTK_TICKER(ticker), td->ebox);
- hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_add(GTK_CONTAINER(td->ebox), hbox);
- buddy_ticker_set_pixmap(contact);
- gtk_box_pack_start(GTK_BOX(hbox), td->icon, FALSE, FALSE, 0);
- g_signal_connect(G_OBJECT(td->ebox), "button-press-event",
- G_CALLBACK(buddy_click_cb), contact);
- td->label = gtk_label_new(purple_contact_get_alias(contact));
- gtk_box_pack_start(GTK_BOX(hbox), td->label, FALSE, FALSE, 2);
- gtk_widget_show_all(td->ebox);
- gtk_widget_show(tickerwindow);
- * Update the icon in a few seconds (after the open door icon has
- * changed). This is somewhat ugly.
- td->timeout = g_timeout_add_seconds(11, buddy_ticker_set_pixmap_cb, td);
-static void ticker_data_free(TickerData *td) {
- g_return_if_fail(td != NULL);
- if (td->timeout != 0) {
- g_source_remove(td->timeout);
-static void buddy_ticker_remove(TickerData *td) {
- gtk_ticker_remove(GTK_TICKER(ticker), td->ebox);
- tickerbuds = g_list_remove(tickerbuds, td);
-static void buddy_ticker_update_contact(PurpleContact *contact) {
- TickerData *td = buddy_ticker_find_contact(contact);
- /* pop up the ticker window again */
- buddy_ticker_create_window();
- if (purple_contact_get_priority_buddy(contact) == NULL)
- buddy_ticker_remove(td);
- buddy_ticker_set_pixmap(contact);
- gtk_label_set_text(GTK_LABEL(td->label), purple_contact_get_alias(contact));
-static void buddy_ticker_remove_buddy(PurpleBuddy *b) {
- PurpleContact *c = purple_buddy_get_contact(b);
- TickerData *td = buddy_ticker_find_contact(c);
- purple_contact_invalidate_priority_buddy(c);
- /* pop up the ticker window again */
- buddy_ticker_create_window();
- buddy_ticker_update_contact(c);
-static void buddy_ticker_show(void)
- PurpleBlistNode *gnode, *cnode, *bnode;
- for (gnode = purple_blist_get_default_root(); gnode;
- gnode = purple_blist_node_get_sibling_next(gnode)) {
- if(!PURPLE_IS_GROUP(gnode))
- for(cnode = purple_blist_node_get_first_child(gnode);
- cnode = purple_blist_node_get_sibling_next(cnode))
- if(!PURPLE_IS_CONTACT(cnode))
- for(bnode = purple_blist_node_get_first_child(cnode);
- bnode = purple_blist_node_get_sibling_next(bnode))
- if(!PURPLE_IS_BUDDY(bnode))
- b = PURPLE_BUDDY(bnode);
- if(PURPLE_BUDDY_IS_ONLINE(b))
- buddy_ticker_add_buddy(b);
-buddy_signon_cb(PurpleBuddy *b)
- PurpleContact *c = purple_buddy_get_contact(b);
- purple_contact_invalidate_priority_buddy(c);
- if(buddy_ticker_find_contact(c))
- buddy_ticker_update_contact(c);
- buddy_ticker_add_buddy(b);
-buddy_signoff_cb(PurpleBuddy *b)
- buddy_ticker_remove_buddy(b);
- gtk_widget_hide(tickerwindow);
-status_changed_cb(PurpleBuddy *b, PurpleStatus *os, PurpleStatus *s)
- PurpleContact *c = purple_buddy_get_contact(b);
- if(buddy_ticker_find_contact(c))
- buddy_ticker_set_pixmap(c);
- buddy_ticker_add_buddy(b);
-signoff_cb(PurpleConnection *gc)
- if (!purple_connections_get_all()) {
- g_list_free_full(tickerbuds, (GDestroyNotify)ticker_data_free);
- gtk_widget_destroy(tickerwindow);
- buddy_ticker_update_contact(td->contact);
-static PidginPluginInfo *
-plugin_query(GError **error)
- const gchar * const authors[] = {
- return pidgin_plugin_info_new(
- "id", TICKER_PLUGIN_ID,
- "name", N_("Buddy Ticker"),
- "version", DISPLAY_VERSION,
- "category", N_("User interface"),
- "summary", N_("A horizontal scrolling version of the buddy list."),
- "description", N_("A horizontal scrolling version of the buddy list."),
- "website", PURPLE_WEBSITE,
- "abi-version", PURPLE_ABI_VERSION,
-plugin_load(PurplePlugin *plugin, GError **error)
- void *blist_handle = purple_blist_get_handle();
- gtk_ticker_register(plugin);
- purple_signal_connect(purple_connections_get_handle(), "signed-off",
- plugin, PURPLE_CALLBACK(signoff_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-signed-on",
- plugin, PURPLE_CALLBACK(buddy_signon_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-signed-off",
- plugin, PURPLE_CALLBACK(buddy_signoff_cb), NULL);
- purple_signal_connect(blist_handle, "buddy-status-changed",
- plugin, PURPLE_CALLBACK(status_changed_cb), NULL);
- if (purple_connections_get_all())
-plugin_unload(PurplePlugin *plugin, GError **error)
- g_list_free_full(tickerbuds, (GDestroyNotify)ticker_data_free);
- if (tickerwindow != NULL) {
- gtk_widget_destroy(tickerwindow);
-PURPLE_PLUGIN_INIT(ticker, plugin_query, plugin_load, plugin_unload);