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