Ihandle Class
[Control SDK]

Collaboration diagram for Ihandle Class:

Data Structures

struct  Iclass_

Modules

 Class Object Functions
 Base Class

Typedefs

typedef enum _InativeType InativeType
typedef enum _IchildType IchildType
typedef char *(* IattribGetFunc )(Ihandle *ih)
typedef char *(* IattribGetIdFunc )(Ihandle *ih, const char *name_id)
typedef int(* IattribSetFunc )(Ihandle *ih, const char *value)
typedef int(* IattribSetIdFunc )(Ihandle *ih, const char *name_id, const char *value)
typedef enum _IattribFlags IattribFlags

Enumerations

enum  _InativeType {
  IUP_TYPEVOID, IUP_TYPECONTROL, IUP_TYPECANVAS, IUP_TYPEDIALOG,
  IUP_TYPEIMAGE, IUP_TYPEMENU
}
enum  _IchildType { IUP_CHILDNONE, IUP_CHILD_ONE, IUP_CHILDMANY }
enum  _IattribFlags {
  IUPAF_DEFAULT = 0, IUPAF_NO_INHERIT = 1, IUPAF_NO_DEFAULTVALUE = 2, IUPAF_NO_STRING = 4,
  IUPAF_NOT_MAPPED = 8, IUPAF_HAS_ID = 16, IUPAF_READONLY = 32, IUPAF_WRITEONLY = 64
}

Functions

IclassiupClassNew (Iclass *ic_parent)
void iupClassRelease (Iclass *ic)
void iupClassRegisterAttribute (Iclass *ic, const char *name, IattribGetFunc get, IattribSetFunc set, const char *default_value, const char *system_default, int flags)
void iupClassRegisterAttributeId (Iclass *ic, const char *name, IattribGetIdFunc get, IattribSetIdFunc set, int flags)
void iupClassRegisterGetAttribute (Iclass *ic, const char *name, IattribGetFunc *get, IattribSetFunc *set, const char **default_value, const char **system_default, int *flags)
void iupClassRegisterCallback (Iclass *ic, const char *name, const char *format)
char * iupClassCallbackGetFormat (Iclass *ic, const char *name)

Detailed Description

See iup_class.h

Typedef Documentation

typedef enum _InativeType InativeType

Known native types.

typedef enum _IchildType IchildType

Possible number of children.

typedef char*(* IattribGetFunc)(Ihandle *ih)

GetAttribute called for a specific attribute. Used by iupClassRegisterAttribute.

typedef char*(* IattribGetIdFunc)(Ihandle *ih, const char *name_id)

GetAttribute called for a specific attribute when has_attrib_id is true.
Same as IattribGetFunc but handle attribute names with number ids at the end.
When calling iupClassRegisterAttribute just use a typecast.
Pure numbers are translated into IDVALUEid. Used by iupClassRegisterAttribute.

typedef int(* IattribSetFunc)(Ihandle *ih, const char *value)

SetAttribute called for a specific attribute.
If returns 0, the attribute will not be stored in the hash table (except inheritble attributes that are always stored in the hash table).
When IupSetAttribute is called using value=NULL, the default_value is passed to this function. Used by iupClassRegisterAttribute.

typedef int(* IattribSetIdFunc)(Ihandle *ih, const char *name_id, const char *value)

SetAttribute called for a specific attribute when has_attrib_id is true.
Same as IattribSetFunc but handle attribute names with number ids at the end.
When calling iupClassRegisterAttribute just use a typecast.
Pure numbers are translated into IDVALUEid, ex: "1" = "IDVALUE1". Used by iupClassRegisterAttribute.

Attribute flags. Used by iupClassRegisterAttribute.


Enumeration Type Documentation

Known native types.

Enumerator:
IUP_TYPEVOID 

No native representation - HBOX, VBOX, ZBOX, FILL, RADIO (handle==(void*)-1 always)

IUP_TYPECONTROL 

Native controls - BUTTON, LABEL, TOGGLE, LIST, TEXT, MULTILINE, FRAME, others

IUP_TYPECANVAS 

Drawing canvas, also used as a base control for custom controls.

IUP_TYPEDIALOG 

DIALOG

IUP_TYPEIMAGE 

IMAGE

IUP_TYPEMENU 

MENU, SUBMENU, ITEM, SEPARATOR

Possible number of children.

Attribute flags. Used by iupClassRegisterAttribute.

Enumerator:
IUPAF_DEFAULT 

inheritable, can has a default value, is a string, can call the set/get functions only if mapped, no ID

IUPAF_NO_INHERIT 

is not inheritable

IUPAF_NO_DEFAULTVALUE 

can not has a default value

IUPAF_NO_STRING 

is not a string

IUPAF_NOT_MAPPED 

will call the set/get functions also when not mapped

IUPAF_HAS_ID 

can has an ID at the end of the name, automatically set by iupClassRegisterAttributeId

IUPAF_READONLY 

is read-only, can not be changed

IUPAF_WRITEONLY 

is write-only, usually an action


Function Documentation

Iclass* iupClassNew ( Iclass ic_parent  ) 

Allocates memory for the Iclass structure and initializes the attribute handling functions table.

void iupClassRelease ( Iclass ic  ) 

Release the memory allocated by the class. Calls the Iclass::Release method.
Called from iupRegisterFinish.

void iupClassRegisterAttribute ( Iclass ic,
const char *  name,
IattribGetFunc  get,
IattribSetFunc  set,
const char *  default_value,
const char *  system_default,
int  flags 
)

Register attribute handling functions. get, set and default_value can be NULL. default_value should point to a constant string, it will not be duplicated internally.
Notice that when an attribute is not defined then default_value=NULL, is inheritable can has a default value and is a string.
Since there is only one attribute function table per class tree, if you register the same attribute in a child class, then it will replace the parent registration.
If an attribute is not inheritable or not a string then it MUST be registered. Internal attributes (starting with "_IUP") can never be registered.

void iupClassRegisterAttributeId ( Iclass ic,
const char *  name,
IattribGetIdFunc  get,
IattribSetIdFunc  set,
int  flags 
)

Same as iupClassRegisterAttribute for attributes with Ids.

void iupClassRegisterGetAttribute ( Iclass ic,
const char *  name,
IattribGetFunc get,
IattribSetFunc set,
const char **  default_value,
const char **  system_default,
int *  flags 
)

Returns the attribute handling functions.

void iupClassRegisterCallback ( Iclass ic,
const char *  name,
const char *  format 
)

Register the parameters of a callback. Used by language bindings. format follows the format specification of the class creation parameters format, but it adds the "double" option and remove array options. It can have none, one or more of the following.

  • "b" = (unsigned char) - byte
  • "i" = (int) - integer
  • "f" = (float) - real
  • "d" = (double) - real
  • "s" = (char*) - string
  • "v" = (void*) - generic pointer
  • "h" = (Ihandle*) - element handle The default return value for all callbacks is "i" (int). But the return value can be specified using one of the above parameters, after all parameters using "=" to separate it from them.
char* iupClassCallbackGetFormat ( Iclass ic,
const char *  name 
)

Returns the format of the parameters of a registered callback. If NULL then the default callback definition is assumed.


Generated on Thu Oct 1 14:02:32 2009 for IUP by  doxygen 1.6.1