CicmWrapper
Beta 0.4
A wrapper for Pure Data
|
The example part for t_ebox. More...
Data Structures | |
struct | t_bang |
The GUI bang structure. More... | |
Functions | |
void | setup_c0x2ebang (void) |
Setups the bang_class for GUI behavior. More... | |
static void * | bang_new (t_symbol *s, int argc, t_atom *argv) |
Allocates and initializes the t_bang structure. More... | |
static void | bang_free (t_bang *x) |
Frees the t_bang structure. More... | |
static void | bang_getdrawparams (t_bang *x, t_object *view, t_edrawparams *params) |
Defines the default graphical parameters of a GUI. More... | |
static void | bang_oksize (t_bang *x, t_rect *newrect) |
Defines and validates the size of a GUI. More... | |
static void | bang_paint (t_bang *x, t_object *view) |
Paints the t_ebox. More... | |
static void | bang_activate (t_bang *x) |
Activates the status of the t_bang. More... | |
static void | bang_deactivate (t_bang *x) |
Deactivates the status of the t_bang. More... | |
static void | bang_mousedown (t_bang *x, t_object *view, t_pt pt, long modifiers) |
Receives the mouse down notification. More... | |
static void | bang_mouseup (t_bang *x, t_object *view, t_pt pt, long modifiers) |
Receives the mouse up notification. More... | |
static void | bang_anything (t_bang *x, t_symbol *s, int argc, t_atom *argv) |
Receives the anything notification. More... | |
Variables | |
static t_eclass * | bang_class |
static t_symbol * | bang_sym_background_layer |
The example part for t_ebox.
This part is an example shows how to initialize a GUI class with methods for painting and mouse interractions and attributes.
struct t_bang |
The GUI bang structure.
It is a basic GUI struture with attributes and basic Pd stuffs.
Data Fields | ||
---|---|---|
t_ebox | b_box |
The t_ebox that allows to create a GUI. |
t_outlet * | b_out |
The t_outlet of the object. |
t_rgba | b_color_background |
The struture for the t_eattr background color. |
t_rgba | b_color_border |
The struture for the t_eattr border color. |
t_rgba | b_color_bang |
The struture for the t_eattr bang color. |
t_clock * | b_clock |
The t_clock of the object. |
char | b_active |
If the object is performming a bang. |
C void setup_c0x2ebang | ( | void | ) |
Setups the bang_class for GUI behavior.
This function is called by Pd to initialize the bang_class of the c.bang object. In the function, you should set up the default methods, behaviors and attributes of your object. If your object's name is simple like "bang", this function should be named "bang_setup" otherwise, if your object's name is more complex like "c.bang" the function's name should replace the special character with the matching UTF8-hexadecimal value and put "setup" before the name of the object. In this example, the dot is replaced with "c0x2e" and the function name becomes "setup_c0x2ebang".
Allocates and initializes the t_bang structure.
The function uses eobj_new to allocate the t_bang with the bang_class and initializes the default values.
s | The name of the object (in this case "c.bang"). |
argc | The number of t_atom parameters. |
argv | The array of t_atom parameters. |
|
static |
Frees the t_bang structure.
The function just calls ebox_free() and frees the t_clock.
x | The t_bang pointer. |
|
static |
Defines the default graphical parameters of a GUI.
The function is used to defines the border size, the border size (dummy mostly for Max compatibility) the border color and the background color of a t_ebox.
x | The t_bang pointer. |
view | The view pointer (dummy). |
params | The t_edrawparams structure to set up. |
Defines and validates the size of a GUI.
The function is validate the new size of a GUI. It can be used to restrict the size.
Paints the t_ebox.
The function is called internally when the t_ebox should be repainted. This is where you should draw all the stuffs you want.
x | The t_bang pointer. |
view | The view that ask to be repainted (dummy mostly for Max compatibility). |
|
static |
Activates the status of the t_bang.
The function activates the status of the t_bang. Outputs a bang message, sends a bang to the attached objects and ask the t_ebox to be redrawn
x | The t_bang pointer. |
|
static |
Deactivates the status of the t_bang.
The function deactiveates the status of the t_bang and ask the t_ebox to be redrawn
x | The t_bang pointer. |
Receives the mouse down notification.
The function is called internally when the object has been clicked.
x | The t_bang pointer. |
view | The view (dummy mostly for Max compatibility). |
pt | The position of the mouse within the object. |
modifiers | The modifiers (alt, ctrl, etc.). |
Receives the mouse up notification.
The function is called internally when the mouse has been released from the object.
x | The t_bang pointer. |
view | The view (dummy mostly for Max compatibility). |
pt | The position of the mouse within the object. |
modifiers | The modifiers (alt, ctrl, etc.). |
Receives the anything notification.
The function is called when any message has been received from the inlet.
x | The t_bang pointer. |
s | The message symbol. |
argc | The number of t_atom. |
argv | The array of t_atom. |
|
static |
|
static |
The "background_layer" t_symbol.