home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / System / ReqToolsLib / Source / reqtools / rtfontrequesta.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-02  |  4.9 KB  |  180 lines

  1.  
  2. /*
  3.     (C) 1999 - 2000 AROS - The Amiga Research OS
  4.     $Id: rtfontrequesta.c,v 1.3 2000/11/26 16:53:48 stegerg Exp $
  5.  
  6.     Desc:
  7.     Lang: English
  8. */
  9.  
  10. #include <exec/types.h>
  11. #include <proto/exec.h>
  12. #include <proto/reqtools.h>
  13. #include <proto/intuition.h>
  14. #include <exec/libraries.h>
  15. #include <exec/memory.h>
  16. #include <aros/libcall.h>
  17.  
  18. #include "reqtools_intern.h"
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.  
  24.     AROS_LH3(ULONG, rtFontRequestA,
  25.  
  26. /*  SYNOPSIS */
  27.  
  28.     AROS_LHA(struct rtFontRequester *, fontreq, A1),
  29.     AROS_LHA(char *, title, A3),
  30.     AROS_LHA(struct TagItem *, taglist, A0),
  31.  
  32. /*  LOCATION */
  33.  
  34.     struct ReqToolsBase *, ReqToolsBase, 16, ReqTools)
  35.  
  36. /*  FUNCTION
  37.     Let the user select a font and a style (optional).
  38.    
  39.     INPUTS
  40.     fontreq  - pointer to a struct rtFontRequester allocated with
  41.         rtAllocRequestA().
  42.     title - pointer to requester window title (null terminated).
  43.     taglist - pointer to a TagItem array.
  44.  
  45.     TAGS
  46.     RT_Window - see rtEZRequestA()
  47.  
  48.     RT_ReqPos - see rtEZRequestA()
  49.  
  50.     RT_LeftOffset - see rtEZRequestA()
  51.  
  52.     RT_TopOffset - see rtEZRequestA()
  53.  
  54.     RT_PubScrName - see rtEZRequestA()
  55.  
  56.     RT_Screen - see rtEZRequestA()
  57.  
  58.     RT_ReqHandler - see rtEZRequestA()
  59.  
  60.     RT_WaitPointer - see rtEZRequestA()
  61.  
  62.     RT_LockWindow - [V38] see rtEZRequestA()
  63.  
  64.     RT_ScreenToFront - [V38] see rtEZRequestA()
  65.  
  66.     RT_ShareIDCMP - [V38] see rtEZRequestA()
  67.  
  68.     RT_Locale - [V38] see rtEZRequestA()
  69.  
  70.     RT_IntuiMsgFunc - (struct Hook *) [V38] The requester will call
  71.         this hook for each IDCMP message it gets that doesn't belong to
  72.         its window. Only applies if you used the RT_ShareIDCMP tag to
  73.         share the IDCMP port with the parent window. Parameters are as
  74.         follows:
  75.  
  76.         A0 - (struct Hook *) your hook
  77.         A2 - (struct rtFontRequester *) your requester
  78.         A1 - (struct IntuiMessage *) the message
  79.  
  80.         After you have finished examining the message and your hook
  81.         returns, ReqTools will reply the message. So do not reply the
  82.         message yourself!
  83.  
  84.     RT_Underscore - (char) [V38] Indicates the symbol that precedes the
  85.         character in a gadget's label to be underscored. This will also
  86.         define the keyboard shortcut for this gadget. Currently only
  87.         needed for RTFO_OkText. Usually set to '_'.
  88.  
  89.     RT_DefaultFont - (struct TextFont *) This tag allows you to specify
  90.         the font to be used in the requester when the screen font is
  91.         proportional. Default is GfxBase->DefaultFont. This tag is
  92.         obsolete in ReqTools 2.2 and higher.
  93.  
  94.     RT_TextAttr - [V38] see rtFileRequestA()
  95.  
  96.     RTFO_Flags - (ULONG) Several flags:
  97.  
  98.         FREQF_NOBUFFER - do not buffer the font list for subsequent
  99.             calls to rtFontRequestA().
  100.  
  101.         FREQF_FIXEDWIDTH - only show fixed-width fonts.
  102.  
  103.         FREQF_COLORFONTS - show color fonts also.
  104.  
  105.         FREQF_CHANGEPALETTE - change the screen's palette to match that
  106.             of a selected color font.
  107.  
  108.         FREQF_LEAVEPALETTE - leave the palette as it is when exiting
  109.             rtFontRequestA() Useful in combination with
  110.             FREQF_CHANGEPALETTE.
  111.  
  112.         FREQF_SCALE - allow fonts to be scaled when they don't exist in
  113.             the requested size. (works on Kickstart 2.0 only, has no
  114.             effect on 1.2/1.3).
  115.  
  116.         FREQF_STYLE - include gadgets so the user may select the font's
  117.             style.
  118.  
  119.     RTFO_Height - (ULONG) Suggested height of font requester window.
  120.  
  121.     RTFO_OkText - (char *) Replacement text for "Ok" gadget. Maximum 6
  122.         chars. (7 is still ok, but not esthetically pleasing)
  123.  
  124.     RTFO_SampleHeight - (ULONG) Height of font sample display in pixels
  125.         (default 24).
  126.  
  127.     RTFO_MinHeight - (ULONG) Minimum font size displayed.
  128.  
  129.     RTFO_MaxHeight - (ULONG) Maximum font size displayed.
  130.  
  131.     RTFO_FilterFunc - (struct Hook *) [V38] Call this hook for each
  132.         available font. Parameters are as follows:
  133.  
  134.         A0 - (struct Hook *) your hook
  135.         A2 - (struct rtFontRequester *) your filereq
  136.         A1 - (struct TextAttr *) textattr of font
  137.  
  138.         If your hook returns TRUE the font will be accepted. If it
  139.         returns FALSE the font will be skipped and will not appear in
  140.         the requester. IMPORTANT NOTE:  If you change your hook's
  141.         behavior you _MUST_ purge the requester's buffer (using
  142.         rtFreeReqBuffer())!
  143.  
  144.     RESULT
  145.     bool - TRUE if the user selected a font (freq->Attr holds the
  146.         font), FALSE if the requester was canceled.
  147.  
  148.     NOTES
  149.     You CANNOT call the font requester from a task because it may use
  150.     DOS calls!
  151.  
  152.     Automatically adjusts the requester to the screen font.
  153.  
  154.     If the requester got too big for the screen because of a very large
  155.     font, the topaz.font will be used.
  156.  
  157.     rtFontRequest() checks the pr_WindowPtr of your process to find the
  158.     screen to put the requester on.
  159.  
  160.     EXAMPLE
  161.  
  162.     BUGS
  163.     none known
  164.  
  165.     SEE ALSO
  166.  
  167.     INTERNALS
  168.  
  169.     HISTORY
  170.  
  171. ******************************************************************************/
  172. {
  173.     AROS_LIBFUNC_INIT
  174.  
  175.     return (ULONG)FileRequestA((struct RealFileRequester *)fontreq, NULL, title, taglist); /* in filereq.c */
  176.     
  177.     AROS_LIBFUNC_EXIT
  178.     
  179. } /* rtFontRequestA */
  180.