]> Pileus Git - ~andy/gtk/blob - gtk/gtktooltips.h
Do nothing on empty string, quietly.
[~andy/gtk] / gtk / gtktooltips.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __GTK_TOOLTIPS_H__
20 #define __GTK_TOOLTIPS_H__
21
22 #include <gdk/gdk.h>
23 #include <gtk/gtkdata.h>
24
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 #define GTK_TYPE_TOOLTIPS                  (gtk_tooltips_get_type ())
31 #define GTK_TOOLTIPS(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_TOOLTIPS, GtkTooltips))
32 #define GTK_TOOLTIPS_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLTIPS, GtkTooltipsClass))
33 #define GTK_IS_TOOLTIPS(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_TOOLTIPS))
34 #define GTK_IS_TOOLTIPS_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLTIPS))
35
36 typedef struct _GtkTooltips      GtkTooltips;
37 typedef struct _GtkTooltipsClass GtkTooltipsClass;
38 typedef struct _GtkTooltipsData  GtkTooltipsData;
39
40 struct _GtkTooltipsData
41 {
42   GtkTooltips *tooltips;
43   GtkWidget *widget;
44   gchar *tip_text;
45   gchar *tip_private;
46   GdkFont *font;
47   gint width;
48   GList *row;
49 };
50
51 struct _GtkTooltips
52 {
53   GtkData data;
54
55   GtkWidget *tip_window;
56   GtkTooltipsData *active_tips_data;
57   GList *tips_data_list;
58
59   GdkGC *gc;
60   GdkColor *foreground;
61   GdkColor *background;
62
63   guint   delay : 30;
64   guint   enabled : 1;
65   gint    timer_tag;
66 };
67
68 struct _GtkTooltipsClass
69 {
70   GtkDataClass parent_class;
71 };
72
73 GtkType          gtk_tooltips_get_type     (void);
74 GtkTooltips*     gtk_tooltips_new          (void);
75
76 void             gtk_tooltips_enable       (GtkTooltips   *tooltips);
77 void             gtk_tooltips_disable      (GtkTooltips   *tooltips);
78 void             gtk_tooltips_set_delay    (GtkTooltips   *tooltips,
79                                             guint          delay);
80 void             gtk_tooltips_set_tip      (GtkTooltips   *tooltips,
81                                             GtkWidget     *widget,
82                                             const gchar   *tip_text,
83                                             const gchar   *tip_private);
84 void             gtk_tooltips_set_colors   (GtkTooltips   *tooltips,
85                                             GdkColor      *background,
86                                             GdkColor      *foreground);
87 GtkTooltipsData* gtk_tooltips_data_get     (GtkWidget     *widget);
88 void             gtk_tooltips_force_window (GtkTooltips   *tooltips);
89
90
91
92 #ifdef __cplusplus
93 }
94 #endif /* __cplusplus */
95
96
97 #endif /* __GTK_TOOLTIPS_H__ */