screens.c

来自「安装DDD之前」· C语言 代码 · 共 1,482 行 · 第 1/4 页

C
1,482
字号
	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_BORDER].top_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_BORDER].top_shadow_color;	gcv.background = scr->components[MWM_BORDER].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_BORDER].top_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_BORDER].bottom_shadow_pixmap != None &&      scr->components[MWM_BORDER].bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_BORDER].bottom_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_BORDER].bottom_shadow_color;	gcv.background = scr->components[MWM_BORDER].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_BORDER].bot_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_BORDER].active_top_shadow_pixmap != None &&	scr->components[MWM_BORDER].active_top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_BORDER].active_top_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_BORDER].active_top_shadow_color;	gcv.background = scr->components[MWM_BORDER].active_background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_BORDER].active_top_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_BORDER].active_bottom_shadow_pixmap != None &&	scr->components[MWM_BORDER].active_bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_BORDER].active_bottom_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_BORDER].active_bottom_shadow_color;	gcv.background = scr->components[MWM_BORDER].active_background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_BORDER].active_bot_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);}/* * create the GC's for the maximize button */static voidcreate_maximize_gcs(ScreenInfo *scr){    XGCValues gcv;    unsigned long gcm;    if (scr->components[MWM_MAXIMIZE_B].top_shadow_pixmap != None &&     scr->components[MWM_MAXIMIZE_B].top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MAXIMIZE_B].top_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MAXIMIZE_B].top_shadow_color;	gcv.background = scr->components[MWM_MAXIMIZE_B].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MAXIMIZE_B].top_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MAXIMIZE_B].bottom_shadow_pixmap != None &&	scr->components[MWM_MAXIMIZE_B].bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MAXIMIZE_B].bottom_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MAXIMIZE_B].bottom_shadow_color;	gcv.background = scr->components[MWM_MAXIMIZE_B].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MAXIMIZE_B].bot_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MAXIMIZE_B].active_top_shadow_pixmap != None &&	scr->components[MWM_MAXIMIZE_B].active_top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MAXIMIZE_B].active_top_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MAXIMIZE_B].active_top_shadow_color;	gcv.background = scr->components[MWM_MAXIMIZE_B].active_background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MAXIMIZE_B].active_top_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MAXIMIZE_B].active_bottom_shadow_pixmap != None &&	scr->components[MWM_MAXIMIZE_B].active_bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MAXIMIZE_B].active_bottom_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MAXIMIZE_B].active_bottom_shadow_color;	gcv.background = scr->components[MWM_MAXIMIZE_B].active_background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MAXIMIZE_B].active_bot_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);}/* * create the GC's for the maximize button */static voidcreate_minimize_gcs(ScreenInfo *scr){    XGCValues gcv;    unsigned long gcm;    if (scr->components[MWM_MINIMIZE_B].top_shadow_pixmap != None &&     scr->components[MWM_MINIMIZE_B].top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MINIMIZE_B].top_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MINIMIZE_B].top_shadow_color;	gcv.background = scr->components[MWM_MINIMIZE_B].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MINIMIZE_B].top_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MINIMIZE_B].bottom_shadow_pixmap != None &&	scr->components[MWM_MINIMIZE_B].bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MINIMIZE_B].bottom_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MINIMIZE_B].bottom_shadow_color;	gcv.background = scr->components[MWM_MINIMIZE_B].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MINIMIZE_B].bot_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MINIMIZE_B].active_top_shadow_pixmap != None &&	scr->components[MWM_MINIMIZE_B].active_top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MINIMIZE_B].active_top_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MINIMIZE_B].active_top_shadow_color;	gcv.background = scr->components[MWM_MINIMIZE_B].active_background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MINIMIZE_B].active_top_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MINIMIZE_B].active_bottom_shadow_pixmap != None &&	scr->components[MWM_MINIMIZE_B].active_bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MINIMIZE_B].active_bottom_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MINIMIZE_B].active_bottom_shadow_color;	gcv.background = scr->components[MWM_MINIMIZE_B].active_background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MINIMIZE_B].active_bot_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);}/* * create the GC's for the maximize button */static voidcreate_menu_b_gcs(ScreenInfo *scr){    XGCValues gcv;    unsigned long gcm;    if (scr->components[MWM_MENU_B].top_shadow_pixmap != None &&	scr->components[MWM_MENU_B].top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MENU_B].top_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MENU_B].top_shadow_color;	gcv.background = scr->components[MWM_MENU_B].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MENU_B].top_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MENU_B].bottom_shadow_pixmap != None &&      scr->components[MWM_MENU_B].bottom_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MENU_B].bottom_shadow_pixmap;	gcv.fill_style = FillTiled;    }    else    {	gcm = GCForeground | GCBackground;	gcv.foreground = scr->components[MWM_MENU_B].bottom_shadow_color;	gcv.background = scr->components[MWM_MENU_B].background;    }    gcm |= GCLineWidth | GCLineStyle | GCCapStyle |	GCGraphicsExposures;    gcv.line_width = 0;    gcv.line_style = LineSolid;    gcv.cap_style = CapButt;    gcv.graphics_exposures = False;    scr->components[MWM_MENU_B].bot_GC =	XCreateGC(dpy, scr->root_win, gcm, &gcv);    if (scr->components[MWM_MENU_B].active_top_shadow_pixmap != None &&	scr->components[MWM_MENU_B].active_top_shadow_pixmap != XmUNSPECIFIED_PIXMAP)    {	gcm = GCTile | GCFillStyle;	gcv.tile = scr->components[MWM_MENU_B].active_top_shadow_pixmap;	gcv.fill_style = FillTiled;    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?