]> Pileus Git - ~andy/gtk/blob - gtk/gtktipsquery.h
deprecated gtk_check_menu_item_set_state, people should use
[~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
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22 #ifndef __GTKTIPSQUERY_H__
23 #define __GTKTIPSQUERY_H__
24
25
26 #include <gtk/gtklabel.h>
27
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32
33
34 /* --- type macros --- */
35 #define GTK_TYPE_TIPS_QUERY             (gtk_tips_query_get_type ())
36 #define GTK_TIPS_QUERY(obj)             (GTK_CHECK_CAST ((obj), GTK_TYPE_TIPS_QUERY, GtkTipsQuery))
37 #define GTK_TIPS_QUERY_CLASS(klass)     (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TIPS_QUERY, GtkTipsQueryClass))
38 #define GTK_IS_TIPS_QUERY(obj)          (GTK_CHECK_TYPE ((obj), GTK_TYPE_TIPS_QUERY))
39 #define GTK_IS_TIPS_QUERY_CLASS(klass)  (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TIPS_QUERY))
40
41
42 /* --- typedefs --- */
43 typedef struct  _GtkTipsQuery           GtkTipsQuery;
44 typedef struct  _GtkTipsQueryClass      GtkTipsQueryClass;
45
46
47 /* --- structures --- */
48 struct  _GtkTipsQuery
49 {
50   GtkLabel      label;
51
52   guint         emit_always : 1;
53   guint         in_query : 1;
54   gchar         *label_inactive;
55   gchar         *label_no_tip;
56
57   GtkWidget     *caller;
58   GtkWidget     *last_crossed;
59
60   GdkCursor     *query_cursor;
61 };
62
63 struct  _GtkTipsQueryClass
64 {
65   GtkLabelClass                 parent_class;
66
67   void  (*start_query)          (GtkTipsQuery   *tips_query);
68   void  (*stop_query)           (GtkTipsQuery   *tips_query);
69   void  (*widget_entered)       (GtkTipsQuery   *tips_query,
70                                  GtkWidget      *widget,
71                                  const gchar    *tip_text,
72                                  const gchar    *tip_private);
73   gint  (*widget_selected)      (GtkTipsQuery   *tips_query,
74                                  GtkWidget      *widget,
75                                  const gchar    *tip_text,
76                                  const gchar    *tip_private,
77                                  GdkEventButton *event);
78 };
79
80
81 /* --- prototypes --- */
82 GtkType         gtk_tips_query_get_type         (void);
83 GtkWidget*      gtk_tips_query_new              (void);
84 void            gtk_tips_query_start_query      (GtkTipsQuery   *tips_query);
85 void            gtk_tips_query_stop_query       (GtkTipsQuery   *tips_query);
86 void            gtk_tips_query_set_caller       (GtkTipsQuery   *tips_query,
87                                                  GtkWidget      *caller);
88 void            gtk_tips_query_set_labels       (GtkTipsQuery   *tips_query,
89                                                  const gchar    *label_inactive,
90                                                  const gchar    *label_no_tip);
91      
92
93
94 #ifdef __cplusplus
95 }
96 #endif /* __cplusplus */
97
98
99 #endif  /* __GTKTIPSQUERY_H__ */