Laxkit
0.0.7.1
|
Public Member Functions | |
virtual int | AddArea (const char *area, ShortcutDefs *cuts, WindowActions *actions) |
virtual int | AddArea (const char *area, ShortcutHandler *handler) |
virtual int | AreaParent (const char *area, const char *parent) |
virtual ShortcutHandler * | NewHandler (const char *area) |
Return a new ShortcutHandler object. The action and shortcut lists are refcounted, not duplicated. | |
virtual ShortcutHandler * | FindHandler (const char *area) |
Return the installed handler for the given area. | |
virtual int | Load (const char *file=NULL) |
Load from file if possible. If file==NULL, use setfile. | |
virtual int | LoadKeysOnly (const char *file) |
virtual int | Save (const char *file=NULL, const char *header=NULL) |
Save to file, or to setfile if file==NULL. | |
virtual int | SaveHTML (const char *file=NULL) |
virtual void | dump_out (FILE *f, int indent, int what, Laxkit::anObject *savecontext) |
virtual void | dump_in_atts (LaxFiles::Attribute *att, int flag, Laxkit::anObject *loadcontext) |
virtual char * | ShortcutString (ShortcutDef *def, char *buffer) |
Just call the other ShortcutString() with key and state. | |
virtual char * | ShortcutString (unsigned int key, unsigned long state, char *buffer) |
virtual int | KeyAndState (const char *str, unsigned int *key, unsigned int *state) |
virtual int | ClearKeys () |
virtual int | UpdateKey (const char *area, unsigned int key, unsigned int state, unsigned int mode, unsigned int newaction) |
virtual int | ReassignKey (const char *area, unsigned int newkey, unsigned int newstate, unsigned int oldkey, unsigned int oldstate, unsigned int mode, unsigned int action) |
Public Member Functions inherited from LaxFiles::DumpUtility | |
virtual Attribute * | dump_out_atts (Attribute *att, int what, Laxkit::anObject *savecontext) |
Default is return NULL. what==0 means write out normal Attribute formatted things. | |
virtual void | dump_in (FILE *f, int indent, int what, Laxkit::anObject *loadcontext, Attribute **att) |
Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts. | |
virtual | ~DumpUtility () |
Empty virtual destructor. | |
Public Member Functions inherited from Laxkit::anObject | |
anObject () | |
Set object_id=getUniqueNumber(). | |
virtual | ~anObject () |
Empty virtual destructor. | |
virtual const char * | whattype () |
Returns the type of anObject. | |
virtual anObject * | duplicate (anObject *ref=NULL) |
virtual int | inc_count () |
Increment the data's count by 1. Returns count. | |
virtual int | dec_count () |
Decrement the count of the data, deleting if count is less than or equal to 0. | |
virtual int | the_count () |
Public Attributes | |
char * | setname |
char * | setfile |
LaxFiles::Attribute | tree |
RefPtrStack< ShortcutHandler > | shortcuts |
Public Attributes inherited from Laxkit::anObject | |
int | suppress_debug |
DeleteRefCountedFunc | deleteMe |
Called when the count is decremented to 0. | |
unsigned long | object_id |
char * | object_idstr |
Additional Inherited Members | |
Protected Attributes inherited from Laxkit::anObject | |
int | _count |
The reference count of the object. |
Class to store collections of shortcuts and actions in a sort of input tree. This is basically a fancy stack of ShortcutHandler objects. Sometimes, there will be WindowAction things defined, but no bound shortcuts, or shortcuts that only are bound to numbers.
|
virtual |
Counts of cuts and actions incremented.
References Laxkit::anObject::dec_count(), and Laxkit::RefPtrStack< T >::push().
|
virtual |
Flush all key shortcuts, but keep all actions. This is used, for instance, with LoadKeysOnly(), which matches all keys to existing actions, but does not load actions. You would want to do this to ensure your application's current actions still exist after loading in a new key set.
References Laxkit::PtrStack< T >::e, Laxkit::PtrStack< T >::flush(), and Laxkit::PtrStack< T >::n.
|
virtual |
If no handler is found for any particular area, then a new one is created.
If one IS found, then any old shortcut bindings are flushed in favor of the new ones. Care must be taken to ensure that there are WindowActions defined for the area BEFORE calling this! Otherwise, the non-number actions defined for the key will not map to anything meaningful.
Implements LaxFiles::DumpUtility.
References Laxkit::ShortcutHandler::AddShortcut(), Laxkit::anObject::dec_count(), Laxkit::PtrStack< T >::e, Laxkit::ShortcutHandler::FindActionNumber(), FindHandler(), isblank(), KeyAndState(), makestr(), Laxkit::PtrStack< T >::n, and Laxkit::RefPtrStack< T >::push().
|
virtual |
* modifiers * +^a,c,h,a,i,n action 5 * shift-alt-'c',h,a,i,n * '+',''',',' someotheraction # <-- a chain of '+' then apostrophe, then comma *
Implements LaxFiles::DumpUtility.
References LaxFiles::Attribute::dump_out(), Laxkit::PtrStack< T >::e, Laxkit::WindowActions::FindAction(), Laxkit::ShortcutDefs::FindShortcutFromAction(), isblank(), Laxkit::PtrStack< T >::n, and ShortcutString().
Referenced by Save().
|
virtual |
Return the installed handler for the given area.
If you are wanting to install a handler object in a window or interface, use NewHandler() instead, and that make a duplicate. The object returned here is merely for informational purposes.
References Laxkit::PtrStack< T >::e, and Laxkit::PtrStack< T >::n.
Referenced by dump_in_atts(), and UpdateKey().
|
virtual |
Return 1 for success or 0 for fail. This is the reverse of ShortcutString().
Referenced by dump_in_atts().
Load from file if possible. If file==NULL, use setfile.
Set setfile to this file, if the load succeeds, else don't change setfile.
Return 0 for success, or nonzero for save fail.
References LaxFiles::DumpUtility::dump_in(), isblank(), lax_basename(), and makestr().
Save to file, or to setfile if file==NULL.
Return 0 for success, or nonzero for save fail. If header is nonzero then first output that string, a newline, then dump_out().
References dump_out(), and makestr().
|
virtual |
It would be good to have buffer at least 20 bytes long. buffer should be null terminated. The key string is strcat'd to it.
See KeyAndState() for the reverse of this.
References Laxkit::key_name_from_value().
|
virtual |
If replace!=0, then replace the action of the key and mode in area with the new action. Otherwise add it as an alternative. Return 0 for sucess, or nonzero for error, could not process.
References FindHandler(), and Laxkit::ShortcutHandler::UpdateKey().