]> Pileus Git - ~andy/gtk/blob - gtk/gtkaccellabel.h
[ Patch from Sebastian Wilhelmi, 52790 ]
[~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, 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-2001.  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_ACCEL_LABEL_H__
31 #define __GTK_ACCEL_LABEL_H__
32
33
34 #include <gtk/gtklabel.h>
35
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41
42 #define GTK_TYPE_ACCEL_LABEL            (gtk_accel_label_get_type ())
43 #define GTK_ACCEL_LABEL(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabel))
44 #define GTK_ACCEL_LABEL_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
45 #define GTK_IS_ACCEL_LABEL(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_ACCEL_LABEL))
46 #define GTK_IS_ACCEL_LABEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_LABEL))
47 #define GTK_ACCEL_LABEL_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
48
49
50 typedef struct _GtkAccelLabel       GtkAccelLabel;
51 typedef struct _GtkAccelLabelClass  GtkAccelLabelClass;
52
53 struct _GtkAccelLabel
54 {
55   GtkLabel label;
56
57   guint      queue_id;
58   guint      accel_padding;
59   GObject   *accel_object;
60   gchar     *accel_string;
61   guint16     accel_string_width;
62 };
63
64 struct _GtkAccelLabelClass
65 {
66   GtkLabelClass  parent_class;
67
68   gchar         *signal_quote1;
69   gchar         *signal_quote2;
70   gchar         *mod_name_shift;
71   gchar         *mod_name_control;
72   gchar         *mod_name_alt;
73   gchar         *mod_separator;
74   gchar         *accel_seperator;
75   guint          latin1_to_char : 1;
76 };
77
78 #ifndef GTK_DISABLE_DEPRECATED
79 #define gtk_accel_label_accelerator_width       gtk_accel_label_get_accel_width
80 #endif /* GTK_DISABLE_DEPRECATED */
81
82 GtkType    gtk_accel_label_get_type          (void) G_GNUC_CONST;
83 GtkWidget *gtk_accel_label_new               (const gchar   *string);
84 GObject   *gtk_accel_label_get_accel_object  (GtkAccelLabel *accel_label);
85 guint      gtk_accel_label_get_accel_width   (GtkAccelLabel *accel_label);
86 void       gtk_accel_label_set_accel_object  (GtkAccelLabel *accel_label,
87                                               GObject       *accel_object);
88 gboolean   gtk_accel_label_refetch           (GtkAccelLabel *accel_label);
89
90 #ifndef GTK_DISABLE_DEPRECATED
91 #define gtk_accel_label_get_accel_widget(accel_label) \
92   GTK_WIDGET(gtk_accel_label_get_accel_object(acel_label))
93 #define gtk_accel_label_set_accel_widget(accel_label, accel_widget) \
94   gtk_accel_label_set_accel_object((accel_label), G_OBJECT(accel_widget))
95 #endif
96
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100
101
102 #endif /* __GTK_ACCEL_LABEL_H__ */