Exemple #1
0
GHandle gwinGConsoleCreate(GDisplay *g, GConsoleObject *gc, const GWindowInit *pInit) {
	if (!(gc = (GConsoleObject *)_gwindowCreate(g, &gc->g, pInit, &consoleVMT, 0)))
		return 0;

	#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
		gc->stream.vmt = &GWindowConsoleVMT;
	#endif

	#if GWIN_CONSOLE_USE_HISTORY
		gc->buffer = 0;
		#if GWIN_CONSOLE_HISTORY_ATCREATE
			gwinConsoleSetBuffer(&gc->g, TRUE);
		#endif
	#endif

	gc->cx = 0;
	gc->cy = 0;

	#if GWIN_CONSOLE_ESCSEQ
		gc->startattr = gc->currattr = 0;
		gc->escstate = 0;
	#endif

	gwinSetVisible((GHandle)gc, pInit->show);

	return (GHandle)gc;
}
Exemple #2
0
GHandle gwinGraphCreate(GGraphObject *gg, const GWindowInit *pInit) {
	if (!(gg = (GGraphObject *)_gwindowCreate(&gg->g, pInit, &graphVMT, 0)))
		return 0;
	gg->xorigin = gg->yorigin = 0;
	gg->lastx = gg->lasty = 0;
	gwinGraphSetStyle((GHandle)gg, &GGraphDefaultStyle);
	gwinSetVisible((GHandle)gg, pInit->show);
	return (GHandle)gg;
}
Exemple #3
0
GHandle gwinGGraphCreate(GDisplay *g, GGraphObject *gg, const GWindowInit *pInit) {
	if (!(gg = (GGraphObject *)_gwindowCreate(g, &gg->g, pInit, &graphVMT, 0)))
		return 0;
	gg->xorigin = gg->yorigin = 0;
	gg->lastx = gg->lasty = 0;
	gwinGraphSetStyle((GHandle)gg, &GGraphDefaultStyle);
	gwinSetVisible((GHandle)gg, pInit->show);
	_gwinFlushRedraws(REDRAW_WAIT);
	return (GHandle)gg;
}
GHandle gwinConsoleCreate(GConsoleObject *gc, const GWindowInit *pInit) {
	if (!(gc = (GConsoleObject *)_gwindowCreate(&gc->g, pInit, &consoleVMT, 0)))
		return 0;
	#if GFX_USE_OS_CHIBIOS && GWIN_CONSOLE_USE_BASESTREAM
		gc->stream.vmt = &GWindowConsoleVMT;
	#endif
	gc->cx = 0;
	gc->cy = 0;
	gwinSetVisible((GHandle)gc, pInit->show);
	return (GHandle)gc;
}
Exemple #5
0
GHandle gwinGImageCreate(GDisplay *g, GImageObject *gobj, GWindowInit *pInit) {
	if (!(gobj = (GImageObject *)_gwindowCreate(g, &gobj->g, pInit, &imageVMT, 0)))
		return 0;

	// Ensure the gdispImageIsOpen() gives valid results
	gdispImageInit(&gobj->image);

	// Initialise the timer
	#if GWIN_NEED_IMAGE_ANIMATION
		gtimerInit(&gobj->timer);
	#endif
	
	gwinSetVisible((GHandle)gobj, pInit->show);

	return (GHandle)gobj;
}
Exemple #6
0
GHandle _gwidgetCreate(GDisplay *g, GWidgetObject *pgw, const GWidgetInit *pInit, const gwidgetVMT *vmt) {
	if (!(pgw = (GWidgetObject *)_gwindowCreate(g, &pgw->g, &pInit->g, &vmt->g, GWIN_FLG_WIDGET|GWIN_FLG_ENABLED|GWIN_FLG_SYSENABLED)))
		return 0;

	#if GWIN_NEED_COLLECTIONS
		// This window can't be system enabled if the parent is not enabled
		if (pgw->parent && !(pgw->parent->flags & GWIN_FLG_SYSENABLED))
			pgw->g.flags &= ~GWIN_FLG_SYSENABLED;
	#endif
	pgw->text = pInit->text ? pInit->text : "";
	pgw->fnDraw = pInit->customDraw ? pInit->customDraw : vmt->DefaultDraw;
	pgw->fnParam = pInit->customParam;
	pgw->pstyle = pInit->customStyle ? pInit->customStyle : defaultStyle;
	#if GWIN_WIDGET_TAGS
			pgw->tag = pInit->tag;
	#endif

	return 	&pgw->g;
}
Exemple #7
0
GHandle gwinWindowCreate(GWindowObject *pgw, const GWindowInit *pInit) {
	if (!(pgw = _gwindowCreate(pgw, pInit, &basegwinVMT, 0)))
		return 0;
	gwinSetVisible(pgw, pInit->show);
	return pgw;
}