From 32b4208c65d3c4b7fb9ab4c19dc20fb712a9d81b Mon Sep 17 00:00:00 2001 From: "ramiro%netscape.com" Date: Wed, 7 Jul 1999 02:25:11 +0000 Subject: [PATCH] Global variable exorcism. git-svn-id: svn://10.0.0.236/trunk@38567 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/motif/nsAppShell.cpp | 45 ++++++------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/mozilla/widget/src/motif/nsAppShell.cpp b/mozilla/widget/src/motif/nsAppShell.cpp index 51ff203f539..77e1a351df3 100644 --- a/mozilla/widget/src/motif/nsAppShell.cpp +++ b/mozilla/widget/src/motif/nsAppShell.cpp @@ -31,6 +31,12 @@ #include #endif +//#define DR_EVIL 1 + +#ifdef DR_EVIL +#include "xlibrgb.h" +#endif + #include "nsIPref.h" XtAppContext gAppContext; @@ -66,20 +72,6 @@ NS_METHOD nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener) // //------------------------------------------------------------------------- -//#define DR_EVIL 1 - -#ifdef DR_EVIL -extern Display * gDisplay; -extern Screen * gScreen; -extern Visual * gVisual; -extern int gDepth; - -extern "C" void xlib_rgb_init (Display *display, Screen *screen); -extern "C" Visual * xlib_rgb_get_visual (void); -extern "C" XVisualInfo * xlib_rgb_get_visual_info (void); - -#endif - NS_METHOD nsAppShell::Create(int* bac, char ** bav) { //char *home=nsnull; @@ -117,29 +109,12 @@ NS_METHOD nsAppShell::Create(int* bac, char ** bav) // XXX This is BAD -- needs to be fixed gAppContext = mAppContext; - #ifdef DR_EVIL - gDisplay = XtDisplay(mTopLevel); - gScreen = XtScreen(mTopLevel); + xlib_rgb_init(XtDisplay(mTopLevel), XtScreen(mTopLevel)); - xlib_rgb_init(gDisplay, gScreen); - - gVisual = xlib_rgb_get_visual(); - - XVisualInfo * x_visual_info = xlib_rgb_get_visual_info(); - - NS_ASSERTION(nsnull != x_visual_info,"Visual info from xlibrgb is null."); - - if (nsnull != x_visual_info) - { - gDepth = x_visual_info->depth; - } - - printf("nsAppShell::Create(dpy=%p screen=%p visual=%p depth=%d)\n", - gDisplay, - gScreen, - gVisual, - gDepth); + printf("nsAppShell::Create(dpy=%p screen=%p)\n", + XtDisplay(mTopLevel), + XtScreen(mTopLevel)); #endif return NS_OK;