1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * GtkAccelLabel: GtkLabel with accelerator monitoring facilities.
5 * Copyright (C) 1998 Tim Janik
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.
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.
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.
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/.
30 #ifndef __GTK_ACCEL_LABEL_H__
31 #define __GTK_ACCEL_LABEL_H__
34 #include <gtk/gtklabel.h>
39 #define GTK_TYPE_ACCEL_LABEL (gtk_accel_label_get_type ())
40 #define GTK_ACCEL_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabel))
41 #define GTK_ACCEL_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
42 #define GTK_IS_ACCEL_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACCEL_LABEL))
43 #define GTK_IS_ACCEL_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_LABEL))
44 #define GTK_ACCEL_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass))
47 typedef struct _GtkAccelLabel GtkAccelLabel;
48 typedef struct _GtkAccelLabelClass GtkAccelLabelClass;
56 GtkWidget *accel_widget;
57 GClosure *accel_closure;
58 GtkAccelGroup *accel_group;
60 guint16 accel_string_width;
63 struct _GtkAccelLabelClass
65 GtkLabelClass parent_class;
69 gchar *mod_name_shift;
70 gchar *mod_name_control;
73 gchar *accel_seperator;
74 guint latin1_to_char : 1;
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);
83 #ifndef GTK_DISABLE_DEPRECATED
84 #define gtk_accel_label_accelerator_width gtk_accel_label_get_accel_width
85 #endif /* GTK_DISABLE_DEPRECATED */
87 GType gtk_accel_label_get_type (void) G_GNUC_CONST;
88 GtkWidget* gtk_accel_label_new (const gchar *string);
89 GtkWidget* gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label);
90 guint gtk_accel_label_get_accel_width (GtkAccelLabel *accel_label);
91 void gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
92 GtkWidget *accel_widget);
93 void gtk_accel_label_set_accel_closure (GtkAccelLabel *accel_label,
94 GClosure *accel_closure);
95 gboolean gtk_accel_label_refetch (GtkAccelLabel *accel_label);
98 gchar * _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
99 guint accelerator_key,
100 GdkModifierType accelerator_mods);
104 #endif /* __GTK_ACCEL_LABEL_H__ */