void FVReplaceOutlineWithReference( FontView *fv, double fudge ) { if ( fv->v!=NULL ) GDrawSetCursor(fv->v,ct_watch); FVBReplaceOutlineWithReference((FontViewBase *) fv, fudge); if ( fv->v!=NULL ) { GDrawRequestExpose(fv->v,NULL,false); GDrawSetCursor(fv->v,ct_pointer); } }
static void KP_SetCursor(KPData *kpd, int ismove ) { if ( kpd->movecursor!=ismove ) { GDrawSetCursor(kpd->v,ismove ? ct_leftright : ct_mypointer ); kpd->movecursor = ismove; } }
static void AnchorD_ChangeSize(AnchorDlg *a) { int i, off; GDrawSetCursor(a->gw,ct_watch); GDrawSync(NULL); /* GDrawProcessPendingEvents(NULL); */ /* Any expose events on the current dlg will cause a crash as there are no bdfc's now */ a->scale = a->pixelsize / (double) (a->sc->parent->ascent + a->sc->parent->descent); BDFCharFree(a->bdfc); a->bdfc = APRasterize(a->freetypecontext,a->sc,a->layer,&a->char_off,&a->char_size,a->pixelsize); a->ymin = a->bdfc->ymin; a->ymax = a->bdfc->ymax; for ( i=0; i<a->cnt; ++i ) { BDFCharFree(a->apmatch[i].bdfc); a->apmatch[i].bdfc = APRasterize(a->freetypecontext,a->apmatch[i].sc,a->layer,&a->apmatch[i].off,&a->apmatch[i].size,a->pixelsize); if ( a->ap->type==at_centry || a->ap->type==at_cexit ) a->apmatch[i].size += a->char_size; else if ( a->ap->type!=at_mark ) a->apmatch[i].size = a->char_size; switch ( a->ap->type ) { case at_cexit: case at_basechar: case at_baselig: case at_basemark: off = rint((-a->apos.y + a->apmatch[i].ap->me.y)*a->scale); if ( a->apmatch[i].bdfc->ymax+off > a->ymax ) a->ymax = a->apmatch[i].bdfc->ymax+off; if ( a->apmatch[i].bdfc->ymin+off < a->ymin ) a->ymin = a->apmatch[i].bdfc->ymin+off; break; case at_centry: case at_mark: if ( a->apmatch[i].bdfc->ymax > a->ymax ) a->ymax = a->apmatch[i].bdfc->ymax; if ( a->apmatch[i].bdfc->ymin < a->ymin ) a->ymin = a->apmatch[i].bdfc->ymin; off = rint((-a->apmatch[i].ap->me.y + a->apos.y)*a->scale); if ( a->bdfc->ymax+off > a->ymax ) a->ymax = a->bdfc->ymax+off; if ( a->bdfc->ymin+off < a->ymin ) a->ymin = a->bdfc->ymin+off; break; } } AnchorD_ChangeMag(a); GDrawSetCursor(a->gw,ct_pointer); }
static int Delta_OK(GGadget *g, GEvent *e) { if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) { QGData *qg = GDrawGetUserData(GGadgetGetWindow(g)); int err=false; int dpi, depth; double within; char *sizes; within = GetReal8(qg->gw,CID_Within,_("Proximity"),&err); dpi = GetInt8(qg->gw,CID_DPI,_("DPI"),&err); if ( err ) return(true); if ( within<=0 || within>=.5 ) { ff_post_error(_("Bad Number"),_("The \"Proximity\" field must be more than 0 and less than a half.")); return( true ); } if ( dpi<10 || dpi>5000 ) { ff_post_error(_("Unreasonable DPI"),_("The \"DPI\" field must be more than 10 and less than 5000.")); return( true ); } depth = GGadgetIsChecked(GWidgetGetControl(qg->gw,CID_BW)) ? 1 : 8; sizes = GGadgetGetTitle8(GWidgetGetControl(qg->gw,CID_Sizes)); GGadgetSetVisible(GWidgetGetControl(qg->gw,CID_Msg),true); GGadgetSetVisible(GWidgetGetControl(qg->gw,CID_Ok),false); GGadgetSetVisible(GWidgetGetControl(qg->gw,CID_Cancel),false); GDrawSetCursor(qg->gw,ct_watch); GDrawProcessPendingEvents(NULL); qg->within = within; qg->dpi = dpi; qg->pixelsizes = sizes; qg->depth = depth; TopFindQuestionablePoints(qg); GGadgetSetVisible(GWidgetGetControl(qg->gw,CID_Msg),false); GGadgetSetVisible(GWidgetGetControl(qg->gw,CID_Ok),true); GGadgetSetVisible(GWidgetGetControl(qg->gw,CID_Cancel),true); GDrawSetCursor(qg->gw,ct_pointer); GDrawProcessPendingEvents(NULL); if ( qg->error!=qg_ok ) { switch ( qg->error ) { case qg_notnumber: ff_post_error(_("Bad Number"),_("An entry in the \"Sizes\" field is not a number.")); break; case qg_badnumber: ff_post_error(_("Bad Number"),_("An entry in the \"Sizes\" field is unreasonable.")); break; case qg_badrange: ff_post_error(_("Bad Number"),_("An range in the \"Sizes\" field is incorrectly ordered.")); break; case qg_nofont: ff_post_error(_("FreeType unavailable"),_("FreeType unavailable.")); break; default: IError(_("Unexpected error")); break; } free(sizes); qg->cur = 0; return( true ); } free(delta_sizes); delta_within = within; delta_dpi = dpi; delta_depth = depth; delta_sizes = sizes; if ( qg->cur==0 ) { ff_post_error(_("Nothing found"),_("Nothng found.")); qg->done = true; return( true ); } if ( qg->cur >= qg->max ) qg->qg = realloc(qg->qg,(qg->max += 1) * sizeof(QuestionableGrid)); memset(qg->qg+qg->cur,0,sizeof(QuestionableGrid)); GDrawSetVisible(qg->gw,false); StartDeltaDisplay(qg); qg->done = true; } return( true ); }