Logo by Browallia (anonymous IP: 18.216.42.225,2258) | ||||||||||||||
| ||||||||||||||
Audio (343) Datatype (51) Demo (203) Development (602) Document (24) Driver (97) Emulation (149) Game (1011) Graphics (500) Library (118) Network (234) Office (66) Utility (932) Video (69) Total files: 4399 Full index file Recent index file
Amigans.net OpenAmiga Aminet IntuitionBase
Support the site
|
This is a simple toolkit library I've created to get rid of AOS technical aspects, because I prefer to concentrate on the interesting part of a project rather than loosing time copying and pasting the same message switch over and over. I guess it can be of some interest for others and it will be required for my next release of USB driver for missile launchers, so here is the first release. There are few basic functionnalities for the moment being as I will add more when needed. Supported functionnalities are: - signal handler management - timer handler management - ReAction window events management Installation ============ Very complex, just drop oltkc.library near your project or add it to LIBS: if you want to use the library in a program, copy the content of the include drawer in SDK:local/common/include Usage in a program ================== Add the include <proto/oltkc.h> in your program and define a global interface: struct OLTKCIFace *IOLTKC = NULL; First you have to instanciate an EventManager, that's the main class which will do the job: EventManager *mgr = IOLTKC->NewEventManager("Sample"); Then you register some event handlers of your choice: IOLTKC->SetOnSignal(mgr, SIGBREAKF_CTRL_C, control_c, NULL, false); This will trigger control_c() each time you press ^C. IOLTKC->AddTimer(mgr, UNIT_VBLANK, DELAY_S, DELAY_uS, true, MY_TIMER_ID, on_timer, NULL); This will trigger on_timer() periodically. IOLTKC->SetDefaultOnWindowEvent(mgr, winobj, default_window_callback, NULL, true); This will trigger default_window_callback() every time an event is set to your window. IOLTKC->SetOnWindowEvent(mgr, winobj, WMHI_CLOSEWINDOW, close_window_callback, NULL, true); This will trigger close_window_callback() every time the close gadget is clicked. Then just let the EventManager take care of the job: IOLTKC->Run(mgr); You leave the manager by "terminating" it somewhere in your event handling code: IOLTKC->Terminate(mgr); Key features: - you don't have to bother about how to use a timer in AmigaOS, just write a function and add it to the manager with a delay - you don't have to bother about the different signals you want to Wait() for, just add the function you want being called for a signal - you can register and unregister a timer, signal or event anytime - you don't have to bother about canceling timers when it's unregistered or the manager terminated, it's taken care of for you - you don't have to bother about unregistering all your handlers when the manager terminates, it's taken care of for you A sample program is included to demonstrate the functionnalities. Bug Report ========== If you've found a bug, - please switch to the debug version of the library and capture the traces, for example with Sashimi, - describe precisely the scenario which reproduces the bug, - describe precisely your hardware and OS setup Send it to me olrick.lefebvre()olrick.fr ToDo ==== - add functionnalities as it is needed or asked for Greetings ========= Thanks to: - the AmiOuest Team and friends for the support, the nice parties and the beer sharings: Alexandre Balaban Guillaume 'zzd10h' Boesel Hugues 'HunoPPC' Nouvel Jérome 'Glames' Senay Mathias 'Corto' Parnaudeau Philippe 'Elwood' Ferrucci - Tonyw and BroadBlues for their help and advices about library development - AmigaOS software and hardware developpers for keeping this party going |
Copyright © 2004-2024 by Björn Hagström All Rights Reserved |