•  Back 
  •  The extended xFSL call 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File13.14.1.3.6  The xFSL_PAR structure                                TOS

With this structure you have extensive influence on the behaviour of 
the font-selector and the type of fonts displayed. Therefore the 
description of the options is somewhat on the long side ...

     typedef struct
     {
      int            par_size;    /* Size of xFSL_PAR structure     */
      int            pfi_size;    /* Size of PFONTINFO structure    */
      unsigned long  control;     /* Control-flags                  */
      const char    *headline;    /* Header, or 0L                  */
      const char    *example;     /* Sample text, or 0L             */
      const char    *helptext;    /* Text of the HELP button, or 0L */
      PFONTINFO     *font;        /* Pointer to Fontinfo structure  */
      unsigned int   fontflags;   /* Permitted font types           */
      const char    *poptext;     /* Text before the popup, or 0L   */
      int            num_entries; /* Number of entries (0..n)       */
      int            sel_entry;   /* Selected entry (0..n-1)        */
      xFSL_PENTRY   *popup;       /* Pointer to a popup, or 0L      */
      char          *helpinfo;    /* Pointer to Help-file/-page     */
     } xFSL_PAR;

Despite the multitude of entries everything is really quite simple, 
the more so that the fields that you do not need, or whose meaning is 
not yet clear to you, can simply be filled with zeros, whereupon the 
font-selector will then assume sensible default values.

The fields in detail:

 par_size    This field may not be set to zero; here the size of the 
             xFSL_PAR structure in bytes is entered, so that in C one 
             can simply write:

                  xpar.par_size=sizeof(xFSL_PAR);

             The size of the structure currently comprises 42 bytes. 
             Should the structure be extended at some time, then the 
             font-selector can recognize from the size specification 
             whether it is dealing with the old or the new structure.

 pfi_size    This field too may not be zero; here one has to enter the 
             size of the PFONTINFO structure, so in C:

                  xpar.pfi_size=sizeof(PFONTINFO);

             The current size of the PFONTINFO structure comprises 38 
             bytes and might also be extended in the future.

 control     These are the so-called control-flags, with which the 
             behaviour of the font-selector can be influenced (e.g. 
             whether it is to appear as a window or a dialog).

             These flags are described in greater detail in their 
             dedicated section below.

 headline    This, as already familiar from the simplified call, is a 
             pointer to a header line for the font-selector. If this 
             is missing (headline contains 0L), then a default text 
             header will inserted.

             The length of the header should be within the limit set 
             by UFSL (34 characters), though the font-selector will 
             truncate longer headers if necessary.

 example     A pointer to a sample text. The font-selector displays an 
             example of glyphs in the currently selected font making 
             up a text that may be specified here. If this text is 
             missing (i.e. example contains zero) then the font- 
             selector will display a default text (e.g. the name of 
             the current font in each case).

 helptext    This is the text for a button that can be displayed at 
             bottom left of the font-selector. Normally one will want 
             to display a button labelled 'HELP' (or 'HILFE'), which 
             explains to the user the function of the font-selector, 
             and what the selected font is to be used for.

             If this text is missing (i.e. helptext contains zero), 
             then no HELP button will be displayed and also xfsl_event 
             will not return a value for xFS_HELP.

             One should choose a short text (around 8 characters), 
             though the font-selector will truncate longer texts if 
             necessary.

 font        This is a pointer to a structure (PFONTINFO) which 
             describes a font. The structure is used both for passing 
             values to the font-selector as well as returning the 
             selected font.

             This structure too is described in greater detail in its 
             dedicated section below.

 fontflags   These are once more the font-flags, familiar from the 
             simplified call, with which you can influence the fonts 
             available for selection.

 poptext, num_entries, sel_entry, popup: With these four parameters an 
             additional popup can be made to appear in the font- 
             selector. Due to the manifold options there is again a 
             dedicated section below for this.

             If you do not want a popup, then simply set these four 
             values to zero.

 helpinfo    This is a pure output parameter: If the HELP button was 
             selected (provided it is present, see `helptext'), then 
             one will find here a pointer to a filename of a Help-file 
             and the name of a page to be displayed. The filename is 
             specified without a path or extension, with the page name 
             following directly after it, separated by a comma.

                  The string may only be read, but not altered!

             If you do not want to display Help yourself with xFS_HELP 
             then you can use the information to call up a help-system 
             (e.g. ST-Guide).

             Example: xfsl_event returns xFS_HELP, in helpinfo there 
             is a pointer to the string:

                  fine,The finest font-selector of all time

             From this one can create the following call for ST-Guide:

                  *:\fine.hyp The finest font-selector of all time

             So one appends the extension for the relevant help-system 
             to the filename and passes the post-comma portion as a 
             page-name.


To stress once more: Fields that you do not require or do not yet 
understand can simply be set to zero at first. Exceptions are only:

   . par_size, the size of the xFSL_PAR structure itself

   . pfi_size, the size of the PFONTINFO structure

   . font, the pointer to the PFONTINFO structure