gandi_driver(3) - Linux man page
Name
This manpage describes routines thru which a dialog with the user proceeds.Synopsis
#include <gandi_core.h>GANDIT_drvret GANDI_action_driver(int key);
int GANDI_ctrl(int k);
GANDIT_drvret GANDI_driver(GANDIT_drvret stat);
int GANDI_getch(void *w);
int GANDI_meta(int k);
Description
GANDIT_drvret GANDI_action_driver(int key);
There is no reason to call this routine directly. Leave this for GANDI_driver which calls it with the key pressed (or its alias gandi_keyalias(3gandi)) as the argument.At first, this function gets a system key value (see gandi_keymap(3gandi)) from a widget's keymap_sys and calls GANDI_super_driver if it is neccesary. The second step is to call the widget's pre_driver (see gandi_keymap(3gandi) for decription of its second argument). The return value will be transfered to the widget's driver. There is only one case, when driver will not follow the pre_driver, if the widget no longer exists. Note too, that this step will not be processed if keymap_sys (or super_driver) did not set the GANDI_drvCONT flag! Now follows the third step - post_driver. It will be called with the first two arguments are the same as for the driver and the last argument will be the return value of the driver. The post_driver will not be called if the driver sets the GANDI_drvSTOP flag.
int GANDI_ctrl(int k);
k is a key code returned by getch(3NCURSES). This macro returns k decreased by code of ''' character (just before 'a'). It is intended to be the same key but with CTRL pressed. You can use this (the CTRL key) in conjunction with printable characters only (letter, digits, etc.).GANDIT_drvret GANDI_driver(GANDIT_drvret stat);
This routine converses with user. No other routines do it. Dialogue will be interrupted as soon as the state stat is reached (see the possible values below).int GANDI_getch(void *w);
It applies wgetch(3NCURSES) for the widget's border object only or, if NULL is specified, executes getch(3NCURSES). And it adds the ALT flag, using GANDI_meta, when it is needed. The result will be returned.Any key, pressed just after ESC within a delay time, will be recognized as a meta key.
int GANDI_meta(int k);
k is the key code returned by getch(3NCURSES). This macro returns k OR'ed with 0x200. It is intended to be the same key but with ALT pressed.typedef int GANDIT_drvret;
When you meet this type you've to remember the following constants:| GANDI_drvCONT | continue driver (works with an active |
| widget); | |
| GANDI_drvJUST | interrupt driver immediately; |
| GANDI_drvNEXT | activate the next widget; |
| GANDI_drvNONE | no active widgets left; |
| GANDI_drvPREV | activate the previous widget; |
| GANDI_drvQUIT | quit the application; |
| GANDI_drvSTOP | interrupt driver processing (no futher |
| drivers (post_driver after driver | |
| or driver after super_driver) will | |
| be executed, hence no one will override | |
| this value | |
| (e.g. GANDI_drvSTOP | GANDI_drvJUST)). |
Notes
There is a global variableGANDIT_drvret(* GANDI_super_driver)(int val);
If it is not NULL, and the pressed key is a system key with a value (see gandi_keymap(3gandi) about system keys' values) less then -1, this function will be called with an argument -(r + 1), where r is a system key's value.
