本文整理汇总了C++中DefaultDepthOfScreen函数的典型用法代码示例。如果您正苦于以下问题:C++ DefaultDepthOfScreen函数的具体用法?C++ DefaultDepthOfScreen怎么用?C++ DefaultDepthOfScreen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DefaultDepthOfScreen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MSPixmapData
void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,
const char *bitmapFile_,unsigned long fg_,unsigned long bg_)
{
Display *display=pServer_->display();
Window window=pServer_->root();
int depth=DefaultDepthOfScreen(pServer_->screen());
unsigned w,h;
Pixmap bitmap;
#ifdef MS_WINDOWS
int res;
if (bitmapFile_==0) res=MSXReadBitmapFromResource(display,window,_name,&w,&h,&bitmap);
else res=MSXReadBitmapFromXbmFile(display,window,bitmapFile_,&w,&h,&bitmap,fg_,bg_,depth);
if( res==BitmapSuccess)
{
_pData=new MSPixmapData(pServer_,pName_,bitmap,w,h,depth,fg_,bg_);
#else
if (XReadBitmapFile(display,window,bitmapFile_,&w,&h,&bitmap,0,0)==BitmapSuccess)
{
Pixmap pixmap=XCreatePixmap(display,window,w,h,depth);
GC gc=XCreateGC(display,window,0,0);
XSetForeground(display,gc,fg_);
XSetBackground(display,gc,bg_);
XCopyPlane(display,bitmap,pixmap,gc,0,0,w,h,0,0,1);
XFreeGC(display,gc);
XFreePixmap(display,bitmap);
_pData=new MSPixmapData(pServer_,pName_,pixmap,w,h,depth,fg_,bg_);
#endif
addToHashTable(pName_,(void *)_pData);
addReference();
}
else
{
// Can't read bitmap file, create one with background color
MSMessageLog::warningMessage("MSPixmap warning: Unable to create Pixmap from file %s\n",bitmapFile_);
char buf[255];
sprintf(buf,"Predefined_%s_%d_%d_%d_%d",MSPixmap::SolidBackgroundPixmap,fg_,bg_,depth,display);
if(copyPixmapDataWithKey(buf)==MSFalse)
create(pServer_,MSPixmap::SolidBackgroundPixmap,fg_,bg_);
}
}
void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,
int w_,int h_,unsigned long fg_,unsigned long bg_)
{
int dep=DefaultDepthOfScreen(pServer_->screen());
Pixmap p=XCreatePixmap(pServer_->display(),pServer_->root(),w_,h_,dep);
create(pServer_,pName_,p,w_,h_,dep,fg_,bg_);
}
示例2: x11_shadow_subsystem_base_init
int x11_shadow_subsystem_base_init(x11ShadowSubsystem* subsystem)
{
if (subsystem->display)
return 1; /* initialize once */
if (!getenv("DISPLAY"))
setenv("DISPLAY", ":0", 1);
if (!XInitThreads())
return -1;
subsystem->display = XOpenDisplay(NULL);
if (!subsystem->display)
{
WLog_ERR(TAG, "failed to open display: %s", XDisplayName(NULL));
return -1;
}
subsystem->xfds = ConnectionNumber(subsystem->display);
subsystem->number = DefaultScreen(subsystem->display);
subsystem->screen = ScreenOfDisplay(subsystem->display, subsystem->number);
subsystem->depth = DefaultDepthOfScreen(subsystem->screen);
subsystem->width = WidthOfScreen(subsystem->screen);
subsystem->height = HeightOfScreen(subsystem->screen);
subsystem->root_window = RootWindow(subsystem->display, subsystem->number);
return 1;
}
示例3: initPixmap
/* Create pixmap to store contents of drawing area; assumes MainCanvas has been setup already */
void initPixmap() {
/* create a pixmap the same size as the drawing area. */
pixmap = XCreatePixmap (XtDisplay(MainCanvas), RootWindowOfScreen (XtScreen (MainCanvas)),
width, height, DefaultDepthOfScreen (XtScreen(MainCanvas)));
/* clear pixmap with white */
XFillRectangle (XtDisplay (MainCanvas), pixmap, gc, 0, 0, width, height);
}
示例4: visual_info_from_widget
/* WIDGET is an Xt widget, VISUAL and DEPTH are return values */
void
visual_info_from_widget (Widget widget, Visual **visual, int *depth)
{
/* grab the visual and depth from the nearest shell ancestor */
Widget p = XtParent(widget);
*visual = CopyFromParent;
*depth = -1;
while (*visual == CopyFromParent && p)
{
if (XtIsShell(p))
{
*visual = ((ShellWidget)p)->shell.visual;
*depth = p->core.depth;
}
p = XtParent(p);
}
if (*visual == CopyFromParent || !*visual)
{
if (debug_colors > 1)
fprintf (stderr, "\nvisual_info_from_widget:"
" failed, using DefaultVisualOfScreen");
*visual = DefaultVisualOfScreen (XtScreen (widget));
*depth = DefaultDepthOfScreen (XtScreen (widget));
}
else if (debug_colors > 1)
fprintf (stderr, "\nvisual_info_from_widget: succeeded");
}
示例5: DisplayInfoSharedGC
static GC DisplayInfoSharedGC(DisplayInfo d, Screen *screen, int depth)
{
int s = XScreenNumberOfScreen(screen);
register int i;
XGCValues v;
Pixmap p;
if (s >= ScreenCount(DisplayOfScreen(screen))) return NULL;
for (i = 0; i < d->depthsForScreen[s] &&
d->validDepths[s][i] != depth; i++) {}
if (i >= d->depthsForScreen[s]) return NULL;
if (d->gcForDepth[s][i] == 0) { /* Not "None" -- used calloc */
if (depth == DefaultDepthOfScreen(screen)) {
d->gcForDepth[s][i] = XCreateGC(d->display,
RootWindowOfScreen(screen), 0, &v);
} else {
p = XCreatePixmap(d->display,
RootWindowOfScreen(screen),
1, 1, depth);
d->gcForDepth[s][i] = XCreateGC(d->display, p, 0, &v);
XFreePixmap(d->display, p);
}
}
return d->gcForDepth[s][i];
}
示例6: XcodaCreatePixmapFromXpm
Pixmap XcodaCreatePixmapFromXpm(Widget parent,
const char** data,
int type)
{
Display *dpy = XtDisplay(parent);
Window win = XDefaultRootWindow(dpy);
Screen *scr = XDefaultScreenOfDisplay(dpy);
int depth = DefaultDepthOfScreen(scr);
Colormap cmap = DefaultColormapOfScreen(scr);
XpmAttributes attr;
unsigned int valuemask = 0;
int err;
/*unsigned int pixmap_ret, pixmap_mask;*/
Pixmap pixmap_ret, pixmap_mask;
XpmColorSymbol col_symbol[1];
Arg arg[5];
int ac = 0;
Pixel parent_bg;
if(type){ /* normal background for pixmap */
XtSetArg (arg[ac], XmNbackground, &parent_bg); ac++;
XtGetValues (parent, arg, ac);
ac = 0;
}
else{ /* inverted or highlighted pixmap */
XtSetArg (arg[ac], XmNforeground, &parent_bg); ac++;
XtGetValues (parent, arg, ac);
ac = 0;
}
col_symbol[0].name = (char *)NULL;
col_symbol[0].value = (char *)malloc((strlen("LightBlue")+1)*sizeof(char));
strcpy(col_symbol[0].value,"LightBlue");
col_symbol[0].pixel = parent_bg;
attr.colormap = cmap;
attr.depth = depth;
attr.colorsymbols = col_symbol;
attr.valuemask = valuemask;
attr.numsymbols = 1;
attr.closeness = 65536;
attr.valuemask |= XpmReturnPixels;
attr.valuemask |= XpmColormap;
attr.valuemask |= XpmColorSymbols;
attr.valuemask |= XpmDepth;
attr.valuemask |= XpmCloseness;
/*
printf("Calling XpmCreatePixmapFromData ...\n");
*/
err = XpmCreatePixmapFromData(dpy, win, (char **)data, &pixmap_ret, &pixmap_mask, &attr);
free (col_symbol[0].value);
if(err != XpmSuccess){
pixmap_ret = 0;
}
return pixmap_ret;
}
示例7: RollEnhanceCB
void
RollEnhanceCB ( Widget w, XtPointer client_data, XtPointer xt_call_data )
{
WindowObjectType *wo;
int cbank;
int scale;
int verbose;
XmScaleCallbackStruct *cbs =
(XmScaleCallbackStruct *) xt_call_data;
verbose = GetVerboseLevel();
wo = GetActiveWindowObject();
cbank = GetGempakColorBank( wo );
scale = cbs->value ;
if( verbose > VERBOSE_1 )
printf ("RollEnhanceCB - value: %d", cbs->value );
if ( cbank == -1 ) return;
RollColorEnhancement ( wo, cbank, scale );
if( DefaultDepthOfScreen(DefaultScreenOfDisplay(XtDisplay(w))) != 8 ) {
RefreshDisplay ( ); /* Necessary for > 8-bit displays to redraw
images with new pixel values reflecting
new read-only color table entries */
}
}
示例8: switch_to_best_mode
static void switch_to_best_mode (void)
{
Screen *scr = ScreenOfDisplay (display, screen);
int w = WidthOfScreen (scr);
int h = HeightOfScreen (scr);
int d = DefaultDepthOfScreen (scr);
#ifdef USE_VIDMODE_EXTENSION
int i, best;
if (vidmodeavail) {
best = 0;
for (i = 1; i < vidmodecount; i++) {
if (allmodes[i]->hdisplay >= current_width
&& allmodes[i]->vdisplay >= current_height
&& allmodes[i]->hdisplay <= allmodes[best]->hdisplay
&& allmodes[i]->vdisplay <= allmodes[best]->vdisplay)
best = i;
}
write_log ("entering DGA mode: %dx%d (%d, %d)\n",
allmodes[best]->hdisplay, allmodes[best]->vdisplay,
current_width, current_height);
XF86VidModeSwitchToMode (display, screen, allmodes[best]);
XF86VidModeSetViewPort (display, screen, 0, 0);
}
#endif
XMoveWindow (display, mywin, 0, 0);
XWarpPointer (display, None, rootwin, 0, 0, 0, 0, 0, 0);
XF86DGADirectVideo (display, screen, XF86DGADirectGraphics | XF86DGADirectMouse | XF86DGADirectKeyb);
XF86DGASetViewPort (display, screen, 0, 0);
memset (fb_addr, 0, (w * h) * (d / 8));
}
示例9: XmGetPixmap
/*
* A pixmap caching function that generates a pixmap, stores it in a pixmap
* cache and returns the pixmap.
*/
extern Pixmap
XmGetPixmap(Screen *screen, char *image_name,
Pixel foreground, Pixel background)
{
Pixmap p;
p = XmGetPixmapByDepth(screen, image_name, foreground, background,
DefaultDepthOfScreen(screen));
DEBUGOUT(_LtDebug(__FILE__, NULL,
"XmGetPixmap(%s, %d, %d) => 0x%x (depth %d)\n",
image_name, foreground, background, p,
DefaultDepthOfScreen(screen)));
return p;
}
示例10: create_window
Window create_window(Display *dsp, Screen *screen) {
Window window;
int x, y;
int width, height;
int depth;
XSetWindowAttributes winAttrib;
XWindowAttributes window_attributes;
x = 30;
y = 60;
width = 200;
height = 300;
winAttrib.background_pixel = BlackPixelOfScreen(screen);
winAttrib.border_pixel = WhitePixelOfScreen(screen);
winAttrib.backing_store = Always/*NotUseful*/;
winAttrib.override_redirect = False;
winAttrib.bit_gravity = NorthWestGravity;
winAttrib.win_gravity = NorthWestGravity;
depth = DefaultDepthOfScreen(screen);
if (XGetWindowAttributes(dsp, RootWindowOfScreen(screen), &window_attributes) == 0)
{
fprintf(stderr, "xf_get_pixmap_info: XGetWindowAttributes failed\n");
return 1;
}
window = XCreateWindow(dsp, RootWindowOfScreen(screen),
x, y,
width, height,
0,
depth,
InputOutput, /*window_attributes.visual*/DefaultVisual(dsp, 0),
0, &winAttrib);
setWindowDecorations(dsp, window, 0); //设置后没有Ubuntu自带的关闭、最小和最大这三个键
return window;
}
示例11: FadeScaleCB
void
FadeScaleCB (Widget w, XtPointer client_data, XtPointer xt_call_data )
{
WindowObjectType *wo;
int cbank;
int scale;
int fadeWid;
int verbose;
GuiImageEnhanceDialogType *img;
Widget fadeW = NULL;
XmScaleCallbackStruct *cbs =
(XmScaleCallbackStruct *) xt_call_data;
fadeWid = (int) client_data;
verbose = GetVerboseLevel();
wo = GetActiveWindowObject();
/*
* Get Gempak Color bank number.
* -1 no image loaded
* 1 satellite
* 2 nids/nowrad
*/
cbank = GetGempakColorBank( wo );
scale = cbs->value ;
if( verbose > VERBOSE_1 )
printf ("FadeScaleCB - value: %d\n", cbs->value );
if ( cbank == -1 ) return;
ChangeImageBrightness ( wo, cbank, scale );
if( DefaultDepthOfScreen(DefaultScreenOfDisplay(XtDisplay(w))) != 8 ) {
RefreshDisplay ( ); /* Necessary for > 8-bit displays to redraw
images with new pixel values reflecting
new read-only color table entries */
}
/*
* Synchronize the fade slider controls. Set the one who did NOT
* call this routine.
*/
img = GetGuiImageEnhanceDialog();
if ( fadeWid == MAIN_CONTROL_FADER )
fadeW = GetSatImageFadeScaleW ( img );
else if ( fadeWid == ENHANCE_POPUP_FADER )
fadeW = GetImageFadeScaleW ( img );
if( fadeW ) XtVaSetValues ( fadeW, XmNvalue, scale, NULL );
}
示例12: xf_pre_connect
boolean xf_pre_connect(freerdp* instance)
{
xfInfo* xfi;
rdpSettings* settings;
xfi = (xfInfo*) xzalloc(sizeof(xfInfo));
SET_XFI(instance, xfi);
xfi->instance = instance;
settings = instance->settings;
settings->order_support[NEG_DSTBLT_INDEX] = True;
settings->order_support[NEG_PATBLT_INDEX] = True;
settings->order_support[NEG_SCRBLT_INDEX] = True;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = True;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = False;
settings->order_support[NEG_MULTIPATBLT_INDEX] = False;
settings->order_support[NEG_MULTISCRBLT_INDEX] = False;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = True;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_LINETO_INDEX] = True;
settings->order_support[NEG_POLYLINE_INDEX] = True;
settings->order_support[NEG_MEMBLT_INDEX] = True;
settings->order_support[NEG_MEM3BLT_INDEX] = False;
settings->order_support[NEG_SAVEBITMAP_INDEX] = True;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_GLYPH_INDEX] = True;
settings->order_support[NEG_POLYGON_SC_INDEX] = False;
settings->order_support[NEG_POLYGON_CB_INDEX] = False;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = False;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = False;
freerdp_chanman_pre_connect(GET_CHANMAN(instance), instance);
xfi->display = XOpenDisplay(NULL);
if (xfi->display == NULL)
{
printf("xf_pre_connect: failed to open display: %s\n", XDisplayName(NULL));
return False;
}
xf_kbd_init(xfi);
xfi->xfds = ConnectionNumber(xfi->display);
xfi->screen_number = DefaultScreen(xfi->display);
xfi->screen = ScreenOfDisplay(xfi->display, xfi->screen_number);
xfi->depth = DefaultDepthOfScreen(xfi->screen);
xfi->big_endian = (ImageByteOrder(xfi->display) == MSBFirst);
xfi->decoration = True;
xfi->mouse_motion = True;
return True;
}
示例13: _name
MSPixmap::MSPixmap(MSDisplayServer *pServer_,const char *pName_,unsigned long fg_,unsigned long bg_)
: _name(pName_)
{
char buf[255];
MSGUARD(_hashTableMutex);
init();
sprintf(buf,"Predefined_%s_%d_%d_%d_%d",pName_,
fg_,bg_,DefaultDepthOfScreen(pServer_->screen()),pServer_->display());
if(copyPixmapDataWithKey(buf)==MSFalse) create(pServer_,pName_,fg_,bg_);
}
示例14: create
void MSPixmap::create(MSDisplayServer *pServer_,const char *pName_,const char *bitmap_,
int w_,int h_,unsigned long fg_,unsigned long bg_)
{
int dep=DefaultDepthOfScreen(pServer_->screen());
Pixmap p=XCreatePixmapFromBitmapData(pServer_->display(),pServer_->root(),(char*)bitmap_,
w_,h_,fg_,bg_,dep);
_pData=new MSPixmapData(pServer_,pName_,p,w_,h_,dep,fg_,bg_);
addToHashTable(pName_,(void *)_pData);
addReference();
}
示例15: SatEnhancementCB
void
SatEnhancementCB (Widget w, XtPointer client_data, XtPointer xt_call_data )
{
extern Widget sat_enhance_list;
extern Widget sat_enhance_but;
extern struct enhance_list satenhance_list;
char color_table[20];
int *pos_list;
int pos_cnt;
int i;
GlobalDataObjectType *gd;
XmListCallbackStruct *cbs =
(XmListCallbackStruct *) xt_call_data;
/*
* Get color table to use.
*/
if ( ! ( XmListGetSelectedPos ( sat_enhance_list,
&pos_list, &pos_cnt ) &&
( pos_cnt == 1 ) ) ) return;
i = pos_list[0] - 1;
free ( pos_list );
strcpy ( color_table, satenhance_list.list[i] );
/*
* Add extension for color tables.
*/
if ( ! ( strcmp ( color_table, "DEFAULT" ) == 0 ||
strcmp ( color_table, "gray" ) == 0 ) )
strcat ( color_table, ".tbl" );
/*
* Save parameters.
*/
gd = GetGlobalDataObject();
SetDefColortable ( gd, color_table );
SetBackgroundColors ( gd, satenhance_list.background[i] );
SetForegroundColors ( gd, satenhance_list.foreground[i] );
/*
* Change lutfile.
*/
newlut ( color_table );
if( DefaultDepthOfScreen(DefaultScreenOfDisplay(XtDisplay(w))) != 8 ) {
RefreshDisplay ( ); /* Necessary for > 8-bit displays to redraw
images with new pixel values reflecting
new read-only color table entries */
}
}