summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux')
-rw-r--r--linux/gfx.c24
-rw-r--r--linux/platgui.c23
2 files changed, 22 insertions, 25 deletions
diff --git a/linux/gfx.c b/linux/gfx.c
index 01c7f4a..0f0575d 100644
--- a/linux/gfx.c
+++ b/linux/gfx.c
@@ -52,7 +52,6 @@ static Pixmap pix=None;
static Pixmap saved=None;
static GC gc=None;
static Display *disp=NULL;
-static XVisualInfo visual;
static XFontStruct *font=NULL;
static int curr_func;
@@ -430,7 +429,7 @@ Pixmap VIDOOM_GFX_SAVE_UNDER(int x, int y, int w, int h)
{
Pixmap p;
- p=XCreatePixmap(disp,win,w,h,visual.depth);
+ p=XCreatePixmap(disp,win,w,h,DefaultDepth(disp, DefaultScreen(disp)));
XCopyArea(disp,pix,p,gc,x,y,w,h,0,0);
return p;
@@ -489,17 +488,11 @@ void GFX_init(void)
init=TRUE;
- /* Open display and find an appropriate visual
+ /* Open display
*/
if (!(disp=XOpenDisplay(NULL)))
GFX_exit(EXIT_FAILURE,"Couldn't open X display\n");
- if (!XMatchVisualInfo(disp,DefaultScreen(disp),32,TrueColor,&visual) &&
- !XMatchVisualInfo(disp,DefaultScreen(disp),24,TrueColor,&visual) &&
- !XMatchVisualInfo(disp,DefaultScreen(disp),16,TrueColor,&visual) &&
- !XMatchVisualInfo(disp,DefaultScreen(disp),15,TrueColor,&visual))
- GFX_exit(EXIT_FAILURE,"Couldn't find a TrueColor visual\n");
-
f=0;
while(font_names[f] && !font)
font=XLoadQueryFont(disp,font_names[f++]);
@@ -576,9 +569,9 @@ void GFX_open(int w,int h)
win=XCreateWindow(disp,DefaultRootWindow(disp),
0,0,width,height,0,
- visual.depth,
+ DefaultDepth(disp, DefaultScreen(disp)),
InputOutput,
- visual.visual,
+ DefaultVisual(disp, DefaultScreen(disp)),
0,NULL);
XSelectInput
@@ -594,8 +587,10 @@ void GFX_open(int w,int h)
XSetWMNormalHints(disp,win,&hint);
- pix=XCreatePixmap(disp,win,width,height,visual.depth);
- saved=XCreatePixmap(disp,win,width,height,visual.depth);
+ pix=XCreatePixmap(disp,win,width,height,
+ DefaultDepth(disp, DefaultScreen(disp)));
+ saved=XCreatePixmap(disp,win,width,height,
+ DefaultDepth(disp, DefaultScreen(disp)));
curr_func=gc_val.function=GXcopy;
gc_val.plane_mask=AllPlanes;
@@ -941,7 +936,8 @@ GFX_IMAGE GFX_create_image(GFX_BITMAP *bm)
data=Grab(bm->w*bm->h*4);
- i.p=XCreateImage(disp,visual.visual,visual.depth,
+ i.p=XCreateImage(disp,DefaultVisual(disp, DefaultScreen(disp)),
+ DefaultDepth(disp, DefaultScreen(disp)),
ZPixmap,0,data,bm->w,bm->h,32,4*bm->w);
if (!i.p)
diff --git a/linux/platgui.c b/linux/platgui.c
index 5fd9c74..36fbcf8 100644
--- a/linux/platgui.c
+++ b/linux/platgui.c
@@ -787,11 +787,12 @@ static int CreateFileList(int x, int y, int w, int h,
return no;
}
+static void TextEditInfo(GuiObjTextEdit *o);
+
static int CreateTextEdit(int x, int y, int w, int h,
TextEditLine *lines, int no_lines, int info,
int read_only)
{
- static void TextEditInfo(GuiObjTextEdit *o);
int no=dialog_no++;
DialCommon(no,GuiTextEdit,x,y,w,h,TRUE);
@@ -818,18 +819,18 @@ static int CreateTextEdit(int x, int y, int w, int h,
/* ---------------------------------------- DIALOG CALLBACK FUNCTIONS
*/
+static CallbackReturn BoxCallback(GuiObj *o ,ObjEvent ev);
+static CallbackReturn LabelCallback(GuiObj *o,ObjEvent ev);
+static CallbackReturn ButtonCallback(GuiObj *o,ObjEvent ev);
+static CallbackReturn ToggleCallback(GuiObj *o,ObjEvent ev);
+static CallbackReturn RadioCallback(GuiObj *o,ObjEvent ev);
+static CallbackReturn ImageListCallback(GuiObj *o,ObjEvent ev);
+static CallbackReturn TextCallback(GuiObj *o,ObjEvent ev);
+static CallbackReturn FileListCallback(GuiObj *o,ObjEvent ev);
+static CallbackReturn TextEditCallback(GuiObj *o,ObjEvent ev);
+
static CallbackReturn Callback(GuiObj *o, ObjEvent ev)
{
- static CallbackReturn BoxCallback(GuiObj *o ,ObjEvent ev);
- static CallbackReturn LabelCallback(GuiObj *o,ObjEvent ev);
- static CallbackReturn ButtonCallback(GuiObj *o,ObjEvent ev);
- static CallbackReturn ToggleCallback(GuiObj *o,ObjEvent ev);
- static CallbackReturn RadioCallback(GuiObj *o,ObjEvent ev);
- static CallbackReturn ImageListCallback(GuiObj *o,ObjEvent ev);
- static CallbackReturn TextCallback(GuiObj *o,ObjEvent ev);
- static CallbackReturn FileListCallback(GuiObj *o,ObjEvent ev);
- static CallbackReturn TextEditCallback(GuiObj *o,ObjEvent ev);
-
switch(o->common.type)
{
case GuiBox: