本文整理汇总了C++中GDrawGetUserData函数的典型用法代码示例。如果您正苦于以下问题:C++ GDrawGetUserData函数的具体用法?C++ GDrawGetUserData怎么用?C++ GDrawGetUserData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GDrawGetUserData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: e_h
static int
e_h (GWindow gw, GEvent *event)
{
if (event->type == et_close)
{
struct gfc_data *d = GDrawGetUserData (gw);
d->done = true;
}
else if (event->type == et_map)
/* Above palettes */
GDrawRaise (gw);
else if (event->type == et_char)
return (false);
else if (event->type == et_mousemove ||
(event->type == et_mousedown && event->u.mouse.button == 3))
{
struct gfc_data *d = GDrawGetUserData (gw);
GFileChooserPopupCheck (d->gfc, event);
}
else if ((event->type == et_mouseup || event->type == et_mousedown) &&
(event->u.mouse.button >= 4 && event->u.mouse.button <= 7))
{
struct gfc_data *d = GDrawGetUserData (gw);
return (GGadgetDispatchEvent ((GGadget *) (d->gfc), event));
}
return (true);
}
开发者ID:khaledhosny,项目名称:sortsmill,代码行数:27,代码来源:gfiledlg.c
示例2: kpd_e_h
static int kpd_e_h(GWindow gw, GEvent *event) {
if ( event->type==et_close ) {
KPData *kpd = GDrawGetUserData(gw);
kpd->done = true;
} else if ( event->type == et_mousemove ) {
kpdpopup(GDrawGetUserData(gw));
} else if ( event->type == et_expose ) {
KPData *kpd = GDrawGetUserData(gw);
GRect size, sbsize;
GDrawGetSize(kpd->v,&size);
GGadgetGetSize(GWidgetGetControl(kpd->gw,CID_ScrollBar),&sbsize);
GDrawSetLineWidth(gw,0);
GDrawDrawLine(gw,size.x,size.y-1,sbsize.x+sbsize.width-1,size.y-1,0x000000);
GDrawDrawLine(gw,size.x,size.y+size.height,sbsize.x+sbsize.width-1,size.y+size.height,0x000000);
GDrawDrawLine(gw,size.x-1,size.y-1,size.x-1,size.y+size.height,0x000000);
} else if ( event->type == et_char ) {
if ( event->u.chr.keysym == GK_F1 || event->u.chr.keysym == GK_Help ) {
help("kernpairs.html");
return( true );
}
if ( event->u.chr.chars[0]!='\0' && event->u.chr.chars[1]=='\0' ) {
enum sortby sort = GGadgetGetFirstListSelectedItem(GWidgetGetControl(gw,CID_SortBy));
KPData *kpd = GDrawGetUserData(gw);
if ( sort!=sb_kern ) {
KPScrollTo(kpd,event->u.chr.chars[0],sort);
return( true );
} else
GDrawBeep(NULL);
}
return( false );
} else if ( event->type == et_resize && event->u.resize.sized ) {
KP_Resize((KPData *) GDrawGetUserData(gw) );
}
return( true );
}
开发者ID:IceJacool,项目名称:fontforge,代码行数:35,代码来源:combinations.c
示例3: e_h
static int e_h(GWindow gw, GEvent *event) {
if ( event->type==et_close ) {
struct gfc_data *d = GDrawGetUserData(gw);
d->done = true;
} else if ( event->type == et_map ) {
/* Above palettes */
GDrawRaise(gw);
} else if ( event->type == et_char ) {
return( false );
} else if ( event->type == et_mousemove ||
(event->type==et_mousedown && event->u.mouse.button==3 )) {
struct gfc_data *d = GDrawGetUserData(gw);
if ( !WithinList(d,event) )
GFileChooserPopupCheck(d->gfc,event);
} else if (( event->type==et_mouseup || event->type==et_mousedown ) &&
(event->u.mouse.button>=4 && event->u.mouse.button<=7) ) {
struct gfc_data *d = GDrawGetUserData(gw);
return( GGadgetDispatchEvent((GGadget *) (d->gfc),event));
} else if ( event->type == et_resize ) {
GRect r, size;
struct gfc_data *d = GDrawGetUserData(gw);
if ( d->gfc!=NULL ) {
GDrawGetSize(gw,&size);
GGadgetGetSize(d->gfc,&r);
GGadgetResize(d->gfc,size.width-2*r.x,r.height);
}
}
return( event->type!=et_char );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:29,代码来源:openfontdlg.c
示例4: nld_e_h
static int nld_e_h(GWindow gw, GEvent *event) {
if ( event->type==et_close ) {
struct nldlg *d = GDrawGetUserData(gw);
d->done = true;
} else if ( event->type == et_char ) {
return( false );
} else if ( event->type==et_controlevent && event->u.control.subtype==et_buttonactivate ) {
struct nldlg *d = GDrawGetUserData(gw);
d->done = true;
d->ok = GGadgetGetCid(event->u.control.g);
}
return( true );
}
开发者ID:Decepticoner,项目名称:fontforge,代码行数:13,代码来源:nonlineartransui.c
示例5: DE_Delete
static int DE_Delete(GGadget *g, GEvent *e) {
GWindow gw;
int *done;
GGadget *list;
int sel,i;
Encoding *item;
if ( e->type==et_controlevent &&
(e->u.control.subtype == et_buttonactivate ||
e->u.control.subtype == et_listdoubleclick )) {
gw = GGadgetGetWindow(g);
done = GDrawGetUserData(gw);
list = GWidgetGetControl(gw,CID_Encodings);
sel = GGadgetGetFirstListSelectedItem(list);
i=0;
for ( item=enclist; item!=NULL; item=item->next ) {
if ( item->builtin )
/* Do Nothing */;
else if ( i==sel )
break;
else
++i;
}
if ( item!=NULL )
DeleteEncoding(item);
*done = true;
}
return( true );
}
开发者ID:monkeyiq,项目名称:fontforge-fill-off-by-one,代码行数:29,代码来源:encodingui.c
示例6: _BdfP_VScroll
static int _BdfP_VScroll(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_scrollbarchange ) {
struct bdf_dlg *bd = (struct bdf_dlg *) GDrawGetUserData(GGadgetGetWindow(g));
BdfP_VScroll(bd,&e->u.control.u.sb);
}
return( true );
}
开发者ID:IceJacool,项目名称:fontforge,代码行数:7,代码来源:bdfinfo.c
示例7: BdfP_Cancel
static int BdfP_Cancel(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
struct bdf_dlg *bd = GDrawGetUserData(GGadgetGetWindow(g));
BdfP_DoCancel(bd);
}
return( true );
}
开发者ID:IceJacool,项目名称:fontforge,代码行数:7,代码来源:bdfinfo.c
示例8: GFD_Cancel
static int GFD_Cancel(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
struct gfc_data *d = GDrawGetUserData(GGadgetGetWindow(g));
d->done = true;
}
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:7,代码来源:openfontdlg.c
示例9: Filter_OK
static int Filter_OK(GGadget *g, GEvent *e) {
struct filter_d *d;
struct matrix_data *md;
int rows,i,cnt;
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
if ( user_font_filters!=NULL ) {
for ( i=0; user_font_filters[i].name!=NULL; ++i ) {
free(user_font_filters[i].name);
free(user_font_filters[i].filter);
}
free(user_font_filters);
user_font_filters = NULL;
}
d = GDrawGetUserData(GGadgetGetWindow(g));
md = GMatrixEditGet(d->gme,&rows);
for ( i=cnt=0; i<rows; ++i )
if ( !md[2*i].frozen )
++cnt;
if ( cnt!=0 ) {
user_font_filters = malloc((cnt+1)*sizeof(struct openfilefilters));
for ( i=cnt=0; i<rows; ++i ) if ( !md[2*i].frozen ) {
user_font_filters[cnt].name = copy(md[2*i].u.md_str);
user_font_filters[cnt].filter = copy(md[2*i+1].u.md_str);
++cnt;
}
user_font_filters[cnt].name = user_font_filters[cnt].filter = NULL;
}
SavePrefs(true);
d->done = true;
}
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:33,代码来源:openfontdlg.c
示例10: OD_Cancel
static int OD_Cancel(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
OutlineData *od = GDrawGetUserData(GGadgetGetWindow(g));
od->done = true;
}
return( true );
}
开发者ID:catharanthus,项目名称:fontforge,代码行数:7,代码来源:effectsui.c
示例11: L2L_OK
static int L2L_OK(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
L2LDlg *d = GDrawGetUserData(GGadgetGetWindow(g));
int from, to, clear;
int err=0;
double errbound;
from = GGadgetGetFirstListSelectedItem(GWidgetGetControl(d->gw,CID_FromLayer));
to = GGadgetGetFirstListSelectedItem(GWidgetGetControl(d->gw,CID_ToLayer));
if ( d->l2l==l2l_copy ) {
clear = GGadgetIsChecked(GWidgetGetControl(d->gw,CID_ClearOld));
if ( d->cv )
_DoCVCopy(d->cv,from,to,clear);
else
_DoFVCopy(d->fv,from,to,clear);
} else {
errbound = GetReal8(d->gw,CID_ErrorBound,_("Error Bound"),&err);
if ( err )
return( true );
if ( d->cv )
_DoCVCompare(d->cv,from,to,errbound);
else
_DoFVCompare(d->fv,from,to,errbound);
}
d->done = true;
}
return( true );
}
开发者ID:UIKit0,项目名称:fontforge-1,代码行数:29,代码来源:layer2layer.c
示例12: BaseLang_OK
static int BaseLang_OK(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
BaseLangDlg *b = GDrawGetUserData(GGadgetGetWindow(g));
GGadget *g = GWidgetGetControl(b->gw,CID_Languages);
int r, rows, cols = GMatrixEditGetColCnt(g);
struct matrix_data *md = GMatrixEditGet(g,&rows);
struct baselangextent *cur, *last;
if ( md==NULL )
return( true );
b->old = last = NULL;
for ( r=0; r<rows; ++r ) {
cur = XZALLOC(struct baselangextent);
cur->lang = TagFromString(md[r*cols+0].u.md_str);
cur->descent = md[r*cols+1].u.md_ival;
cur->ascent = md[r*cols+2].u.md_ival;
cur->features = (struct baselangextent *) md[r*cols+3].u.md_str;
md[r*cols+3].u.md_str = NULL;
if ( last==NULL )
b->old = cur;
else
last->next = cur;
last = cur;
}
b->done = true;
}
开发者ID:jric,项目名称:fontforge,代码行数:28,代码来源:basedlg.c
示例13: AnchorD_Cancel
static int AnchorD_Cancel(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
AnchorDlg *a = GDrawGetUserData(GGadgetGetWindow(g));
AnchorD_DoCancel(a);
}
return( true );
}
开发者ID:catharanthus,项目名称:fontforge,代码行数:7,代码来源:anchorsaway.c
示例14: delta_e_h
static int delta_e_h(GWindow gw, GEvent *event) {
if ( event->type==et_close ) {
QGData *qg = GDrawGetUserData(gw);
qg->done = true;
} else if ( event->type == et_char ) {
return( false );
} else if ( event->type == et_map ) {
/* Above palettes */
GDrawRaise(gw);
} else if ( event->type == et_destroy ) {
QGData *qg = GDrawGetUserData(gw);
free(qg->qg);
free(qg);
}
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:16,代码来源:deltaui.c
示例15: Delta_Cancel
static int Delta_Cancel(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
QGData *qg = GDrawGetUserData(GGadgetGetWindow(g));
qg->done = true;
}
return( true );
}
开发者ID:Hasimir,项目名称:fontforge,代码行数:7,代码来源:deltaui.c
示例16: Goto_OK
static int Goto_OK(GGadget *g, GEvent *e) {
GWindow gw;
GotoData *d;
char *ret;
int i;
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
gw = GGadgetGetWindow(g);
d = GDrawGetUserData(gw);
ret = GGadgetGetTitle8(GWidgetGetControl(gw,CID_Name));
if ( d->ranges!=NULL ) {
for ( i=0; d->ranges[i].text!=NULL; ++i ) {
if ( strcmp(ret,(char *) d->ranges[i].text)==0 ) {
d->ret = (intpt) d->ranges[i].userdata;
break;
}
}
}
if ( d->ret==-1 ) {
d->ret = NameToEncoding(d->sf,d->map,ret);
if ( d->ret<0 || (d->ret>=d->map->enccount && d->sf->cidmaster==NULL ))
d->ret = -1;
if ( d->ret==-1 ) {
ff_post_notice(_("Goto"),_("Could not find the glyph: %.70s"),ret);
} else
d->done = true;
} else
d->done = true;
}
return( true );
}
开发者ID:UIKit0,项目名称:fontforge-1,代码行数:31,代码来源:gotodlg.c
示例17: FtPpem_Cancel
static int FtPpem_Cancel(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
FtSizeData *fsd = GDrawGetUserData(GGadgetGetWindow(g));
fsd->done = true;
}
return( true );
}
开发者ID:Arthaey,项目名称:fontforge,代码行数:7,代码来源:cvgridfit.c
示例18: sv_e_h
static int sv_e_h(GWindow gw, GEvent *event) {
SearchView *sv = (SearchView *) ((CharViewBase *) GDrawGetUserData(gw))->container;
switch ( event->type ) {
case et_expose:
SVDraw(sv,gw,event);
break;
case et_resize:
if ( event->u.resize.sized )
SVResize(sv,event);
break;
case et_char:
SVChar(sv,event);
break;
case et_timer:
SVCheck(sv);
break;
case et_close:
SV_DoClose((struct cvcontainer *) sv);
break;
case et_create:
break;
case et_destroy:
SearchViewFree(sv);
break;
case et_map:
if ( event->u.map.is_visible )
CVPaletteActivate(sv->cv_srch.inactive?&sv->cv_rpl:&sv->cv_srch);
else
CVPalettesHideIfMine(sv->cv_srch.inactive?&sv->cv_rpl:&sv->cv_srch);
sv->isvisible = event->u.map.is_visible;
break;
}
return( true );
}
开发者ID:ystk,项目名称:debian-fontforge,代码行数:35,代码来源:searchview.c
示例19: OD_OK
static int OD_OK(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
OutlineData *od = GDrawGetUserData(GGadgetGetWindow(g));
real width, gap;
int err = 0;
width = GetReal8(od->gw,CID_Width,_("Outline Width"),&err);
if ( od->isinline )
gap = GetReal8(od->gw,CID_Gap,_("_Gap:"),&err);
if ( err )
return(true);
def_outline_width = width;
if ( od->isinline ) {
def_gap_width = gap;
if ( od->fv!=NULL )
FVInline((FontViewBase *) od->fv,width,gap);
else if ( od->cv!=NULL )
CVInline(od->cv,width,gap);
else if ( od->mv!=NULL )
MVInline(od->mv,width,gap);
} else {
if ( od->fv!=NULL )
FVOutline((FontViewBase *) od->fv,width);
else if ( od->cv!=NULL )
CVOutline(od->cv,width);
else if ( od->mv!=NULL )
MVOutline(od->mv,width);
}
od->done = true;
}
return( true );
}
开发者ID:catharanthus,项目名称:fontforge,代码行数:32,代码来源:effectsui.c
示例20: GCol_OK
static int GCol_OK(GGadget *g, GEvent *e) {
if ( e->type==et_controlevent && e->u.control.subtype == et_buttonactivate ) {
struct gcol_data *d = GDrawGetUserData(GGadgetGetWindow(g));
double *offs[7] = { &d->col.h, &d->col.s, &d->col.v, &d->col.r, &d->col.g, &d->col.b, &d->col.alpha };
int err = false, i;
double val;
for ( i=0; i<7; ++i ) {
val = GetReal8(d->gw,cids[i],_(labnames[i]),&err);
if ( err )
return( true );
if ( i==0 ) {
val = fmod(val,360);
if ( val<0 ) val += 360;
} else {
if ( val<0 || val>1 ) {
gwwv_post_error(_("Value out of bounds"), _("Saturation and Value, and the three colors must be between 0 and 1"));
return( true );
}
}
*offs[i] = val;
}
d->done = true;
}
return( true );
}
开发者ID:BorisLucas,项目名称:fontforge,代码行数:27,代码来源:gcolor.c
注:本文中的GDrawGetUserData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论