gtk2/gtk/gtkaccelmap.h

82 lines
2.7 KiB
C
Raw Normal View History

added gtkaccelmap.sgml. other updates. Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org> * added gtkaccelmap.sgml. other updates. Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org> * gtk/maketypes.awk: fix type utils generation on unix. * gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator registry. * gtk/gtkaccelgroup.[hc]: major API/implementation revamp: removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default, gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry, gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove, gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object. introduced ::accel_changed signal for change notification, and gtk_accel_group_connect/disconnect to connect closures to accel groups. made gtk_accel_group_attach/detach and gtk_accel_group_activate private functions. deprecated gtk_accel_group_ref/unref. * gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention to accel group changed notification and basically operate on closures. removed gtk_accel_label_get_accel_object and gtk_accel_label_set_accel_object. introduced gtk_accel_label_set_accel_closure, and for convenience, gtk_accel_label_set_accel_widget. * gtk/gtkitemfactory.[hc]: removed accelerator propagation code which mostly moved into gtkaccelmap.[hc]. removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_* and gtk_item_factory_print_func. * gtk/gtkmain.c: call _gtk_accel_map_init(). * gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(), that associates an accelerator path with menu items, through which persistent accelerator settings on menu items are enabled. * gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator paths of menu item can be default constructed to allow installation of accelerators on menu items that don't come with an accelerator binding by default. * gtk/gtksettings.c: fix STRING type rc settings by special casing them appropriately in the parser. * gtk/gtksignal.[hc]: allow a class function offset of 0 for gtk_signal_newv(). * gtk/gtkwidget.[hc]: accelerator API revamp. removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal, gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and gtk_widget_(un)lock_accelerators. accelerators maintained through gtk_widget_add/remove_accelerator() are not runtime changable now, the correct sequence to setup a widget for runtime changable accelerators is now: gtk_accel_map_add_entry(accel_path, key, mods); _gtk_widget_set_accel_path(widget, accel_path, accel_group); * gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel group changes (as well as mnemonic changes) through the new signal ::accels_changed. Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org> * gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle GString->string conversions.
2001-11-13 00:53:47 +00:00
/* GTK - The GIMP Toolkit
* Copyright (C) 1998, 2001 Tim Janik
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_ACCEL_MAP_H__
#define __GTK_ACCEL_MAP_H__
#include <gtk/gtkaccelgroup.h>
G_BEGIN_DECLS
/* --- notifier --- */
typedef void (*GtkAccelMapNotify) (gpointer data,
GQuark accel_path_quark,
guint accel_key,
guint accel_mods,
GtkAccelGroup *accel_group,
guint old_accel_key,
guint old_accel_mods);
typedef void (*GtkAccelMapForeach) (gpointer data,
const gchar *accel_path,
guint accel_key,
guint accel_mods,
gboolean changed);
/* --- public API --- */
GQuark gtk_accel_map_add_entry (const gchar *accel_path,
guint accel_key,
guint accel_mods);
void gtk_accel_map_add_notifer (const gchar *accel_path,
gpointer notify_data,
GtkAccelMapNotify notify_func,
GtkAccelGroup *accel_group);
void gtk_accel_map_remove_notifer (const gchar *accel_path,
gpointer notify_data,
GtkAccelMapNotify notify_func);
GQuark gtk_accel_map_lookup_entry (const gchar *accel_path,
GtkAccelKey *key);
gboolean gtk_accel_map_change_entry (const gchar *accel_path,
guint accel_key,
GdkModifierType accel_mods,
gboolean replace);
void gtk_accel_map_load (const gchar *file_name);
void gtk_accel_map_save (const gchar *file_name);
void gtk_accel_map_foreach (gpointer data,
GtkAccelMapForeach foreach_func);
void gtk_accel_map_load_fd (gint fd);
void gtk_accel_map_load_scanner (GScanner *scanner);
void gtk_accel_map_save_fd (gint fd);
/* --- filter functions --- */
void gtk_accel_map_add_filter (const gchar *filter_pattern);
void gtk_accel_map_foreach_unfilterd (gpointer data,
GtkAccelMapForeach foreach_func);
/* --- internal API --- */
void _gtk_accel_map_init (void);
G_END_DECLS
#endif /* __GTK_ACCEL_MAP_H__ */