Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# accelgroup.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002 The Inti Development Team.
    00003  *  Copyright (C) 2000 Red Hat, Inc.
    00004  *
    00005  *  This program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2 of the License, or
    00008  *  (at your option) any later version.
    00009  *
    00010  *  This program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00013  *  GNU Library General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU Library General Public License
    00016  *  along with this program; if not, write to the Free Software
    00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00018  */
    00019
    00026
    00027 #ifndef INTI_GTK_ACCEL_GROUP_H
    00028 #define INTI_GTK_ACCEL_GROUP_H
    00029
    00030 #ifndef INTI_G_OBJECT_H
    00031 #include <inti/glib/object.h>
    00032 #endif
    00033
    00034 #ifndef INTI_GDK_TYPES_H
    00035 #include <inti/gdk/types.h>
    00036 #endif
    00037
    00038 #ifndef INTI_GTK_ENUMS_H
    00039 #include <inti/gtk/enums.h>
    00040 #endif
    00041
    00042 namespace Inti {
    00043
    00044 namespace Gtk {
    00045
    00046 class AccelGroupClass;
    00047 class AccelKey;
    00048
    00051
    00052 bool accel_groups_activate(G::Object& object, const AccelKey& accel_key);
    00058
    00059 Gdk::ModifierTypeField accelerator_get_default_mod_mask();
    00062
    00063 void accelerator_set_default_mod_mask(Gdk::ModifierTypeField default_mod_mask);
    00074
    00075 bool accelerator_valid(const AccelKey& accel_key);
    00083
    00084 AccelKey accelerator_parse(const char *accelerator, AccelFlagsField accel_flags = Gtk::ACCEL_VISIBLE);
    00094
    00095 String accelerator_name(const AccelKey& accel_key);
    00102
    00104
    00110
    00111 class AccelKey
    00112 {
    00113         GtkAccelKey key_;
    00114
    00115 public:
    00118
    00119         AccelKey();
    00121
    00122         AccelKey(const char *accelerator, AccelFlagsField accel_flags = Gtk::ACCEL_VISIBLE);
    00131
    00132         AccelKey(unsigned int accel_key, Gdk::ModifierTypeField accel_mods, AccelFlagsField accel_flags = Gtk::ACCEL_VISIBLE);
    00137
    00138         AccelKey(const AccelKey& src);
    00140
    00141         AccelKey& operator=(const AccelKey& src);
    00143
    00147
    00148         GtkAccelKey* gtk_accel_key() const { return const_cast<GtkAccelKey*>(&key_); }
    00150
    00151         operator GtkAccelKey* () const;
    00153
    00154         unsigned int key() const;
    00156
    00157         Gdk::ModifierTypeField mods() const;
    00159
    00160         AccelFlagsField flags() const;
    00162
    00166
    00167         void set(const char *accelerator, AccelFlagsField accel_flags = Gtk::ACCEL_VISIBLE);
    00176
    00177         void set(unsigned int accel_key, Gdk::ModifierTypeField accel_mods, AccelFlagsField accel_flags = Gtk::ACCEL_VISIBLE);
    00182
    00184 };
    00185
    00200
    00201 class AccelGroup : public G::Object
    00202 {
    00203         friend class G::Object;
    00204         friend class AccelGroupClass;
    00205
    00206         AccelGroup(const AccelGroup&);
    00207         AccelGroup& operator=(const AccelGroup&);
    00208
    00209 protected:
    00212
    00213         explicit AccelGroup(GtkAccelGroup *group, bool reference = true);
    00220
    00224
    00225         virtual void on_accel_changed(const AccelKey& accel_key, GClosure *accel_closure);
    00229
    00231 //  Signals
    00232
    00233         typedef G::Signal2<void, const AccelKey&, GClosure*> AccelChangedSignalType;
    00234         typedef G::SignalProxy<TypeInstance, AccelChangedSignalType> AccelChangedSignalProxy;
    00235         static const AccelChangedSignalType accel_changed_signal;
    00236
    00237 public:
    00240
    00241         AccelGroup();
    00243
    00244         virtual ~AccelGroup();
    00246
    00250
    00251         GtkAccelGroup* gtk_accel_group() const { return (GtkAccelGroup*)instance; }
    00253
    00254         GtkAccelGroupClass* gtk_accel_group_class() const;
    00256
    00257         operator GtkAccelGroup* () const;
    00259
    00261
    00262         static AccelGroup* from_accel_closure(GClosure *closure);
    00266
    00269
    00270         void lock();
    00276
    00277         void unlock();
    00279
    00280         void connect(const AccelKey& accel_key, GClosure *closure);
    00291
    00292         void connect(const char *accel_path, GClosure *closure);
    00301
    00302         bool disconnect(GClosure *closure);
    00306
    00307         bool disconnect(const AccelKey& accel_key);
    00311
    00315
    00316         const AccelChangedSignalProxy sig_accel_changed()
    00317         {
    00318                 return AccelChangedSignalProxy(this, &accel_changed_signal);
    00319         }
    00321
    00323 };
    00324
    00325 } // namespace Gtk
    00326
    00327 } // namespace Inti
    00328
    00329 #endif // INTI_GTK_ACCEL_GROUP_H
    00330

Main Page - Footer