コード例 #1
0
ファイル: wmevents.c プロジェクト: koujinogaku/helloos
int wm_update(GR_EVENT_UPDATE *event)
{
	win *window;

	Dprintf("wm_update: wid %d, subwid %d, x %d, y %d, width %d, height %d, "
	       "utype %d\n", event->wid, event->subwid, event->x, event->y, event->width,
	       event->height, event->utype);
	
	if(!(window = wm_find_window(event->subwid))) {
		if (event->utype == GR_UPDATE_MAP)
			wm_new_client_window(event->subwid);
	  	return 0;
	}

	if(window->type == WINDOW_TYPE_CONTAINER) {
		if (event->utype == GR_UPDATE_ACTIVATE)
			wm_redraw_ncarea(window);
		return 0;
	}

	if (window->type == WINDOW_TYPE_CLIENT) {
		if(event->utype == GR_UPDATE_MAP)
			wm_client_window_remap(window);
		if(event->utype == GR_UPDATE_DESTROY)
			wm_client_window_destroy(window);
		if(event->utype == GR_UPDATE_UNMAP)
			wm_client_window_unmap(window);
		if(event->utype == GR_UPDATE_SIZE)
			wm_client_window_resize(window);
	}
	return 0;
}
コード例 #2
0
ファイル: wmaction.c プロジェクト: ghaerr/microwindows
void closebutton_buttonup(win *window, GR_EVENT_BUTTON *event)
{
	win *pwin = wm_find_window(window->pid);
	struct clientinfo *ci = pwin->data;

	Dprintf("closebutton_buttonup window %d\n", window->wid);

	window->active = GR_FALSE;
	closebutton_exposure(window, NULL);
	GrCloseWindow(ci->cid);
}
コード例 #3
0
ファイル: wmaction.c プロジェクト: ghaerr/microwindows
void topbar_exposure(win *window, GR_EVENT_EXPOSURE *event)
{
	win *pwin = wm_find_window(window->pid);
	struct clientinfo *ci = pwin->data;
	GR_WM_PROPERTIES prop;

	Dprintf("topbar_exposure window %d\n", window->wid);

	GrGetWMProperties(ci->cid, &prop);
	if (prop.title) {
		GrText(window->wid, buttonsgc, 0, 0, prop.title, -1, GR_TFASCII|GR_TFTOP);
		free(prop.title);
	}
}
コード例 #4
0
ファイル: wmevents.c プロジェクト: koujinogaku/helloos
int wm_focus_in(GR_EVENT_GENERAL *event)
{
	win *window;

	Dprintf("wm_focus_in: wid %d\n", event->wid);

	if(!(window = wm_find_window(event->wid)))
		return 0;

	switch(window->type) {
		default:
			Dprintf("Unhandled focus in from window %d "
				"(type %d)\n", window->wid, window->type);
			break;
	}
	return 0;
}
コード例 #5
0
ファイル: wmevents.c プロジェクト: koujinogaku/helloos
int wm_mouse_exit(GR_EVENT_GENERAL *event)
{
	win *window;

	Dprintf("wm_mouse_exit: wid %d\n", event->wid);

	if(!(window = wm_find_window(event->wid)))
		return 0;

	switch(window->type) {
		case WINDOW_TYPE_CONTAINER:
			wm_container_mouse_exit(window, event);
			return 0; 	/* don't eat event*/
		default:
			Dprintf("Unhandled mouse exit from window %d "
				"(type %d)\n", window->wid, window->type);
			break;
	}
	return 0;
}
コード例 #6
0
ファイル: wmevents.c プロジェクト: koujinogaku/helloos
int wm_exposure(GR_EVENT_EXPOSURE *event)
{
	win *window;

	Dprintf("wm_exposure: wid %d, x %d, y %d, width %d, height %d\n",
		event->wid, event->x, event->y, event->width, event->height);

	if(!(window = wm_find_window(event->wid)))
		return 0;

	switch(window->type) {
		case WINDOW_TYPE_CONTAINER:
			wm_container_exposure(window, event);
			return 0; 	/* dont' eat event*/
		default:
			Dprintf("Unhandled exposure on window %d (type %d)\n",
				window->wid, window->type);
			break;
	}
	return 0;
}
コード例 #7
0
ファイル: wmevents.c プロジェクト: koujinogaku/helloos
int wm_button_down(GR_EVENT_BUTTON *event)
{
	win *window;

	Dprintf("wm_button_down: wid %d, subwid %d, rootx %d, rooty %d, x %d, "
		"y %d, buttons %d, changebuttons %d, modifiers %d\n",
		event->wid, event->subwid, event->rootx, event->rooty, event->x,
		event->y, event->buttons, event->changebuttons,
		event->modifiers);

	if(!(window = wm_find_window(event->wid))) return 0;

	switch(window->type) {
		case WINDOW_TYPE_CONTAINER:
			wm_container_buttondown(window, event);
			return 1; 	/* eat event*/
		default:
			Dprintf("Unhandled button down on window %d "
				"(type %d)\n", window->wid, window->type);
			break;
	}
	return 0;
}
コード例 #8
0
ファイル: wmevents.c プロジェクト: koujinogaku/helloos
int wm_mouse_moved(GR_EVENT_MOUSE *event)
{
	win *window;

	Dprintf("wm_mouse_moved: wid %d, subwid %d, rootx %d, rooty %d, x %d, "
		"y %d, buttons %d, modifiers %d\n", event->wid, event->subwid,
		event->rootx, event->rooty, event->x, event->y, event->buttons,
		event->modifiers);

	if(!(window = wm_find_window(event->wid)))
		return 0;

	switch(window->type) {
		case WINDOW_TYPE_CONTAINER:
			wm_container_mousemoved(window, event);
			return 0; 	/* don't eat event*/
		default:
			Dprintf("Unhandled mouse movement in window %d "
				"(type %d)\n", window->wid, window->type);
			break;
	}
	return 0;
}