CicmWrapper  Beta 0.4
A wrapper for Pure Data
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
Data Structures | Enumerations | Functions
The GUI Object Part

The t_ebox and t_edspbox part. More...

Data Structures

struct  t_edrawparams
 The drawing parameters. More...
 
struct  t_ebox
 The GUI object. More...
 
struct  t_edspbox
 The GUI DSP object. More...
 

Enumerations

enum  emod_flags {
  EMOD_NONE = 0, EMOD_SHIFT = 1, EMOD_MAJ = 2, EMOD_CTRL = 4,
  EMOD_CMD = 8, EMOD_ALT = 16, EMOD_RIGHT = 32
}
 The mouse modifiers. More...
 
enum  ekey_flags { EKEY_DEL = 0, EKEY_TAB = 1, EKEY_ENTER = 2, EKEY_ESC = 3 }
 The system keys. More...
 
enum  ebox_flags { EBOX_GROWNO = (1<<4), EBOX_GROWLINK = (1<<5), EBOX_GROWINDI = (1<<6), EBOX_IGNORELOCKCLICK = (1<<7) }
 The flags that discribe the behavior of a t_ebox. More...
 
enum  ebox_cursors {
  ECURSOR_LEFT_PTR = 0, ECURSOR_CENTER_PTR = 1, ECURSOR_SDOUBLE_ARROW = 2, ECURSOR_PLUS = 3,
  ECURSOR_HAND = 4, ECURSOR_CIRCLE = 5, ECURSOR_X = 6, ECURSOR_BOTTOM = 7,
  ECURSOR_RIGHT_CORNER = 8, ECURSOR_RIGHT_SIDE = 9, ECURSOR_DOUBLE_ARROW = 10, ECURSOR_EXCHANGE = 11,
  ECURSOR_XTERM = 12
}
 The cursors that can be used. More...
 

Functions

void ebox_new (t_ebox *x, long flags)
 Initializes the graphical members of the t_ebox. More...
 
void ebox_ready (t_ebox *x)
 Indicates that the t_ebox can be drawn. More...
 
void ebox_free (t_ebox *x)
 Indicates that the t_ebox can be drawn. More...
 
t_symbolebox_getfontname (t_ebox *x)
 Retrieves the name of the font of the t_ebox. More...
 
t_symbolebox_getfontslant (t_ebox *x)
 Retrieves the slant of the font of the t_ebox. More...
 
t_symbolebox_getfontweight (t_ebox *x)
 Retrieves the weight of the font of the t_ebox. More...
 
float ebox_getfontsize (t_ebox *x)
 Retrieves the size of the font of the t_ebox. More...
 
t_pdebox_getsender (t_ebox *x)
 Retrieves the link list of object binded to the t_ebox. More...
 
char ebox_isdrawable (t_ebox *x)
 Retrieves if a t_ebox is drawable. More...
 
void ebox_attrprocess_viabinbuf (void *x, t_binbuf *d)
 Changes the attributes with a binbuf. More...
 
void ebox_attrprocess_viatoms (void *x, int argc, t_atom *argv)
 Changes the attributes with an array of atoms. More...
 
void ebox_set_cursor (t_ebox *x, int cursor)
 Changes the cursor of the mouse. More...
 
void ebox_redraw (t_ebox *x)
 Notifies the t_ebox that it should be redrawn. More...
 
void ebox_get_rect_for_view (t_ebox *x, t_rect *rect)
 Retrieves the rectangle of the t_ebox. More...
 
t_elayerebox_start_layer (t_ebox *x, t_symbol *name, float width, float height)
 Creates or initializes a layer for the t_ebox. More...
 
t_pd_err ebox_end_layer (t_ebox *x, t_symbol *name)
 Marks a layer as ready to be drawn. More...
 
t_pd_err ebox_paint_layer (t_ebox *x, t_symbol *name, float x_p, float y_p)
 Paints a layer in the t_ebox. More...
 
t_pd_err ebox_invalidate_layer (t_ebox *x, t_symbol *name)
 Marks a layer as invalid. More...
 

Detailed Description

The t_ebox and t_edspbox part.

This part refers to the methods and structures that can be used by all the t_ebox structures.


Data Structure Documentation

struct t_edrawparams

The drawing parameters.

It contains the default parameters of a ebox.

Examples:
c.bang.cpp.
Data Fields
float d_cornersize

The corner roundness.

float d_borderthickness

The border size.

t_rgba d_bordercolor

The border color.

t_rgba d_boxfillcolor

The background color.

struct t_ebox

The GUI object.

It contains the t_eobj with all the members for graphical behavior. This should be used for graphical object that don't have signal processing methods.

Examples:
c.bang.cpp.
Data Fields
t_eobj b_obj The object.
t_symbol * b_receive_id

The object user ID.

t_symbol * b_send_id

The object send ID.

t_symbol * b_objpreset_id

The object preset ID.

t_symbol * b_canvas_id

The canvas ID.

t_symbol * b_drawing_id

The drawing ID.

t_symbol * b_window_id

The window ID.

t_symbol * b_all_id

The global ID.

long b_flags

The ebox flags.

t_rect b_rect

The ebox rectangle.

t_rect b_rect_last

The ebox previous rectangle.

t_efont b_font

The ebox font.

int b_selected_box

The selected state

int b_selected_item

The items selected.

int b_selected_inlet

The inlet selected.

int b_selected_outlet

The outlet selected.

char b_mouse_down

The mouse state.

char b_visible

The visible state.

char b_ready_to_draw

The ebox state for drawing.

char b_have_window

The ebox window state.

char b_isinsubcanvas

If the box is in a sub canvas.

t_edrawparams b_boxparameters

The ebox parameters.

t_elayer * b_layers

The ebox layers.

long b_number_of_layers

The ebox number of layers.

struct t_edspbox

The GUI DSP object.

It contains the t_eobj with all the members for graphical behavior and signal processing. This should be used for graphical object that have signal processing methods.

Data Fields
t_eobj b_obj

The DSP object.

t_symbol * b_receive_id

The object user ID.

t_symbol * b_send_id

The object send ID.

t_symbol * b_objpreset_id

The object preset ID.

t_symbol * b_canvas_id

The canvas ID.

t_symbol * b_drawing_id

The drawing ID.

t_symbol * b_window_id

The window ID.

t_symbol * b_all_id

The global ID.

long b_flags

The ebox flags.

t_rect b_rect

The ebox rectangle.

t_rect b_rect_last

The ebox previous rectangle.

t_efont b_font

The ebox font.

int b_selected_box

The selected state

int b_selected_item

The items selected.

int b_selected_inlet

The inlet selected.

int b_selected_outlet

The outlet selected.

char b_mouse_down

The mouse state.

char b_visible

The visible State.

char b_ready_to_draw

The ebox state for drawing.

char b_have_window

The ebox window state.

char b_isinsubcanvas

If the box is in a sub canvas.

t_edrawparams b_boxparameters

The ebox parameters.

t_elayer * b_layers

The ebox layers.

long b_number_of_layers

The ebox number of layers.

t_edsp d_dsp

The dsp structure.

Enumeration Type Documentation

enum emod_flags

The mouse modifiers.

It define mouse modifiers.

Enumerator
EMOD_NONE 

Nothing.

EMOD_SHIFT 

Shift.

EMOD_MAJ 

Maj.

EMOD_CTRL 

Control.

EMOD_CMD 

Command.

EMOD_ALT 

Alt.

EMOD_RIGHT 

Right click.

enum ekey_flags

The system keys.

It define the system keys.

Enumerator
EKEY_DEL 

The delete key.

EKEY_TAB 

The tabulation key.

EKEY_ENTER 

The return key.

EKEY_ESC 

The escape key.

enum ebox_flags

The flags that discribe the behavior of a t_ebox.

It define all the behavior of a t_ebox.

Enumerator
EBOX_GROWNO 

The width and the height can't be modified.

EBOX_GROWLINK 

The width and the height are linked.

EBOX_GROWINDI 

The width and the height are independant.

EBOX_IGNORELOCKCLICK 

The t_ebox ignore the mouse events.

The cursors that can be used.

It define all the available cursors.

Enumerator
ECURSOR_LEFT_PTR 

The left_ptr string.

ECURSOR_CENTER_PTR 

The center_ptr string.

ECURSOR_SDOUBLE_ARROW 

The sb_v_double_arrow string.

ECURSOR_PLUS 

The plus string.

ECURSOR_HAND 

The hand2 string.

ECURSOR_CIRCLE 

The circle string.

ECURSOR_X 

The X_cursor string.

ECURSOR_BOTTOM 

The bottom_side string.

ECURSOR_RIGHT_CORNER 

The bottom_right_corner string.

ECURSOR_RIGHT_SIDE 

The right_side string.

ECURSOR_DOUBLE_ARROW 

The double_arrow string.

ECURSOR_EXCHANGE 

The exchange string.

ECURSOR_XTERM 

The xterm string.

Function Documentation

void ebox_new ( t_ebox x,
long  flags 
)

Initializes the graphical members of the t_ebox.

Sets the defaults values and initializes the attributes.
This function should be call after eobj_new().

Parameters
xThe t_ebox pointer.
flagsA set of flags that defines the t_ebox behavior.
See also
ebox_flags
Todo:
Not here but for doc (in ebox_wvis vis is called sevral times with vis = 1 perhaps we can avoid to recreate the stuff at each time)
void ebox_ready ( t_ebox x)

Indicates that the t_ebox can be drawn.

Actives the drawind methods.
This function should be call after durng the new method just before returning the object.

Parameters
xThe t_ebox pointer.
void ebox_free ( t_ebox x)

Indicates that the t_ebox can be drawn.

Deletes the drawings.
This function should replace pd_free() and you shouldn't have to call eobj_free() or eobj_dspfree();

Parameters
xThe t_ebox pointer.
t_symbol* ebox_getfontname ( t_ebox x)

Retrieves the name of the font of the t_ebox.

Parameters
xThe t_ebox pointer.
Returns
The font name.
t_symbol* ebox_getfontslant ( t_ebox x)

Retrieves the slant of the font of the t_ebox.

Parameters
xThe t_ebox pointer.
Returns
The font slant.
t_symbol* ebox_getfontweight ( t_ebox x)

Retrieves the weight of the font of the t_ebox.

Parameters
xThe t_ebox pointer.
Returns
The font weight.
float ebox_getfontsize ( t_ebox x)

Retrieves the size of the font of the t_ebox.

Parameters
xThe t_ebox pointer.
Returns
The font size.
t_pd* ebox_getsender ( t_ebox x)

Retrieves the link list of object binded to the t_ebox.

Parameters
xThe t_ebox pointer.
Returns
The pointer to the link list.
char ebox_isdrawable ( t_ebox x)

Retrieves if a t_ebox is drawable.

Checks several things that ensure that the t_ebox can be drawn;

Parameters
xThe t_ebox pointer.
Returns
The function returns 1 if the box is drawable otherwise 0.
void ebox_attrprocess_viabinbuf ( void *  x,
t_binbuf d 
)

Changes the attributes with a binbuf.

Retrieves and interpretes a binbuf to initialize the attributes.

Parameters
xThe t_ebox pointer.
dThe binbuf pointer.
void ebox_attrprocess_viatoms ( void *  x,
int  argc,
t_atom argv 
)

Changes the attributes with an array of atoms.

Retrieves and interpretes a binbuf to initialize the attributes.

Parameters
xThe t_ebox pointer.
argcThe number of atoms.
argvThe pointer to the atoms.
void ebox_set_cursor ( t_ebox x,
int  cursor 
)

Changes the cursor of the mouse.

Parameters
xThe t_ebox pointer.
cursorThe type of cursor.
See also
ebox_cursors
void ebox_redraw ( t_ebox x)

Notifies the t_ebox that it should be redrawn.

Parameters
xThe t_ebox pointer.
void ebox_get_rect_for_view ( t_ebox x,
t_rect rect 
)

Retrieves the rectangle of the t_ebox.

This function should be used while the paint method is called to retrieves the current size of the t_ebox.

Parameters
xThe t_ebox pointer.
rectThe t_rect pointer.
t_elayer* ebox_start_layer ( t_ebox x,
t_symbol name,
float  width,
float  height 
)

Creates or initializes a layer for the t_ebox.

If the layer is new, the function allocate a new empty layer. if the layer already exist and is marked as invalid the layer is returned otherwise(if the layer is maked as redeay to be drawn for example) the function returns NULL. You should always check the returned layer of the function before using it.

Parameters
xThe t_ebox pointer.
nameThe name of the layer.
widthThe width of the layer.
heightThe height of the layer.
See also
ebox_end_layer ebox_invalidate_layer ebox_paint_layer t_elayer_flags t_elayer
t_pd_err ebox_end_layer ( t_ebox x,
t_symbol name 
)

Marks a layer as ready to be drawn.

After the several painting methods, you should call this function to notify that the layer is ready to be drawn.

Parameters
xThe t_ebox pointer.
nameThe name of the layer.
See also
ebox_start_layer ebox_invalidate_layer ebox_paint_layer t_elayer_flags t_elayer
t_pd_err ebox_paint_layer ( t_ebox x,
t_symbol name,
float  x_p,
float  y_p 
)

Paints a layer in the t_ebox.

If a layer is ready to be drawn, the function will paint it in the t_ebox.

Parameters
xThe t_ebox pointer.
nameThe name of the layer.
x_pThe abscissa of the layer in the t_ebox.
y_pThe ordinate of the layer in the t_ebox.
See also
ebox_start_layer ebox_end_layer ebox_invalidate_layer t_elayer_flags t_elayer
t_pd_err ebox_invalidate_layer ( t_ebox x,
t_symbol name 
)

Marks a layer as invalid.

When you want to redraw a layer you have to call this function and then call ebox_redraw. You should always prefer to invalidate several layer before calling ebox_redraw.

Parameters
xThe t_ebox pointer.
nameThe name of the layer.
See also
ebox_start_layer ebox_end_layer ebox_redraw ebox_paint_layer t_elayer_flags t_elayer