]> Pileus Git - ~andy/gtk/blob - gtk/gtktipsquery.h
Use the correct screen for getting the height. (Fix from Stephen Browne,
[~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 Lesser 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  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser 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
23 /*
24  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
25  * file for a list of people on the GTK+ Team.  See the ChangeLog
26  * files for a list of changes.  These files are distributed with
27  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
28  */
29
30 #ifndef GTK_DISABLE_DEPRECATED
31
32 #ifndef __GTKTIPSQUERY_H__
33 #define __GTKTIPSQUERY_H__
34
35
36 #include <gtk/gtklabel.h>
37
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif /* __cplusplus */
42
43
44 /* --- type macros --- */
45 #define GTK_TYPE_TIPS_QUERY             (gtk_tips_query_get_type ())
46 #define GTK_TIPS_QUERY(obj)             (GTK_CHECK_CAST ((obj), GTK_TYPE_TIPS_QUERY, GtkTipsQuery))
47 #define GTK_TIPS_QUERY_CLASS(klass)     (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_TIPS_QUERY, GtkTipsQueryClass))
48 #define GTK_IS_TIPS_QUERY(obj)          (GTK_CHECK_TYPE ((obj), GTK_TYPE_TIPS_QUERY))
49 #define GTK_IS_TIPS_QUERY_CLASS(klass)  (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TIPS_QUERY))
50 #define GTK_TIPS_QUERY_GET_CLASS(obj)   (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_TIPS_QUERY, GtkTipsQueryClass))
51
52
53 /* --- typedefs --- */
54 typedef struct  _GtkTipsQuery           GtkTipsQuery;
55 typedef struct  _GtkTipsQueryClass      GtkTipsQueryClass;
56
57
58 /* --- structures --- */
59 struct  _GtkTipsQuery
60 {
61   GtkLabel      label;
62
63   guint         emit_always : 1;
64   guint         in_query : 1;
65   gchar         *label_inactive;
66   gchar         *label_no_tip;
67
68   GtkWidget     *caller;
69   GtkWidget     *last_crossed;
70
71   GdkCursor     *query_cursor;
72 };
73
74 struct  _GtkTipsQueryClass
75 {
76   GtkLabelClass                 parent_class;
77
78   void  (*start_query)          (GtkTipsQuery   *tips_query);
79   void  (*stop_query)           (GtkTipsQuery   *tips_query);
80   void  (*widget_entered)       (GtkTipsQuery   *tips_query,
81                                  GtkWidget      *widget,
82                                  const gchar    *tip_text,
83                                  const gchar    *tip_private);
84   gint  (*widget_selected)      (GtkTipsQuery   *tips_query,
85                                  GtkWidget      *widget,
86                                  const gchar    *tip_text,
87                                  const gchar    *tip_private,
88                                  GdkEventButton *event);
89
90   /* Padding for future expansion */
91   void (*_gtk_reserved1) (void);
92   void (*_gtk_reserved2) (void);
93   void (*_gtk_reserved3) (void);
94   void (*_gtk_reserved4) (void);
95 };
96
97
98 /* --- prototypes --- */
99 GtkType         gtk_tips_query_get_type         (void) G_GNUC_CONST;
100 GtkWidget*      gtk_tips_query_new              (void);
101 void            gtk_tips_query_start_query      (GtkTipsQuery   *tips_query);
102 void            gtk_tips_query_stop_query       (GtkTipsQuery   *tips_query);
103 void            gtk_tips_query_set_caller       (GtkTipsQuery   *tips_query,
104                                                  GtkWidget      *caller);
105 void            gtk_tips_query_set_labels       (GtkTipsQuery   *tips_query,
106                                                  const gchar    *label_inactive,
107                                                  const gchar    *label_no_tip);
108      
109
110
111 #ifdef __cplusplus
112 }
113 #endif /* __cplusplus */
114
115
116 #endif  /* __GTKTIPSQUERY_H__ */
117
118 #endif /* GTK_DISABLE_DEPRECATED */