]> Pileus Git - ~andy/gtk/blob - gtk/gtktipsquery.h
New widget GtkTipsQuery for letting the user query tooltips of widgets.
[~andy/gtk] / gtk / gtktipsquery.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * GtkQueryTips: Query onscreen widgets for their tooltips
5  * Copyright (C) 1998 Tim Janik
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library 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 GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the Free
19  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 #ifndef __GTKTIPSQUERY_H__
22 #define __GTKTIPSQUERY_H__
23
24
25 #include <gtk/gtklabel.h>
26
27
28 #ifdef __cplusplus
29 extern "C" {
30 #pragma }
31 #endif /* __cplusplus */
32
33
34 /* --- type macros --- */
35 #define GTK_TIPS_QUERY(obj)             (GTK_CHECK_CAST (obj, gtk_tips_query_get_type (), GtkTipsQuery))
36 #define GTK_TIPS_QUERY_CLASS(klass)     (GTK_CHECK_CLASS_CAST (klass, gtk_tips_query_get_type (), GtkTipsQueryClass))
37 #define GTK_IS_TIPS_QUERY(obj)          (GTK_CHECK_TYPE (obj, gtk_tips_query_get_type ()))
38
39
40 /* --- typedefs --- */
41 typedef struct  _GtkTipsQuery           GtkTipsQuery;
42 typedef struct  _GtkTipsQueryClass      GtkTipsQueryClass;
43
44
45 /* --- structures --- */
46 struct  _GtkTipsQuery
47 {
48   GtkLabel      label;
49
50   guint         emit_always : 1;
51   guint         in_query : 1;
52   gchar         *label_inactive;
53   gchar         *label_no_tip;
54
55   GtkWidget     *caller;
56   GtkWidget     *last_crossed;
57   GSList        *event_restore_list;
58 };
59
60 struct  _GtkTipsQueryClass
61 {
62   GtkLabelClass                 parent_class;
63
64   void  (*start_query)          (GtkTipsQuery   *tips_query);
65   void  (*stop_query)           (GtkTipsQuery   *tips_query);
66   void  (*widget_entered)       (GtkTipsQuery   *tips_query,
67                                  GtkWidget      *widget,
68                                  const gchar    *tip_text,
69                                  const gchar    *tip_private);
70   gint  (*widget_selected)      (GtkTipsQuery   *tips_query,
71                                  GtkWidget      *widget,
72                                  const gchar    *tip_text,
73                                  const gchar    *tip_private,
74                                  GdkEventButton *event);
75 };
76
77
78 /* --- prototypes --- */
79 GtkType         gtk_tips_query_get_type         (void);
80 GtkWidget*      gtk_tips_query_new              (void);
81 void            gtk_tips_query_start_query      (GtkTipsQuery   *tips_query);
82 void            gtk_tips_query_stop_query       (GtkTipsQuery   *tips_query);
83 void            gtk_tips_query_set_caller       (GtkTipsQuery   *tips_query,
84                                                  GtkWidget      *caller);
85 void            gtk_tips_query_set_labels       (GtkTipsQuery   *tips_query,
86                                                  const gchar    *label_inactive,
87                                                  const gchar    *label_no_tip);
88      
89
90
91 #ifdef __cplusplus
92 #pragma {
93 }
94 #endif /* __cplusplus */
95
96
97 #endif  /* __GTKTIPSQUERY_H__ */