Re: [java-gnome-hackers] BindingSet (was: Update)
Brought to you by:
afcowie
From: Jeffrey M. <ku...@zo...> - 2003-12-27 12:24:57
|
This looks fine to me. -Jeff On Fri, 2003-12-26 at 22:59, Luca De Rugeriis wrote: > This is the finished class (javadocs apart): > > /* > * Java-Gnome Bindings Library > * > * Copyright 1998-2002 the Java-Gnome Team, all rights reserved. > * > * The Java-Gnome bindings library is free software distributed under > * the terms of the GNU Library General Public License version 2. > */ > package org.gnu.gtk; > > import org.gnu.gdk.ModifierType; > import org.gnu.glib.Boxed; > > /** > * Key bindings for individual widgets > */ > public class BindingSet extends Boxed { > > /** > * Construct a new BindingSet using a handle to a native resource. > */ > public BindingSet(int handle) { > this.handle = handle; > } > > /** > * Construct a new BindingSet object. > * @param setName > */ > public BindingSet(String setName) { > handle = gtk_binding_set_new(setName); > } > > static public BindingSet findBindingSet(String setName) { > return new BindingSet(gtk_binding_set_find(setName)); > } > > public boolean activateBindings(int keyval, ModifierType modifier) { > return gtk_bindings_activate(handle, keyval, modifier.getValue()); > } > > public boolean activateBindingSet(int keyval, ModifierType modifier) { > return gtk_binding_set_activate(handle, keyval, modifier.getValue(), handle); > } > > public void clearEntry(int keyval, ModifierType modifier) { > gtk_binding_entry_clear(handle, keyval, modifier.getValue()); > } > > public void addPath(PathType pathType, String pathPattern, PathPriorityType priority) { > gtk_binding_set_add_path(handle, pathType.getValue(), pathPattern, priority.getValue()); > } > > > /**************************************** > * BEGINNING OF JNI CODE > ****************************************/ > native static final protected int gtk_binding_set_new(String setName); > native static final protected int gtk_binding_set_find(String setName); > native static final protected boolean gtk_bindings_activate(int object, int keyval, int modifier); > native static final protected boolean gtk_binding_set_activate(int bindingSet, int keyval, int modifier, int object); > native static final protected void gtk_binding_entry_clear(int bindingSet, int keyval, int modifier); > native static final protected void gtk_binding_set_add_path(int bindingSet, int pathType, String pathPattern, int priority); > /**************************************** > * END OF JNI CODE > ****************************************/ > } > > If you don't find any error, I'll write some comments and commit the changes ;) |