home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_09 / GENEVA4B.LZH / PROGRAM / XWINDGFA.LST < prev   
File List  |  1995-10-18  |  34KB  |  1,050 lines

  1. ' ----------------------------------------
  2. '         dmj's GFA Geneva Library
  3. '     Portions ╜ 1993 Gribnif Software
  4. '      Version 1.0   November 5, 1993
  5. ' Modified by Dan Wilga for Geneva rel 003
  6. ' ----------------------------------------
  7. '
  8. ' Every effort has been made to make sure this code is free from errors, but
  9. ' this code is provided as-is, with no guarantee whatsoever.  Use it at your
  10. ' own risk.
  11. '
  12. ' Should you find an error, omission, or tip, please let me know.
  13. '
  14. '       GEnie: DMJ
  15. '    Internet: DMJ@genie.geis.com
  16. '
  17. '       Phone: (817) 582-7373
  18. '         Fax: (817) 582-7377
  19. '         BBS: (817) 582-0672 (14.4K, 24 Hrs, E-mail "Sysop" or "dmj")
  20. '
  21. '  Snail Mail: Damien M. Jones
  22. '              dmj software
  23. '              Route 1, Box 168
  24. '              Milford, TX 76670
  25. '              USA
  26. '
  27. > procedure X_documentation               ! Read in here first.
  28.   '
  29.   ' This is the GFA version of the NEW_AES.H and XWIND.H files on the Geneva
  30.   ' master disk.  Since it contains information from the disk as well as from
  31.   ' the Geneva manual, it falls under the same Product License as Geneva itself.
  32.   ' Consult your Geneva manual for further details.
  33.   '
  34.   ' This will NOT tell you how to write programs that take advantage of
  35.   ' Geneva; what it DOES do is provide you with a library of routines you can
  36.   ' use to call Geneva.  For documentation on these routines, see your Geneva
  37.   ' manual or (in a few cases) the Atari Compendium.
  38.   '
  39.   ' The procedure X_init should be called before using any Geneva variables
  40.   ' or constants.  The other functions (they are ALL functions) correspond to
  41.   ' those listed in section 13 of the Geneva manual.
  42.   '
  43.   ' The in-line comments listed in the X_init procedure come from the header
  44.   ' files, except those prefixed by ****.
  45.   '
  46.   ' -----------------
  47.   '   From XWIND.H:
  48.   ' -----------------
  49.   '
  50.   ' Since GFA BASIC does not have a struct variable type, to extract the items
  51.   ' in a struct you must do some peeking around.  Listed below is more
  52.   ' information for each of the Geneva structures.  NOTE: Some of the listings
  53.   ' in the Geneva manual are out of date.  These definitions were taken from
  54.   ' the .H files, and are assumed to be current.
  55.   '
  56.   ' G_cookie% - Pointer to G_COOKIE structure.  This pointer is the _value_
  57.   '             of the "Gnva" cookie.
  58.   '
  59.   ' Int{G_cookie%}        ver             Geneva version.
  60.   ' {G_cookie%+2}         *process_name   Pointer to process name.
  61.   '   Char{{G_cookie%+2}} process_name    Actual process name.
  62.   ' Int{G_cookie%+6}      apid            Applicatioin ID of process.
  63.   ' {G_cookie%+8}         (**aes_funcs)() Pointer to function array.
  64.   ' {G_cookie%+12}        (**xaes_funcs)() Pointer to more functions array.
  65.   '
  66.   ' Ani_mouse% - Pointer to ANI_MOUSE structure.
  67.   '
  68.   ' Int{Ani_mouse%}       frames          Number of frames in mouse sequence.
  69.   ' Int{Ani_mouse%+2}     delay           50 Hz ticks between frames.
  70.   '
  71.   ' Mouse forms are listed starting at Ani_mouse%+4.  There may be up to 32 of
  72.   ' them.
  73.   '
  74.   ' Rshdr2% - Pointer to RSHDR2 structure (long .RSC header).
  75.   '
  76.   ' Int{Rshdr2%}          rsh_vrsn        .RSC version--should be 3.
  77.   ' Int{Rshdr2%+2}        rsh_extvrsn     Set to "IN" by Interface.
  78.   ' {Rshdr2%+4}           rsh_object
  79.   ' {Rshdr2%+8}           rsh_tedinfo
  80.   ' {Rshdr2%+12}          rsh_iconblk
  81.   ' {Rshdr2%+16}          rsh_bitblk
  82.   ' {Rshdr2%+20}          rsh_frstr
  83.   ' {Rshdr2%+24}          rsh_string
  84.   ' {Rshdr2%+28}          rsh_imdata      Image data.
  85.   ' {Rshdr2%+32}          rsh_frimg
  86.   ' {Rshdr2%+36}          rsh_trindex
  87.   ' {Rshdr2%+40}          rsh_nobs        Counts of various structs.
  88.   ' {Rshdr2%+44}          rsh_ntree
  89.   ' {Rshdr2%+48}          rsh_nted
  90.   ' {Rshdr2%+52}          rsh_nib
  91.   ' {Rshdr2%+56}          rsh_nbb
  92.   ' {Rshdr2%+60}          rsh_nstring
  93.   ' {Rshdr2%+64}          rsh_nimages
  94.   ' {Rshdr2%+68}          rsh_rssize      Total bytes in resource.
  95.   '
  96.   ' Note that this is twice the size of the normal .RSC header.
  97.   '
  98.   ' Keycode% - Pointer to KEYCODE structure.
  99.   '
  100.   ' Byte{Keycode%}        shift    Bit codes: 3210 = Ctrl / Alt / LShft / Rshft
  101.   ' Byte{Keycode%+1}      scan     Scan code or zero.
  102.   ' Byte{Keycode%+2}      ascii    ASCII value or zero (see note in manual).
  103.   '
  104.   ' Ob_prefer% - Extended object definition (bitmapped flags).
  105.   '
  106.   '  3         2         1
  107.   ' 10987654321098765432109876543210-- Object is OUTLINED.
  108.   ' |  || |||  ||  ||         ||||'--- Object is SHADOWED.
  109.   ' |  || |||  ||  |'-Reservd-'||'---- Object is drawn in 3D.
  110.   ' |  || |||  ||  |           |'----- Object has rounded corners.
  111.   ' |  || |||  ||  |           '------ Atari 3D. (reserved for future use)
  112.   ' |  || |||  |'--'------------------ Color of frame.
  113.   ' |  || ||'--'---------------------- Color of text.
  114.   ' |  || |'-------------------------- 0: transparent, 1: replace.
  115.   ' |  |'-'--------------------------- Fill pattern index.
  116.   ' '--'------------------------------ Color of interior.
  117.   '
  118.   ' Settings% - Pointer to SETTINGS structure.
  119.   '
  120.   ' Int{Settings%}        version         Version SETTINGS is for, in BCD.
  121.   ' Int{Settings%+2}      struct_len      Total # of bytes in SETTINGS.
  122.   ' Int{Settings%+4}      boot_rez        ST/TT resolution at startup.
  123.   ' Int{Settings%+6}      falcon_rez      Falcon video mode at startup.
  124.   ' Int{Settings%+8}      flags           Bitmapped flags (see below).
  125.   ' Int{Settings%+10}     gadget_pause    # of 50 Hz timer ticks before repeat.
  126.   ' Settings%+12          menu_start      KEYCODE - Key to start menus.
  127.   ' Settings%+16          app_switch      KEYCODE - Key to toggle between apps.
  128.   ' Settings%+20          app_sleep       KEYCODE - Key to sleep an app.
  129.   ' Settings%+24          ascii_table     KEYCODE - Key to open ASCII table.
  130.   ' Settings%+28          redraw_all      KEYCODE - Key to redraw whole screen.
  131.   ' Settings%+32          wind_keys[13]   KEYCODEs for window events.
  132.   ' Settings%+84          color_3D[4]     OB_PREFERs for 3D objects.
  133.   ' Settings%+100         color_root[4]   OB_PREFERs for root objects.
  134.   ' Settings%+116         color_exit[4]   OB_PREFERs for EXIT objects.
  135.   ' Settings%+132         color_other[4]  OB_PREFERs for other objects.
  136.   ' Byte{Settings%+148}   sort_type       fsel sort type, 0 (Name) - 4 (None).
  137.   ' Char{Settings%+149}   find_file[26]   fsel search string.
  138.   ' Settings%+175         fsel_path[10][35] Item selector paths.
  139.   ' Settings%+525         fsel_ext[10][6] Item selector extension strings.
  140.   '
  141.   ' flags definition:
  142.   '
  143.   '      1
  144.   ' 5432109876543210-- Use pulldown menus.
  145.   ' |    |||||||||'--- Insert in dialog edits.
  146.   ' 'Rsv-'|||||||'---- Use long underlines in X_UNDERLINE.
  147.   '       ||||||'----- Alerts appear under mouse.
  148.   '       |||||'------ Use 1 column in Item Selector.
  149.   '       ||||'------- FMD_GROW/SHRINK is on.
  150.   '       |||'-------- Tear-off menus are always usable.
  151.   '       ||'--------- auto_update_shell flag.
  152.   '       |'---------- alert_mode_change flag.
  153.   '       '----------- ignore_video_mode in GENEVA.CNF flag.
  154.   '
  155.   ' See note in manual for color_xx[] arrays.
  156.   '
  157.   ' Wind_tree% - Pointer to WIND_TREE structure.
  158.   '
  159.   ' Int{Wind_tree%}       handle          Handle of window being modified.
  160.   ' Int{Wind_tree%+2}     count           Number of objects in window.
  161.   ' Int{Wind_tree%+4}     flag            Location to copy to / from.
  162.   ' {Wind_tree%+6}        *tree           Pointer to object tree.
  163.   '
  164.   ' Apflg% - APFLG definition (bitmapped flags).
  165.   '
  166.   '  3         2         1
  167.   ' 10987654321098765432109876543210-- Multitasking.
  168.   ' |              || ||||||||||||'--- Use extended object types.
  169.   ' |              || |||||||||||'---- Use rounded EXIT buttons.
  170.   ' |              || ||||||||||'----- Use auto keyboard equivs.
  171.   ' |              || |||||||||'------ Undraw when form_do exits.
  172.   ' |              || ||||||||'------- Allow windows off left edge.
  173.   ' |              || |||||||'-------- Redraw everything at quit.
  174.   ' |              || ||||||'--------- New messages for AES 4.0 OK.
  175.   ' |              || |||||'---------- Limit window handles to 1-7.
  176.   ' |              || ||||'----------- Limit malloc's.
  177.   ' |              || |||'------------ Keep desktop / menu bar.
  178.   ' |              || ||'------------- Clear malloc'd memory.
  179.   ' |              || |'-------------- Omit unnecessary gadgets.
  180.   ' |              |'-'--------------- Reserved for future use.
  181.   ' '--------------'------------------ KB of memory to limit to.
  182.   '
  183.   ' You can extract the KB memory limit with the following statement:
  184.   ' Limit&=Card(Swap(Apflg%))
  185.   '
  186.   ' You can splice a new one back in with this:
  187.   ' Apflg%=Card(Apflg%) Or Swap(Limit&)
  188.   '
  189.   ' Appflags% - Pointer to APPFLAGS structure.
  190.   '
  191.   ' Char{Appflags%}       name            Filename pattern to use these flags.
  192.   ' Char{Appflags%+13}    desc            User-defined description of what flags
  193.   '                                       are for.
  194.   ' {Appflags%+30}        flags           APFLG - Execution flags.
  195.   ' Appflags%+34          open_key        KEYCODE - Open application when this
  196.   '                                       key is pressed.
  197.   ' Appflags%+38          reserve_key[3]  KEYCODEs - Application uses these
  198.   '                                       keys, so don't let Geneva process them
  199.   '
  200.   ' Xfontinfo% - Pointer to XFONTINFO structure.
  201.   '
  202.   ' Int{Xfontinfo%}       font_id         VDI font ID#.
  203.   ' Int{Xfontinfo%+2}     point_size      Point size of the font.
  204.   ' Int{Xfontinfo%+4}     gadget_wid      Width of the border around a char in a
  205.   '                                       window gadget.
  206.   ' Int{Xfontinfo%+6}     gadget_ht       Height of the border around a char in
  207.   '                                       a window gadget.
  208.   '
  209.   ' -------------------
  210.   '   From NEW_AES.H:
  211.   ' -------------------
  212.   '
  213.   ' Menu% - Pointer to MENU structure.
  214.   '
  215.   ' {Menu%}               *mn_tree        Pointer to submenu tree.
  216.   ' Int{Menu%+4}          mn_menu         Index of parent of menu.
  217.   ' Int{Menu%+6}          mn_item         Index of menu item.
  218.   ' Int{Menu%+8}          mn_scroll       0 - don't scroll; 1 - scroll if needed
  219.   ' Int{Menu%+10}         mn_keystate     Control/Alt/Shift key state on return
  220.   '
  221.   ' Note that the first edition of the Atari Compendium omitted the mn_keystate
  222.   ' field; it is listed in the first errata sheet for that book.
  223.   '
  224.   ' Shwrcmd% - Pointer to a SHWRCMD structure.
  225.   '
  226.   ' {Shwrcmd%}            *name           Pointer to filename.
  227.   '   Char{{Shwrcmd%}}    name            Actual filename.
  228.   ' {Shwrcmd%+4}          psetlimit       Maximum memory size for program.
  229.   ' {Shwrcmd%+8}          prenice         MiNT process priority.
  230.   ' {Shwrcmd%+12}         *dflt_dir       Pointer to default directory.
  231.   '   Char{{Shwrcmd%+12}} dflt_dir        Actual default directory for program.
  232.   ' {Shwrcmd%+16}         *environ        Pointer to environment strings.
  233.   '
  234.   ' More information on this structure can be found in the Compendium, but you
  235.   ' should note that the Compendium uses slightly different names for the
  236.   ' fields in this structure than those shown here.
  237.   '
  238.   ' -----------------
  239.   '   Miscellaneous
  240.   ' -----------------
  241.   '
  242.   ' GFA does not have a GRECT structure, commonly used by C programs to
  243.   ' indicate a coordinate rectangle.  Here's the definition of the GRECT
  244.   ' structure (Grect% is a pointer to one):
  245.   '
  246.   ' Int{Grect%}           g_x             X coordinate of left edge.
  247.   ' Int{Grect%+2}         g_y             Y coordinate of top edge.
  248.   ' Int{Grect%+4}         g_w             Rectangle width.
  249.   ' Int{Grect%+6}         g_h             Rectangle height.
  250.   '
  251.   ' GFA has a variable type which IS eight bytes long (big enough to hold a
  252.   ' GRECT)--floating-point.  To make it easier to use floating-point variables
  253.   ' as GRECTs, I have included the Ext_read_rect() and Ext_write_rect()
  254.   ' procedures.  Note than when a GRECT is being passed to a procedure or
  255.   ' function, I pass the ADDRESS, not the floating-point value itself.  Don't
  256.   ' try to print a floating-point variable used as a GRECT (you'll get
  257.   ' garbage).  Also note that the way the Ext_read_rect and Ext_write_rect
  258.   ' procedures are written, you can use ANY 8-byte memory block as a GRECT;
  259.   ' I recommend using floating-point variables only because they are
  260.   ' convenient.
  261.   '
  262.   ' In order to make your program more multitasking-friendly, you should follow
  263.   ' these guidelines:
  264.   '
  265.   '       1. Include one RESERVE statement near the beginning of your
  266.   '          program, which should keep just enough memory for GFA to
  267.   '          manage strings.  (32K should be enough, unless your program
  268.   '          is string-intensive.)  Don't use RESERVE after this; GFA
  269.   '          makes bad assumptions about RESERVE and your program may
  270.   '          crash.
  271.   '       2. Use malloc() for any large memory allocations.  Don't use
  272.   '          large arrays--use malloc() instead.
  273.   '       3. Put dialogs in windows whenever possible.
  274.   '       4. Name your program with menu_register.
  275.   '       5. Don't hog processor control for long periods of time;
  276.   '          give other programs a chance to run whenever possible.
  277.   '
  278.   ' ------------------
  279.   '   Revision Notes
  280.   ' ------------------
  281.   '
  282.   ' - Several of the x_settings constants were not explicitly stated in the
  283.   '   XWIND.H file.  I assigned them what I assumed to be correct values.
  284.   ' - The x_wind_calc() function was not fully documented in the Geneva
  285.   '   manual.  I assume the GFA routine is correct.
  286.   ' - x_sprintf() and x_sscanf() are not included in this version of the
  287.   '   library; GFA provides several functions which provide similar
  288.   '   functionality.  (And besides, GFA doesn't allow a variable number of
  289.   '   parameters to be passed to a function.)  I will add these later when
  290.   '   I have more time.
  291.   '
  292. Return
  293. > procedure X_init                        ! Initialize constants.
  294.   '
  295.   ' -----------------------
  296.   '   Items from XWIND.H.
  297.   ' -----------------------
  298.   '
  299.   Geneva_cookie%=Cvl("Gnva")
  300.   Geneva_ver&=&H102
  301.   '
  302.   Cjar_xbios&=Cvi("CJ")
  303.   Cjar_ok&=Cvi("ar")
  304.   '
  305.   ' appl_search constants.
  306.   '
  307.   X_aps_child0&=&H7100
  308.   X_aps_child&=&H7101
  309.   X_aps_chexit&=-1
  310.   '
  311.   ' wind_get / wind_set constants.
  312.   '
  313.   X_wf_menu&=&H1100
  314.   X_wf_dialog&=&H1200
  315.   X_wf_dialwid&=&H1300
  316.   X_wf_dialht&=&H1400
  317.   X_wf_dfltdesk&=&H1500         ! wind_set only
  318.   X_wf_minmax&=&H1600
  319.   '
  320.   X_wf_hsplit&=&H1700
  321.   X_wf_vsplit&=&H1800
  322.   X_wf_splmin&=&H1900
  323.   X_wf_hslide2&=&H1A00
  324.   X_wf_vslide2&=&H1B00
  325.   X_wf_hslsize2&=&H1C00
  326.   X_wf_vslsize2&=&H1D00
  327.   '
  328.   X_wf_dialflgs&=&H1E00
  329.   X_wd_active&=1                ! Mouse / keyboard events processed.
  330.   X_wd_blitscrl&=2              ! Use blit for realtime scroll.
  331.   '
  332.   X_wf_objhand&=&H1F00
  333.   X_wf_dialedit&=&H2000
  334.   '
  335.   ' evnt_multi / evnt_mesag constants.
  336.   '
  337.   X_mn_selected&=&HFFFFE000
  338.   X_wm_selected&=&HFFFFE100     ! Only if X_WTFL_CLICKS is off.
  339.   X_get_help&=&HFFFFE200
  340.   X_wm_hsplit&=&HFFFFE400
  341.   X_wm_vsplit&=&HFFFFE500
  342.   X_wm_arrowed2&=&HFFFFE600
  343.   X_wm_hslid2&=&HFFFFE700
  344.   X_wm_vslid2&=&HFFFFE800
  345.   X_wm_object&=&HFFFFE900
  346.   '
  347.   X_mu_dialog&=&H4000           ! evnt_multi (only) type.
  348.   '
  349.   ' objc_draw constants.
  350.   '
  351.   X_magmask&=&HFFFFF000         ! ob_state: Mask for X_MAGIC.
  352.   X_magic&=&H900                !           Must be set this way.
  353.   X_prefer&=&H40                !           User-defined fill.
  354.   X_draw3d&=&H80                !           3D.
  355.   X_rounded&=&H100              !           Rounded.
  356.   X_kbd_equiv&=&H200            !           Scan for ['s; Root: no auto equivs.
  357.   X_smalltext&=&H400            !           Small font.
  358.   '
  359.   X_mover&=17                   ! Extended ob_type: Dialog mover box.
  360.   X_radchkund&=18               !                   Radio / check / Undo.
  361.   X_underline&=19               !                   Title (G_STRING).
  362.   X_group&=20                   !                   Group (G_BUTTON).
  363.   X_help&=21                    !                   Activated with Help key.
  364.   X_undo&=31                    !                   Activated with Undo key.
  365.   X_usrdefpre&=90               !                   Call G_USERDEF before draw.
  366.   X_usrdefpost&=91              !                   Call G_USERDEF after draw.
  367.   '
  368.   X_bold&=&H4000                ! ob_flags: With X_MAGIC, bold text.
  369.   X_italic&=&HFFFF8000          !           With X_MAGIC, italic text.
  370.   '
  371.   ' form_dial constants.
  372.   '
  373.   X_fmd_start&=&H1000           ! Save area under dialog.
  374.   X_fmd_finish&=&H1003          ! Restore area under dialog.
  375.   '
  376.   ' graf_mouse constants.
  377.   '
  378.   X_lftrt&=8                    ! Left-right arrow.
  379.   X_updown&=9                   ! Up-down arrow.
  380.   X_mreset&=&H1000              ! Reset to on once.
  381.   X_mget&=&H1001                ! Get mouse shape.
  382.   X_set_shape&=&H1100           ! Add to mouse shape index to change shape.
  383.   '
  384.   ' rsrc_load constants.
  385.   '
  386.   X_longrsc&=Cvi("IN")
  387.   '
  388.   ' x_settings constants.
  389.   '
  390.   Set_ver&=&H100
  391.   '
  392.   Xs_uppage&=0
  393.   Xs_dnpage&=1                  ! **** The XWIND.H file refers to WA_... values
  394.   Xs_upline&=2                  ! **** that I are defined in the normal AES.H
  395.   Xs_dnline&=3
  396.   Xs_lfpage&=4
  397.   Xs_rtpage&=5
  398.   Xs_lfline&=6
  399.   Xs_rtline&=7
  400.   '
  401.   Xs_close&=8                   ! **** These were specified in XWIND.H.
  402.   Xs_cycle&=9
  403.   Xs_lfinfo&=11
  404.   Xs_rtinfo&=12
  405.   '
  406.   ' x_shel_get / x_shel_put constants.
  407.   '
  408.   X_shloadsave&=-1              ! Load / save SETTINGS.
  409.   X_shopen&=0                   ! Start read / write.
  410.   X_shaccess&=1                 ! Read / write.
  411.   X_shclose&=2                  ! Close.
  412.   '
  413.   ' x_wind_create / x_wind_calc constants.
  414.   '
  415.   X_menu&=1
  416.   X_hsplit&=2
  417.   X_vsplit&=4
  418.   '
  419.   ' x_wind_tree constants.
  420.   '
  421.   X_wt_getcnt&=0                ! Get count and flag.
  422.   X_wt_read&=1                  ! Copy window tree.
  423.   X_wt_set&=2                   ! Set new tree.
  424.   '
  425.   X_wtfl_resize&=1              ! Flags bit 0: Auto resize.
  426.   X_wtfl_clicks&=2              !           1: Process clicks.
  427.   X_wtfl_sliders&=4             !           2: Resize sliders, info.
  428.   '
  429.   ' Window gadgets.
  430.   Wgclose&=1                    ! BOXCHAR
  431.   Wgmove&=2                     ! BOXTEXT
  432.   Wgiconiz&=3                   ! BOXCHAR
  433.   Wgback&=4                     ! BOXCHAR
  434.   Wgfull&=5                     ! BOXCHAR
  435.   Wgileft&=6                    ! BOXCHAR
  436.   Wginfo&=7                     ! BOXTEXT
  437.   Wgirt&=8                      ! BOXCHAR
  438.   Wgtoolbox&=9                  ! IBOX
  439.   Wgmnleft&=10                  ! BOXCHAR
  440.   Wgmenu&=11                    ! BOX
  441.   Wgmnrt&=12                    ! BOXCHAR
  442.   Wgup&=13                      ! BOXCHAR
  443.   Wgvbigsl&=14                  ! BOX
  444.   Wgvsmlsl&=15                  ! BOX
  445.   Wgdown&=16                    ! BOXCHAR
  446.   Wgvsplit&=17                  ! BOX
  447.   Wgup2&=18                     ! BOXCHAR
  448.   Wgvbigsl2&=19                 ! BOX
  449.   Wgvsmlsl2&=20                 ! BOX
  450.   Wgdown2&=21                   ! BOXCHAR
  451.   Wgleft&=22                    ! BOXCHAR
  452.   Wghbigsl&=23                  ! BOX
  453.   Wghsmlsl&=24                  ! BOX
  454.   Wgrt&=25                      ! BOXCHAR
  455.   Wghsplit&=26                  ! BOX
  456.   Wgleft2&=27                   ! BOXCHAR
  457.   Wghbigsl2&=28                 ! BOX
  458.   Wghsmlsl2&=29                 ! BOX
  459.   Wgrt2&=30                     ! BOXCHAR
  460.   Wgsize&=31                    ! BOXCHAR
  461.   '
  462.   ' -------------------------
  463.   '   Items from NEW_AES.H.
  464.   ' -------------------------
  465.   '
  466.   ' New AES messages.
  467.   '
  468.   Wm_iconify&=34                ! AES 4.1 and newer.
  469.   Wm_uniconify&=35              ! AES 4.1.
  470.   Wm_alliconify&=36             ! AES 4.1.
  471.   Wm_toolbar&=37                ! AES 4.1.
  472.   Resch_completed&=61           ! Typo corrected from AES.H.
  473.   Sh_wdraw&=72
  474.   '
  475.   ' New object constants.
  476.   '
  477.   G_cicon&=33                   ! Ob_type.
  478.   Fl3dmask&=&H600               ! Ob_flags.
  479.   Fl3dnone&=0
  480.   Fl3dind&=&H200                ! **** Note: these do not match the Compendium,
  481.   Fl3dbak&=&H400                !            because the Compendium is wrong!
  482.   Fl3dact&=&H600
  483.   '
  484.   ' objc_sysvar constants.
  485.   '
  486.   Lk3dind&=1
  487.   Lk3dact&=2
  488.   Indbutcol&=3
  489.   Actbutcol&=4
  490.   Backgrcol&=5
  491.   Ad3dvalue&=6
  492.   '
  493.   ' graf_mouse constants.
  494.   '
  495.   M_save&=258
  496.   M_restore&=259
  497.   M_previous&=260
  498.   '
  499.   ' wind_create / wind_calc constants.
  500.   '
  501.   Smaller&=&H1000               ! AES 4.1 and newer.
  502.   '
  503.   ' wind_get / wind_set constants.
  504.   '
  505.   Wf_bottom&=25                 ! 1/25/93.
  506.   Wf_iconify&=26                ! AES 4.1 and newer.
  507.   Wf_uniconify&=27              ! AES 4.1.
  508.   Wf_uniconifyxywh&=28          ! AES 4.1.
  509.   Wf_toolbar&=30                ! AES 4.1.
  510.   Wf_ftoolbar&=31               ! AES 4.1.
  511.   Wf_ntoolbar&=32               ! AES 4.1.
  512.   '
  513.   ' The following definitions were added by Dan Wilga, to make using
  514.   ' shel_write easier.
  515.   '
  516.   ' shel_write sh_wdoex parameter flags in LSB.
  517.   '
  518.   Shw_runany&=0                 ! Run and let AES decide mode.
  519.   Shw_runapp&=1                 ! Run an application.
  520.   Shw_runacc&=3                 ! Run a desk accessory.
  521.   Shw_shutdown&=4               ! Enter shutdown mode.
  522.   Shw_newrez&=5                 ! Change resolution.
  523.   Shw_broadcast&=6              ! Broadcast to all processes.
  524.   Shw_environ&=8                ! Modify environment.
  525.   Shw_msgtype&=9                ! What kind of message app can understand.
  526.   Shw_sendtoaes&=10             ! Send AES a message.
  527.   '
  528.   ' shel_write sh_wdoex parameter flags in MSB.
  529.   '
  530.   Shd_environ&=&H800            ! Environment string.
  531.   Shd_dfltdir&=&H400            ! Default directory string.
  532.   Shd_prenice&=&H200            ! MiNT Prenice (priority) level.
  533.   Shd_psetlim&=&H100            ! MiNT memory allocation limit.
  534.   '
  535. Return
  536. '
  537. > function Appl_yield                     ! Allow other processes to take
  538. '                                         ! control.
  539. $F%
  540. '
  541. Gcontrl(0)=17                 ! Prep CONTROL array.
  542. Gcontrl(1)=0
  543. Gcontrl(2)=1
  544. Gcontrl(3)=0
  545. Gcontrl(4)=0
  546. '
  547. Gemsys                        ! Call AES.
  548. '
  549. Return Gintout(0)             ! Return error code.
  550. '
  551. Endfunc
  552. > function X_appl_flags(Getset&,Index&,Flags%) ! Get or set program flags.
  553. $F%
  554. '
  555. Gcontrl(0)=&H7100             ! Prep CONTROL array.
  556. Gcontrl(1)=2
  557. Gcontrl(2)=1
  558. Gcontrl(3)=1
  559. Gcontrl(4)=0
  560. '
  561. Gintin(0)=Getset&             ! Write input parameters.
  562. Gintin(1)=Index&
  563. Addrin(0)=Flags%
  564. '
  565. Gemsys                        ! Call AES.
  566. '
  567. Return Gintout(0)             ! Return error code.
  568. '
  569. Endfunc
  570. > function X_appl_font(Getset&,Zero&,Info%) ! Change font characteristics.
  571. $F%
  572. '
  573. Gcontrl(0)=&H7101             ! Prep CONTROL array.
  574. Gcontrl(1)=2
  575. Gcontrl(2)=1
  576. Gcontrl(3)=1
  577. Gcontrl(4)=0
  578. '
  579. Gintin(0)=Getset&             ! Write input parameters.
  580. Gintin(1)=Zero&
  581. Addrin(0)=Info%
  582. '
  583. Gemsys                        ! Call AES.
  584. '
  585. Return Gintout(0)             ! Return error code.
  586. '
  587. Endfunc
  588. > function X_appl_sleep(Id&,Sleep&)       ! Put an application to sleep.
  589. $F%
  590. '
  591. Gcontrl(0)=&H7102             ! Prep CONTROL array.
  592. Gcontrl(1)=2
  593. Gcontrl(2)=1
  594. Gcontrl(3)=0
  595. Gcontrl(4)=0
  596. '
  597. Gintin(0)=Id&                 ! Write input parameters.
  598. Gintin(1)=Sleep&
  599. '
  600. Gemsys                        ! Call AES.
  601. '
  602. Return Gintout(0)             ! Return error code.
  603. '
  604. Endfunc
  605. > function X_appl_term(Apid&,Retrn&,Set_me&) ! Terminate an application.
  606. $F%
  607. '
  608. Gcontrl(0)=&H7103             ! Prep CONTROL array.
  609. Gcontrl(1)=3
  610. Gcontrl(2)=1
  611. Gcontrl(3)=0
  612. Gcontrl(4)=0
  613. '
  614. Gintin(0)=Apid&               ! Write input parameters.
  615. Gintin(1)=Retrn&
  616. Gintin(2)=Set_me&
  617. '
  618. Gemsys                        ! Call AES.
  619. '
  620. Return Gintout(0)             ! Return error code.
  621. '
  622. Endfunc
  623. > function X_form_center(Tree%,Var Cx&,Cy&,Cw&,Ch&) ! Center an object tree.
  624. $F%
  625. '
  626. Gcontrl(0)=&H7110             ! Prep CONTROL array.
  627. Gcontrl(1)=0
  628. Gcontrl(2)=4
  629. Gcontrl(3)=1
  630. Gcontrl(4)=0
  631. '
  632. Addrin(0)=Tree%               ! Write input parameters.
  633. '
  634. Gemsys                        ! Call AES.
  635. '
  636. Cx&=Gintout(1)                ! Get output values.
  637. Cy&=Gintout(2)
  638. Cw&=Gintout(3)
  639. Ch&=Gintout(4)
  640. '
  641. Return Gintout(0)             ! Return error code.
  642. '
  643. Endfunc
  644. > function X_form_error(Fmt$,Errnum&)     ! Give a formatted error message alert
  645. $F%
  646. '
  647. Fmt$=Fmt$+Chr$(0)             ! Insure null-terminated string.
  648. '
  649. Gcontrl(0)=&H7111             ! Prep CONTROL array.
  650. Gcontrl(1)=1
  651. Gcontrl(2)=1
  652. Gcontrl(3)=1
  653. Gcontrl(4)=0
  654. '
  655. Gintin(0)=Errnum&             ! Write input parameters.
  656. Addrin(0)=V:Fmt$
  657. '
  658. Gemsys                        ! Call AES.
  659. '
  660. Return Gintout(0)             ! Return error code.
  661. '
  662. Endfunc
  663. '                             ! Convert to/from standard GEMDOS filename.
  664. > function X_form_filename(Tree%,Obj&,To_from&,Var String$)
  665. $F%
  666. '
  667. String$=Left$(String$+String$(13,0),13) ! Pad to 13 characters with NULLs.
  668. '
  669. Gcontrl(0)=&H7112             ! Prep CONTROL array.
  670. Gcontrl(1)=2
  671. Gcontrl(2)=1
  672. Gcontrl(3)=2
  673. Gcontrl(4)=0
  674. '
  675. Gintin(0)=Obj&                ! Write input parameters.
  676. Gintin(1)=To_from&
  677. Addrin(0)=Tree%
  678. Addrin(1)=V:String$
  679. '
  680. Gemsys                        ! Call AES.
  681. '
  682. Return Gintout(0)             ! Return error code.
  683. '
  684. Endfunc
  685. '                             ! Handle mouse clicks in a dialog.
  686. > function X_form_mouse(Tree%,Mouse_x&,Mouse_y&,Clicks&,Var Edit_obj&,Next_obj&,Edit_idx&)
  687. $F%
  688. '
  689. Gcontrl(0)=&H7113             ! Prep CONTROL array.
  690. Gcontrl(1)=6
  691. Gcontrl(2)=4
  692. Gcontrl(3)=1
  693. Gcontrl(4)=0
  694. '
  695. Gintin(0)=Mouse_x&            ! Write input parameters.
  696. Gintin(1)=Mouse_y&
  697. Gintin(2)=Clicks&
  698. Gintin(3)=Edit_obj&
  699. Gintin(4)=Next_obj&
  700. Gintin(5)=Edit_idx&
  701. Addrin(0)=Tree%
  702. '
  703. Gemsys                        ! Call AES.
  704. '
  705. Edit_obj&=Gintout(1)          ! Get output values.
  706. Next_obj&=Gintout(2)
  707. Edit_idx&=Gintout(3)
  708. '
  709. Return Gintout(0)             ! Return error code.
  710. '
  711. Endfunc
  712. '                             ! Extended file selector.
  713. > function X_fsel_input(Var Inpath$,Pathlen&,Files$,Sels&,Exbutton&,Label$)
  714. $F%
  715. Local T&
  716. '
  717. T&=13*Sels&+1                 ! Minimum length of Files$.
  718. '                             ! Pad to Pathlen& characters with NULLs.
  719. Inpath$=Left$(Inpath$+String$(Pathlen&,0),Pathlen&)
  720. Files$=Left$(Files$+String$(T&,0),T&) ! Pad to T& characters with NULLs.
  721. Label$=Label$+Chr$(0)         ! Insure null-terminated.
  722. '
  723. Gcontrl(0)=&H7120             ! Prep CONTROL array.
  724. Gcontrl(1)=2
  725. Gcontrl(2)=2
  726. Gcontrl(3)=3
  727. Gcontrl(4)=0
  728. '
  729. Gintin(0)=Pathlen&            ! Write input parameters.
  730. Gintin(1)=Sels&
  731. Addrin(0)=V:Inpath$
  732. Addrin(1)=V:Files$
  733. Addrin(2)=V:Label$
  734. '
  735. Gemsys                        ! Call AES.
  736. '
  737. Exbutton&=Gintout(1)          ! Get output values.
  738. '
  739. Return Gintout(0)             ! Return error code.
  740. '
  741. Endfunc
  742. > function X_graf_blit(Source%,Dest%)  ! Blit one area of the screen to another.
  743. $F%
  744. '
  745. Gcontrl(0)=&H7130             ! Prep CONTROL array.
  746. Gcontrl(1)=0
  747. Gcontrl(2)=1
  748. Gcontrl(3)=2
  749. Gcontrl(4)=0
  750. '
  751. Addrin(0)=Source%             ! Write input parameters.
  752. Addrin(1)=Dest%
  753. '
  754. Gemsys                        ! Call AES.
  755. '
  756. Return Gintout(0)             ! Return error code.
  757. '
  758. Endfunc
  759. '                             ! Extended rubberband box drawing.
  760. > function X_graf_rubberbox(Area%,Outer%,Minwidth&,Minheight&,Maxwidth&,Maxheight&,Snap&,Lag&)
  761. $F%
  762. '
  763. Gcontrl(0)=&H7131             ! Prep CONTROL array.
  764. Gcontrl(1)=6
  765. Gcontrl(2)=1
  766. Gcontrl(3)=2
  767. Gcontrl(4)=0
  768. '
  769. Gintin(0)=Minwidth&           ! Write input parameters.
  770. Gintin(1)=Minheight&
  771. Gintin(2)=Maxwidth&
  772. Gintin(3)=Maxheight&
  773. Gintin(4)=Snap&
  774. Gintin(5)=Lag&
  775. Addrin(0)=Area%
  776. Addrout(1)=Outer%
  777. '
  778. Gemsys                        ! Call AES.
  779. '
  780. Return Gintout(0)             ! Return error code.
  781. '
  782. Endfunc
  783. '                             ! Process keyboard input into an editable field.
  784. > function X_objc_edit(Tree%,Edit_obj&,Key_press&,Shift_state&,Var Edit_idx&,Mode&)
  785. $F%
  786. '
  787. Gcontrl(0)=&H7140             ! Prep CONTROL array.
  788. Gcontrl(1)=5
  789. Gcontrl(2)=2
  790. Gcontrl(3)=1
  791. Gcontrl(4)=0
  792. '
  793. Gintin(0)=Edit_obj&           ! Write input parameters.
  794. Gintin(1)=Key_press&
  795. Gintin(2)=Edit_idx&
  796. Gintin(3)=Shift_state&
  797. Gintin(4)=Mode&
  798. Addrin(0)=Tree%
  799. '
  800. Gemsys                        ! Call AES.
  801. '
  802. Edit_idx&=Gintout(1)          ! Get output values.
  803. '
  804. Return Gintout(0)             ! Return error code.
  805. '
  806. Endfunc
  807. > function X_wdial_draw(Handle&,Start&,Depth&) ! Redraw windowed dialog.
  808. $F%
  809. '
  810. Gcontrl(0)=&H7150             ! Prep CONTROL array.
  811. Gcontrl(1)=3
  812. Gcontrl(2)=1
  813. Gcontrl(3)=0
  814. Gcontrl(4)=0
  815. '
  816. Gintin(0)=Handle&             ! Write input parameters.
  817. Gintin(1)=Start&
  818. Gintin(2)=Depth&
  819. '
  820. Gemsys                        ! Call AES.
  821. '
  822. Return Gintout(0)             ! Return error code.
  823. '
  824. Endfunc
  825. '                             ! Change windowed dialog object.
  826. > function X_wdial_change(Handle&,Object&,Newstate&)
  827. $F%
  828. '
  829. Gcontrl(0)=&H7151             ! Prep CONTROL array.
  830. Gcontrl(1)=3
  831. Gcontrl(2)=1
  832. Gcontrl(3)=0
  833. Gcontrl(4)=0
  834. '
  835. Gintin(0)=Handle&             ! Write input parameters.
  836. Gintin(1)=Object&
  837. Gintin(2)=Newstate&
  838. '
  839. Gemsys                        ! Call AES.
  840. '
  841. Return Gintout(0)             ! Return error code.
  842. '
  843. Endfunc
  844. > function X_wind_create(Kind&,Xkind&,Wx&,Wy&,Ww&,Wh&) ! Extended wind_create().
  845. $F%
  846. '
  847. Gcontrl(0)=&H7153             ! Prep CONTROL array.
  848. Gcontrl(1)=6
  849. Gcontrl(2)=1
  850. Gcontrl(3)=0
  851. Gcontrl(4)=0
  852. '
  853. Gintin(0)=Kind&               ! Write input parameters.
  854. Gintin(1)=Xkind&
  855. Gintin(2)=Wx&
  856. Gintin(3)=Wy&
  857. Gintin(4)=Ww&
  858. Gintin(5)=Wh&
  859. '
  860. Gemsys                        ! Call AES.
  861. '
  862. Return Gintout(0)             ! Return error code.
  863. '
  864. Endfunc
  865. '                             ! Extended wind_calc().
  866. > function X_wind_calc(Type&,Kind&,Xkind&,Inx&,Iny&,Inw&,Inh&,Var Outx&,Outy&,Outw&,Outh&)
  867. $F%
  868. '
  869. Gcontrl(0)=&H7154             ! Prep CONTROL array.
  870. Gcontrl(1)=7
  871. Gcontrl(2)=5
  872. Gcontrl(3)=0
  873. Gcontrl(4)=0
  874. '
  875. Gintin(0)=Type&               ! Write input parameters.
  876. Gintin(1)=Kind&
  877. Gintin(2)=Xkind&
  878. Gintin(3)=Inx&
  879. Gintin(4)=Iny&
  880. Gintin(5)=Inw&
  881. Gintin(6)=Inh&
  882. '
  883. Gemsys                        ! Call AES.
  884. '
  885. Outx&=Gintout(1)              ! Get output values.
  886. Outy&=Gintout(2)
  887. Outw&=Gintout(3)
  888. Outh&=Gintout(4)
  889. '
  890. Return Gintout(0)             ! Return error code.
  891. '
  892. Endfunc
  893. > function X_wind_tree(Mode&,Wtree%) ! Get or alter a window's OBJECT tree.
  894. $F%
  895. '
  896. Gcontrl(0)=&H7152             ! Prep CONTROL array.
  897. Gcontrl(1)=1
  898. Gcontrl(2)=1
  899. Gcontrl(3)=1
  900. Gcontrl(4)=0
  901. '
  902. Gintin(0)=Mode&               ! Write input parameters.
  903. Addrin(0)=Wtree%
  904. '
  905. Gemsys                        ! Call AES.
  906. '
  907. Return Gintout(0)             ! Return error code.
  908. '
  909. Endfunc
  910. '                             ! Get or set Geneva's internal settings.
  911. > function X_settings(Getset&,Length&,User%)
  912. $F%
  913. '
  914. Gcontrl(0)=&H7180             ! Prep CONTROL array.
  915. Gcontrl(1)=2
  916. Gcontrl(2)=1
  917. Gcontrl(3)=1
  918. Gcontrl(4)=0
  919. '
  920. Gintin(0)=Getset&             ! Write input parameters.
  921. Gintin(1)=Length&
  922. Addrin(0)=User%
  923. '
  924. Gemsys                        ! Call AES.
  925. '
  926. Return Gintout(0)             ! Return error code.
  927. '
  928. Endfunc
  929. > function X_shel_get(Mode&,Length&,Var Buf$) ! Read information from GENEVA.CNF
  930. $F%
  931. '
  932. Buf$=String$(Length&,0)       ! Reserve space for data.
  933. '
  934. Gcontrl(0)=&H7181             ! Prep CONTROL array.
  935. Gcontrl(1)=2
  936. Gcontrl(2)=1
  937. Gcontrl(3)=1
  938. Gcontrl(4)=0
  939. '
  940. Gintin(0)=Mode&               ! Write input parameters.
  941. Gintin(1)=Length&
  942. Addrin(0)=V:Buf$
  943. '
  944. Gemsys                        ! Call AES.
  945. '
  946. Return Gintout(0)             ! Return error code.
  947. '
  948. Endfunc
  949. > function X_shel_put(Mode&,Buf$) ! Write information to GENEVA.CNF.
  950. $F%
  951. '
  952. Buf$=Buf$+Chr$(0)             ! Insure null-terminated.
  953. '
  954. Gcontrl(0)=&H7182             ! Prep CONTROL array.
  955. Gcontrl(1)=1
  956. Gcontrl(2)=1
  957. Gcontrl(3)=1
  958. Gcontrl(4)=0
  959. '
  960. Gintin(0)=Mode&               ! Write input parameters.
  961. Addrin(0)=V:Buf$
  962. '
  963. Gemsys                        ! Call AES.
  964. '
  965. Return Gintout(0)             ! Return error code.
  966. '
  967. Endfunc
  968. '                             ! Inform the Help display program of a request for
  969. '                             ! help text.
  970. > function X_help(Topic$,Helpfile$,Sensitive&)
  971. $F%
  972. '
  973. Topic$=Topic$+Chr$(0)         ! Insure null-terminated strings.
  974. Helpfile$=Helpfile$+Chr$(0)
  975. '
  976. Gcontrl(0)=&H7185             ! Prep CONTROL array.
  977. Gcontrl(1)=1
  978. Gcontrl(2)=1
  979. Gcontrl(3)=2
  980. Gcontrl(4)=0
  981. '
  982. Gintin(0)=Sensitive&          ! Write input parameters.
  983. Addrin(0)=V:Topic$
  984. Addrin(1)=V:Helpfile$
  985. '
  986. Gemsys                        ! Call AES.
  987. '
  988. Return Gintout(0)             ! Return error code.
  989. '
  990. Endfunc
  991. '
  992. > function Appl_getinfo(Ap_gtype&,Var Ao_gout1&,Ap_gout2&,Ap_gout3&,Ap_gout4&)
  993. $F%
  994. '
  995. Gcontrl(0)=130                ! Prep CONTROL array.
  996. Gcontrl(1)=1
  997. Gcontrl(2)=5
  998. Gcontrl(3)=0
  999. Gcontrl(4)=0
  1000. '
  1001. Gintin(0)=Ap_gtype&           ! Write input parameters.
  1002. '
  1003. Gemsys                        ! Call AES.
  1004. '
  1005. Ap_gout1&=Gintout(1)          ! Get output values.
  1006. Ap_gout2&=Gintout(2)
  1007. Ap_gout3&=Gintout(3)
  1008. Ap_gout4&=Gintout(4)
  1009. '
  1010. Return Gintout(0)             ! Return error code.
  1011. '
  1012. Endfunc
  1013. > function Objc_sysvar(Ob_smode&,Ob_swhich&,Ob_sival1&,Ob_sival2&,Var Ob_soval1&,Ob_soval2&)
  1014. $F%
  1015. '
  1016. Gcontrl(0)=48                 ! Prep CONTROL array.
  1017. Gcontrl(1)=4
  1018. Gcontrl(2)=3
  1019. Gcontrl(3)=0
  1020. Gcontrl(4)=0
  1021. '
  1022. Gintin(0)=Ob_smode&           ! Write input parameters.
  1023. Gintin(1)=Ob_swhich&
  1024. Gintin(2)=Ob_sival1&
  1025. Gintin(3)=Ob_sival2&
  1026. '
  1027. Gemsys                        ! Call AES.
  1028. '
  1029. Ob_soval1&=Gintout(1)         ! Get output values.
  1030. Ob_soval2&=Gintout(2)
  1031. '
  1032. Return Gintout(0)             ! Return error code.
  1033. '
  1034. Endfunc
  1035. '
  1036. > procedure Ext_read_rect(Rect%,Var X&,Y&,W&,H&) ! Read a GRECT structure.
  1037. X&=Int{Rect%}
  1038. Y&=Int{Rect%+2}
  1039. W&=Int{Rect%+4}
  1040. H&=Int{Rect%+6}
  1041. Return
  1042. > procedure Ext_write_rect(Rect%,X&,Y&,W&,H&)    ! Write a GRECT structure.
  1043. Int{Rect%}=X&
  1044. Int{Rect%+2}=Y&
  1045. Int{Rect%+4}=W&
  1046. Int{Rect%+6}=H&
  1047. Return
  1048. ' End of XWINDGFA.LST
  1049. '
  1050.