]> Pileus Git - ~andy/gtk/blob - gtk/gtkaccellabel.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtkaccellabel.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * GtkAccelLabel: GtkLabel with accelerator monitoring facilities.
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, see <http://www.gnu.org/licenses/>.
19  */
20
21 /*
22  * Modified by the GTK+ Team and others 1997-2001.  See the AUTHORS
23  * file for a list of people on the GTK+ Team.  See the ChangeLog
24  * files for a list of changes.  These files are distributed with
25  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
26  */
27
28 #ifndef __GTK_ACCEL_LABEL_H__
29 #define __GTK_ACCEL_LABEL_H__
30
31
32 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
33 #error "Only <gtk/gtk.h> can be included directly."
34 #endif
35
36 #include <gtk/gtklabel.h>
37
38
39 G_BEGIN_DECLS
40
41 #define GTK_TYPE_ACCEL_LABEL            (gtk_accel_label_get_type ())
42 #define GTK_ACCEL_LABEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabel))
43 #define GTK_ACCEL_LABEL_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
44 #define GTK_IS_ACCEL_LABEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACCEL_LABEL))
45 #define GTK_IS_ACCEL_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_LABEL))
46 #define GTK_ACCEL_LABEL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
47
48
49 typedef struct _GtkAccelLabel        GtkAccelLabel;
50 typedef struct _GtkAccelLabelClass   GtkAccelLabelClass;
51 typedef struct _GtkAccelLabelPrivate GtkAccelLabelPrivate;
52
53 /**
54  * GtkAccelLabel:
55  *
56  * The #GtkAccelLabel-struct struct contains private data only, and
57  * should be accessed using the functions below.
58  */
59 struct _GtkAccelLabel
60 {
61   GtkLabel label;
62   GtkAccelLabelPrivate *priv;
63 };
64
65 struct _GtkAccelLabelClass
66 {
67   GtkLabelClass  parent_class;
68
69   gchar         *signal_quote1;
70   gchar         *signal_quote2;
71   gchar         *mod_name_shift;
72   gchar         *mod_name_control;
73   gchar         *mod_name_alt;
74   gchar         *mod_separator;
75
76   /* Padding for future expansion */
77   void (*_gtk_reserved1) (void);
78   void (*_gtk_reserved2) (void);
79   void (*_gtk_reserved3) (void);
80   void (*_gtk_reserved4) (void);
81 };
82
83
84 GType      gtk_accel_label_get_type          (void) G_GNUC_CONST;
85 GtkWidget* gtk_accel_label_new               (const gchar   *string);
86 GtkWidget* gtk_accel_label_get_accel_widget  (GtkAccelLabel *accel_label);
87 guint      gtk_accel_label_get_accel_width   (GtkAccelLabel *accel_label);
88 void       gtk_accel_label_set_accel_widget  (GtkAccelLabel *accel_label,
89                                               GtkWidget     *accel_widget);
90 void       gtk_accel_label_set_accel_closure (GtkAccelLabel *accel_label,
91                                               GClosure      *accel_closure);
92 gboolean   gtk_accel_label_refetch           (GtkAccelLabel *accel_label);
93 GDK_AVAILABLE_IN_3_6
94 void       gtk_accel_label_set_accel         (GtkAccelLabel   *accel_label,
95                                               guint            accelerator_key,
96                                               GdkModifierType  accelerator_mods);
97
98 /* private */
99 gchar *    _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
100                                                          guint               accelerator_key,
101                                                          GdkModifierType     accelerator_mods);
102
103 G_END_DECLS
104
105 #endif /* __GTK_ACCEL_LABEL_H__ */