Beispiel #1
0
static void loggerwindow_do_move(LoggerWindow *lw, int x, int y) {
	lw->lmouse[0]= x, lw->lmouse[1]= y;
	
	if (scrollbar_is_scrolling(lw->scroll)) {
		scrollbar_keep_scrolling(lw->scroll, y);
		GHOST_InvalidateWindow(lw->win);
	}
}
Beispiel #2
0
static void mainwindow_do_move(MainWindow *mw, int x, int y) {
	mw->lmouse[0]= x, mw->lmouse[1]= y;
	
	if (mw->lmbut[0]) {
		mw->tmouse[0]= x, mw->tmouse[1]= y;
		GHOST_InvalidateWindow(mw->win);
	}
}
Beispiel #3
0
static void gearsTimerProc(GHOST_TimerTaskHandle hTask, GHOST_TUns64 time)
{
	GHOST_WindowHandle hWindow = NULL;
	fAngle += 2.0;
	view_roty += 1.0;
	hWindow = (GHOST_WindowHandle)GHOST_GetTimerTaskUserData(hTask);
	if (GHOST_GetFullScreen(shSystem))
	{
		/* Running full screen */
		GHOST_InvalidateWindow(sFullScreenWindow);
	}
	else {
		if (GHOST_ValidWindow(shSystem, hWindow))
		{
			GHOST_InvalidateWindow(hWindow);
		}
	}
}
Beispiel #4
0
void loggerwindow_log(LoggerWindow *lw, char *line) {
	if (lw->nloglines==lw->logsize) {
		lw->loglines= memdbl(lw->loglines, &lw->logsize, sizeof(*lw->loglines));
	}
	
	lw->loglines[lw->nloglines++]= string_dup(line);
	scrollbar_set_thumbpct(lw->scroll, (float) lw->ndisplines/lw->nloglines);
	
	GHOST_InvalidateWindow(lw->win);
}
Beispiel #5
0
static void mainwindow_do_button(MainWindow *mw, int which, int press) {
	if (which==GHOST_kButtonMaskLeft) {
		mw->lmbut[0]= press;
		mw->tmouse[0]= mw->lmouse[0], mw->tmouse[1]= mw->lmouse[1];
		GHOST_InvalidateWindow(mw->win);
	} else if (which==GHOST_kButtonMaskLeft) {
		mw->lmbut[1]= press;
	} else if (which==GHOST_kButtonMaskLeft) {
		mw->lmbut[2]= press;
	}
}
Beispiel #6
0
static void loggerwindow_do_button(LoggerWindow *lw, int which, int press) {
	if (which==GHOST_kButtonMaskLeft) {
		lw->lmbut[0]= press;
		
		if (press) {
			if (scrollbar_contains_pt(lw->scroll, lw->lmouse)) {
				scrollbar_start_scrolling(lw->scroll, lw->lmouse[1]);				
				GHOST_SetCursorShape(lw->win, GHOST_kStandardCursorUpDown);
				GHOST_InvalidateWindow(lw->win);
			}
		} else {
			if (scrollbar_is_scrolling(lw->scroll)) {
				scrollbar_stop_scrolling(lw->scroll);
				GHOST_SetCursorShape(lw->win, GHOST_kStandardCursorDefault);
				GHOST_InvalidateWindow(lw->win);
			}
		}
	} else if (which==GHOST_kButtonMaskMiddle) {
		lw->lmbut[1]= press;
	} else if (which==GHOST_kButtonMaskRight) {
		lw->lmbut[2]= press;
	}
}
Beispiel #7
0
static void mainwindow_do_key(MainWindow *mw, GHOST_TKey key, int press) {
	switch(key) {
	case GHOST_kKeyC:
		if (press)
			GHOST_SetCursorShape(mw->win, (GHOST_TStandardCursor) (rand()%(GHOST_kStandardCursorNumCursors)));
		break;
	case GHOST_kKeyLeftBracket:
		if (press)
			GHOST_SetCursorVisibility(mw->win, 0);
		break;
	case GHOST_kKeyRightBracket:
		if (press)
			GHOST_SetCursorVisibility(mw->win, 1);
		break;
	case GHOST_kKeyE:
		if (press)
			multitestapp_toggle_extra_window(mw->app);
		break;
	case GHOST_kKeyQ:
		if (press)
			multitestapp_exit(mw->app);
		break;
	case GHOST_kKeyT:
		if (press)
			mainwindow_log(mw, "TextTest~|`hello`\"world\",<>/");
		break;
	case GHOST_kKeyR:
		if (press) {
			int i;
			
			mainwindow_log(mw, "Invalidating window 10 times");
			for (i=0; i<10; i++)
				GHOST_InvalidateWindow(mw->win);
		}
		break;
	case GHOST_kKeyF11:
		if (press) {
			GHOST_SetWindowOrder(mw->win, GHOST_kWindowOrderBottom);
		}
		break;
	}
}