home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / muibuilder21.lha / MUIBuilder / MB / Developer / Autodocs / MUIBuilder.doc
Encoding:
Text File  |  1994-08-30  |  10.0 KB  |  370 lines

  1. TABLE OF CONTENTS
  2.  
  3. MUIBuilder.library/--background--
  4. MUIBuilder.library/MB_Open
  5. MUIBuilder.library/MB_Close
  6. MUIBuilder.library/MB_GetA
  7. MUIBuilder.library/MB_GetVarInfoA
  8. MUIBuilder.library/MB_GetNextCode
  9. MUIBuilder.library/MB_GetNextNotify
  10.  
  11. MUIBuilder.library/--background--
  12.     The goal of the muibuilder library is, at this time, to provide some
  13.     functions to help the writing of MUIBuilder external generators.
  14.  
  15.     These functions are described in the following documentation.
  16.  
  17. MUIBuilder.library/MB_Open
  18.  
  19.    NAME
  20.     MB_Open
  21.  
  22.   SYNOPSIS
  23.     bool = MB_Open();
  24.  
  25.     BOOL MB_Open( void );
  26.  
  27.   FUNCTION
  28.     Opens the MUIBuilder temporary files, and initializes global
  29.     variables.
  30.  
  31.   RESULT
  32.     bool : a boolean : the function returns TRUE ( 1 ) if all
  33.            file openings and memory allocations have succeeded
  34.  
  35.   WARNING
  36.     none of the other functions will work if this one is not successful
  37.  
  38.   SEE ALSO
  39.     MB_Close()
  40.  
  41. MUIBuilder.library/MB_Close
  42.  
  43.    NAME
  44.     MB_Close
  45.  
  46.   SYNOPSIS
  47.     MB_Close();
  48.  
  49.     void MB_Close( void );
  50.  
  51.   FUNCTION
  52.     Closes the temporary files and deallocates memory
  53.  
  54.   WARNING
  55.     don't forget to call this function before exiting your generator,
  56.     even if MB_Open() call failed.
  57.  
  58.   SEE ALSO
  59.     MB_Open()
  60.  
  61. MUIBuilder.library/MB_GetA
  62.  
  63.   NAME
  64.     MB_GetA    
  65.     MB_Get
  66.  
  67.   SYNOPSYS
  68.     MB_GetA( Tags );
  69.           A1
  70.  
  71.     MB_GetA( struct TagItem * );
  72.  
  73.     MB_Get ( Tag Tag1, ... );
  74.  
  75.   FUNCTION
  76.     This function enables you to get the initialization values
  77.     for the generator ( such as the file name of the file you
  78.     have to create ... )
  79.     These values are here to give you some informations, such as
  80.     the name of the file to generate, the name of the catalog file,
  81.     the number of variables needed in the program the generator must
  82.     create ... and so on ...
  83.  
  84.   INPUTS
  85.     tags - pointer to a tag list
  86.  
  87.   TAGS
  88.     tags for use with this function:
  89.  
  90.     MUIB_FileName ( STRPTR* )     - returns the name of the file to generate.
  91.  
  92.     MUIB_CatalogName( STRPTR* )     - same as above for MUIB_FileName
  93.                           returns the name of the .cd file.
  94.  
  95.     MUIB_GetStringName( STRPTR* )     - same as above for MUIB_FileName
  96.                         returns the name of the GetString function.
  97.  
  98.     MUIB_Code( BOOL* )         - return in the variable if the user wants
  99.                          the code to be generated.
  100.  
  101.     MUIB_Environment ( BOOL* )     - will return TRUE in the variable
  102.                          if the user wants an environment
  103.                          You must interpret this value in the generator.
  104.                         (please try GenCodeC to see the consequence)
  105.  
  106.     MUIB_Locale ( BOOL* )         - will return TRUE if the user wants
  107.                     a localised code
  108.  
  109.     MUIB_Declarations ( BOOL* )     - will return TRUE if the user wants
  110.                           the declarations
  111.  
  112.     MUIB_VarNumber ( ULONG* )     - will return in the variable the number
  113.                          of variables declared in the generated code
  114.  
  115.     MUIB_Application ( BOOL* )    - will return TRUE in the given variable if
  116.                     the user generates the whole application
  117.  
  118.   EXAMPLE
  119.     ULONG    varnb;
  120.     BOOL    Code, Env, Locale, Declarations;
  121.     char    *FileName, *CatalogName, *GetString;
  122.  
  123.     MB_Get    (
  124.         MUIB_VarNumber        , &varnb,
  125.         MUIB_Code        , &Code,
  126.         MUIB_Environment    , &Env,
  127.         MUIB_Locale        , &Locale,
  128.         MUIB_Declarations    , &Declarations,
  129.         MUIB_FileName        , &FileName,
  130.         MUIB_CatalogName    , &CatalogName,
  131.         MUIB_GetStringName    , &GetString,
  132.         TAG_END
  133.         );
  134.  
  135.     After this call :
  136.         - varnb contains the number of variables to be generated
  137.         - Code  contains TRUE or FALSE (depending on the user choice)
  138.         - Env   contains TRUE or FALSE
  139.         - Declarations contains TRUE or FALSE
  140.         - FileName is a pointer on the File name
  141.         - CatalogName is a pointer on the Catalog name
  142.         - GetString is a pointer on the GetString function name
  143.  
  144.   WARNING
  145.     this function will do NOTHING if MB_Open() was not successful, or
  146.     was not called.
  147.  
  148.   SEE ALSO
  149.     MB_GetVarInfoA, MB_GetNextCode, MB_GetNextNotify.
  150. MUIBuilder.library/MB_GetVarInfoA
  151.  
  152.   NAME
  153.     MB_GetVarInfoA    
  154.     MB_GetVarInfo
  155.  
  156.   SYNOPSYS
  157.     MB_GetVarInfoA( variable_number, Tags );
  158.                     D0      A1
  159.  
  160.     MB_GetVarInfoA( ULONG, struct TagItem * );
  161.  
  162.     MB_GetVarInfo ( ULONG, Tag Tag1, ... );
  163.  
  164.   FUNCTION
  165.     get infos on the variable number 'variable_number'. This info
  166.     can be its name, its size, its type or how you have to initialise
  167.     the variable.
  168.  
  169.   INPUTS
  170.     variable_number    - number of the variable for which you want to
  171.               get info
  172.  
  173.     Tags        - pointer to a list of tags giving the information
  174.               you want to get
  175.  
  176.   TAGS
  177.     MUIB_VarSize ( ULONG* )    - get the size of the variable
  178.             this size is :
  179.             - for a string array  : its size
  180.             - for a string          : its length
  181.             - for all other types : 0
  182.  
  183.     MUIB_VarName ( STRPTR* ) - get the name of the variable
  184.  
  185.     MUIB_VarType ( ULONG* ) - get the type of the variable
  186.             this type could be :
  187.             - TYPEVAR_BOOL        (1)    Boolean
  188.             - TYPEVAR_INT        (2) Integer ( 4 bytes long )
  189.             - TYPEVAR_STRING    (3) String Pointer
  190.             - TYPEVAR_TABSTRING (4) Strings Array
  191.             - TYPEVAR_PTR        (5) Pointer
  192.             - TYPEVAR_HOOK        (6) Function Hook
  193.             - TYPEVAR_IDENT        (7) A constant identifier (i.e. ID_ReturnValue)
  194.             - TYPEVAR_EXTERNAL  (8) External variable
  195.             - TYPEVAR_LOCAL_PTR (9) A pointer local to the Create procedure
  196.  
  197.     MUIB_VarInitPtr ( ULONG* ) - get the pointer to the init zone
  198.             of the specified variable
  199.             This 'init zone' could be :
  200.             - a string ending with '\0' ( for a string )
  201.             - the list of the strings   ( for a strings array )
  202.             - just a '\0' for all other types
  203.             
  204.   EXAMPLE
  205.     ULONG    i, type, size;
  206.     char    *name, *inits;
  207.  
  208.     MB_GetVarInfo( i,
  209.                MUIB_VarType    , &type,
  210.                MUIB_VarName    , &name,
  211.                MUIB_VarSize    , &size,
  212.                MUIB_VarInitPtr    , &inits,
  213.                TAG_END
  214.              );
  215.   WARNING
  216.     this function will do NOTHING if MB_Open() was not successful, or
  217.     was not called.
  218.  
  219.   SEE ALSO
  220.     MB_GetA(), MB_GetNextCode(), MB_GetNextNotify()
  221. MUIBuilder.library/MB_GetNextCode
  222.  
  223.   NAME
  224.     MB_GetNextCode
  225.  
  226.   SYNOPSIS
  227.     MB_GetNextCode( type, code );
  228.              A0    A1
  229.  
  230.     void MB_GetNextCode( ULONG*, char** );
  231.  
  232.   FUNCTION
  233.     get the next code element. You just have to read every code element.
  234.     Then you react depending on the code element type you receive.
  235.  
  236.   RESULT
  237.     type     - will contain the type of the code element to write
  238.           this type could be :
  239.  
  240.             TC_CREATEOBJ        : creation of a MUI object
  241.             TC_ATTRIBUT        : name of an object attribute
  242.             TC_END            : end of an object creation
  243.             TC_FUNCTION        : opening of a function
  244.             TC_STRING        : a string
  245.             TC_INTEGER        : an integer
  246.             TC_CHAR            : a character
  247.             TC_VAR_AFFECT        : affectation of a variable
  248.             TC_VAR_ARG        : variable as argument
  249.             TC_END_FUNCTION     : end of a function call
  250.             TC_BOOL            : boolean
  251.             TC_MUIARG        : a mui argument
  252.             TC_OBJFUNCTION        : function creating an object
  253.             TC_LOCALESTRING     : a locale string reference
  254.             TC_EXTERNAL_CONSTANT    : reference to an external constant
  255.                           (i.e. not created by MUIBuilder)
  256.             TC_EXTERNAL_FUNCTION    : reference to an external function
  257.                           (i.e. not created by MUIBuilder)
  258.             TC_MUIARG_ATTRIBUT    : a MUI attribute as argument
  259.             TC_MUIARG_FUNCTION    : a function as argument
  260.             TC_MUIARG_OBJ        : an object as argument of a MUI attribute
  261.             TC_BEGIN_NOTIFICATION    : the beginning of a notification
  262.             TC_END_NOTIFICATION    : the end of a notification
  263.             TC_EXTERNAL_VARIABLE    : reference to an external variable
  264.                           (ie not generated by MUIBuilder)
  265.             TC_MUIARG_OBJFUNCTION    : an object function as argument
  266.             TC_OBJ_ARG        : an object take as argument
  267.             TC_LOCALECHAR        : a locale char
  268.  
  269.     code    - is a pointer, and will contain the pointer to the
  270.           code you have to write. This code is ALWAYS a string.
  271.           to obtain a number or a boolean, you have to convert this string !
  272.  
  273.                 type    /    code
  274.  
  275.             TC_CREATEOBJ        : the number of the object
  276.             TC_ATTRIBUT        : the number of the attribute
  277.             TC_END            : the number of 'End'
  278.             TC_FUNCTION        : the number of the function
  279.             TC_STRING        : the string ( ending with '\0' )
  280.             TC_INTEGER        : the value of the integer
  281.             TC_CHAR            : the character
  282.             TC_VAR_AFFECT        : the number of the variable
  283.                         ( you can get infos with MB_GetVarInfo )
  284.             TC_VAR_ARG        : the number of the variable
  285.             TC_END_FUNCTION     : the number of 'End'
  286.             TC_BOOL            : '0' [ FALSE ] or '1' [ TRUE ]
  287.             TC_MUIARG        : the number of the MUI string
  288.             TC_OBJFUNCTION        : the number of the MUI function
  289.             TC_LOCALESTRING     : the string MSG_xxxxx ( ending with '\0' )
  290.             TC_LOCALECHAR        : the string MSG_xxxxx ( ending with '\0' )
  291.             TC_EXTERNAL_CONSTANT    : name of the constant
  292.             TC_EXTERNAL_FUNCTION    : name of the function
  293.             TC_MUIARG_ATTRIBUT    : number of the attribute
  294.             TC_MUIARG_FUNCTION    : Number of the function
  295.             TC_MUIARG_OBJ        : Number of the object
  296.             TC_BEGIN_NOTIFICATION    : Number of the variable taken as argument of the
  297.                           notification
  298.             TC_END_NOTIFICATION    : end of the notification (no special return)
  299.             TC_EXTERNAL_VARIABLE    : name of the variable
  300.             TC_MUIARG_OBJFUNCTION    : number of the object
  301.             TC_OBJ_ARG        : number of the object taken as argument
  302.  
  303.         When you read a TC_LOCALE_STRING, you will generate a call to a GetMBString
  304.         function. There is then two case depending on the string in the catalog
  305.         file :
  306.             1. A\00A try : In this case your function must return "A Try"
  307.             2. A Try     : In this case your function must return "A Try"
  308.         This function MUST use the user-defined GetString function.
  309.  
  310.         When you read TC_LOCALE_CHAR, you must return the first char of the
  311.         String you get after the call to the user-defined GetString Function
  312.  
  313.   EXAMPLE
  314.     ULONG    type;
  315.     char    *code;
  316.  
  317.     MB_GetNextCode( &type, &code );
  318.  
  319.     switch ( type )
  320.     {
  321.             .
  322.             .
  323.             .
  324.         case TC_FUNCTION:
  325.             ...
  326.             break;
  327.             .
  328.             .
  329.         case TC_VAR_ARG:
  330.             ...
  331.             break;
  332.             .
  333.             .
  334.             .
  335.         default:
  336.             ErrorMessage("There is a problem with this file !");
  337.             return;
  338.             break;
  339.     }
  340.  
  341.   WARNING
  342.     this function will do NOTHING if MB_Open() was not successful, or
  343.     was not called.
  344.  
  345.   SEE ALSO
  346.     MB_GetA(), MB_GetVarInfoA(), MB_GetNextNotify().
  347. MUIBuilder.library/MB_GetNextNotify
  348.  
  349.   NAME
  350.     MB_GetNextNotify
  351.  
  352.   SYNOPSIS
  353.     MB_GetNextNotify( type, code );
  354.                A0    A1
  355.  
  356.     void MB_GetNextNotify( ULONG*, char** );
  357.  
  358.   FUNCTION
  359.     get the next notify element.
  360.  
  361.     ALL specifications are exactly the same as GetNextCode. The only
  362.     difference is that this function gets the notify elements.
  363.  
  364.   WARNING
  365.     this function will do NOTHING if MB_Open() was not successful, or
  366.     was not called.
  367.  
  368.   SEE ALSO
  369.     MB_GetA(), MB_GetVarInfoA(), MB_GetNextCode().
  370.