您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DisplayWidth函数代码示例

51自学网 2021-06-01 20:28:26
  C++
这篇教程C++ DisplayWidth函数代码示例写得很实用,希望能帮到您。

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

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

示例1: main

int main(int argc,char *argv[]) { XSetWindowAttributes xswa; XWindowAttributes wattr; char *displayname = NULL; unsigned long mask = 0; Display *dpy; Window root; Window win; GC mgc; Visual vis; int c; int x1     = 0; int y1     = 0; int depth; int width  = 0; int height = 0; Pixmap bg; // get options... // --------------- while (1) {  int option_index = 0;  static struct option long_options[] =  {   {"display"    , 1 , 0 , 'd'},   {"x1"         , 1 , 0 , 'x'},   {"y1"         , 1 , 0 , 'y'},   {"width"      , 1 , 0 , 'w'},   {"height"     , 1 , 0 , 'e'},   {"help"       , 0 , 0 , 'h'},   {0            , 0 , 0 , 0  }  };  c = getopt_long (argc, argv, "hd:x:y:w:e:",long_options, &option_index);  if (c == -1)   break;  switch (c) {    case 0:     break;    case 'h':     usage();    case 'd':     displayname = (char*)malloc(80*sizeof(char));     strcpy(displayname,optarg);     break;    case 'x':     x1 = atoi(optarg);     break;    case 'y':     y1 = atoi(optarg);     break;    case 'w':     width = atoi(optarg);     break;    case 'e':     height = atoi(optarg);     break;    default:     /*fprintf (stderr,"?? getopt returned character code 0%o ??/n", c);*/     usage();     exit(1);  } } // open display... // ----------------- dpy = XOpenDisplay (displayname); if (!dpy) {  fprintf (stderr, "unable to open display %s/n", XDisplayName(displayname));  exit (1); } // get screen dimensions... // -------------------------- if (width <= 0) {  width = DisplayWidth(dpy,XDefaultScreen(dpy)); } if (height <= 0) {  height = DisplayHeight(dpy,XDefaultScreen(dpy)); } // get root window and default context // ------------------------------------ root  = RootWindow  (dpy,XDefaultScreen(dpy)); mgc   = DefaultGC   (dpy,XDefaultScreen(dpy)); depth = DefaultDepth(dpy,XDefaultScreen(dpy)); xswa.event_mask        = EnterWindowMask |   LeaveWindowMask         |   ExposureMask            |   VisibilityChangeMask    |   StructureNotifyMask     | //.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:sax-svn,代码行数:101,


示例2: main

	int main(int argc, char **argv)	{		static char *string = "Hello World!";		Display *display;		int screen_num;		Window win;			//窗口ID		unsigned int width, height;	//窗口尺寸		unsigned int border_width = 4;	//边界空白		unsigned int display_width, display_height;//屏幕尺寸		int count;		XEvent report;		GC gc;		unsigned long valuemask = 0;		XGCValues values;		char *display_name = NULL;			// 和X 服务器连接		if ( (display=XOpenDisplay(display_name)) == NULL )		{			printf("Cannot connect to X server %s/n", 					XDisplayName(display_name));			exit(-1);		}		//获得缺省的 screen_num		screen_num = DefaultScreen(display);		//获得屏幕的宽度和高度		display_width = DisplayWidth(display, screen_num);		display_height = DisplayHeight(display, screen_num);			//指定所建立窗口的宽度和高度		width = display_width/3;		height = display_height/4;			//建立窗口		win = XCreateSimpleWindow(display, 	//display			RootWindow(display,screen_num), //父窗口			0, 0, width, height, 		//位置和大小			border_width, 			//边界宽度			BlackPixel(display,screen_num), //前景色			WhitePixel(display,screen_num));//背景色			//选择窗口感兴趣的事件掩码		XSelectInput(display, win, 			ExposureMask | KeyPressMask | 			ButtonPressMask | StructureNotifyMask);		//建立GC		gc = XCreateGC(display, win, valuemask, &values);		//显示窗口		XMapWindow(display, win);		//进入事件循环		while (1)  {			//取得队列中的事件			XNextEvent(display, &report);			switch  (report.type) {			//曝光事件, 窗口应重绘			case Expose:				//取得最后一个曝光事件				if (report.xexpose.count != 0) break;					//写字符串				XDrawString(display, win, gc, width/2,height/2,					string, strlen(string));					break;			//窗口尺寸改变, 重新取得窗口的宽度和高度			case ConfigureNotify:				width = report.xconfigure.width;				height = report.xconfigure.height;				break;			//鼠标点击或有按键, 释放资源则退出			case ButtonPress:			case KeyPress:				XFreeGC(display, gc);				XCloseDisplay(display);				exit(1);			default:								break;			}		}	}
开发者ID:alannet,项目名称:example,代码行数:90,


示例3: _glfwSetVideoModeMODE

void _glfwSetVideoModeMODE(int screen, int mode, int rate){    if (_glfwLibrary.X11.RandR.available)    {#if defined(_GLFW_HAS_XRANDR)        XRRScreenConfiguration* sc;        Window root;        root = RootWindow(_glfwLibrary.X11.display, screen);        sc   = XRRGetScreenInfo(_glfwLibrary.X11.display, root);        // Remember old size and flag that we have changed the mode        if (!_glfwLibrary.X11.FS.modeChanged)        {            _glfwLibrary.X11.FS.oldSizeID = XRRConfigCurrentConfiguration(sc, &_glfwLibrary.X11.FS.oldRotation);            _glfwLibrary.X11.FS.oldWidth  = DisplayWidth(_glfwLibrary.X11.display, screen);            _glfwLibrary.X11.FS.oldHeight = DisplayHeight(_glfwLibrary.X11.display, screen);            _glfwLibrary.X11.FS.modeChanged = GL_TRUE;        }        if (rate > 0)        {            // Set desired configuration            XRRSetScreenConfigAndRate(_glfwLibrary.X11.display,                                      sc,                                      root,                                      mode,                                      RR_Rotate_0,                                      (short) rate,                                      CurrentTime);        }        else        {            // Set desired configuration            XRRSetScreenConfig(_glfwLibrary.X11.display,                               sc,                               root,                               mode,                               RR_Rotate_0,                               CurrentTime);        }        XRRFreeScreenConfigInfo(sc);#endif /*_GLFW_HAS_XRANDR*/    }    else if (_glfwLibrary.X11.VidMode.available)    {#if defined(_GLFW_HAS_XF86VIDMODE)        XF86VidModeModeInfo **modelist;        int modecount;        // Get a list of all available display modes        XF86VidModeGetAllModeLines(_glfwLibrary.X11.display, screen,                                   &modecount, &modelist);        // Unlock mode switch if necessary        if (_glfwLibrary.X11.FS.modeChanged)            XF86VidModeLockModeSwitch(_glfwLibrary.X11.display, screen, 0);        // Change the video mode to the desired mode        XF86VidModeSwitchToMode(_glfwLibrary.X11.display, screen, modelist[mode]);        // Set viewport to upper left corner (where our window will be)        XF86VidModeSetViewPort(_glfwLibrary.X11.display, screen, 0, 0);        // Lock mode switch        XF86VidModeLockModeSwitch(_glfwLibrary.X11.display, screen, 1);        // Remember old mode and flag that we have changed the mode        if (!_glfwLibrary.X11.FS.modeChanged)        {            _glfwLibrary.X11.FS.oldMode = *modelist[0];            _glfwLibrary.X11.FS.modeChanged = GL_TRUE;        }        XFree(modelist);#endif /*_GLFW_HAS_XF86VIDMODE*/    }}
开发者ID:dalfy,项目名称:glfw,代码行数:80,


示例4: main

intmain(int argc, char *argv[]){	bool fast = false;	int i;	for (i = 1; i < argc; i++)		/* these options take no arguments */		if (!strcmp(argv[i], "-v")) {      /* prints version information */			puts("dmenu-"VERSION);			exit(0);		} else if (!strcmp(argv[i], "-b")) /* appears at the bottom of the screen */			topbar = false;		else if (!strcmp(argv[i], "-f"))   /* grabs keyboard before reading stdin */			fast = true;		else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */			fstrncmp = strncasecmp;			fstrstr = cistrstr;		} else if (i + 1 == argc)			usage();		/* these options take one argument */		else if (!strcmp(argv[i], "-l"))   /* number of lines in vertical list */			lines = atoi(argv[++i]);		else if (!strcmp(argv[i], "-m"))			mon = atoi(argv[++i]);		else if (!strcmp(argv[i], "-p"))   /* adds prompt to left of input field */			prompt = argv[++i];		else if (!strcmp(argv[i], "-fn"))  /* font or font set */			fonts[0] = argv[++i];		else if (!strcmp(argv[i], "-nb"))  /* normal background color */			normbgcolor = argv[++i];		else if (!strcmp(argv[i], "-nf"))  /* normal foreground color */			normfgcolor = argv[++i];		else if (!strcmp(argv[i], "-sb"))  /* selected background color */			selbgcolor = argv[++i];		else if (!strcmp(argv[i], "-sf"))  /* selected foreground color */			selfgcolor = argv[++i];		else			usage();	if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())		fputs("warning: no locale support/n", stderr);	if (!(dpy = XOpenDisplay(NULL)))		die("cannot open display/n");	screen = DefaultScreen(dpy);	root = RootWindow(dpy, screen);	sw = DisplayWidth(dpy, screen);	sh = DisplayHeight(dpy, screen);	drw = drw_create(dpy, screen, root, sw, sh);	drw_load_fonts(drw, fonts, LENGTH(fonts));	if (!drw->fontcount)		die("no fonts could be loaded./n");	drw_setscheme(drw, &scheme[SchemeNorm]);	if (fast) {		grabkeyboard();		readstdin();	} else {		readstdin();		grabkeyboard();	}	setup();	run();	return 1; /* unreachable */}
开发者ID:temochka,项目名称:dmenu,代码行数:66,


示例5: getFTFace

gintnsFreeTypeXImage::DrawString(nsRenderingContextGTK* aContext,                            nsDrawingSurfaceGTK* aSurface, nscoord aX,                            nscoord aY, const PRUnichar* aString,                            PRUint32 aLength){#if DEBUG_SHOW_GLYPH_BOX  PRUint32 x, y;  // grey shows image size  // red shows character cells  // green box shows text ink#endif  if (aLength < 1) {    return 0;  }  // get the face/size from the FreeType cache  FT_Face face = getFTFace();  NS_ASSERTION(face, "failed to get face/size");  if (!face)    return 0;  nsresult rslt;  PRInt32 leftBearing, rightBearing, ascent, descent, width;  rslt = doGetBoundingMetrics(aString, aLength, &leftBearing, &rightBearing,                              &ascent, &descent, &width);  if (NS_FAILED(rslt))    return 0;  // make sure we bring down enough background for blending  rightBearing = PR_MAX(rightBearing, width+1);  // offset in the ximage to the x origin  PRInt32 x_origin = PR_MAX(0, -leftBearing);  // offset in the ximage to the x origin  PRInt32 y_origin = ascent;  PRInt32 x_pos = x_origin;  int image_width  = x_origin + rightBearing;  int image_height = y_origin + PR_MAX(descent, 0);  if ((image_width<=0) || (image_height<=0)) {    // if we do not have any pixels then no point in trying to draw    // eg: the space char has 0 height    NS_ASSERTION(width>=0, "Negative width");    return width;  }  Display *dpy = GDK_DISPLAY();  Drawable win = GDK_WINDOW_XWINDOW(aSurface->GetDrawable());  GC gc = GDK_GC_XGC(aContext->GetGC());  XGCValues values;  if (!XGetGCValues(dpy, gc, GCForeground, &values)) {    NS_ERROR("failed to get foreground pixel");    return 0;  }  nscolor color = nsX11AlphaBlend::PixelToNSColor(values.foreground);#if DEBUG_SHOW_GLYPH_BOX  // show X/Y origin  XDrawLine(dpy, win, DefaultGC(dpy, 0), aX-2, aY, aX+2, aY);  XDrawLine(dpy, win, DefaultGC(dpy, 0), aX, aY-2, aX, aY+2);  // show width  XDrawLine(dpy, win, DefaultGC(dpy, 0), aX-x_origin,  aY-y_origin-2,                                         aX+rightBearing, aY-y_origin-2);#endif  //  // Get the background  //  XImage *sub_image = nsX11AlphaBlend::GetBackground(dpy, DefaultScreen(dpy),                                 win, aX-x_origin, aY-y_origin,                                 image_width, image_height);  if (sub_image==nsnull) {#ifdef DEBUG    int screen = DefaultScreen(dpy);    // complain if the requested area is not completely off screen    int win_width = DisplayWidth(dpy, screen);    int win_height = DisplayHeight(dpy, screen);    if (((int)(aX-leftBearing+image_width) > 0)  // not hidden to left        && ((int)(aX-leftBearing) < win_width)   // not hidden to right        && ((int)(aY-ascent+image_height) > 0)// not hidden to top        && ((int)(aY-ascent) < win_height))   // not hidden to bottom    {      NS_ASSERTION(sub_image, "failed to get the image");    }#endif    return 0;  }#if DEBUG_SHOW_GLYPH_BOX  DEBUG_AADRAWBOX(sub_image,0,0,image_width,image_height,0,0,0,255/4);  nscolor black NS_RGB(0,255,0);  blendPixel blendPixelFunc = nsX11AlphaBlend::GetBlendPixel();  // x origin  for (x=0; x<(unsigned int)image_height; x++)    if (x%4==0) (*blendPixelFunc)(sub_image, x_origin, x, black, 255/2);  // y origin  for (y=0; y<(unsigned int)image_width; y++)    if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);//.........这里部分代码省略.........
开发者ID:rn10950,项目名称:RetroZilla,代码行数:101,


示例6: main

int main(int argc, char* argv[]){	Display *dpy = NULL;	ASVisual *asv ;	int screen = 0, depth = 0;	int dummy, geom_flags = 0;	unsigned int to_width, to_height ;	ASGradient grad ;	ASGradient default_grad = { 1, 11, &(default_colors[0]), 									   &(default_offsets[0])} ;	ASImage *grad_im = NULL;	/* see ASView.1 : */	set_application_name( argv[0] );#if (HAVE_AFTERBASE_FLAG==1)	set_output_threshold(OUTPUT_LEVEL_DEBUG);#endif	if( argc > 1 )	{	    if( strcmp( argv[1], "-h") == 0 )	    {			usage();			return 0;		}	    /* see ASScale.1 : */	    geom_flags = XParseGeometry( argv[1], &dummy, &dummy,		                             &to_width, &to_height );	}else		usage();	memset( &grad, 0x00, sizeof(ASGradient));#ifndef X_DISPLAY_MISSING    dpy = XOpenDisplay(NULL);	_XA_WM_DELETE_WINDOW = XInternAtom( dpy, "WM_DELETE_WINDOW", False);	screen = DefaultScreen(dpy);	depth = DefaultDepth( dpy, screen );#endif	if( argc >= 5 )	{		int i = 2;		/* see ASGrad.1 : */		grad.type = atoi( argv[2] );		grad.npoints = 0 ;		grad.color = safemalloc( ((argc-2)/2)*sizeof(ARGB32));		grad.offset = safemalloc( ((argc-2)/2)*sizeof(double));		while( ++i < argc )		{			if( grad.npoints > 0 )			{				if( i == argc-1 )					grad.offset[grad.npoints] = 1.0;				else					grad.offset[grad.npoints] = atof( argv[i] );				++i ;			}			/* see ASTile.1 : */			if( parse_argb_color( argv[i], &(grad.color[grad.npoints])) 				!= argv[i] )				if( grad.offset[grad.npoints] >= 0. && 					grad.offset[grad.npoints]<= 1.0 )					grad.npoints++ ;		}	}else	{		grad = default_grad ;		if( argc >= 3 )			grad.type = atoi( argv[2] );	}	if( grad.npoints <= 0 )	{		show_error( " not enough gradient points specified.");		return 1;	}	/* Making sure tiling geometry is sane : */#ifndef X_DISPLAY_MISSING	if( !get_flags(geom_flags, WidthValue ) )		to_width  = DisplayWidth(dpy, screen)*2/3 ;	if( !get_flags(geom_flags, HeightValue ) )		to_height = DisplayHeight(dpy, screen)*2/3 ;#else	if( !get_flags(geom_flags, WidthValue ) )		to_width  = 500 ;	if( !get_flags(geom_flags, HeightValue ) )		to_height = 500 ;#endif	printf( "%s: rendering gradient of type %d to %dx%d/n",			get_application_name(), grad.type&GRADIENT_TYPE_MASK, 			to_width, to_height );	/* see ASView.3 : */	asv = create_asvisual( dpy, screen, depth, NULL );	/* see ASGrad.2 : */	grad_im = make_gradient( asv, &grad, to_width, to_height,	        	             SCL_DO_ALL,#ifndef X_DISPLAY_MISSING//.........这里部分代码省略.........
开发者ID:Remmy,项目名称:afterstep,代码行数:101,


示例7: getNativeDisplay

    X11EGLSupport::X11EGLSupport()    {    mNativeDisplay = getNativeDisplay();        mGLDisplay = getGLDisplay();        int dummy;        if (XQueryExtension((Display*)mNativeDisplay, "RANDR", &dummy, &dummy, &dummy))        {            XRRScreenConfiguration *screenConfig;            mRandr = true;            screenConfig = XRRGetScreenInfo((Display*)mNativeDisplay, DefaultRootWindow((Display*)mNativeDisplay));            if (screenConfig)            {                XRRScreenSize *screenSizes;                int nSizes = 0;                Rotation currentRotation;                int currentSizeID = XRRConfigCurrentConfiguration(screenConfig, &currentRotation);                screenSizes = XRRConfigSizes(screenConfig, &nSizes);                mCurrentMode.first.first = screenSizes[currentSizeID].width;                mCurrentMode.first.second = screenSizes[currentSizeID].height;                mCurrentMode.second = XRRConfigCurrentRate(screenConfig);                mOriginalMode = mCurrentMode;                for (int sizeID = 0; sizeID < nSizes; sizeID++)                {                    short *rates;                    int nRates = 0;                    rates = XRRConfigRates(screenConfig, sizeID, &nRates);                    for (int rate = 0; rate < nRates; rate++)                    {                        VideoMode mode;                        mode.first.first = screenSizes[sizeID].width;                        mode.first.second = screenSizes[sizeID].height;                        mode.second = rates[rate];                        mVideoModes.push_back(mode);                    }                }                XRRFreeScreenConfigInfo(screenConfig);            }        }        else        {            mCurrentMode.first.first = DisplayWidth((Display*)mNativeDisplay, DefaultScreen(mNativeDisplay));            mCurrentMode.first.second = DisplayHeight((Display*)mNativeDisplay, DefaultScreen(mNativeDisplay));            mCurrentMode.second = 0;            mOriginalMode = mCurrentMode;            mVideoModes.push_back(mCurrentMode);        }        EGLConfig *glConfigs;        int config, nConfigs = 0;        glConfigs = chooseGLConfig(NULL, &nConfigs);        for (config = 0; config < nConfigs; config++)        {            int caveat, samples;            getGLConfigAttrib(glConfigs[config], EGL_CONFIG_CAVEAT, &caveat);            if (caveat != EGL_SLOW_CONFIG)            {                getGLConfigAttrib(glConfigs[config], EGL_SAMPLES, &samples);                mSampleLevels.push_back(StringConverter::toString(samples));            }        }        free(glConfigs);        removeDuplicates(mSampleLevels);    }
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:78,


示例8: init_geom

static int init_geom(client_t *c, strut_t *s){    Atom win_type, state;    int screen_x = DisplayWidth(dpy, screen);    int screen_y = DisplayHeight(dpy, screen);    int wmax = screen_x - s->left - s->right;    int hmax = screen_y - s->top - s->bottom;    int mouse_x, mouse_y;    /* We decide the geometry for these types of windows, so we can just     * ignore everything and return right away. If c->zoomed is set, that     * means we've already set things up, but otherwise, we do it here. */    if (c->zoomed)        return 1;    if (get_atoms(c->win, net_wm_state, XA_ATOM, 0, &state, 1, NULL) &&            state == net_wm_state_fs) {        c->geom.x = 0;        c->geom.y = 0;        c->geom.w = screen_x;        c->geom.h = screen_y;        return 1;    }    /* Here, we merely set the values; they're in the same place regardless     * of whether the user or the program specified them. We'll distinguish     * between the two cases later, if we need to. */    if (c->size.flags & (USSize|PSize)) {        if (c->size.width > 0) c->geom.w = c->size.width;        if (c->size.height > 0) c->geom.h = c->size.height;    }    if (c->size.flags & (USPosition|PPosition)) {        if (c->size.x > 0) c->geom.x = c->size.x;        if (c->size.y > 0) c->geom.y = c->size.y;    }    /* Several types of windows can put themselves wherever they want, but we     * need to read the size hints to get that position before returning. */    if (get_atoms(c->win, net_wm_wintype, XA_ATOM, 0, &win_type, 1, NULL) &&            CAN_PLACE_SELF(win_type))        return 1;    /* At this point, maybe nothing was set, or something went horribly wrong     * and the values are garbage. So, make a guess, based on the pointer. */    if (c->geom.x <= 0 && c->geom.y <= 0) {        get_pointer(&mouse_x, &mouse_y);        recalc_map(c, c->geom, mouse_x, mouse_y, mouse_x, mouse_y, s);    }    /* In any case, if we got this far, we need to do a further sanity check     * and make sure that the window isn't overlapping any struts -- except     * for transients, because they might be a panel-type client popping up a     * notification window over themselves. */    if (!c->trans) {        if (c->geom.x + c->geom.w > screen_x - s->right)            c->geom.x = screen_x - s->right - c->geom.w;        if (c->geom.y + c->geom.h > screen_y - s->bottom)            c->geom.y = screen_y - s->bottom - c->geom.h;        if (c->geom.x < s->left || c->geom.w > wmax)            c->geom.x = s->left;        if (c->geom.y < s->top || c->geom.h > hmax)            c->geom.y = s->top;    }    /* Finally, we decide if we were ultimately satisfied with the position     * given, or if we had to make something up, so that the caller can     * consider using some other method. */    return c->trans || c->size.flags & USPosition;}
开发者ID:joshuaeckroth,项目名称:aewmx,代码行数:68,


示例9: gst_gl_window_new

/* Must be called in the gl thread */GstGLWindow *gst_gl_window_new (gulong external_gl_context){  GstGLWindow *window = g_object_new (GST_GL_TYPE_WINDOW, NULL);  GstGLWindowPrivate *priv = window->priv;  EGLint config_attrib[] = {    EGL_SURFACE_TYPE, EGL_WINDOW_BIT,    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,    EGL_DEPTH_SIZE, 16,    EGL_NONE  };  EGLint context_attrib[] = {    EGL_CONTEXT_CLIENT_VERSION, 2,    EGL_NONE  };  EGLint majorVersion;  EGLint minorVersion;  EGLint numConfigs;  EGLConfig config;  XSetWindowAttributes win_attr;  XTextProperty text_property;  XWMHints wm_hints;  unsigned long mask;  const gchar *title = "OpenGL renderer";  Atom wm_atoms[3];  static gint x = 0;  static gint y = 0;  setlocale (LC_NUMERIC, "C");  priv->x_lock = g_mutex_new ();  priv->cond_send_message = g_cond_new ();  priv->running = TRUE;  priv->visible = FALSE;  priv->parent = 0;  priv->allow_extra_expose_events = TRUE;  g_mutex_lock (priv->x_lock);  priv->device = XOpenDisplay (priv->display_name);  XSynchronize (priv->device, FALSE);  g_debug ("gl device id: %ld/n", (gulong) priv->device);  priv->disp_send = XOpenDisplay (priv->display_name);  XSynchronize (priv->disp_send, FALSE);  g_debug ("gl display sender: %ld/n", (gulong) priv->disp_send);  priv->screen_num = DefaultScreen (priv->device);  priv->root = RootWindow (priv->device, priv->screen_num);  priv->depth = DefaultDepth (priv->device, priv->screen_num);  g_debug ("gl root id: %lud/n", (gulong) priv->root);  priv->device_width = DisplayWidth (priv->device, priv->screen_num);  priv->device_height = DisplayHeight (priv->device, priv->screen_num);  priv->visual_info = g_new0 (XVisualInfo, 1);  XMatchVisualInfo (priv->device, priv->screen_num, priv->depth, TrueColor,      priv->visual_info);  win_attr.event_mask =      StructureNotifyMask | ExposureMask | VisibilityChangeMask;  win_attr.do_not_propagate_mask = NoEventMask;  win_attr.background_pixmap = None;  win_attr.background_pixel = 0;  win_attr.border_pixel = 0;  win_attr.colormap =      XCreateColormap (priv->device, priv->root, priv->visual_info->visual,      AllocNone);  mask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask;  x += 20;  y += 20;  priv->internal_win_id = XCreateWindow (priv->device, priv->root, x, y,      1, 1, 0, priv->visual_info->depth, InputOutput,      priv->visual_info->visual, mask, &win_attr);  XSync (priv->device, FALSE);  XSetWindowBackgroundPixmap (priv->device, priv->internal_win_id, None);  g_debug ("gl window id: %lud/n", (gulong) priv->internal_win_id);  g_debug ("gl window props: x:%d y:%d/n", x, y);  wm_atoms[0] = XInternAtom (priv->device, "WM_DELETE_WINDOW", True);//.........这里部分代码省略.........
开发者ID:ChinnaSuhas,项目名称:ossbuild,代码行数:101,


示例10: get_current_screen_size

万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。