FontSB.h revision 824
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe/*
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * FontSB.h
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe *
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * (c) Copyright 1991-1994 Adobe Systems Incorporated.
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * All rights reserved.
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe *
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * Permission to use, copy, modify, distribute, and sublicense this software
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * and its documentation for any purpose and without fee is hereby granted,
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * provided that the above copyright notices appear in all copies and that
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * both those copyright notices and this permission notice appear in
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * supporting documentation and that the name of Adobe Systems Incorporated
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * not be used in advertising or publicity pertaining to distribution of the
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * software without specific, written prior permission. No trademark license
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * to use the Adobe trademarks is hereby granted. If the Adobe trademark
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * "Display PostScript"(tm) is used to describe this software, its
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * functionality or for any other purpose, such use shall be limited to a
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * statement that this software works in conjunction with the Display
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * PostScript system. Proper trademark attribution to reflect Adobe's
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * ownership of the trademark shall be given whenever any such reference to
f71f7a61dec7c9089378d14493ad564a1dedf0b5neil_a_wilson * the Display PostScript system is made.
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe *
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
186f94aaee0ba7f253e09c491a3a513cbabea65fjcambon * NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson *
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
3cedecd5ea21cca5d9709abf320a2082cd3694e5jvergara * Incorporated which may be registered in certain jurisdictions
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson *
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson * Author: Adobe Systems Incorporated
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson */
014019918f7e3844f558f6159b8d41517254edc2lutoff/* $XFree86$ */
014019918f7e3844f558f6159b8d41517254edc2lutoff
014019918f7e3844f558f6159b8d41517254edc2lutoff#ifndef _FontSelectionBox_h
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson#define _FontSelectionBox_h
69de0fe5b7ed905860bef5f86937d30cc206ef7dneil_a_wilson
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe/* New resouce names and classes */
266c5071a91fda6a5159b08ea8d45261228d03d5neil_a_wilson
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtNcontext "context"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtCContext "Context"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtNpreviewString "previewString"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCPreviewString "PreviewString"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNsizes "sizes"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCSizes "Sizes"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNsizeCount "sizeCount"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCSizeCount "SizeCount"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNdefaultResourcePath "defaultResourcePath"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCDefaultResourcePath "DefaultResourcePath"
2ed4722b4c052dcfe7884519a119e68a295f77afludovicp#define XtNresourcePathOverride "resourcePathOverride"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCResourcePathOverride "ResourcePathOverride"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNuseFontName "useFontName"
2ed4722b4c052dcfe7884519a119e68a295f77afludovicp#define XtCUseFontName "UseFontName"
2ed4722b4c052dcfe7884519a119e68a295f77afludovicp#define XtNfontName "fontName"
2ed4722b4c052dcfe7884519a119e68a295f77afludovicp#define XtCFontName "FontName"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNfontFamily "fontFamily"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCFontFamily "FontFamily"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNfontFace "fontFace"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCFontFace "FontFace"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNfontSize "fontSize"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtCFontSize "FontSize"
44a7ec1a853804826c90cda2fbb4ac712c86bbaaludovicp#define XtNfontBlend "fontBlend"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtCFontBlend "FontBlend"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtNfontNameMultiple "fontNameMultiple"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtCFontNameMultiple "FontNameMultiple"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtNfontFamilyMultiple "fontFamilyMultiple"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtCFontFamilyMultiple "FontFamilyMultiple"
014019918f7e3844f558f6159b8d41517254edc2lutoff#define XtNfontFaceMultiple "fontFaceMultiple"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtCFontFaceMultiple "FontFaceMultiple"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtNfontSizeMultiple "fontSizeMultiple"
39e085accf228684b9573bc8ad707a364ed6242ejvergara#define XtCFontSizeMultiple "FontSizeMultiple"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtNgetServerFonts "getServerFonts"
39e085accf228684b9573bc8ad707a364ed6242ejvergara#define XtCGetServerFonts "GetServerFonts"
266c5071a91fda6a5159b08ea8d45261228d03d5neil_a_wilson#define XtNgetAFM "getAFM"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtCGetAFM "GetAFM"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtNautoPreview "autoPreview"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtCAutoPreview "AutoPreview"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtNpreviewOnChange "previewOnChange"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtCPreviewOnChange "PreviewOnChange"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtNundefUnusedFonts "undefUnusedFonts"
d319724fed3be916a9f68676aac6eb203d44b551chebrard#define XtCUndefUnusedFonts "UndefUnusedFonts"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtNmaxPendingDeletes "maxPendingDeletes"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtCMaxPendingDeletes "MaxPendingDeletes"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtNmakeFontsShared "makeFontsShared"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtCMakeFontsShared "MakeFontsShared"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtNshowSampler "showSampler"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtCShowSampler "ShowSampler"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtNshowSamplerButton "showSamplerButton"
37f9a536593b696e5a3dcec443e1475f22fb5afdjvergara#define XtCShowSamplerButton "ShowSamplerButton"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtNtypographicSort "typographicSort"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtCTypographicSort "TypographicSort"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtNokCallback "okCallback"
61ae414d98d24ba4a72a905b07db9424353669f4neil_a_wilson#define XtNapplyCallback "applyCallback"
5c6cfc2988a5121fd22081643ef0790e38c99379neil_a_wilson#define XtNresetCallback "resetCallback"
7070667c2dffad87009999bdeb16d5305e0afdbejvergara#ifndef XtNcancelCallback
7070667c2dffad87009999bdeb16d5305e0afdbejvergara#define XtNcancelCallback "cancelCallback"
7070667c2dffad87009999bdeb16d5305e0afdbejvergara#endif
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe#define XtNvalidateCallback "validateCallback"
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara#define XtNfaceSelectCallback "faceSelectCallback"
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe#define XtNvalueChangedCallback "valueChangedCallback"
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe#define XtNcreateSamplerCallback "createSamplerCallback"
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe#define XtNcreateCreatorCallback "createCreatorCallback"
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe
61ae414d98d24ba4a72a905b07db9424353669f4neil_a_wilson/* Read-only resources for all the subwidgets */
61ae414d98d24ba4a72a905b07db9424353669f4neil_a_wilson
37f9a536593b696e5a3dcec443e1475f22fb5afdjvergara#define XtNpaneChild "paneChild"
186f94aaee0ba7f253e09c491a3a513cbabea65fjcambon#define XtNpreviewChild "previewChild"
61ae414d98d24ba4a72a905b07db9424353669f4neil_a_wilson#define XtNpanelChild "panelChild"
37f9a536593b696e5a3dcec443e1475f22fb5afdjvergara#define XtNfamilyLabelChild "familyLabelChild"
186f94aaee0ba7f253e09c491a3a513cbabea65fjcambon#define XtNfamilyMultipleLabelChild "familyMultipleLabelChild"
61ae414d98d24ba4a72a905b07db9424353669f4neil_a_wilson#define XtNfamilyScrolledListChild "familyScrolledListChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNfaceLabelChild "faceLabelChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNfaceMultipleLabelChild "faceMultipleLabelChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNfaceScrolledListChild "faceScrolledListChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNsizeLabelChild "sizeLabelChild"
37f9a536593b696e5a3dcec443e1475f22fb5afdjvergara#define XtNsizeTextFieldChild "sizeTextFieldChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNsizeOptionMenuChild "sizeOptionMenuChild"
ca7fd1a989fecd15241ed293d67750c6049d06d2neil_a_wilson#define XtNsizeMultipleLabelChild "sizeMultipleLabelChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNsamplerButtonChild "samplerButtonChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNpreviewButtonChild "previewButtonChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNseparatorChild "separatorChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNokButtonChild "okButtonChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNapplyButtonChild "applyButtonChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNresetButtonChild "resetButtonChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNcancelButtonChild "cancelButtonChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara#define XtNmultipleMasterButtonChild "multipleMasterButtonChild"
fbae67e0ce2395d66b4cec5b17c54ddf8dd3dcb2jvergara
186f94aaee0ba7f253e09c491a3a513cbabea65fjcambon/* New resource types */
7070667c2dffad87009999bdeb16d5305e0afdbejvergara
7070667c2dffad87009999bdeb16d5305e0afdbejvergara#define XtRFloatList "FloatList"
7070667c2dffad87009999bdeb16d5305e0afdbejvergara#define XtRDPSContext "DPSContext"
7070667c2dffad87009999bdeb16d5305e0afdbejvergara
7070667c2dffad87009999bdeb16d5305e0afdbejvergara/* Class record constants */
7070667c2dffad87009999bdeb16d5305e0afdbejvergara
7070667c2dffad87009999bdeb16d5305e0afdbejvergaraextern WidgetClass fontSelectionBoxWidgetClass;
4afc3f189bd46ee59828c326a83684969dc39d80neil_a_wilson
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergaratypedef struct _FontSelectionBoxRec *FontSelectionBoxWidget;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara
7070667c2dffad87009999bdeb16d5305e0afdbejvergaratypedef enum {FSBNone, FSBOne, FSBMultiple} FSBSelectionType;
7070667c2dffad87009999bdeb16d5305e0afdbejvergaratypedef enum {FSBOK, FSBApply, FSBReset, FSBCancel,
61491a8f67f7eae3967ce28737730583c6ad922djvergara FSBValueChanged} FSBCallbackReason;
61491a8f67f7eae3967ce28737730583c6ad922djvergara
61491a8f67f7eae3967ce28737730583c6ad922djvergaratypedef struct {
61491a8f67f7eae3967ce28737730583c6ad922djvergara FSBCallbackReason reason;
61491a8f67f7eae3967ce28737730583c6ad922djvergara String family;
61491a8f67f7eae3967ce28737730583c6ad922djvergara String face;
61491a8f67f7eae3967ce28737730583c6ad922djvergara float size;
61491a8f67f7eae3967ce28737730583c6ad922djvergara String name;
61491a8f67f7eae3967ce28737730583c6ad922djvergara String afm_filename;
61491a8f67f7eae3967ce28737730583c6ad922djvergara FSBSelectionType family_selection;
61491a8f67f7eae3967ce28737730583c6ad922djvergara FSBSelectionType face_selection;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara FSBSelectionType size_selection;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara FSBSelectionType name_selection;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara Boolean afm_present;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara Boolean unused;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara String blend;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara String base_name;
7070667c2dffad87009999bdeb16d5305e0afdbejvergara float axis_percent[4];
4edb61f8b0f8ce9f62d803c706612376498672b4al_xipe} FSBCallbackRec;
typedef struct {
FSBCallbackReason reason;
String family;
String face;
float size;
String name;
String afm_filename;
FSBSelectionType family_selection;
FSBSelectionType face_selection;
FSBSelectionType size_selection;
FSBSelectionType name_selection;
Boolean afm_present;
Boolean doit;
String blend;
String base_name;
float axis_percent[4];
} FSBValidateCallbackRec;
typedef struct {
String *available_faces;
int num_available_faces;
String current_face;
String new_face;
} FSBFaceSelectCallbackRec;
typedef struct {
Widget sampler;
Widget sampler_shell;
} FSBCreateSamplerCallbackRec;
typedef struct {
Widget creator;
Widget creator_shell;
} FSBCreateCreatorCallbackRec;
typedef enum {FSBAddBlend, FSBReplaceBlend, FSBDeleteBlend} FSBBlendAction;
/* Convenience and info routines */
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* Note use of Bool and double in prototypes: this makes the library
work correctly when linked with no-prototype compiled objects */
extern void FSBSetFontName(Widget w,
String font_name,
Bool font_name_multiple);
extern void FSBSetFontFamilyFace(Widget w,
String font_family, String font_face,
Bool font_family_multiple,
Bool font_face_multiple);
extern void FSBSetFontSize(Widget w, double font_size,
Bool font_size_multiple);
extern void FSBRefreshFontList(Widget w);
extern void FSBGetFamilyList(Widget w, int *count_return,
String **family_return);
extern void FSBGetFaceList(Widget w, String family, int *count_return,
String **face_return, String **font_return);
extern void FSBUndefineUnusedFonts(Widget w);
extern Boolean FSBDownloadFontName(Widget w, String font_name);
extern Boolean FSBMatchFontFace(Widget w, String old_face, String new_family,
String *new_face);
extern void FSBFontNameToFamilyFace(Widget w, String font_name,
String *family, String *face);
extern void FSBFontFamilyFaceToName(Widget w, String family, String face,
String *font_name);
extern String FSBFindAFM(Widget w, String font_name);
extern String FSBFindFontFile(Widget w, String font_name);
extern void FSBGetTextDimensions(Widget w, String text, String font,
double size, double x, double y,
float *dx, float *dy,
float *left, float *right,
float *top, float *bottom);
extern void FSBSetFontFamilyFaceBlend(Widget w, String family, String face,
String blend, Bool family_multiple,
Bool face_multiple);
extern void FSBFontNameToFamilyFaceBlend(Widget w, String font_name,
String *family, String *face,
String *blend);
extern void FSBFontFamilyFaceBlendToName(Widget w, String family, String face,
String blend, String *font_name);
extern void FSBGetBlendList(Widget w, String font_name, int *count_return,
String **blend_return, String **font_name_return,
float **axis_values_return);
extern void FSBGetBlendInfo(Widget w, String name, int *num_axes_return,
int *num_designs_return,
String **axis_names_return,
float **blend_positions_return,
int **blend_map_count_return,
int **blend_design_coords_return,
float **blend_normalized_coords_return);
extern Boolean FSBChangeBlends(Widget w, String base_name, String blend_name,
FSBBlendAction action, int *axis_values,
float *axis_percents);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* _FontSelectionBox_h */
/* DON'T ADD ANYTHING AFTER THIS #endif */