Example #1
0
void
bar_init(WMScreen *s) {
	WinAttr wa;

	if(s->barwin) {
		bar_resize(s);
		return;
	}

	s->brect = s->r;
	s->brect.min.y = s->brect.max.y - labelh(def.font);

	wa.override_redirect = 1;
	wa.background_pixmap = ParentRelative;
	wa.event_mask = ExposureMask
		      | ButtonPressMask
		      | ButtonReleaseMask
		      | FocusChangeMask;
	s->barwin = createwindow(&scr.root, s->brect, scr.depth, InputOutput,
			&wa, CWOverrideRedirect
			   | CWBackPixmap
			   | CWEventMask);
	s->barwin->aux = s;
	xdnd_initwindow(s->barwin);
	sethandler(s->barwin, &handlers);
	if(s == screens[0])
		mapwin(s->barwin);
}
Example #2
0
/*
	Initialize().

*/
HWND CDisplayDX::Initialize( const uint32 _width, const uint32 _height, const bool _bFullscreen )
{
    m_WindowHandle = createwindow( _width, _height, _bFullscreen );
    if( m_WindowHandle == 0 )
    {
        g_Log->Error( "CDisplayDX::Initialize createwindow returned 0" );
        return 0;
    }

    //	Show or Hide cursor.
    ShowCursor( !_bFullscreen );

    //	Get window dimensions.
    RECT rect;
    GetClientRect( m_WindowHandle, &rect );
    m_Width = rect.right - rect.left;
    m_Height = rect.bottom - rect.top;

    ShowWindow( m_WindowHandle, SW_SHOW );
    if (gl_hFocusWindow == NULL)
    {
        SetForegroundWindow( m_WindowHandle );
        SetFocus( m_WindowHandle );
    }

    if( !InitDX9() )
        return false;

    return	m_WindowHandle;
}
Example #3
0
static Window*
gethsep(Rectangle r) {
	Window *w;
	WinAttr wa;

	wa.background_pixel = pixelvalue(&scr.root, &def.normcolor.border);
	w = createwindow(&scr.root, r, scr.depth, InputOutput, &wa, CWBackPixel);
	mapwin(w);
	raisewin(w);
	return w;
}
Example #4
0
Window*
constraintwin(Rectangle r) {
	Window *w;

	w = createwindow(&scr.root, r, 0, InputOnly, nil, 0);
	if(0) {
		Window *w2;

		w2 = createwindow(&scr.root, r, 0, InputOutput, nil, 0);
		selectinput(w2, ExposureMask);
		w->aux = w2;

		setborder(w2, 1, &def.focuscolor.border);
		sethandler(w2, &chandler);
		mapwin(w2);
		raisewin(w2);
	}
	mapwin(w);
	return w;
}
Example #5
0
File: event.c Project: bartman/wmii
void
xtime_kludge(void) {
	Window *w;
	WinAttr wa;
	XEvent e;
	long l;

	w = createwindow(&scr.root, Rect(0, 0, 1, 1), 0, InputOnly, &wa, 0);

	XSelectInput(display, w->xid, PropertyChangeMask);
	changeprop_long(w, "ATOM", "ATOM", &l, 0);
	XIfEvent(display, &e, findtime, (void*)w);

	destroywindow(w);
}
Example #6
0
void
ewmh_init(void) {
	char myname[] = "wmii";
	long win;

	ewmhwin = createwindow(&scr.root,
		Rect(0, 0, 1, 1), 0 /*depth*/,
		InputOnly, nil, 0);

	win = ewmhwin->xid;
	changeprop_long(&scr.root, Net("SUPPORTING_WM_CHECK"), "WINDOW", &win, 1);
	changeprop_long(ewmhwin, Net("SUPPORTING_WM_CHECK"), "WINDOW", &win, 1);
	changeprop_string(ewmhwin, Net("WM_NAME"), myname);

	changeprop_long(&scr.root, Net("DESKTOP_VIEWPORT"), "CARDINAL",
			(long[2]){0, 0}, 2);
Example #7
0
HWND CDisplayDD::Initialize( const uint32 _width, const uint32 _height, const bool _bFullscreen )
{
	m_WindowHandle = createwindow( _width, _height, _bFullscreen );
	m_ParentWindowHandle = m_WindowHandle;
	if( m_WindowHandle == 0 )
		return 0;

	//	Show or Hide cursor.
	ShowCursor( !_bFullscreen );

	if (!_bFullscreen)
	{
		RECT rcClient, rcWindow;
		POINT ptDiff;
		GetClientRect(m_WindowHandle, &rcClient);
		GetWindowRect(m_WindowHandle, &rcWindow);
		ptDiff.x = (rcWindow.right - rcWindow.left) - rcClient.right;
		ptDiff.y = (rcWindow.bottom - rcWindow.top) - rcClient.bottom;
		MoveWindow(m_WindowHandle, rcWindow.left, rcWindow.top, _width + ptDiff.x, _height + ptDiff.y, TRUE);
	}
	//	Get window dimensions.
	RECT rect;
    GetClientRect( m_WindowHandle, &rect );
    m_Width = rect.right;
    m_Height = rect.bottom;

    ShowWindow( m_WindowHandle, SW_SHOW );
    SetForegroundWindow( m_WindowHandle );
    SetFocus( m_WindowHandle );

	InitDD(m_WindowHandle);
	
	if (m_Width == 0 && m_Height == 0)
	{
		m_Width = m_dd.GetSize().cx;
		m_Height = m_dd.GetSize().cy;
	}

	return	m_WindowHandle;
}
Example #8
0
/** 
 * Begin a Plotting Window
 *
 * @param number 
 *    Number of the graphics window to turn on
 * @param nerr
 *    Error Return Code
 *    - 0 on success
 *    - Non-Zero on Failure
 *
 * @date   900829;  Fixed bug created by last bug fix, call setctable with
 *                  nctsize+1. [wct]
 * @date   900817:  Fixed bug created by last change. [jet]
 * @date   900803:  Changed method of setting color table for new window. 
 * @date   870426:  Moved window checking and creation from begindevices.
 * @date   861201:  Original version.
 */
void 
beginwindow(int  number, 
            int *nerr) {

	int exists;
	float screenratio, ymin, ymax;

        int i, n;
        display_t **dev;
        n   = gdm_get_ndevices();
        dev = gdm_get_devices();

	*nerr = 0;

	/* - Check input window number for correctness. */
	cmgdm.iwindow = max( 1, min( MWINDOWS, number ) );
    
	/* - Create a new graphics window if necessary. */
	getwindowstatus( &cmgdm.iwindow, &exists );
	if( !exists ){
		getdeviceratio( &screenratio );
                for(i = 0; i < n; i++) {
                  if(dev[i]->on && dev[i]->get_window_size) {
                    dev[i]->get_window_size( & Xwindowmin[cmgdm.iwindow],
                                             & Xwindowmax[cmgdm.iwindow],
                                             & Ywindowmin[cmgdm.iwindow],
                                             & Ywindowmax[cmgdm.iwindow]);
                  }
                }
                ymin = Ywindowmin[cmgdm.iwindow] * screenratio;
                ymax = Ywindowmax[cmgdm.iwindow] * screenratio;
                
		createwindow( &cmgdm.iwindow, 
                              Xwindowmin[cmgdm.iwindow], 
                              Xwindowmax[cmgdm.iwindow], 
                              ymin, ymax, nerr );
		if( *nerr != 0 )
			goto L_8888;


                for(i = 0; i < n; i++) {
                  if(dev[i]->on && dev[i]->set_color_table) {
                    dev[i]->set_color_table(cmgdm.iwindow, 
                                            cmgdm.nctsize + 1, 
                                            &cmgdm.ctred[0], 
                                            &cmgdm.ctgreen[0], 
                                            &cmgdm.ctblue[0]);
                  }
                }
        }
	/* - Activate the graphics window for each active device. */

        for(i = 0; i < n; i++) {
          if(dev[i]->on && dev[i]->begin_window ) {
            dev[i]->begin_window( &cmgdm.iwindow, nerr );
          }
        }

	/* - Set default color if window did not exist.
	 *   Must be done after beginwindow, at least for Sunwindows. */

	if( !exists )
		setcolor( cmgdm.nctsize );

	/* - Calculate new values for graphics status variables. */

	calstatus();

L_8888:
	return;

        }