Defines | |
#define | mt_RsrcFree(app) mt_rsrc_free(app->aes_global) |
Release from memory resource file loaded by mt_RsrcLoad(). | |
#define | RsrcFree() mt_rsrc_free(gl_appvar->aes_global) |
See mt_RsrcFree(). | |
Functions | |
int | mt_RsrcLoad (APPvar *app, const char *name) |
Load a resource file in memory. | |
void | mt_RsrcXtype (APPvar *app, int mode, OBJECT **rs_trindex, int num_tree) |
Install/remove WinDom extended objects. | |
void | mt_RsrcFixCicon (APPvar *app, OBJECT *object, int num_obs, int num_cib, INT16 palette[][4], void *fix) |
Fix color icons to the current screen resolution. | |
void | mt_RsrcFreeCicon (APPvar *app, void *fix) |
Release from memory fixed color icons. | |
int | mt_RsrcUserDraw (APPvar *app, int mode, WINDOW *win, int __index, func_userdraw draw, void *data) |
associate a drawing function to an objet formular | |
void * | mt_RsrcXload (APPvar *app, const char *name) |
load multiple extended GEM resource file. | |
void | mt_RsrcXfree (APPvar *app, void *rsc) |
Release memory allocated by mt_RsrcXload(). | |
int | mt_RsrcGaddr (APPvar *app, void *rsc, int type, int __index, void *addr) |
retrieve an address object from a loaded resource file. | |
rscHDR * | mt_RsrcGhdr (APPvar *app, void *rsc) |
return the header of the RSC |
|
Release from memory resource file loaded by mt_RsrcLoad().
|
|
See mt_RsrcFree().
|
|
Fix color icons to the current screen resolution.
|
|
Release from memory fixed color icons.
|
|
retrieve an address object from a loaded resource file.
|
|
return the header of the RSC
typedef struct { long nobs; // number of OBJECT items long ntree; // number of tree OBJECT long nted; // number of TEDINFO items long ncib; // number of CICON items long nib; long nbb; long nfstr; // number of string items long nfimg; // number of IMAGE items OBJECT *object; // address of OBJECTS TEDINFO *tedinfo; // address of TEDINFO ICONBLK *iconblk; // address of ICONBLK BITBLK *bitblk; // address of BITBLK CICON *cicon; // address of CICON CICONBLK *ciconblk; // table of CICONBLK char **frstr; BITBLK **frimg; OBJECT **trindex; // address of tree OBJECTS } rscHDR; *
|
|
Load a resource file in memory.
Trick : mt_RsrcLoad() use PATH environment variable to locate resource file.
|
|
associate a drawing function to an objet formular
Refer to the documentation of the func_userdraw type for a description of the userdef callback function interface.
|
|
Release memory allocated by mt_RsrcXload().
|
|
load multiple extended GEM resource file.
mt_RsrcXload() use the PATH environment variable to locate the resource file (in this case, the filename should not be a pathname). The function returns a pointer which identify the resource or a NULL value if an error occurs. The pointer must be kept in memory because it is used by mt_RsrcGaddr() to get an object address in resource and it is used by mt_RsrcXfree() to release resource memory. Icons colors are automatically fixed by mt_RsrcXload() using mt_RsrcFixCicon() and transformed into a XCICON extended type. Due to this, color icons are displaying on any TOS version. To access to ICONBLK structure of a XCICON object, use the macro GET_XCICON(). Example { void *rsc1, *rsc2; OBJECT *tree; // Loads resources rsc1 = RsrcXload( "myrsc1.rsc"); rsc2 = RsrcXload( "myrsc2.rsc"); // Get an object RsrcGaddr( rsc1, R_TREE, FORM1, &tree); ... RsrcXfree( rsc2); RsrcXfree( rsc1); }
|
|
Install/remove WinDom extended objects.
An WinDom extended object is an object having a special value in ob_type field of the OBJECT structure. The low byte of ob_type is used by AES to identify the type of object (button, box, text, ...). The high byte is not read by AES. WinDom uses it to specify new objects. mt_RsrcXtype() transform theses objects into a G_USERDEF objects or insersly can restore objects previously transformed. The mode parameter describes the action to perform. Mode RSRC_XTYPE installs extended type for objects having an extended type. There is a second mode, RSRC_X3D, which installs new object types with a 3D look for all objects. The goal of this mode is to allow your dialog boxes to have the same aspect with MagiC, Naes, TOS or any other GEM system. Addressed objects are buttons and boxes (!U)without extended types(!u). And off course, these two modes can be cumulated (mode RSRC_XALL).
To fix the objects in the internal resource, the trindex parameter must set to NULL and the trindex parameter is not used. To fix an external resource, the trindex parameter should be filled with the address of object trees in the resource. This address is supplied with the RSH file created by your resource editor. The RSH file must be include in your source code with an When the application finishes, extended objects should be freed by a call to RsrcXtype() with mode 0. |