gandi_gandiw(3) - Linux man page

Name

All GANDI widget's core properties.

Synopsis

#include <gandi_core.h>

typedef struct _GANDIW_widget {
    void *                  self;           //widget itself
    PANEL *                 border;         //border window
    PANEL **                panlist;        //widget windows
    void *                  parent;         //parent
    void **                 child;          //children
    bool                    live;           //wether it can be focused
    void *                  resize_o;       //widget to resize
    bool                    movable;        //wether it can be moved
    void **                 move_o;         //widgets to move
    int                     rows_min;       //min lines number
    int                     cols_min;       //min columns number
    int                     rows_max;       //max lines number
    int                     cols_max;       //max columns number
    bool                    allow_border;
    bool                    visible;        //whether it is visible
    GANDIT_key_alias **     key_alias;      //array of key aliases
    GANDIT_keymap **        keymap_sys;     //system key map
    GANDIT_keymap **        keymap;         //key map
    GANDIT_timer *          timer;          //timer structure
    GANDIact_actions        act;            //event handlers
    void *                  userptr;        //one can store anything here
} GANDIW_widget;

Description

Each widget has the structure of GANDIW_widget * type. This is the first property it has and usually called core. GANDI core works with that part only. It is common to all widgets, on the other hand other properties are defined in the widget library header.

Access to most properties is implemented via routines with either GANDI_setwidget_ or GANDI_getwidget_ prefixes followed by the property name (e.g. GANDI_setwidget_live). GANDI_setwidget_ requires only one argument - the widget - and returns the current value. GANDI_getwidget_ requires two - the widget and the value to be set. It returns a value, which is set just after this function executes. It can differ from the desired value in the case of error.

void * self

Points to the widget itself. E.g. there is a widget GANDIW_some_widget *w (wich is declared in the libgandiw_some_widget.so). Its core is w->core. An expression w->core->self will be equal to the w.

PANEL * border

Any GANDI widget has a special panel (see panel(3CURSES)). It is used for the border only. If the widget allows a border, then this panel will be greater by two characters in the heigh and the width than its widget. Otherwise their sizes are equal.

This one is always defined. Manipulate it with the visible and allow_border properties.

PANEL ** panlist

A widget may have panels (see panel(3CURSES)). GANDI core has to know them for the correct drawing. Therefore they all are stored in this array. Use GANDI_get_Npanel (or GANDI_get_Nwindow as well) from gandi_widget(3gandi) for control them. Their number (array size) is determined when GANDI_make_emptywidget is called (see gandi_widget(3gandi)).

This one is always defined but may point to the empty array.

void * parent

The parent widget. See gandi_children(3gandi) for details on relation between parent and its children.

May be NULL if the widget has no parent.

void ** child

Array of widget's children. See gandi_children(3gandi) for the further information.

This one is always defined but may point to the empty array if the widget has no children.

bool live

Defines, whether the widget can be focused (see gandi_active(3gandi)). The timer (see gandi_timer(3gandi)) is still in process.

void resize_o

Assigns the widget wich must be resized instead of this one (see gandi_resize(3gandi)).

bool movable

Defines, whether the widget allows moving (see gandi_widget(3gandi)).

void ** move_o

The list of widgets wich must be resized together with this one (see gandi_move(3gandi)).

It always points to the allocated memory though may be an empty array.

int rows_min, cols_min, rows_max, cols_max

These properties define the minimal and maximal widget size. They limit execution of GANDI_mvwidget(see gandi_widget(3gandi)) and related.

bool allow_border

If it is FALSE the widget will be without a border, i.e. the border panel will not be visible.

bool visible

If it is FALSE the widget will be invisible, but still may be focused! Beware, an invisible widget may confuse users a lot.

GANDIT_key_alias ** key_alias

An array of key aliases. See gandi_keyalias(3gandi) for details.

It is never NULL but may point to the empty array.

GANDIT_keymap ** keymap_sys

A map of system keys. See gandi_keymap(3gandi) for details.

Is never NULL but may point to the empty array.

GANDIT_keymap ** keymap

A map of widget defined keys. See gandi_keymap(3gandi) for details.

May be NULL.

GANDIT_timer * timer

A pointer to the timer structure. See gandi_timer(3gandi) for details.

GANDIact_actions act

It is a structure:
typedef struct _GANDIact_actions {
        GANDIact_pre_focus      pre_focus;
        GANDIact_post_focus     post_focus;
        GANDIact_resize         resize;
        GANDIact_pre_driver     pre_driver;
        GANDIact_driver         driver;
        GANDIact_post_driver    post_driver;
        GANDIact_kill           kill;
} GANDIact_actions;
See gandi_acts(3gandi) about these handlers.

Notes

timer related properties should be controlled with routines with GANDI_setwidget_timer_ and GANDI_getwidget_timer_ prefixes. GANDI_setwidget_timer_ requires three arguments (two for the time set) and GANDI_getwidget_timer_ returns a pointer to the structure. Never use them without GANDI_timer_attach!

In order to get the core part of widget use GANDI_vtw from gandi_service(3gandi).

See Also

gandi_active(3gandi) gandi_acts(3gandi) gandi_children(3gandi) gandi_core(3gandi) gandi_keyalias(3gandi) gandi_keymap(3gandi) gandi_move(3gandi) gandi_resize(3gandi) gandi_service(3gandi) gandi_timer(3gandi) gandi_widget(3gandi) panel(3CURSES)