File indexing completed on 2025-01-18 10:15:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef _XmFontSelectorP_h
0026 #define _XmFontSelectorP_h
0027
0028 #if defined(VMS) || defined(__VMS)
0029 #include <X11/apienvset.h>
0030 #endif
0031
0032
0033
0034
0035 #include <Xm/ManagerP.h>
0036 #include <Xm/PanedP.h>
0037 #include <Xm/FontS.h>
0038
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042
0043 #define XmFontSelectorIndex (XmPanedIndex + 1)
0044
0045 #define XmFontS_current_font(w) (((XmFontSelectorWidget)(w))->fs.current_font)
0046 #define XmFontS_show_font_name(w) (((XmFontSelectorWidget)(w))->fs.show_font_name)
0047 #define XmFontS_iso_fonts_only(w) (((XmFontSelectorWidget)(w))->fs.iso_fonts_only)
0048 #define XmFontS_use_scaling(w) (((XmFontSelectorWidget)(w))->fs.use_scaling)
0049 #define XmFontS_text_rows(w) (((XmFontSelectorWidget)(w))->fs.text_rows)
0050 #define XmFontS_font_changed_callback(w) (((XmFontSelectorWidget)(w))->fs.font_changed_callback)
0051 #define XmFontS_strings(w) (((XmFontSelectorWidget)(w))->fs.strings)
0052 #define XmFontS_xlfd_mode(w) (((XmFontSelectorWidget)(w))->fs.xlfd_mode)
0053 #define XmFontS_font_info(w) (((XmFontSelectorWidget)(w))->fs.font_info)
0054 #define XmFontS_text(w) (((XmFontSelectorWidget)(w))->fs.text)
0055 #define XmFontS_name_label(w) (((XmFontSelectorWidget)(w))->fs.name_label)
0056 #define XmFontS_middle_pane(w) (((XmFontSelectorWidget)(w))->fs.middle_pane)
0057 #define XmFontS_family_box(w) (((XmFontSelectorWidget)(w))->fs.family_box)
0058 #define XmFontS_size_box(w) (((XmFontSelectorWidget)(w))->fs.size_box)
0059 #define XmFontS_bold_toggle(w) (((XmFontSelectorWidget)(w))->fs.bold_toggle)
0060 #define XmFontS_italic_toggle(w) (((XmFontSelectorWidget)(w))->fs.italic_toggle)
0061 #define XmFontS_xlfd_toggle(w) (((XmFontSelectorWidget)(w))->fs.xlfd_toggle)
0062 #define XmFontS_other_toggle(w) (((XmFontSelectorWidget)(w))->fs.other_toggle)
0063 #define XmFontS_show_font_toggle(w) (((XmFontSelectorWidget)(w))->fs.show_font_toggle)
0064 #define XmFontS_use_scaling_toggle(w) (((XmFontSelectorWidget)(w))->fs.use_scaling_toggle)
0065 #define XmFontS_option_menu(w) (((XmFontSelectorWidget)(w))->fs.option_menu)
0066 #define XmFontS_encoding_menu_shell(w) (((XmFontSelectorWidget)(w))->fs.encoding_menu_shell)
0067 #define XmFontS_xlfd_only(w) (((XmFontSelectorWidget)(w))->fs.xlfd_only)
0068 #define XmFontS_xlfd_sensitive(w) (((XmFontSelectorWidget)(w))->fs.xlfd_sensitive)
0069 #define XmFontS_num_xlfd_only(w) (((XmFontSelectorWidget)(w))->fs.num_xlfd_only)
0070 #define XmFontS_num_xlfd_sensitive(w) (((XmFontSelectorWidget)(w))->fs.num_xlfd_sensitive)
0071 #define XmFontS_alloc_xlfd_only(w) (((XmFontSelectorWidget)(w))->fs.alloc_xlfd_only)
0072 #define XmFontS_alloc_xlfd_sensitive(w) (((XmFontSelectorWidget)(w))->fs.alloc_xlfd_sensitive)
0073 #define XmFontS_user_state(w) (((XmFontSelectorWidget)(w))->fs.user_state)
0074 #define XmFontS_current_text(w) (((XmFontSelectorWidget)(w))->fs.current_text)
0075 #define XmFontS_get_font(w) (((XmFontSelectorWidget)(w))->fs.get_font)
0076 #define XmFontS_encoding(w) (((XmFontSelectorWidget)(w))->fs.encoding)
0077 #define XmFontS_old_fontlist(w) (((XmFontSelectorWidget)(w))->fs.old_fontlist)
0078 #define XmFontS_old_fontdata(w) (((XmFontSelectorWidget)(w))->fs.old_fontdata)
0079 #define XmFontS_dpi75(w) (((XmFontSelectorWidget)(w))->fs.dpi75)
0080 #define XmFontS_dpi100(w) (((XmFontSelectorWidget)(w))->fs.dpi100)
0081 #define XmFontS_dpiAny(w) (((XmFontSelectorWidget)(w))->fs.dpiAny)
0082 #define XmFontS_proportional(w) (((XmFontSelectorWidget)(w))->fs.proportional)
0083 #define XmFontS_monospace(w) (((XmFontSelectorWidget)(w))->fs.monospace)
0084 #define XmFontS_any_spacing(w) (((XmFontSelectorWidget)(w))->fs.any_spacing)
0085
0086
0087 #define SAMPLE_TEXT(fsw) (XmFontS_strings((fsw)).sample_text)
0088 #define ANY_STRING(fsw) (XmFontS_strings((fsw)).any)
0089 #define LOWER_ANY_STRING(fsw) (XmFontS_strings((fsw)).lower_any)
0090 #define FAMILY_STRING(fsw) (XmFontS_strings((fsw)).family)
0091 #define SIZE_STRING(fsw) (XmFontS_strings((fsw)).size)
0092 #define BOLD_STRING(fsw) (XmFontS_strings((fsw)).bold)
0093 #define ITALIC_STRING(fsw) (XmFontS_strings((fsw)).italic)
0094
0095 #define OPTION_STRING(fsw) (XmFontS_strings((fsw)).option)
0096
0097 #define BOTH_STRING(fsw) (XmFontS_strings((fsw)).both)
0098 #define MONO_SPACE_STRING(fsw) (XmFontS_strings((fsw)).mono_space)
0099 #define PROPORTIONAL_STRING(fsw)(XmFontS_strings((fsw)).prop_space)
0100
0101 #define XLFD_STRING(fsw) (XmFontS_strings((fsw)).xlfd)
0102 #define OTHER_FONT_STRING(fsw) (XmFontS_strings((fsw)).other_font)
0103
0104 #define DPI75_STRING(fsw) (XmFontS_strings((fsw)).dpi_75)
0105 #define DPI100_STRING(fsw) (XmFontS_strings((fsw)).dpi_100)
0106
0107 #define SCALING_STRING(fsw) (XmFontS_strings((fsw)).scaling)
0108 #define SHOW_NAME_STRING(fsw) (XmFontS_strings((fsw)).show_name)
0109
0110 #define ENCODING_ONLY_STRING(fsw) (XmFontS_strings((fsw)).encoding_only)
0111 #define ENCODING_LIST(fsw) (XmFontS_strings((fsw)).encoding_list)
0112
0113 #define ENCODING_STRING(fsw) XmFontS_encoding((fsw))
0114
0115
0116
0117 #define WEIGHT_LEN 15
0118 #define SLANT_LEN 3
0119 #define SPACING_LEN 3
0120
0121 typedef unsigned char Flag;
0122 typedef unsigned int LongFlag;
0123
0124 #define FIXED ((Flag) 1 << 0)
0125 #define BOLD ((Flag) 1 << 1)
0126 #define ITALIC ((Flag) 1 << 2)
0127 #define PROPORTIONAL ((Flag) 1 << 3)
0128 #define SCALED_75 ((Flag) 1 << 4)
0129 #define SCALED_100 ((Flag) 1 << 5)
0130 #define DPI_75 ((Flag) 1 << 6)
0131 #define DPI_100 ((Flag) 1 << 7)
0132
0133
0134
0135
0136
0137
0138 #define USER_PROPORTIONAL PROPORTIONAL
0139 #define USER_FIXED FIXED
0140
0141 typedef struct _FontData {
0142 XrmQuark familyq;
0143 XrmQuark weightq;
0144 char slant[SLANT_LEN + 1];
0145 char spacing[SPACING_LEN + 1];
0146 short resolution_x, resolution_y;
0147 short point_size;
0148 XrmQuark encoding;
0149 Flag state;
0150 } FontData;
0151
0152 typedef struct FamilyInfo {
0153 XrmQuark nameq;
0154 XrmQuark bold_nameq, medium_nameq;
0155 XrmQuark italic_nameq, upright_nameq;
0156 char fixed_spacing[SPACING_LEN + 1];
0157 LongFlag sizes_75, sizes_100;
0158 Flag state;
0159 XrmQuark *encodings;
0160 int encoding_alloc;
0161 } FamilyInfo;
0162
0163 typedef struct FontInfo {
0164 FontData *current_font;
0165 String *others;
0166 FamilyInfo *family_info;
0167 short num_others;
0168 short num_families;
0169 short resolution;
0170 } FontInfo;
0171
0172 typedef struct _XmFontSelStringInfo {
0173 XmString sample_text;
0174 XmString any, lower_any;
0175 XmString family, size;
0176 XmString bold, italic, option, both;
0177 XmString mono_space, prop_space;
0178 XmString xlfd, other_font;
0179 XmString dpi_75, dpi_100;
0180 XmString scaling, encoding_only, show_name;
0181
0182 String *encoding_list;
0183 } XmFontSelStringInfo;
0184
0185
0186
0187
0188
0189 typedef struct _FontSelectorClassPart
0190 {
0191 XtPointer extension;
0192 } FontSelectorClassPart;
0193
0194 typedef struct _XmFontSelectorClassRec
0195 {
0196 CoreClassPart core_class;
0197 CompositeClassPart composite_class;
0198 ConstraintClassPart constraint_class;
0199 XmManagerClassPart manager_class;
0200 XmPanedClassPart paned_class;
0201 FontSelectorClassPart font_selector_class;
0202 } XmFontSelectorClassRec;
0203
0204 typedef struct _XmFontSelectorPart
0205 {
0206
0207 String current_font;
0208
0209 Boolean show_font_name;
0210 Boolean iso_fonts_only;
0211 Boolean use_scaling;
0212
0213 Dimension text_rows;
0214
0215 XtCallbackList font_changed_callback;
0216
0217 XmFontSelStringInfo strings;
0218
0219
0220
0221 Boolean xlfd_mode;
0222
0223 FontInfo *font_info;
0224 Widget text, name_label;
0225 Widget middle_pane;
0226 Widget family_box;
0227 Widget size_box;
0228 Widget bold_toggle, italic_toggle;
0229 Widget xlfd_toggle, other_toggle;
0230 Widget show_font_toggle, use_scaling_toggle;
0231 Widget option_menu;
0232 Widget encoding_menu_shell;
0233
0234
0235 WidgetList xlfd_only;
0236 WidgetList xlfd_sensitive;
0237
0238 char num_xlfd_only, num_xlfd_sensitive;
0239 char alloc_xlfd_only, alloc_xlfd_sensitive;
0240
0241 Flag user_state;
0242
0243 String current_text;
0244 String get_font;
0245
0246 String encoding;
0247
0248
0249
0250
0251
0252
0253 XmFontList old_fontlist;
0254 XFontStruct * old_fontdata;
0255
0256
0257
0258
0259 Widget dpi75, dpi100, dpiAny;
0260 Widget proportional, monospace, any_spacing;
0261
0262 } XmFontSelectorPart;
0263
0264 typedef struct _XmFontSelectorRec
0265 {
0266 CorePart core;
0267 CompositePart composite;
0268 ConstraintPart constraint;
0269 XmManagerPart manager;
0270 XmPanedPart paned;
0271 XmFontSelectorPart fs;
0272 } XmFontSelectorRec;
0273
0274 typedef struct _XmFontSelectorConstraintsPart
0275 {
0276 XtPointer dummy;
0277 } XmFontSelectorConstraintsPart;
0278
0279 typedef struct _XmFontSelectorConstraintsRec
0280 {
0281 XmManagerConstraintPart manager;
0282 XmPanedConstraintsPart paned;
0283 XmFontSelectorConstraintsPart fs;
0284 } XmFontSelectorConstraintsRec, *XmFontSelectorConstraints;
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302 extern XmFontSelectorClassRec xmFontSelectorClassRec;
0303
0304 #ifdef __cplusplus
0305 }
0306 #endif
0307
0308 #if defined(VMS) || defined(__VMS)
0309 #include <X11/apienvrst.h>
0310 #endif
0311
0312 #endif