2 * @file pidgintooltip.h Pidgin Tooltip API
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.
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.
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.
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
26 #ifndef _PIDGIN_TOOLTIP_H_
27 #define _PIDGIN_TOOLTIP_H_
32 * @param tipwindow The window for the tooltip.
33 * @param path The GtkTreePath representing the row under the cursor.
34 * @param userdata The userdata set during pidgin_tooltip_setup_for_treeview.
35 * @param w The value of this should be set to the desired width of the tooltip window.
36 * @param h The value of this should be set to the desired height of the tooltip window.
38 * @return @c TRUE if the tooltip was created correctly, @c FALSE otherwise.
41 typedef gboolean (*PidginTooltipCreateForTree
)(GtkWidget
*tipwindow
,
42 GtkTreePath
*path
, gpointer userdata
, int *w
, int *h
);
45 * @param tipwindow The window for the tooltip.
46 * @param userdata The userdata set during pidgin_tooltip_show.
47 * @param w The value of this should be set to the desired width of the tooltip window.
48 * @param h The value of this should be set to the desired height of the tooltip window.
50 * @return @c TRUE if the tooltip was created correctly, @c FALSE otherwise.
53 typedef gboolean (*PidginTooltipCreate
)(GtkWidget
*tipwindow
,
54 gpointer userdata
, int *w
, int *h
);
57 * @param tipwindow The window for the tooltip.
58 * @param userdata The userdata set during pidgin_tooltip_setup_for_treeview or pidgin_tooltip_show.
60 * @return @c TRUE if the tooltip was painted correctly, @c FALSE otherwise.
63 typedef gboolean (*PidginTooltipPaint
)(GtkWidget
*tipwindow
, gpointer userdata
);
66 * Setup tooltip drawing functions for a treeview.
68 * @param tree The treeview
69 * @param userdata The userdata to send to the callback functions
70 * @param create_cb Callback function to create the tooltip for a GtkTreePath
71 * @param paint_cb Callback function to paint the tooltip
73 * @return @c TRUE if the tooltip callbacks were setup correctly.
76 gboolean
pidgin_tooltip_setup_for_treeview(GtkWidget
*tree
, gpointer userdata
,
77 PidginTooltipCreateForTree create_cb
, PidginTooltipPaint paint_cb
);
80 * Setup tooltip drawing functions for any widget.
82 * @param widget The widget
83 * @param userdata The userdata to send to the callback functions
84 * @param create_cb Callback function to create the tooltip for the widget
85 * @param paint_cb Callback function to paint the tooltip
87 * @return @c TRUE if the tooltip callbacks were setup correctly.
90 gboolean
pidgin_tooltip_setup_for_widget(GtkWidget
*widget
, gpointer userdata
,
91 PidginTooltipCreate create_cb
, PidginTooltipPaint paint_cb
);
94 * Destroy the tooltip.
97 void pidgin_tooltip_destroy(void);
100 * Create and show a tooltip.
102 * @param widget The widget the tooltip is for
103 * @param userdata The userdata to send to the callback functions
104 * @param create_cb Callback function to create the tooltip from the GtkTreePath
105 * @param paint_cb Callback function to paint the tooltip
109 void pidgin_tooltip_show(GtkWidget
*widget
, gpointer userdata
,
110 PidginTooltipCreate create_cb
, PidginTooltipPaint paint_cb
);