From: Alan W. I. <ir...@be...> - 2003-02-27 16:29:12
|
One of our users (Alessandro Mirone) has a huge pyqt-based PLplot GUI application his group has developed which he has just ported from plplot-5.1.0 to recent CVS (in anticipation of 5.2.1). However, to get his application to work, he needs to have an option to not initialize the colors in xwin. Here is his proposed change to xwin.c. (I have also taken the opportunity to clean up some commentary on the other xwin options.) --- xwin.c_old Thu Feb 27 06:55:28 2003 +++ xwin.c Thu Feb 27 07:40:54 2003 @@ -20,7 +20,10 @@ /* Use "-drvopt sync" cmd line option to set. */ static int nobuffered = 0; /* make it a buffered device by default */ - /* use "-drvopt buffered=0" to make it unbuffered */ + /* use "-drvopt unbuffered" to make it unbuffered */ + +static int noinitcolors = 0; /* Call InitColors by default */ + /* use "-drvopt noinitcolors" to leave colors uninitialized */ /* When USE_DEFAULT_VISUAL is defined, DefaultVisual() is used to get the * visual. Otherwise, the visual is obtained using XGetVisualInfo() to make a @@ -161,6 +164,7 @@ static DrvOpt xwin_options[] = {{"sync", DRV_INT, &synchronize, "Synchronized X server operation (0|1)"}, {"nobuffered", DRV_INT, &nobuffered, "Sets unbuffered operation (0|1)"}, + {"noinitcolors", DRV_INT, &noinitcolors, "Sets cmap0 allocation (0|1)"}, {NULL, DRV_INT, NULL, NULL}}; void plD_dispatch_init_xw( PLDispatchTable *pdt ) @@ -820,7 +824,7 @@ /* Initialize colors */ - InitColors(pls); + if (noinitcolors == 0) InitColors(pls); XSetWindowColormap( xwd->display, dev->window, xwd->map ); /* Set up GC for ordinary draws */ I have checked that this builds and executes without problems. Alessandro assures me this option is required for his application. I presume this is for second and subsequent calls to the xwin driver after the colours have been set in the first call. I think it is probably worth putting in this option since it may be useful to others and has zero impact otherwise. If there are no objections to this additional xwin driver option, I propose to commit this later today. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the Canadian Centre for Climate Modelling and Analysis (www.cccma.bc.ec.gc.ca) and the PLplot scientific plotting software package (plplot.org). __________________________ Linux-powered Science __________________________ |