Beispiel #1
0
static void
raise_widget(mvp_widget_t *widget, mvp_widget_t *top)
{
	int wid;

	if (widget) {
		if (top == NULL) {
			wid = GrGetFocus();
			top = find_widget(wid);
		}

		if (top == widget)
			return;

		if (widget->below)
			widget->below->above = widget->above;
		if (widget->above)
			widget->above->below = widget->below;
		widget->below = top;
		widget->above = NULL;

		if (top) {
			top->above = widget;
		}

		GrSetFocus(widget->wid);
	}
}
Beispiel #2
0
void wm_redraw_ncarea(win *window)
{
	GR_WINDOW_INFO info;
	GR_WM_PROPERTIES props;
	GR_BOOL active;

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

	GrGetWindowInfo(window->wid, &info);
	GrGetWMProperties(window->clientid, &props);

	/*
	 * Check for invalid window.  This will be the
	 * case if the client exited, and we're just
	 * getting the paint notification for our parent.
	 */
	if (props.flags) {
		active = (window->clientid == GrGetFocus());
		nxPaintNCArea(window->wid, info.width, info.height, props.title,
			active, props.props);
	}

	/* free title returned from GrGetWMProperties*/
	if (props.title)
		free(props.title);
}
Beispiel #3
0
static void
GrGetFocusWrapper(void *r)
{
	GR_WINDOW_ID wid = GrGetFocus();

	GsWriteType(current_fd, GrNumGetFocus);
	GsWrite(current_fd, &wid, sizeof(wid));
}
Beispiel #4
0
mvp_widget_t*
mvpw_get_focus(void)
{
	int wid;

	wid = GrGetFocus();

	return find_widget(wid);
}
Beispiel #5
0
int
KbdWrite(int c)
{
	GR_WINDOW_ID	win = GrGetFocus();

	/* FIXME: modifiers are incorrect*/
	GrInjectKeyboardEvent(win, c, 0, 0, 1);
	GrInjectKeyboardEvent(win, c, 0, 0, 0);
	return 1;
}
static void browser_do_draw()
{
	/* window is focused */
	if(browser_wid == GrGetFocus()) {
		if( ipod_get_setting( BROWSER_PATH ))
			pz_draw_header(browser_shorten_path());
		else
			pz_draw_header(browser_menu->title);
		menu_draw(browser_menu);
	}
}
Beispiel #7
0
static void
fdinput(GR_EVENT_FDINPUT *fdinput)
{
	mvp_widget_t *widget;
	GR_WINDOW_ID wid;	

	if (fdinput_callback)
		fdinput_callback();

	wid = GrGetFocus();
	if ((widget=find_widget_fd(wid, fdinput->fd)) == NULL)
		return;

	if (widget->callback_fdinput)
		widget->callback_fdinput(widget, fdinput->fd);
	if (widget->fdinput)
		widget->fdinput(widget, fdinput->fd);
}
Beispiel #8
0
void wm_redraw_ncarea(win *window)
{
	GR_WINDOW_INFO info;
	GR_WM_PROPERTIES props;
	GR_BOOL active;
	GR_WINDOW_ID focusedwindow;

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

	GrGetWindowInfo(window->wid, &info);
	GrGetWMProperties(window->clientid, &props);

	/*
	 * Check for invalid window.  This will be the
	 * case if the client exited, and we're just
	 * getting the paint notification for our parent.
	 */
	if (props.flags) {
 		/* Get window with keyboard focus*/
 		focusedwindow = GrGetFocus();
 		/*
 	 	 * Check if the current window or any of its ancestors has the focus 
 	 	 * A window is active even if any of its ancestors has focus
 	 	 * --Amit Kulkarni
 	 	 */	 
 		active = checkHasFocus(window->clientid,focusedwindow);
 		/*
 	 	 * Note that we should also raise the window if its active and behind.
 	 	 * an active window deserves to be on the top :-)
 	 	 */
 		//if(active)
 			//GrRaiseWindow(window->wid);			// FIXME
		nxPaintNCArea(window->wid, info.width, info.height, props.title, active, props.props);
	}

	/* free title returned from GrGetWMProperties*/
	if (props.title)
		free(props.title);
}
Beispiel #9
0
int XGetInputFocus(Display* display, Window* focus_return, int* revert_to_return)
{
    * focus_return = GrGetFocus();
    * revert_to_return = 0;
    return Success;
}