Lines Matching defs:fc
210 FontCreatorWidget fc = (FontCreatorWidget) clientData;
212 if (!XtIsRealized(widget) || fc->creator.gstate == 0) return;
217 XDPSSetContextGState(fc->creator.fsb->fsb.context, fc->creator.gstate);
219 XDPSSetContextParameters(fc->creator.fsb->fsb.context, XtScreen(widget),
225 _DPSFReclip(fc->creator.fsb->fsb.context);
227 XDPSUpdateContextGState(fc->creator.fsb->fsb.context, fc->creator.gstate);
230 static void DrawMM(FontCreatorWidget fc)
241 BlendDataRec *bd = fc->creator.font->blend_data;
245 str = XmTextFieldGetString(fc->creator.display_text_child);
248 XtVaGetValues(fc->creator.axis_scale_child[i], XmNvalue, &val, NULL);
252 XtVaGetValues(fc->creator.preview_child, XtNheight, &hgt, NULL);
253 context = fc->creator.fsb->fsb.context;
254 if (fc->creator.gstate == 0) {
256 XtWindow(fc->creator.preview_child), hgt);
257 XDPSCaptureContextGState(context, &fc->creator.gstate);
258 } else XDPSSetContextGState(context, fc->creator.gstate);
273 XtVaGetValues(fc->creator.size_text_field_child,
279 _DPSFSetUpMM(context, fc->creator.font->font_name,
282 XClearWindow(XtDisplay(fc->creator.preview_child),
283 XtWindow(fc->creator.preview_child));
293 FontCreatorWidget fc = (FontCreatorWidget) clientData;
295 DrawMM(fc);
304 FontCreatorWidget fc = (FontCreatorWidget) clientData;
308 if (!fc->creator.preview_fixed) {
311 XChangeWindowAttributes(XtDisplay(fc),
312 XtWindow(fc->creator.preview_child),
314 fc->creator.preview_fixed = TRUE;
320 DrawMM(fc);
323 static void SetUpBlendList(FontCreatorWidget fc)
329 FontRec *f = fc->creator.font;
332 XtVaSetValues(fc->creator.blend_label_child,
351 XtVaSetValues(fc->creator.blend_scrolled_list_child, XmNitemCount, count,
357 static void CalcCarryValues(FontCreatorWidget fc, FontRec *oldf, int *carry_values)
359 FontRec *f = fc->creator.font;
367 XmScaleGetValue(fc->creator.axis_scale_child[j],
375 static void SetUpAxisLabels(FontCreatorWidget fc, FontRec *oldf, int *carry_values)
380 BlendDataRec *bd = fc->creator.font->blend_data, *oldbd = 0;
389 XtVaSetValues(fc->creator.axis_label_child[i],
397 XtVaSetValues(fc->creator.axis_min_label_child[i],
405 XtVaSetValues(fc->creator.axis_max_label_child[i],
412 fc->creator.follow_size_toggle_child)) {
413 XtVaGetValues(fc->creator.fsb->fsb.size_text_field_child,
422 XtVaSetValues(fc->creator.axis_scale_child[i],
428 static void ManageAxes(FontCreatorWidget fc)
434 diff = fc->creator.managed_axes - fc->creator.font->blend_data->num_axes;
439 for (i = fc->creator.managed_axes, j=0; j < -diff * 5; i++, j+=5) {
440 w[j] = fc->creator.axis_label_child[i];
441 w[j+1] = fc->creator.axis_scale_child[i];
442 w[j+2] = fc->creator.axis_value_text_child[i];
443 w[j+3] = fc->creator.axis_min_label_child[i];
444 w[j+4] = fc->creator.axis_max_label_child[i];
448 for (i = fc->creator.font->blend_data->num_axes, j=0; j < diff * 5;
450 w[j] = fc->creator.axis_label_child[i];
451 w[j+1] = fc->creator.axis_scale_child[i];
452 w[j+2] = fc->creator.axis_value_text_child[i];
453 w[j+3] = fc->creator.axis_min_label_child[i];
454 w[j+4] = fc->creator.axis_max_label_child[i];
458 fc->creator.managed_axes = fc->creator.font->blend_data->num_axes;
461 static void SetScaleValues(FontCreatorWidget fc)
467 axes = fc->creator.font->blend_data->num_axes;
470 XmScaleGetValue(fc->creator.axis_scale_child[i], &val);
472 XmTextFieldSetString(fc->creator.axis_value_text_child[i], buf);
476 static void SetUpAxes(FontCreatorWidget fc, FontRec *oldf)
480 if (oldf != NULL) CalcCarryValues(fc, oldf, carry_values);
481 SetUpAxisLabels(fc, oldf, carry_values);
482 SetScaleValues(fc);
483 ManageAxes(fc);
493 FontCreatorWidget fc = (FontCreatorWidget) clientData;
494 FontRec *f, *oldf = fc->creator.font;
498 f = fc->creator.family->fonts;
506 if (!_FSBDownloadFontIfNecessary(f, fc->creator.fsb)) {
507 _FSBFlushFont(fc->creator.fsb, f);
510 if (fc->creator.font != NULL) fc->creator.font->in_font_creator = False;
511 fc->creator.font = f;
513 SetUpBlendList(fc);
514 SetUpAxes(fc, oldf);
516 DrawMM(fc);
519 static void HandleSelectedBlend(FontCreatorWidget fc, int n)
521 BlendDataRec *bd = fc->creator.font->blend_data;
531 XmTextFieldSetString(fc->creator.name_text_child, b->blend_name);
535 XmScaleSetValue(fc->creator.axis_scale_child[i], value);
537 XmTextFieldSetString(fc->creator.axis_value_text_child[i], buf);
548 FontCreatorWidget fc = (FontCreatorWidget) clientData;
550 if (fc->creator.font->blend_count == 0) return;
552 HandleSelectedBlend(fc, listCB->item_position);
554 DrawMM(fc);
604 static void PutUpDialog(FontCreatorWidget fc, char *name)
608 message = XmCreateInformationDialog((Widget) fc, name, (ArgList) NULL, 0);
618 static void NoName(FontCreatorWidget fc)
620 PutUpDialog(fc, "noNameMessage");
623 static void UsedName(FontCreatorWidget fc)
625 PutUpDialog(fc, "usedNameMessage");
628 static void SomeUsedName(FontCreatorWidget fc)
630 PutUpDialog(fc, "someUsedNameMessage");
633 static void NoSuchName(FontCreatorWidget fc)
635 PutUpDialog(fc, "noSuchNameMessage");
638 static Boolean DoAdd(FontCreatorWidget fc, FontRec *f, String name)
651 newb->CS_blend_name = CS(newb->blend_name, (Widget) fc);
656 newb->CS_space_blend_name = CS(spaceName, (Widget) fc);
660 XtVaGetValues(fc->creator.axis_scale_child[i],
669 fc->creator.family->blend_count++;
679 SetUpBlendList(fc);
680 _FSBSetUpFaceList(fc->creator.fsb, False);
690 FontCreatorWidget fc = (FontCreatorWidget) clientData;
694 BlendDataRec *bd = fc->creator.font->blend_data;
697 value = XmTextFieldGetString(fc->creator.name_text_child);
700 NoName(fc);
704 if (XmToggleButtonGadgetGetState(fc->creator.do_all_toggle_child)) {
705 for (f = fc->creator.family->fonts; f != NULL; f = f->next) {
711 if (i == bd->num_axes) failures |= DoAdd(fc, f, value);
714 if (failures) SomeUsedName(fc);
715 } else if (DoAdd(fc, fc->creator.font, value)) UsedName(fc);
718 static Boolean DoReplace(FontCreatorWidget fc, FontRec *f, String name)
728 XtVaGetValues(fc->creator.axis_scale_child[i],
733 if (fc->creator.fsb->fsb.currently_selected_blend == b) {
734 _FSBSetUpFaceList(fc->creator.fsb, True);
748 FontCreatorWidget fc = (FontCreatorWidget) clientData;
752 BlendDataRec *bd = fc->creator.font->blend_data;
755 value = XmTextFieldGetString(fc->creator.name_text_child);
758 NoName(fc);
762 if (XmToggleButtonGadgetGetState(fc->creator.do_all_toggle_child)) {
763 for (f = fc->creator.family->fonts; f != NULL; f = f->next) {
769 if (i == bd->num_axes) failures &= DoReplace(fc, f, value);
772 if (failures) NoSuchName(fc);
773 } else if (DoReplace(fc, fc->creator.font, value)) NoSuchName(fc);
776 static Boolean DoDelete(FontCreatorWidget fc, FontRec *f, String name)
787 if (fc->creator.fsb->fsb.currently_selected_blend == b) {
788 fc->creator.fsb->fsb.currently_selected_blend = NULL;
793 fc->creator.family->blend_count--;
794 SetUpBlendList(fc);
795 _FSBSetUpFaceList(fc->creator.fsb, current);
808 FontCreatorWidget fc = (FontCreatorWidget) clientData;
813 value = XmTextFieldGetString(fc->creator.name_text_child);
816 NoName(fc);
820 if (XmToggleButtonGadgetGetState(fc->creator.do_all_toggle_child)) {
821 for (f = fc->creator.family->fonts; f != NULL; f = f->next) {
823 failures &= DoDelete(fc, f, value);
826 if (failures) NoSuchName(fc);
827 } else if (DoDelete(fc, fc->creator.font, value)) NoSuchName(fc);
836 FontCreatorWidget fc = (FontCreatorWidget) clientData;
838 XtUnmanageChild(fc->creator.option_box);
847 FontCreatorWidget fc = (FontCreatorWidget) clientData;
849 XtManageChild(fc->creator.option_box);
858 FontCreatorWidget fc = (FontCreatorWidget) clientData;
859 BlendDataRec *bd = fc->creator.font->blend_data;
865 XtVaGetValues(fc->creator.axis_scale_child[i],
878 XmTextFieldSetString(fc->creator.name_text_child, nameBuf);
887 FontCreatorWidget fc = (FontCreatorWidget) clientData;
889 if (XtIsShell(XtParent(fc))) XtPopdown(XtParent(fc));
890 XtCallCallbackList(widget, fc->creator.dismiss_callback, (XtPointer) NULL);
900 FontCreatorWidget fc = (FontCreatorWidget) clientData;
902 FontRec *f = fc->creator.font;
917 if (!XmToggleButtonGadgetGetState(fc->creator.follow_size_toggle_child)) {
926 XmTextFieldSetString(fc->creator.axis_value_text_child[i], buf);
928 SetScale(fc->creator.axis_value_text_child[i],
929 (XtPointer) fc->creator.axis_scale_child[i], (XtPointer) NULL);
930 DrawMM(fc);
950 FontCreatorWidget fc = (FontCreatorWidget) clientData;
955 if (value == NULL) option = fc->creator.other_size;
959 option = XtNameToWidget(fc->creator.size_menu, value);
960 if (option == NULL) option = fc->creator.other_size;
963 XtVaSetValues(fc->creator.size_option_menu_child,
1015 FontCreatorWidget fc = (FontCreatorWidget) clientData;
1021 XtVaSetValues(fc->creator.size_text_field_child, XmNvalue, buf, NULL);
1046 FontCreatorWidget fc,
1059 XtVaGetValues(fc->creator.size_menu, XtNchildren, &children,
1065 sizes = (Widget *) XtMalloc((fc->creator.size_count+1) *
1069 sizes = (Widget *) XtMalloc((fc->creator.size_count+1) *
1072 fc->creator.other_size = sizes[0] =
1074 fc->creator.size_menu, args, i);
1077 for (j = 0; j < fc->creator.size_count; j++) {
1078 (void) sprintf(buf, "%g", fc->creator.sizes[j]);
1084 XmCreatePushButtonGadget(fc->creator.size_menu, buf, args, i);
1087 SetSize, (XtPointer) fc);
1089 DrawMMCallback, (XtPointer) fc);
1095 static void CreateChildren(FontCreatorWidget fc)
1103 fc->creator.pane_child =
1105 (Widget) fc, args, i);
1108 fc->creator.preview_child =
1110 fc->creator.pane_child, args, i);
1111 XtAddCallback(fc->creator.preview_child, XmNexposeCallback,
1112 ExposeCallback, (XtPointer) fc);
1113 XtAddCallback(fc->creator.preview_child, XmNresizeCallback,
1114 ResizePreview, (XtPointer) fc);
1118 fc->creator.pane_child, args, i);
1125 XtAddCallback(button, XmNactivateCallback, DeleteCallback, (XtPointer) fc);
1134 ReplaceCallback, (XtPointer) fc);
1142 XtAddCallback(button, XmNactivateCallback, AddCallback, (XtPointer) fc);
1148 fc->creator.generate_button_child =
1151 XtAddCallback(fc->creator.generate_button_child, XmNactivateCallback,
1152 GenerateCallback, (XtPointer) fc);
1156 XtSetArg(args[i], XmNrightWidget, fc->creator.generate_button_child);i++;
1160 XtAddCallback(button, XmNactivateCallback, ShowOptions, (XtPointer) fc);
1168 DismissCallback, (XtPointer) fc);
1189 fc->creator.size_text_field_child =
1192 XtAddCallback(fc->creator.size_text_field_child, XmNvalueChangedCallback,
1193 SizeSelect, (XtPointer) fc);
1194 XtAddCallback(fc->creator.size_text_field_child, XmNmodifyVerifyCallback,
1195 TextVerify, (XtPointer) fc);
1196 XtAddCallback(fc->creator.size_text_field_child, XmNactivateCallback,
1197 DrawMMCallback, (XtPointer) fc);
1200 fc->creator.size_menu = XmCreatePulldownMenu(form, "sizeMenu", args, i);
1202 CreateSizeMenu(fc, FALSE);
1206 XtSetArg(args[i], XmNleftWidget, fc->creator.size_text_field_child);i++;
1209 XtSetArg(args[i], XmNsubMenuId, fc->creator.size_menu); i++;
1210 fc->creator.size_option_menu_child =
1212 XtManageChild(fc->creator.size_option_menu_child);
1214 SizeSelect(fc->creator.size_text_field_child, (XtPointer) fc,
1222 fc->creator.name_text_child =
1225 XtAddCallback(fc->creator.name_text_child, XmNactivateCallback,
1226 AddCallback, (XtPointer) fc);
1230 XtSetArg(args[i], XmNbottomWidget, fc->creator.name_text_child); i++;
1245 fc->creator.face_scrolled_list_child =
1247 XtAddCallback(fc->creator.face_scrolled_list_child,
1248 XmNbrowseSelectionCallback, FaceSelect, (XtPointer) fc);
1256 XtSetValues(XtParent(fc->creator.face_scrolled_list_child), args, i);
1257 XtManageChild(fc->creator.face_scrolled_list_child);
1263 fc->creator.blend_label_child =
1270 fc->creator.blend_scrolled_list_child =
1272 XtAddCallback(fc->creator.blend_scrolled_list_child,
1273 XmNbrowseSelectionCallback, BlendSelect, (XtPointer) fc);
1277 XtSetArg(args[i], XmNtopWidget, fc->creator.blend_label_child); i++;
1281 XtSetArg(args[i], XmNbottomWidget, fc->creator.name_text_child); i++;
1282 XtSetValues(XtParent(fc->creator.blend_scrolled_list_child), args, i);
1283 XtManageChild(fc->creator.blend_scrolled_list_child);
1289 XtParent(fc->creator.face_scrolled_list_child)); i++;
1291 fc->creator.display_text_child =
1294 XtAddCallback(fc->creator.display_text_child, XmNactivateCallback,
1295 DrawMMCallback, (XtPointer) fc);
1299 XtSetArg(args[i], XmNtopWidget, fc->creator.display_text_child); i++;
1304 prev = fc->creator.display_text_child;
1312 fc->creator.axis_value_text_child[j] =
1319 fc->creator.axis_value_text_child[j]); i++;
1322 fc->creator.axis_value_text_child[j]); i++;
1324 fc->creator.axis_scale_child[j] =
1326 XtAddCallback(fc->creator.axis_scale_child[j],
1327 XmNvalueChangedCallback, DrawMMCallback, (XtPointer) fc);
1328 XtAddCallback(fc->creator.axis_scale_child[j],
1329 XmNdragCallback, DrawMMCallback, (XtPointer) fc);
1330 XtAddCallback(fc->creator.axis_scale_child[j],
1332 (XtPointer) fc->creator.axis_value_text_child[j]);
1333 XtAddCallback(fc->creator.axis_scale_child[j],
1335 (XtPointer) fc->creator.axis_value_text_child[j]);
1336 XtAddCallback(fc->creator.axis_value_text_child[j],
1338 (XtPointer) fc->creator.axis_scale_child[j]);
1343 fc->creator.axis_scale_child[j]); i++;
1346 fc->creator.axis_scale_child[j]); i++;
1348 fc->creator.axis_max_label_child[j] =
1354 fc->creator.axis_scale_child[j]); i++;
1357 fc->creator.axis_scale_child[j]); i++;
1359 fc->creator.axis_min_label_child[j] =
1365 fc->creator.axis_value_text_child[j]); i++;
1368 fc->creator.axis_label_child[j] =
1371 prev = fc->creator.axis_value_text_child[j];
1376 fc->creator.option_box = XmCreateFormDialog((Widget) fc, "optionBox",
1379 fc->creator.option_box, (Arg *) NULL, 0);
1380 fc->creator.do_all_toggle_child =
1383 fc->creator.follow_size_toggle_child =
1391 UnmanageOptions, (XtPointer) fc);
1401 FontCreatorWidget fc = (FontCreatorWidget) new;
1405 if (fc->creator.fsb == NULL) {
1415 if (fc->creator.size_count > 0 && fc->creator.sizes == NULL) {
1421 fc->creator.size_count = 0;
1424 if (fc->creator.size_count < 0) {
1430 fc->creator.size_count = 0;
1433 fc->creator.gstate = 0;
1434 fc->creator.family = NULL;
1435 fc->creator.font = NULL;
1436 fc->creator.managed_axes = 0;
1437 fc->creator.preview_fixed = False;
1438 fc->creator.option_box = NULL;
1440 CreateChildren(fc);
1441 XtAddCallback(fc->creator.fsb->fsb.size_text_field_child,
1442 XmNvalueChangedCallback, SizeChanged, (XtPointer) fc);
1445 static void SelectBlend(FontCreatorWidget fc, BlendRec *cur_b)
1452 if (!XmListGetSelectedPos(fc->creator.blend_scrolled_list_child,
1458 for (i = 0, b = fc->creator.font->blend_data->blends;
1459 i < fc->creator.font->blend_count; i++, b = b->next) {
1466 ListSelectPos(fc->creator.blend_scrolled_list_child, cur, FALSE);
1467 HandleSelectedBlend(fc, cur);
1472 FontCreatorWidget fc = (FontCreatorWidget) w;
1474 FontRec *newf = NULL, *f, *oldf = fc->creator.font;
1477 if (ff != fc->creator.family) {
1478 fc->creator.family = ff;
1488 if (f == fc->creator.fsb->fsb.currently_selected_face) {
1494 XtVaSetValues(fc->creator.face_scrolled_list_child,
1504 if (f == fc->creator.fsb->fsb.currently_selected_face) {
1512 if (fc->creator.font != NULL) fc->creator.font->in_font_creator = False;
1513 fc->creator.font = newf;
1515 ListSelectPos(fc->creator.face_scrolled_list_child, cur, FALSE);
1516 SetUpBlendList(fc);
1517 SetUpAxes(fc, oldf);
1518 if (fc->creator.fsb->fsb.currently_selected_blend != 0) {
1519 SelectBlend(fc, fc->creator.fsb->fsb.currently_selected_blend);
1521 SelectBlend(fc, NULL);
1523 SetScaleValues(fc);
1524 XmTextFieldSetString(fc->creator.display_text_child, ff->family_name);
1525 DrawMM(fc);
1530 FontCreatorWidget fc = (FontCreatorWidget) widget;
1532 if (fc->creator.gstate != 0) {
1533 XDPSFreeContextGState(fc->creator.fsb->fsb.context,
1534 fc->creator.gstate);
1540 FontCreatorWidget fc = (FontCreatorWidget) widget;
1542 XtResizeWidget(fc->creator.pane_child, fc->core.width, fc->core.height, 0);
1606 FontCreatorWidget fc = (FontCreatorWidget) w;
1608 w->core.width = fc->composite.children[0]->core.width;
1609 w->core.height = fc->composite.children[0]->core.height;