]> Pileus Git - ~andy/gtk/blob - gtk/gtktipsquery.h
docs/gtkfaq.sgml: fix the spelling of Helge Hess's name
[~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
58   GdkCursor     *query_cursor;
59 };
60
61 struct  _GtkTipsQueryClass
62 {
63   GtkLabelClass                 parent_class;
64
65   void  (*start_query)          (GtkTipsQuery   *tips_query);
66   void  (*stop_query)           (GtkTipsQuery   *tips_query);
67   void  (*widget_entered)       (GtkTipsQuery   *tips_query,
68                                  GtkWidget      *widget,
69                                  const gchar    *tip_text,
70                                  const gchar    *tip_private);
71   gint  (*widget_selected)      (GtkTipsQuery   *tips_query,
72                                  GtkWidget      *widget,
73                                  const gchar    *tip_text,
74                                  const gchar    *tip_private,
75                                  GdkEventButton *event);
76 };
77
78
79 /* --- prototypes --- */
80 GtkType         gtk_tips_query_get_type         (void);
81 GtkWidget*      gtk_tips_query_new              (void);
82 void            gtk_tips_query_start_query      (GtkTipsQuery   *tips_query);
83 void            gtk_tips_query_stop_query       (GtkTipsQuery   *tips_query);
84 void            gtk_tips_query_set_caller       (GtkTipsQuery   *tips_query,
85                                                  GtkWidget      *caller);
86 void            gtk_tips_query_set_labels       (GtkTipsQuery   *tips_query,
87                                                  const gchar    *label_inactive,
88                                                  const gchar    *label_no_tip);
89      
90
91
92 #ifdef __cplusplus
93 #pragma {
94 }
95 #endif /* __cplusplus */
96
97
98 #endif  /* __GTKTIPSQUERY_H__ */