comparison pidgin/pidgintooltip.h @ 21877:6bf73aea6450

Some utility functions for showing tooltips. This is used by the buddylist, the roomlist and the infopane in the conversation window. The userlist in chats can also use this, I think. It works OK, but it may be possible to make the code a bit nicer. Any suggestions?
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 06 Dec 2007 07:33:53 +0000
parents
children f5d961556972
comparison
equal deleted inserted replaced
21789:cbf778310bdd 21877:6bf73aea6450
1 /**
2 * @file pidgintooltip.h Pidgin Tooltip API
3 * @ingroup pidgin
4 */
5
6 /* pidgin
7 *
8 * Pidgin is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26 #ifndef _PIDGIN_TOOLTIP_H_
27 #define _PIDGIN_TOOLTIP_H_
28
29 #include <gtk/gtk.h>
30
31 typedef gboolean (*PidginTooltipCreateForTree)(GtkWidget *window, GtkTreePath *path, gpointer userdata, int *w, int *h);
32 typedef gboolean (*PidginTooltipCreate)(GtkWidget *window, gpointer userdata, int *w, int *h);
33 typedef gboolean (*PidginTooltipPaint)(GtkWidget *widget, GdkEventExpose *event, gpointer data);
34
35 /**
36 * Setup tooltip drawing functions for a treeview.
37 *
38 * @param tree The treeview
39 * @param userdata The userdata to send to the callback functions
40 * @param create_cb Callback function to create the tooltip from the GtkTreePath
41 * @param paint_cb Callback function to paint the tooltip
42 *
43 * @return @c TRUE if the tooltip callbacks were setup correctly.
44 * @since
45 */
46 gboolean pidgin_tooltip_setup_for_treeview(GtkWidget *tree, gpointer userdata,
47 PidginTooltipCreateForTree create_cb, PidginTooltipPaint paint_cb);
48
49 /**
50 * Destroy the tooltip.
51 */
52 void pidgin_tooltip_destroy(void);
53
54 /**
55 * Create and show a tooltip.
56 *
57 * @param widget The widget the tooltip is for
58 * @param userdata The userdata to send to the callback functions
59 * @param create_cb Callback function to create the tooltip from the GtkTreePath
60 * @param paint_cb Callback function to paint the tooltip
61 *
62 * @since
63 */
64 void pidgin_tooltip_show(GtkWidget *widget, gpointer userdata,
65 PidginTooltipCreate create_cb, PidginTooltipPaint paint_cb);
66 #endif