3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef _PIDGIN_TOOLTIP_H_
23 #define _PIDGIN_TOOLTIP_H_
25 * SECTION:pidgintooltip
26 * @section_id: pidgin-pidgintooltip
27 * @short_description: <filename>pidgintooltip.h</filename>
28 * @title: Pidgin Tooltip API
34 * PidginTooltipCreateForTree:
35 * @tipwindow: The window for the tooltip.
36 * @path: The GtkTreePath representing the row under the cursor.
37 * @userdata: The userdata set during pidgin_tooltip_setup_for_treeview.
38 * @w: The value of this should be set to the desired width of the tooltip window.
39 * @h: The value of this should be set to the desired height of the tooltip window.
41 * Returns: %TRUE if the tooltip was created correctly, %FALSE otherwise.
43 typedef gboolean (*PidginTooltipCreateForTree
)(GtkWidget
*tipwindow
,
44 GtkTreePath
*path
, gpointer userdata
, int *w
, int *h
);
47 * PidginTooltipCreate:
48 * @tipwindow: The window for the tooltip.
49 * @userdata: The userdata set during pidgin_tooltip_show.
50 * @w: The value of this should be set to the desired width of the tooltip window.
51 * @h: The value of this should be set to the desired height of the tooltip window.
53 * Returns: %TRUE if the tooltip was created correctly, %FALSE otherwise.
55 typedef gboolean (*PidginTooltipCreate
)(GtkWidget
*tipwindow
,
56 gpointer userdata
, int *w
, int *h
);
60 * @tipwindow: The window for the tooltip.
61 * @cr: The cairo context for drawing.
62 * @userdata: The userdata set during pidgin_tooltip_setup_for_treeview or pidgin_tooltip_show.
64 * Returns: %TRUE if the tooltip was painted correctly, %FALSE otherwise.
66 typedef gboolean (*PidginTooltipPaint
)(GtkWidget
*tipwindow
, cairo_t
*cr
,
72 * pidgin_tooltip_setup_for_treeview:
74 * @userdata: The userdata to send to the callback functions
75 * @create_cb: Callback function to create the tooltip for a GtkTreePath
76 * @paint_cb: Callback function to paint the tooltip
78 * Setup tooltip drawing functions for a treeview.
80 * Returns: %TRUE if the tooltip callbacks were setup correctly.
82 gboolean
pidgin_tooltip_setup_for_treeview(GtkWidget
*tree
, gpointer userdata
,
83 PidginTooltipCreateForTree create_cb
, PidginTooltipPaint paint_cb
);
86 * pidgin_tooltip_setup_for_widget:
88 * @userdata: The userdata to send to the callback functions
89 * @create_cb: Callback function to create the tooltip for the widget
90 * @paint_cb: Callback function to paint the tooltip
92 * Setup tooltip drawing functions for any widget.
94 * Returns: %TRUE if the tooltip callbacks were setup correctly.
96 gboolean
pidgin_tooltip_setup_for_widget(GtkWidget
*widget
, gpointer userdata
,
97 PidginTooltipCreate create_cb
, PidginTooltipPaint paint_cb
);
100 * pidgin_tooltip_destroy:
102 * Destroy the tooltip.
104 void pidgin_tooltip_destroy(void);
107 * pidgin_tooltip_show:
108 * @widget: The widget the tooltip is for
109 * @userdata: The userdata to send to the callback functions
110 * @create_cb: Callback function to create the tooltip from the GtkTreePath
111 * @paint_cb: Callback function to paint the tooltip
113 * Create and show a tooltip.
115 void pidgin_tooltip_show(GtkWidget
*widget
, gpointer userdata
,
116 PidginTooltipCreate create_cb
, PidginTooltipPaint paint_cb
);