Beispiel #1
0
void
AG_GLViewButtonupFn(AG_GLView *glv, AG_EventFn fn, const char *fmt, ...)
{
    AG_ObjectLock(glv);
    glv->btnup_ev = AG_SetEvent(glv, "mouse-button-up", fn, NULL);
    AG_EVENT_GET_ARGS(glv->btnup_ev, fmt);
    AG_ObjectUnlock(glv);
}
Beispiel #2
0
void
AG_GLViewMotionFn(AG_GLView *glv, AG_EventFn fn, const char *fmt, ...)
{
    AG_ObjectLock(glv);
    glv->motion_ev = AG_SetEvent(glv, "mouse-motion", fn, NULL);
    AG_EVENT_GET_ARGS(glv->motion_ev, fmt);
    AG_ObjectUnlock(glv);
}
Beispiel #3
0
void
AG_GLViewKeyupFn(AG_GLView *glv, AG_EventFn fn, const char *fmt, ...)
{
    AG_ObjectLock(glv);
    glv->keyup_ev = AG_SetEvent(glv, "key-up", fn, NULL);
    AG_EVENT_GET_ARGS(glv->keyup_ev, fmt);
    AG_ObjectUnlock(glv);
}
Beispiel #4
0
void
AG_GLViewScaleFn(AG_GLView *glv, AG_EventFn fn, const char *fmt, ...)
{
    AG_ObjectLock(glv);
    glv->scale_ev = AG_SetEvent(glv, NULL, fn, NULL);
    AG_EVENT_GET_ARGS(glv->scale_ev, fmt);
    AG_ObjectUnlock(glv);
}
Beispiel #5
0
void
AG_GLViewButtondownFn(void *obj, AG_EventFn fn, const char *fmt, ...)
{
	AG_GLView *glv = obj;

	AG_ObjectLock(glv);
	glv->btndown_ev = AG_SetEvent(glv, "mouse-button-down", fn, NULL);
	AG_EVENT_GET_ARGS(glv->btndown_ev, fmt);
	AG_ObjectUnlock(glv);
}
Beispiel #6
0
void
AG_GLViewKeydownFn(void *obj, AG_EventFn fn, const char *fmt, ...)
{
	AG_GLView *glv = obj;

	AG_ObjectLock(glv);
	glv->keydown_ev = AG_SetEvent(glv, "key-down", fn, NULL);
	AG_EVENT_GET_ARGS(glv->keydown_ev, fmt);
	AG_ObjectUnlock(glv);
}
Beispiel #7
0
void
AG_GLViewOverlayFn(void *obj, AG_EventFn fn, const char *fmt, ...)
{
	AG_GLView *glv = obj;

	AG_ObjectLock(glv);
	glv->overlay_ev = AG_SetEvent(glv, NULL, fn, NULL);
	AG_EVENT_GET_ARGS(glv->overlay_ev, fmt);
	AG_ObjectUnlock(glv);
}
Beispiel #8
0
AG_Button *
AG_ButtonNewFn(void *parent, Uint flags, const char *caption, AG_EventFn fn,
    const char *fmt, ...)
{
	AG_Button *bu;
	AG_Event *ev;

	if (!(flags & AG_BUTTON_NOEXCL)) { flags |= AG_BUTTON_EXCL;  }
	bu = AG_ButtonNewS(parent, flags, caption);
	ev = AG_SetEvent(bu, "button-pushed", fn, NULL);
	AG_EVENT_GET_ARGS(ev, fmt);
	return (bu);
}
Beispiel #9
0
AG_UCombo *
AG_UComboNewPolled(void *parent, Uint flags, AG_EventFn fn, const char *fmt,
    ...)
{
	AG_UCombo *com;
	AG_Event *ev;

	com = AG_UComboNew(parent, flags);
	AG_ObjectLock(com);
	com->list->flags |= AG_TLIST_POLL;
	ev = AG_SetEvent(com->list, "tlist-poll", fn, NULL);
	AG_EVENT_GET_ARGS(ev, fmt);
	AG_ObjectUnlock(com);
	return (com);
}