当前位置: 首页>>代码示例>>C++>>正文


C++ RootWindowOfScreen函数代码示例

本文整理汇总了C++中RootWindowOfScreen函数的典型用法代码示例。如果您正苦于以下问题:C++ RootWindowOfScreen函数的具体用法?C++ RootWindowOfScreen怎么用?C++ RootWindowOfScreen使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了RootWindowOfScreen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: XbrGfxReadBitmap

Pixmap XbrGfxReadBitmap(Display *display, Screen *screen, GC gc, char *bits,
                        int width, int height)
{
    Pixmap bitmap, pixmap;

    /* Create a bitmap from the bits passed in */
    bitmap = XCreateBitmapFromData(display, RootWindowOfScreen(screen), bits,
      width, height);

    /* Create a pixmap with the same dimensions */
    pixmap = XCreatePixmap(display, RootWindowOfScreen(screen), width, height,
      DefaultDepthOfScreen(screen));

    /* Copy the bitmap onto the first plane of the pixmap */
    XCopyPlane(display, bitmap, pixmap, gc, 0, 0, width, height, 0, 0, 1);

    /* Finished with the bitmap */
    XFreePixmap(display, bitmap);

    /* Done. */
    return(pixmap);
}
开发者ID:idunham,项目名称:dtextra,代码行数:22,代码来源:XbrGfx.c

示例2: register_canvas

void register_canvas(Widget w, GC gc)
{
    draww = w;
    drawGC = gc;

    XtVaGetValues(w, XmNwidth, &width, XmNheight, &height, NULL);
    pixmap = XCreatePixmap(XtDisplay(w),
			   RootWindowOfScreen(XtScreen(w)), width, height,
			   (unsigned int)DefaultDepthOfScreen(XtScreen(w)));
    set_color("White");
    (void)XFillRectangle(XtDisplay(draww), pixmap, drawGC, 0,0, width,height);
    diameter = min(width, height) - RM;
}
开发者ID:rogerhu,项目名称:dd-wrt,代码行数:13,代码来源:display.c

示例3: _wncki_screen_get_workspace_count

// -----------------------------------------------------------------------------
int _wncki_screen_get_workspace_count(Screen* xscreen)
{
	int    ns    = 0;
	Window xroot = RootWindowOfScreen(xscreen);

	if( !_wncki_get_cardinal(xscreen, xroot, _wncki_atom_get("_NET_NUMBER_OF_DESKTOPS"), &ns) )
		ns  = 1;

	if( ns <= 0 )
		ns  = 1;

	return ns;
}
开发者ID:DGLSBC,项目名称:jabs-clock,代码行数:14,代码来源:x.cpp

示例4: get_pp_pixmap

Pixmap get_pp_pixmap(void){
	if(!pp_pixmap) {
		pp_pixmap = XCreatePixmapFromBitmapData(
			XtDisplay(root),
			RootWindowOfScreen(XtScreen(root)),
			(char*)pp_bitmap_bits,
			pp_bitmap_width,
			pp_bitmap_height,
			BlackPixelOfScreen(XtScreen(root)), /* foreground pixel */
			WhitePixelOfScreen(XtScreen(root)), /* background pixel */
			DefaultDepthOfScreen(XtScreen(root)) /* depth */);
	}
	return pp_pixmap;
}
开发者ID:RobArthan,项目名称:pp,代码行数:14,代码来源:pixmaps.c

示例5: xf_CreateDesktopWindow

xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height, boolean decorations)
{
	xfWindow* window;

	window = (xfWindow*) xzalloc(sizeof(xfWindow));

	if (window != NULL)
	{
		int input_mask;
		XClassHint* class_hints;

		window->width = width;
		window->height = height;
		window->fullscreen = False;
		window->decorations = decorations;

		window->handle = XCreateWindow(xfi->display, RootWindowOfScreen(xfi->screen),
			xfi->workArea.x, xfi->workArea.y, xfi->width, xfi->height, 0, xfi->depth, InputOutput, xfi->visual,
			CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap |
			CWBorderPixel, &xfi->attribs);

		class_hints = XAllocClassHint();

		if (class_hints != NULL)
		{
			class_hints->res_name = "xfreerdp";
			class_hints->res_class = "xfreerdp";
			XSetClassHint(xfi->display, window->handle, class_hints);
			XFree(class_hints);
		}

		xf_ResizeDesktopWindow(xfi, window, width, height);
		xf_SetWindowDecorations(xfi, window, decorations);

		input_mask =
			KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
			VisibilityChangeMask | FocusChangeMask | StructureNotifyMask |
			PointerMotionMask | ExposureMask | PropertyChangeMask;

		if (xfi->grab_keyboard)
			input_mask |= EnterWindowMask | LeaveWindowMask;

		XSelectInput(xfi->display, window->handle, input_mask);
		XMapWindow(xfi->display, window->handle);
	}

	XStoreName(xfi->display, window->handle, name);

	return window;
}
开发者ID:ngraziano,项目名称:FreeRDP,代码行数:50,代码来源:xf_window.c

示例6: xf_CreateWindow

xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width, int height, uint32 id)
{
	xfWindow* window;

	window = (xfWindow*) xzalloc(sizeof(xfWindow));

	if ((width * height) < 1)
		return NULL;

	xf_FixWindowCoordinates(xfi, &x, &y, &width, &height);

	window->left = x;
	window->top = y;
	window->right = x + width - 1;
	window->bottom = y + height - 1;
	window->width = width;
	window->height = height;

	if (window != NULL)
	{
		XGCValues gcv;
		int input_mask;
		XClassHint* class_hints;

		window->decorations = False;
		window->fullscreen = False;
		window->window = wnd;
		window->localMoveSize = False;

		window->handle = XCreateWindow(xfi->display, RootWindowOfScreen(xfi->screen),
			x, y, window->width, window->height, 0, xfi->depth, InputOutput, xfi->visual,
			CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap |
			CWBorderPixel, &xfi->attribs);

		xf_SetWindowDecorations(xfi, window, window->decorations);

		class_hints = XAllocClassHint();

		if (class_hints != NULL)
		{
			char* class;
			class = xmalloc(sizeof(rail_window_class));
			snprintf(class, sizeof(rail_window_class), "RAIL:%08X", id);
			class_hints->res_name = "RAIL";
			class_hints->res_class = class;
			XSetClassHint(xfi->display, window->handle, class_hints);
			XFree(class_hints);
			xfree(class);
		}
开发者ID:ngraziano,项目名称:FreeRDP,代码行数:49,代码来源:xf_window.c

示例7: XPixmapLoader

static Bool
XPixmapLoader(XawParams *params, Screen *screen, Colormap colormap, int depth,
	      Pixmap *pixmap_return, Pixmap *mask_return,
	      Dimension *width_return, Dimension *height_return)
{
  XpmAttributes xpm_attributes;
  XawArgVal *argval;
  unsigned int closeness = 4000;
  static SubstitutionRec sub[] = {
    {'H',   NULL},
    {'N',   NULL},
    {'T',   "pixmaps"},
    {'P',   PROJECT_ROOT},
  };
  char *filename;

  if ((argval = XawFindArgVal(params, "closeness")) != NULL
      && argval->value)
    closeness = atoi(argval->value);

  if (params->name[0] != '/' && params->name[0] != '.')
    {
      if (!sub[0].substitution)
	sub[0].substitution = getenv("HOME");
      sub[1].substitution = params->name;
      if (pixmap_path == NULL)
	GetResourcePixmapPath(DisplayOfScreen(screen));
      filename = XtFindFile(pixmap_path, sub, XtNumber(sub), NULL);
      if (!filename)
	return (False);
    }
  else
    filename = params->name;

  xpm_attributes.colormap = colormap;
  xpm_attributes.closeness = closeness;
  xpm_attributes.valuemask = XpmSize | XpmColormap | XpmCloseness;
  if (XpmReadFileToPixmap(DisplayOfScreen(screen),
			  RootWindowOfScreen(screen), filename, pixmap_return,
			  mask_return, &xpm_attributes) == XpmSuccess)
    {
      *width_return = xpm_attributes.width;
      *height_return = xpm_attributes.height;

      return (True);
    }

  return (False);
}
开发者ID:erdincay,项目名称:vcxsrv-linux2windows,代码行数:49,代码来源:Pixmap.c

示例8: printf

IMAGE_CONTEXT *new_window( char *wnd_name, int x, int y, int width, int height )
{
    IMAGE_CONTEXT *img_ctx;
    img_ctx = new IMAGE_CONTEXT;

    g_width = width;
    g_height = height;

    // First we are creating the window
    if ( ( img_ctx->display = XOpenDisplay(NULL) ) == NULL )
    {
        printf("Error: XOpenDisplay failed.\n");
        exit(1);
    }

    img_ctx->screenNumber = DefaultScreen( img_ctx->display );
    img_ctx->screen = XScreenOfDisplay( img_ctx->display, img_ctx->screenNumber );


    img_ctx->window = XCreateSimpleWindow (
			img_ctx->display,
			RootWindowOfScreen( img_ctx->screen ),
			0,
			0,
			g_width,
			g_height,
			0,
			BlackPixelOfScreen( img_ctx->screen ),
			BlackPixelOfScreen( img_ctx->screen )
    );


    img_ctx->xImage = NULL;
    if( image_create( img_ctx, g_width, g_height ) < 0 )
    {
        printf("Error: image_create() failed\n");
        exit(1);
    }

    XSelectInput( img_ctx->display, img_ctx->window, ButtonPressMask | KeyPressMask );
    XMapRaised( img_ctx->display, img_ctx->window );
    XStoreName( img_ctx->display, img_ctx->window, wnd_name );
	XGetWindowAttributes( img_ctx->display, img_ctx->window, &(img_ctx->windowAttributes ) );

	XMoveWindow( img_ctx->display, img_ctx->window, x, y );


    return img_ctx;
}
开发者ID:jaantti,项目名称:Firestarter,代码行数:49,代码来源:capture.cpp

示例9: x_get_std_cmap

/* Uses: dpy, scr, cmap. */
static XStandardColormap *
x_get_std_cmap(gx_device_X * xdev, Atom prop)
{
    int i;
    XStandardColormap *scmap, *sp;
    int nitems;

    if (XGetRGBColormaps(xdev->dpy, RootWindowOfScreen(xdev->scr),
			 &scmap, &nitems, prop))
	for (i = 0, sp = scmap; i < nitems; i++, sp++)
	    if (xdev->cmap == sp->colormap)
		return sp;

    return NULL;
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:16,代码来源:gdevxcmp.c

示例10: awt_util_updateXtCoordinatesForEmbeddedFrame

static void awt_util_updateXtCoordinatesForEmbeddedFrame(Widget ef)
{
    Window ef_window;
    Window win;
    int32_t x, y;
    ef_window = XtWindow(ef);
    if (ef_window != None) {
        if (XTranslateCoordinates(awt_display, ef_window,
            RootWindowOfScreen(XtScreen(ef)),
            0, 0, &x, &y, &win)) {
            DTRACE_PRINTLN("correcting coordinates");
            ef->core.x = x;
            ef->core.y = y;
        }
    }
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:16,代码来源:awt_util.c

示例11: XDPSCreatePixmapForEPSF

int XDPSCreatePixmapForEPSF(
    DPSContext context,
    Screen *screen,
    FILE *epsf,
    int depth,
    double pixelsPerPoint,
    Pixmap *pixmap,
    XRectangle *pixelSize,
    XRectangle *bbox)
{
    Pixmap p;
    int width, height;
    XRectangle bb;

    if (screen == NULL || depth <= 0 ||
	pixelsPerPoint <= 0) {
	return dps_status_illegal_value;
    }

    if (context == NULL) {
	context = XDPSGetSharedContext(DisplayOfScreen(screen));
    }

    (*rewindFunction)(epsf, rewindClientData);

    if (ParseFileForBBox(epsf, &bb) == dps_status_failure) {
	return dps_status_failure;
    }

    width = ceil(bb.width * pixelsPerPoint);
    height = ceil(bb.height * pixelsPerPoint);
    if (width <= 0 || height <= 0) return dps_status_failure;

    p = XCreatePixmap(DisplayOfScreen(screen), RootWindowOfScreen(screen),
		      width, height, depth);

    if (pixmap != NULL) *pixmap = p;
    if (pixelSize != NULL) {
       pixelSize->x = pixelSize->y = 0;
       pixelSize->width = width;
       pixelSize->height = height;
    }
    if (bbox != NULL) *bbox = bb;

    if (context != NULL) return dps_status_success;
    else return dps_status_no_extension;
}
开发者ID:aosm,项目名称:X11,代码行数:47,代码来源:XDPSpreview.c

示例12: XSync

void wxTopLevelWindowX11::DoGetPosition(int *x, int *y) const
{
    XSync(wxGlobalDisplay(), False);
    Window window = (Window) m_mainWindow;
    if (!window)
        return ;

    Display *display = wxGlobalDisplay();
    Window root = RootWindowOfScreen(DefaultScreenOfDisplay(display));
    Window parent_window = window,
        next_parent   = window;

    // search for the parent that is child of ROOT, because the WM may
    // reparent twice and notify only the next parent (like FVWM)
    while (next_parent != root) {
        Window *theChildren;
#if wxUSE_NANOX
        GR_COUNT n;
#else
        unsigned int n;
#endif
        parent_window = next_parent;
        XQueryTree(display, parent_window, &root,
            &next_parent, &theChildren, &n);
        XFree(theChildren); // not needed
    }
#if 0
    int xx, yy; unsigned int dummy;
    XGetGeometry(display, parent_window, &root,
                 &xx, &yy, &dummy, &dummy, &dummy, &dummy);
    if (x) *x = xx;
    if (y) *y = yy;
#else
    XWindowAttributes attr;
    Status status = XGetWindowAttributes( wxGlobalDisplay(), parent_window, & attr);
    if (status)
    {
        if (x) *x = attr.x;
        if (y) *y = attr.y;
    }
    else
    {
        if (x) *x = 0;
        if (y) *y = 0;
    }
#endif
}
开发者ID:chromylei,项目名称:third_party,代码行数:47,代码来源:toplevel.cpp

示例13: move_resize_window

void
move_resize_window (WnckWindow *win,
		    int	       direction,
		    decor_event *gtkwd_event)
{
    Display    *xdisplay;
    GdkDisplay *gdkdisplay;
    GdkScreen  *screen;
    Window     xroot;
    XEvent     ev;

    gdkdisplay = gdk_display_get_default ();
    xdisplay   = GDK_DISPLAY_XDISPLAY (gdkdisplay);
    screen     = gdk_display_get_default_screen (gdkdisplay);
    xroot      = RootWindowOfScreen (gdk_x11_screen_get_xscreen (screen));

    if (action_menu_mapped)
    {
	gtk_object_destroy (GTK_OBJECT (action_menu));
	return;
    }

    ev.xclient.type    = ClientMessage;
    ev.xclient.display = xdisplay;

    ev.xclient.serial	  = 0;
    ev.xclient.send_event = TRUE;

    ev.xclient.window	    = wnck_window_get_xid (win);
    ev.xclient.message_type = wm_move_resize_atom;
    ev.xclient.format	    = 32;

    ev.xclient.data.l[0] = gtkwd_event->x_root;
    ev.xclient.data.l[1] = gtkwd_event->y_root;
    ev.xclient.data.l[2] = direction;
    ev.xclient.data.l[3] = gtkwd_event->button;
    ev.xclient.data.l[4] = 1;

    XUngrabPointer (xdisplay, gtkwd_event->time);
    XUngrabKeyboard (xdisplay, gtkwd_event->time);

    XSendEvent (xdisplay, xroot, FALSE,
		SubstructureRedirectMask | SubstructureNotifyMask,
		&ev);

    XSync (xdisplay, FALSE);
}
开发者ID:Jubei-Mitsuyoshi,项目名称:aaa-compiz,代码行数:47,代码来源:events.c

示例14: wxGlobalDisplay

// Wait for an appropriate window to be created.
// If exactMatch is FALSE, a substring match is OK.
// If windowName is empty, then wait for the next overrideRedirect window.
bool wxReparenter::WaitAndReparent(wxWindow* newParent, wxAdoptedWindow* toReparent,
                                   const wxString& windowName,
                                   bool exactMatch)
{
    sm_newParent = newParent;
    sm_toReparent = toReparent;
    sm_exactMatch = exactMatch;
    sm_name = windowName;
    
    Display* display = wxGlobalDisplay();
    XSelectInput(display,
        RootWindowOfScreen(DefaultScreenOfDisplay(display)),
        SubstructureNotifyMask);

    if (!WM_STATE)
        WM_STATE = XInternAtom(display, "WM_STATE", False);

#ifdef __WXDEBUG__
    if (!windowName.IsEmpty())
        wxLogDebug(_T("Waiting for window %s"), windowName.c_str());
#endif
    
    sm_done = FALSE;

    wxEventLoop eventLoop;
    while (!sm_done)
    {
        if (eventLoop.Pending())
        {
            XEvent xevent;
            XNextEvent(display, & xevent);
            if (!wxTheApp->ProcessXEvent((WXEvent*) & xevent))
            {
                // Do the local event processing
                ProcessXEvent((WXEvent*) & xevent);
            }
        }
        else
        {
#if wxUSE_TIMER
            wxTimer::NotifyTimers();
            wxTheApp->ProcessIdle();
#endif
        }
    }
    return TRUE;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:50,代码来源:reparent.cpp

示例15: CreatePixmap

static Drawable
CreatePixmap(Screen *screen, const gfxIntSize& size, unsigned int depth,
             Drawable relatedDrawable)
{
    if (!gfxASurface::CheckSurfaceSize(size, XLIB_IMAGE_SIDE_SIZE_LIMIT))
        return None;

    if (relatedDrawable == None) {
        relatedDrawable = RootWindowOfScreen(screen);
    }
    Display *dpy = DisplayOfScreen(screen);
    // X gives us a fatal error if we try to create a pixmap of width
    // or height 0
    return XCreatePixmap(dpy, relatedDrawable,
                         NS_MAX(1, size.width), NS_MAX(1, size.height),
                         depth);
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:17,代码来源:gfxXlibSurface.cpp


注:本文中的RootWindowOfScreen函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。