]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkaccelmap.h
GtkWidget::draw() - Document how to get the dirty region
[~andy/gtk] / gtk / gtkaccelmap.h
index 99d0887ff338f91573d1381a336a7a3134629759..8612f18017a92b042aae82f1c0a16492a369f825 100644 (file)
  * 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.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #ifndef __GTK_ACCEL_MAP_H__
 #define __GTK_ACCEL_MAP_H__
 
 
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
 #include <gtk/gtkaccelgroup.h>
 
 G_BEGIN_DECLS
 
+/* --- global GtkAccelMap object --- */
+#define GTK_TYPE_ACCEL_MAP                (gtk_accel_map_get_type ())
+#define GTK_ACCEL_MAP(accel_map)         (G_TYPE_CHECK_INSTANCE_CAST ((accel_map), GTK_TYPE_ACCEL_MAP, GtkAccelMap))
+#define GTK_ACCEL_MAP_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ACCEL_MAP, GtkAccelMapClass))
+#define GTK_IS_ACCEL_MAP(accel_map)      (G_TYPE_CHECK_INSTANCE_TYPE ((accel_map), GTK_TYPE_ACCEL_MAP))
+#define GTK_IS_ACCEL_MAP_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ACCEL_MAP))
+#define GTK_ACCEL_MAP_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_MAP, GtkAccelMapClass))
+
+typedef struct _GtkAccelMap      GtkAccelMap;
+typedef struct _GtkAccelMapClass GtkAccelMapClass;
 
 /* --- 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);
+/**
+ * GtkAccelMapForeach:
+ * @data: User data passed to gtk_accel_map_foreach() or
+ *  gtk_accel_map_foreach_unfiltered()
+ * @accel_path: Accel path of the current accelerator
+ * @accel_key: Key of the current accelerator
+ * @accel_mods: Modifiers of the current accelerator
+ * @changed: Changed flag of the accelerator (if %TRUE, accelerator has changed
+ *  during runtime and would need to be saved during an accelerator dump)
+ */
 typedef void (*GtkAccelMapForeach)             (gpointer        data,
                                                 const gchar    *accel_path,
                                                 guint           accel_key,
-                                                guint           accel_mods,
+                                                GdkModifierType accel_mods,
                                                 gboolean        changed);
 
 
 /* --- public API --- */
-GQuark    gtk_accel_map_add_entry      (const gchar            *accel_path,
+
+void      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,
+                                        GdkModifierType         accel_mods);
+gboolean   gtk_accel_map_lookup_entry  (const gchar            *accel_path,
                                         GtkAccelKey            *key);
 gboolean   gtk_accel_map_change_entry  (const gchar            *accel_path,
                                         guint                   accel_key,
@@ -65,15 +75,17 @@ void           gtk_accel_map_load_fd        (gint                    fd);
 void      gtk_accel_map_load_scanner   (GScanner               *scanner);
 void      gtk_accel_map_save_fd        (gint                    fd);
 
+void       gtk_accel_map_lock_path      (const gchar            *accel_path);
+void       gtk_accel_map_unlock_path    (const gchar            *accel_path);
 
 /* --- filter functions --- */
-void   gtk_accel_map_add_filter        (const gchar            *filter_pattern);
-void   gtk_accel_map_foreach_unfilterd (gpointer                data,
-                                        GtkAccelMapForeach      foreach_func);
-
+void   gtk_accel_map_add_filter         (const gchar           *filter_pattern);
+void   gtk_accel_map_foreach_unfiltered (gpointer               data,
+                                         GtkAccelMapForeach     foreach_func);
 
-/* --- internal API --- */
-void           _gtk_accel_map_init             (void);
+/* --- notification --- */
+GType        gtk_accel_map_get_type (void) G_GNUC_CONST;
+GtkAccelMap *gtk_accel_map_get      (void);
 
 
 G_END_DECLS