Home AESAES Menu libraryMenu library Process libraryProcess library

8.18 Object library

This library makes functions available for drawing and manipulating objects (of any kind). The following routines exist for this:

objc_add Inserts an object in object tree
objc_change Alters status of an object
objc_delete Removes object from the object tree
objc_draw Draws AES objects (or part-objects)
objc_edit Edits text in an object
objc_find Determines object at given screen position
objc_offset Obtains true screen coordinates of an object
objc_order Alters order of objects in object tree
objc_sysvar Manipulates 3D objects
objc_wchange Alters status of an object (in window)
objc_wdraw Draws objects (or part-objects) (in window)
objc_wedit Edits text in an object (in window)
objc_xedit Edits text in an object
objc_xfind Finds object index from its position
• objc_xoffset No information available at present
x_objc_edit Edits text in an object, with extensions

Note: Here special merit has been earned by objc_sysvar, with whose help the 3D-look of objects can be controlled (and as of MagiC 3 also switched off).

See also:
About the AES   AES object structure   Scrollable input fields   Style guidelines

8.18.1 objc_add

Name: »Object add« - Insert object in an object tree.
 
Opcode: 40
 
Syntax: int16_t objc_add ( OBJECT *ob_atree, int16_t ob_aparent, int16_t ob_achild );
 
Description: The call objc_add creates a hierarchical connection between two objects in an object tree - in other words extablishes the relationship of a child object to its parent. The following apply:
 
Parameter Meaning
   
ob_atree Address of the relevant object tree
ob_aparent Index of the object to which the child is to be added
ob_achild Index of the child, i.e. of the object to be added

(Note: At insertion, the components ob_head and ob_tail of the OBJECT structure must already have been suitably initialized and be part of the OBJECT array.
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: All AES versions.
 
Group: Object library
 
See also: Binding   OBJECT   objc_delete
 

8.18.1.1 Bindings for objc_add

C: int16_t objc_add ( OBJECT *ob_atree, int16_t ob_aparent, int16_t ob_achild );
 
Binding:
 
int16_t objc_add (OBJECT *ob_atree, int16_t ob_aparent,
                  int16_t ob_achild)
{
   int_in[0]  = ob_aparent;
   int_in[1]  = ob_achild;
   addr_in[0] = ob_atree;

   return ( crys_if(40) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 40 # Function opcode
control+2 control[1] 2 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_aparent
int_in+2 int_in[1] ob_achild
addr_in addr_in[0] ob_atree
int_out int_out[0] Return value

8.18.2 objc_change

Name: »Object change« - Alter display of an object within specified limits.
 
Opcode: 47
 
Syntax: int16_t objc_change ( OBJECT *ob_ctree, int16_t ob_cobject, int16_t ob_cresvd, int16_t ob_cxclip, int16_t ob_cyclip, int16_t ob_cwclip, int16_t ob_chclip, int16_t ob_cnewstate, int16_t ob_credraw );
 
Description: The call objc_change alters the display state of an object and, if necessary, redraws it. The following apply:
 
Parameter Meaning
   
ob_ctree Address of the relevant object tree
ob_cobject Index of the object in question
ob_cresvd Reserved, should be 0
ob_cxclip X-coordinate, and
ob_cyclip Y-coordinate of top left corner,
ob_cwclip Width, and
ob_chclip Height of the clipping cectangle
ob_cnewstate New status of the object
ob_credraw
0 = Do not redraw object
1 = Redraw object
Return value: An error has arisen only if the value 0 is returned.
 
Availability: All AES versions.
 
Group: Object library
 
See also: Binding   objc_wchange   OBJECT
 

8.18.2.1 Bindings for objc_change

C: int16_t objc_change ( OBJECT *ob_ctree, int16_t ob_cobject, int16_t ob_cresvd, int16_t ob_cxclip, int16_t ob_cyclip, int16_t ob_cwclip, int16_t ob_chclip, int16_t ob_cnewstate, int16_t ob_credraw );
 
Binding:
 
int16_t objc_change (OBJECT *ob_ctree, int16_t ob_cobject,
                     int16_t ob_cresvd, int16_t ob_cxclip,
                     int16_t ob_cyclip, int16_t ob_cwclip,
                     int16_t ob_chclip, int16_t ob_cnewstate,
                     int16_t ob_credraw)
{
   int_in[0]  = ob_cobject;
   int_in[1]  = ob_cresvd;
   int_in[2]  = ob_cxclip;
   int_in[3]  = ob_cyclip;
   int_in[4]  = ob_cwclip;
   int_in[5]  = ob_chclip;
   int_in[6]  = ob_cnewstate;
   int_in[7]  = ob_credraw;

   addr_in[0] = ob_ctree;

   return ( crys_if(47) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 47 # Function opcode
control+2 control[1] 8 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_cobject
int_in+2 int_in[1] ob_cresvd
int_in+4 int_in[2] ob_cxclip
int_in+6 int_in[3] ob_cyclip
int_in+8 int_in[4] ob_cwclip
int_in+10 int_in[5] ob_chclip
int_in+12 int_in[6] ob_cnewstate
int_in+14 int_in[7] ob_credraw
addr_in addr_in[0] ob_ctree
int_out int_out[0] Return value

8.18.3 objc_delete

Name: »Object delete« - Remove object from an object tree.
 
Opcode: 41
 
Syntax: int16_t objc_delete ( OBJECT *ob_dltree, int16_t ob_dlobject );
 
Description: The call objc_delete removes an object from an object tree. The following apply:
 

Parameter Meaning
ob_dltree Address of the relevant object tree
ob_dlobject Index of the object to be removed
Return value: An error has arisen only if the value 0 is returned.
 
Availability: All AES versions.
 
Group: Object library
 
Querverweise: Binding   OBJECT   objc_add
 

8.18.3.1 Bindings for objc_delete

C: int16_t objc_delete ( OBJECT *ob_dltree, int16_t ob_dlobject );
 
Binding:
 
int16_t objc_delete (OBJECT *ob_dltree, int16_t ob_dlobject)
{
   int_in[0]  = ob_dlobject;
   addr_in[0] = ob_dltree;

   return ( crys_if(41) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 41 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_dlobject
addr_in addr_in[0] ob_dltree
int_out int_out[0] Return value

8.18.4 objc_draw

Name: »Object draw« - Draw an AES object tree.
 
Opcode: 42
 
Syntax: int16_t objc_draw ( OBJECT *ob_drtree, int16_t ob_drstart, int16_t ob_drdepth, int16_t ob_drxclip, int16_t ob_dryclip, int16_t ob_drwclip, int16_t ob_drhclip );
 
Description: The call objc_draw renders an object tree (or parts of objects) on the screen. The following apply:
 
Parameter Meaning
   
ob_drtree Address of object tree to draw
ob_drstart Index of the first object to be drawn
ob_drdepth Number of object generations to be drawn (0 = only the first object), maximum of 8
ob_drxclip X-coordinate, and
ob_dryclip Y-coordinate of top left corner,
ob_drwclip Width, and
ob_drhclip Height of the bounding rectangle

Note: With the parameters one can specify a rectangle to which drawing is to be restricted (clipping).
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: All AES versions.
 
Group: Object library
 
See also: Binding   objc_wdraw   OBJECT
 

8.18.4.1 Bindings for objc_draw

C: int16_t objc_draw ( OBJECT *ob_drtree, int16_t ob_drstart, int16_t ob_drdepth, int16_t ob_drxclip, int16_t ob_dryclip, int16_t ob_drwclip, int16_t ob_drhclip );
 
Binding:
 
int16_t objc_draw (OBJECT *ob_drtree, int16_t ob_drstart,
                   int16_t ob_drdepth, int16_t ob_drxclip,
                   int16_t ob_dryclip, int16_t ob_drwclip,
                   int16_t ob_drhclip)
{
   int_in[0]  = ob_drstart;
   int_in[1]  = ob_drdepth;
   int_in[2]  = ob_drxclip;
   int_in[3]  = ob_dryclip;
   int_in[4]  = ob_drwclip;
   int_in[5]  = ob_drhclip;

   addr_in[0] = ob_drtree;

   return ( crys_if(42) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 42 # Function opcode
control+2 control[1] 6 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_drstart
int_in+2 int_in[1] ob_drdepth
int_in+4 int_in[2] ob_drxclip
int_in+6 int_in[3] ob_dryclip
int_in+8 int_in[4] ob_drwclip
int_in+10 int_in[5] ob_drhclip
addr_in addr_in[0] ob_drtree
int_out int_out[0] Return value

8.18.5 objc_edit

Name: »Object edit« - Edit text in an editable text object.
 
Opcode: 46
 
Syntax: int16_t objc_edit ( OBJECT *ob_edtree, int16_t ob_edobject, int16_t ob_edchar, int16_t *ob_edidx, int16_t ob_edkind );
 
Description: The call objc_edit permits manual text input into objects of the type G_FTEXT or G_FBOXTEXT. The following apply:
 
Parameter Meaning
   
ob_edtree Address of the relevant object tree
ob_edobject Index of the object to be edited
ob_edchar Character that was input (scancode in the high and ASCII-code in the low byte)
ob_edidx Position of the character in string
ob_edkind Function selection, as follows:
EDSTART 0 Reserved
EDINIT 1 Calculate formatted string, and switch on cursor
EDCHAR 2 Process character and then display string anew
EDEND 3 Switch off cursor

Note: MagiC as of version 2.0 has an extended function objc_xedit.
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: All AES versions.
 
Group: Object library
 
See also: Binding   objc_wedit   OBJECT   TEDINFO   objc_xedit
 

8.18.5.1 Bindings for objc_edit

C: int16_t objc_edit ( OBJECT *ob_edtree, int16_t ob_edobject, int16_t ob_edchar, int16_t *ob_edidx, int16_t ob_edkind );
 
Binding:
 
int16_t objc_edit (OBJECT *ob_edtree, int16_t ob_edobject,
                   int16_t ob_edchar, int16_t *ob_edidx,
                   int16_t ob_edkind)
{
   int_in[0]  = ob_edobject;
   int_in[1]  = ob_edchar;
   int_in[2]  = *ob_edidx;
   int_in[3]  = ob_edkind;
   addr_in[0] = ob_edtree;

   crys_if (46);

   *ob_edidx = int_out[1];
   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 46 # Function opcode
control+2 control[1] 4 # Entry in int_in
control+4 control[2] 2 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_edobject
int_in+2 int_in[1] ob_edchar
int_in+4 int_in[2] ob_edidx
int_in+6 int_in[3] ob_edkind
addr_in addr_in[0] ob_edtree
int_out int_out[0] Return value
int_out+2 int_out[1] ob_edidx

8.18.6 objc_find

Name: »Object find« - Find which object that lies at the specified screen position.
 
Opcode: 43
 
Syntax: int16_t objc_find ( OBJECT *ob_ftree, int16_t ob_fstartob, int16_t ob_fdepth, int16_t ob_fmx, int16_t ob_fmy );
 
Description: The call objc_find determines which object is found at given screen coordinates. The following apply:
 
Parameter Meaning
   
ob_ftree Address of the relevant object tree
ob_fstartob Index of the object at which the search is to start
ob_fdepth Number of generations that are to be searched (0 = parent object only), 7 max.
ob_fmx X-coordinate, and
ob_fmy Y-coordinate of screen position to search
Return value: The object index found at the coordinates ob_fmx, ob_fmy (or -1 for 'no object found').
 
Availability: All AES versions.
 
Group: Object library
 
See also: Binding   OBJECT   objc_xfind
 

8.18.6.1 Bindings for objc_find

C: int16_t objc_find ( OBJECT *ob_ftree, int16_t ob_fstartob, int16_t ob_fdepth, int16_t ob_fmx, int16_t ob_fmy );
 
Binding:
 
int16_t objc_find (OBJECT *ob_ftree, int16_t ob_fstartob,
                   int16_t ob_fdepth, int16_t ob_fmx,
                   int16_t ob_fmy)
{
   int_in[0]  = ob_fstartob;
   int_in[1]  = ob_fdepth;
   int_in[2]  = ob_fmx;
   int_in[3]  = ob_fmy;
   addr_in[0] = ob_ftree;

   return ( crys_if(43) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 43 # Function opcode
control+2 control[1] 4 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_fstartob
int_in+2 int_in[1] ob_fdepth
int_in+4 int_in[2] ob_fmx
int_in+6 int_in[3] ob_fmy
addr_in addr_in[0] ob_ftree
int_out int_out[0] Return value

8.18.7 objc_offset

Name: »Object offset« - Calculate the true position of an object on the screen.
 
Opcode: 44
 
Syntax: int16_t objc_offset ( OBJECT *ob_oftree, int16_t ob_ofobject, int16_t *ob_ofxoff, int16_t *ob_ofyoff );
 
Description: The call objc_offset calculates the true position of an object in absolute screen coordinates. The following apply:
 

Parameter Meaning
ob_oftree Address of the object tree
ob_ofobject Index of the relevant object
ob_ofxoff Calculated X-coordinate
ob_ofyoff Calculated Y-coordinate
Return value: An error has arisen only if the value 0 is returned.
 
Availability: All AES versions.
 
Group: Object library
 
Querverweise: Binding   OBJECT   form_center
 

8.18.7.1 Bindings for objc_offset

C: int16_t objc_offset ( OBJECT *ob_oftree, int16_t ob_ofobject, int16_t *ob_ofxoff, int16_t *ob_ofyoff );
 
Binding:
 
int16_t objc_offset (OBJECT *ob_oftree, int16_t ob_ofobject,
                     int16_t *ob_ofxoff, int16_t *ob_ofyoff)
{
   int_in[0]  = ob_ofobject;
   addr_in[0] = ob_oftree;

   crys_if (44);

   *ob_ofxoff = int_out[1];
   *ob_ofyoff = int_out[2];

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 44 # Function opcode
control+2 control[1] 1 # Entry in int_in
control+4 control[2] 3 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_ofobject
addr_in addr_in[0] ob_oftree
int_out int_out[0] Return value
int_out+2 int_out[1] ob_ofxoff
int_out+4 int_out[2] ob_ofyoff

8.18.8 objc_order

Name: »Object order« - Alter order of object in object tree.
 
Opcode: 45
 
Syntax: int16_t objc_order ( OBJECT *ob_ortree, int16_t ob_orobject, int16_t ob_ornewpos );
 
Description: The call objc_order alters the position of an object relative to other child objects of the same parent within a sub-tree. The following apply:
 
Parameter Meaning
   
ob_ortree Address of the object tree
ob_orobject Index of the relevant object
ob_ornewpos New position in tree, namely:
-1 = At the end (last child)
0 = At the start (first child)
1 = In the second position (2nd child)
2 = In the third position (etc.)

Note: This call does not move the structure elements in memory, but updates the OBJECT tree's ob_head, ob_tail and ob_next fields, thus 'moving' the OBJECT in the tree hierarchy.
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: All AES versions.
 
Group: Object library
 
See also: Binding   OBJECT
 

8.18.8.1 Bindings for objc_order

C: int16_t objc_order ( OBJECT *ob_ortree, int16_t ob_orobject, int16_t ob_ornewpos );
 
Binding:
 
int16_t objc_order (OBJECT *ob_ortree, int16_t ob_orobject,
                    int16_t ob_ornewpos)
{
   int_in[0]  = ob_orobject;
   int_in[1]  = ob_ornewpos;
   addr_in[0] = ob_ortree;

   return ( crys_if(45) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 45 # Function opcode
control+2 control[1] 2 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_orobject
int_in+2 int_in[1] ob_ornewpos
addr_in addr_in[0] ob_ortree
int_out int_out[0] Return value

8.18.9 objc_sysvar

Name: »Object sysvar« - Manipulation of 3D objects.
 
Opcode: 48
 
Syntax: int16_t objc_sysvar ( int16_t ob_smode, int16_t ob_swhich, int16_t ob_sival1, int16_t ob_sival2, int16_t *ob_soval1, int16_t *ob_soval2 );
 
Description: The call objc_sysvar permits the setting or inquiring the appearance of the AES 3D objects. The following apply:
 
Parameter Meaning
   
ob_smode
0 - Inquire status
1 - Set new status
ob_swhich Desired 3D elements:

LK3DIND (1) - Indicators
Mode 0: ob_soval1 = 0
On selection of an object the associated text does not move ob_soval1 = 1
On selection of an abject the associated text moves
ob_soval2 = 0
Object colour does not change on selection
ob_soval2 = 1
Object colour changes on selection
Mode 1: As mode 1, but now the relevant values may be set with the parameters ob_sival1 or ob_sival2

LK3DACT (2) - Activators
Determines behaviour of the activators; all further statements are to be used in the same way as for indicators

INDBUTCOL (3) - Colour of non-selected indicators
Mode 0: ob_soval1 is the current colour
Mode 1: ob_sival1 contains the colour to be set

ACTBUTCOL (4) - Colour of non-selected activators
Mode 0: ob_soval1 is the current colour
Mode 1: ob_sival1 contains the colour to be set

BACKGRCOL (5) - Colour of the 3D background
Mode 0: ob_soval1 is the current colour
Mode 1: ob_sival1 contains the colour to be set

AD3DVALUE (6) - Inquire pixel enlargement
Mode 0: ob_soval1
Number of pixels in the horizontal direction by which the 3D buttons should be enlarged on each side
ob_soval2
Number of pixels in the vertical direction by which the 3D buttons should be enlarged on each side
Note: This mode always returns the value 0 in MagiC as the object sizes of the system are not affected in this case
Mode 1: Not supported at present

MX_ENABLE3D (10) - Switch on/off 3D-look
This mode is only present under MagiC (since Version 3.0) and allows the 3D-look to be switched on or off. The following apply:
Mode 0: ob_soval1 = 0
(3D is off)
ob_soval1 = 1
(3D is active)
Mode 1: ob_sival1 = 0
ob_sival2 = 0
(3D-look off)
ob_sival1 = 1
ob_sival2 = 1
(3D-look on)

MX_MENUCOL (11) - Menüfarbe
This mode is only present under MagiC (since version 6.0 09.04.1998).
Es kann die Farbe der Menüzeile ermittelt werden.
Mode 0: ob_soval1 is the current colour
Mode 1: Return an error.

Note: The settings made with objc_sysvar apply not just for your own program, but are global for the whole system. For this reason the function should not be used in normal user applications, but only in configuration programs (such as CPX modules).
 
Although the function is present in MagiC 2.0, due to not yet implemented 3D-objects no modifications are possible. For this reason close attention should be paid to the function's return value. As of MagiC 3 the 3D-look is available, but some differences have to be borne in mind.
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: Available as of AES version 3.40.
 
The presence of this function can be ascertained with a call of appl_getinfo (opcode 13).
 
Group: Object library
 
See also: Binding
 

8.18.9.1 Bindings for objc_sysvar

C: int16_t objc_sysvar ( int16_t ob_smode, int16_t ob_swhich, int16_t ob_sival1, int16_t ob_sival2, int16_t *ob_soval1, int16_t *ob_soval2 );
 
Binding:
 
int16_t objc_sysvar (int16_t ob_smode, int16_t ob_swhich,
                     int16_t ob_sival1, int16_t ob_sival2,
                     int16_t *ob_soval1, int16_t *ob_soval2)
{
   int_in[0] = ob_smode;
   int_in[1] = ob_swhich;
   int_in[2] = ob_sival1;
   int_in[3] = ob_sival2;

   crys_if (48);

   *ob_soval1 = int_out[1];
   *ob_soval2 = int_out[2];

   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 48 # Function opcode
control+2 control[1] 4 # Entry in int_in
control+4 control[2] 3 # Entry in int_out
control+6 control[3] 0 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_smode
int_in+2 int_in[1] ob_swhich
int_in+4 int_in[2] ob_sival1
int_in+6 int_in[3] ob_sival2
int_out int_out[0] Return value
int_out+2 int_out[1] ob_soval1
int_out+4 int_out[2] ob_soval2

8.18.10 objc_wchange

Name: »Object window change« - Alter the display of an object in a window within specified limits.
 
Opcode: 61
 
Syntax: void objc_wchange ( OBJECT *ob_ctree, int16_t ob_cobject, int16_t ob_cnewstate, GRECT *clip, int16_t whandle );
 
Description: The call objc_wchange alters the display state of an object in a window and, if necessary, redraws it. The following apply:
 

Parameter Meaning
ob_ctree Address of the object tree
ob_cobject Index of the relevant object
ob_cnewstate New status of the object
clip Bounding clipping rectangle
whandle Window identifier

Note: A call of this function is equivalent to calling objc_change (without a redraw) followed by objc_wdraw.
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: The function is available in MagiC as of Version 5.10.
 
Group: Object library
 
See also: Binding   objc_change   OBJECT
 

8.18.10.1 Bindings for objc_wchange

C: void objc_wchange ( OBJECT *ob_ctree, int16_t ob_cobject, int16_t ob_cnewstate, GRECT *clip, int16_t whandle );
 
Binding:
 
void objc_wchange (OBJECT *ob_ctree, int16_t ob_cobject,
                   int16_t ob_cnewstate, GRECT *clip,
                   int16_t whandle)
{
   int_in[0]  = ob_cobject;
   int_in[1]  = ob_cnewstate;
   int_in[2]  = whandle;

   addr_in[0] = ob_ctree;
   addr_in[1] = clip;

   crys_if(61);
}
GEM-Arrays:
 

Address Element Contents
control control[0] 61 # Function opcode
control+2 control[1] 3 # Entry in int_in
control+4 control[2] 0 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_cobject
int_in+2 int_in[1] ob_cnewstate
int_in+4 int_in[2] whandle
addr_in addr_in[0] ob_ctree
addr_in+4 addr_in[1] clip

8.18.11 objc_wdraw

Name: »Object window draw« - Draw an AES object tree in a window.
 
Opcode: 60
 
Syntax: void objc_wdraw ( OBJECT *ob_drtree, int16_t ob_drstart, int16_t ob_drdepth, GRECT *clip, int16_t whandle );
 
Description: The call objc_wdraw renders an object tree (or parts of objects) in a window on the screen. The following apply:
 
Parameter Meaning
   
ob_drtree Address of object tree to draw
ob_drstart Index of the first object to be drawn
ob_drdepth Number of object generations to be drawn (0 = only the first object), maximum of 8
clip Bounding clipping rectangle
whandle Window identifier

Note: In the parameters one can specify a rectangle to which drawing is to be restricted (clipping). If clip has the value NULL, then the drawing region is restricted to the working area of the window.
 
The function corresponds essentially to objc_draw with the difference that here the rectangle list of a window is respected.
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: The function is available in MagiC as of Version 5.10.
 
Group: Object library
 
See also: Binding   objc_draw   OBJECT
 

8.18.11.1 Bindings for objc_wdraw

C: void objc_wdraw ( OBJECT *ob_drtree, int16_t ob_drstart, int16_t ob_drdepth, GRECT *clip, int16_t whandle );
 
Binding:
 
void objc_wdraw (OBJECT *ob_drtree, int16_t ob_drstart,
                 int16_t ob_drdepth, GRECT *clip,
                 int16_t whandle)
{
   int_in[0]  = ob_drstart;
   int_in[1]  = ob_drdepth;
   int_in[2]  = whandle;

   addr_in[0] = ob_drtree;
   addr_in[1] = clip;

   crys_if(60);
}
GEM-Arrays:
 

Address Element Contents
control control[0] 60 # Function opcode
control+2 control[1] 3 # Entry in int_in
control+4 control[2] 0 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_drstart
int_in+2 int_in[1] ob_drdepth
int_in+4 int_in[2] whandle
addr_in addr_in[0] ob_drtree
addr_in+4 addr_in[1] clip

8.18.12 objc_wedit

Name: »Object window edit« - Edit text in an object in a window.
 
Opcode: 65
 
Syntax: int16_t objc_wedit ( OBJECT *ob_edtree, int16_t ob_edobject, int16_t ob_edchar, int16_t *ob_edidx, int16_t ob_edkind, int16_t whandle );
 
Description: The call objc_wedit permits manual text input into objects of the type G_FTEXT or G_FBOXTEXT in a window. The following apply:
 
Parameter Meaning
   
ob_edtree Address of the relevant object tree
ob_edobject Index of the object to be edited
ob_edchar Character that was input (scancode in the high and ASCII-code in the low byte)
ob_edidx Position of character in the string
ob_edkind Function selection, as follows:
0 = Reserved
1 = Calculate formatted string, and switch on cursor
2 = Process character and then display string anew
3 = Switch off cursor
103 = As mode 3, but the cursor is drawn in XOR mode
whandle Window identifier

Note: The function corresponds in principle to objc_edit with the difference that here the rectangle list of a window is respected.
 
Return value: An error has arisen only if the value 0 is returned.
 
Availability: The function is available in MagiC as of Version 5.10.
 
Group: Object library
 
See also: Binding   objc_edit   OBJECT   TEDINFO
 

8.18.12.1 Bindings for objc_wedit

C: int16_t objc_wedit ( OBJECT *ob_edtree, int16_t ob_edobject, int16_t ob_edchar, int16_t *ob_edidx, int16_t ob_edkind, int16_t whandle );
 
Binding:
 
int16_t objc_wedit (OBJECT *ob_edtree, int16_t ob_edobject,
                    int16_t ob_edchar, int16_t *ob_edidx,
                    int16_t ob_edkind, int16_t whandle)
{
   int_in[0] = ob_edobject;
   int_in[1] = ob_edchar;
   int_in[2] = *ob_edidx;
   int_in[3] = ob_edkind;
   int_in[4] = whandle;

   addr_in[0] = ob_edtree;

   crys_if (65);

   *ob_edidx = int_out[1];
   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 65 # Function opcode
control+2 control[1] 5 # Entry in int_in
control+4 control[2] 2 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_edobject
int_in+2 int_in[1] ob_edchar
int_in+4 int_in[2] ob_edidx
int_in+6 int_in[3] ob_edkind
int_in+8 int_in[4] whandle
addr_in addr_in[0] ob_edtree
int_out int_out[0] Return value
int_out+2 int_out[1] ob_edidx

8.18.13 objc_xedit

Name: »Object xedit« - Edit text in an object.
 
Opcode: 46
 
Syntax: int16_t objc_xedit ( OBJECT *ob_edtree, int16_t ob_edobject, int16_t ob_edchar, int16_t *ob_edidx, int16_t ob_edkind, GRECT *r );
 
Description: The call objc_xedit permits manual text input into objects of the type G_FTEXT or G_FBOXTEXT. The following apply:
 
Parameter Meaning
   
ob_edtree Address of the relevant object tree
ob_edobject Index of the object to be edited
ob_edchar Character that was input (scancode in the high and ASCII-code in the low byte)
ob_edidx Position of character in the string
ob_edkind Function selection, as follows:
  0 = Reserved
  1 = Calculate formatted string, and switch on cursor
  2= Process character and then display string anew
  3 = Switch off cursor
103 As mode 3, but the cursor is drawn in XOR mode, and in addition a pointer to a GRECT must be passed, to which the output is restricted; important for redraws in windows
r See ob_edkind
Return value: An error has arisen only if the value 0 is returned.
 
Availability: As of MagiC Version 2.0.
 
Group: Object library
 
See also: Binding   objc_wedit   OBJECT   TEDINFO   objc_edit
 

8.18.13.1 Bindings for objc_xedit

C: int16_t objc_xedit ( OBJECT *ob_edtree, int16_t ob_edobject, int16_t ob_edchar, int16_t *ob_edidx, int16_t ob_edkind, GRECT *r );
 
Binding:
 
int16_t objc_xedit (OBJECT *ob_edtree, int16_t ob_edobject,
                    int16_t ob_edchar, int16_t *ob_edidx,
                    int16_t ob_edkind, GRECT *r)
{
   int_in[0]  = ob_edobject;
   int_in[1]  = ob_edchar;
   int_in[2]  = *ob_edidx;
   int_in[3]  = ob_edkind;
   addr_in[0] = ob_edtree;
   addr_in[1] = r;

   crys_if (46);

   *ob_edidx = int_out[1];
   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 46 # Function opcode
control+2 control[1] 4 # Entry in int_in
control+4 control[2] 2 # Entry in int_out
control+6 control[3] 2 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_edobject
int_in+2 int_in[1] ob_edchar
int_in+4 int_in[2] ob_edidx
int_in+6 int_in[3] ob_edkind
addr_in addr_in[0] ob_edtree
addr_in+4 addr_in[1] r
int_out int_out[0] Return value
int_out+2 int_out[1] ob_edidx

8.18.14 objc_xfind

Name: »Object xfind« - Find which object lies at the specified screen position.
 
Opcode: 49
 
Syntax: int16_t objc_xfind ( OBJECT *ob_ftree, int16_t ob_fstartob, int16_t ob_fdepth, int16_t ob_fmx, int16_t ob_fmy );
 
Description: The call objc_xfind determines which object is found at given screen coordinates. The following apply:
 
Parameter Meaning
   
ob_ftree Address of the relevant object tree
ob_fstartob Index of the object at which the search is to start
ob_fdepth Number of generations that are to be searched (0 = parent object only), 7 max.
ob_fmx X-coordinate, and
ob_fmy Y-coordinate of the screen position

Note: The difference from objc_find is that this uses the bounding object rectangle instead of the normal object rectangle, so in this function the frame of the object will be respected as well.
 
Return value: The object index found at the coordinates ob_fmx, ob_fmy (or -1 for 'no object found').
 
Availability: The presence of this function can be ascertained with a call of appl_getinfo (opcode 5).
 
Group: Object library
 
See also: Binding   OBJECT   objc_find
 

8.18.14.1 Bindings for objc_xfind

C: int16_t objc_xfind ( OBJECT *ob_ftree, int16_t ob_fstartob, int16_t ob_fdepth, int16_t ob_fmx, int16_t ob_fmy );
 
Binding:
 
int16_t objc_xfind (OBJECT *ob_ftree, int16_t ob_fstartob,
                    int16_t ob_fdepth, int16_t ob_fmx,
                    int16_t ob_fmy)
{
   int_in[0]  = ob_fstartob;
   int_in[1]  = ob_fdepth;
   int_in[2]  = ob_fmx;
   int_in[3]  = ob_fmy;
   addr_in[0] = ob_ftree;

   return ( crys_if(49) );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 49 # Function opcode
control+2 control[1] 4 # Entry in int_in
control+4 control[2] 1 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] ob_fstartob
int_in+2 int_in[1] ob_fdepth
int_in+4 int_in[2] ob_fmx
int_in+6 int_in[3] ob_fmy
addr_in addr_in[0] ob_ftree
int_out int_out[0] Return value

8.18.15 x_objc_edit

Name: »Object edit« - Edit text in an editable text object.
 
Opcode: 28992
 
Syntax: int16_t x_objc_edit( OBJECT *tree, int16_t edit_obj, int16_t key_press, int16_t shift_state, int16_t *edit_idx, int16_t mode );
 
Description:
 
Parameter Meaning
   
tree OBJECT tree containing editable field
edit_obj Object being edited
key_press Scan code and ASCII value of the key
shift_state
Bit 0 = Right-Shift
Bit 1 = Left-Shift
Bit 2 = Control
edit_idx Current cursor position within field
mode
1 Calculate formatted string, and switch on cursor
2 Process character and then display string anew
3 Switch off cursor

This function is nearly identical to the objc_edit function normaly found in GEM. By adding the shift_state, however, it is able to correctly process extended keystrokes involving the [Control] and [Shift] keys.
 
Return value: 0 = not an editable field
1 = No error
 
In edit_idx will return the new cursor position.
 
Availability: The function is only available under Geneva.
 
Group: Object library
 
See also: Binding   objc_edit
 

8.18.15.1 Bindings for x_objc_edit

C: int16_t x_objc_edit( OBJECT *tree, int16_t edit_obj, int16_t key_press, int16_t shift_state, int16_t *edit_idx, int16_t mode );
 
Binding:
 
int16_t x_objc_edit( OBJECT *tree, int16_t edit_obj, int16_t
key_press, int16_t shift_state, int16_t *edit_idx, int16_t
mode )
{
   int_in[0] = edit_obj;
   int_in[1] = key_press;
   int_in[2] = *edit_idx;
   int_in[3] = shift_state;
   int_in[4] = mode;
   addr_in[0] = tree;

   crys_if(28992);

   *edit_idx = int_out[1];
   return ( int_out[0] );
}
GEM-Arrays:
 

Address Element Contents
control control[0] 28992 # Function opcode
control+2 control[1] 5 # Entry in int_in
control+4 control[2] 2 # Entry in int_out
control+6 control[3] 1 # Entry in addr_in
control+8 control[4] 0 # Entry in addr_out
int_in int_in[0] edit_obj
int_in+2 int_in[1] key_press
int_in+4 int_in[2] edit_idx
int_in+6 int_in[3] shift_state
int_in+8 int_in[4] mode
addr_in addr_in[0] tree
int_out int_out[0] Return value
int_out+2 int_out[1] edit_idx

Home AESAES Menu libraryMenu library Process libraryProcess library