[GRASS5] Re: [GRASS-CVS] CVS update: grass/src/display/devices/CELL

Glynn,

the recent changes to XDRIVER introduced a bug:

Try:
export GRASS_HEIGHT=100
d.mon x0
using default visual which is TrueColor
ncolors: 65536
Graphics driver [x0] started

d.mon stop=x0

export GRASS_HEIGHT=

d.mon x0
using default visual which is TrueColor
X Error of failed request: BadValue (integer parameter out of range for
operation)
  Major opcode of failed request: 1 (X_CreateWindow)
  Value in failed request: 0x0
  Serial number of failed request: 8
  Current serial number in output stream: 20
No socket to connect to for monitor <x0>.
Problem selecting x0. Will try once more
No socket to connect to for monitor <x0>.

export GRASS_HEIGHT=33
d.mon x0
using default visual which is TrueColor
ncolors: 65536
Graphics driver [x0] started

Please pre-define the variable if unset (will also affect GRASS_WIDTH,
unchecked).

Then a question: Now PNGDriver and Xdriver use the same size variables
GRASS_HEIGHT and GRASS_WIDTH (or not?).
I am not sure if that is a good idea (less convenient than before).
Usually the monitor will be smaller than file output to PNG.

Markus

On Sat, Feb 16, 2002 at 08:13:02AM +0100, grass@intevation.de wrote:

Date: Saturday February 16, 2002 @ 7:13
Author: glynn

Update of /grassrepository/grass/src/display/devices/CELL
In directory doto:/tmp/cvs-serv21664/src/display/devices/CELL

Modified Files:
      Tag: releasebranch_11_april_2001_5_0_0
  cell.h Graph_Set.c
Log Message:
General display driver tidying
Move screen_{left,right,top,bottom} and initialisation thereof to lib/main.c
XDRIVER now uses GRASS_{WIDTH,HEIGHT} instead of XDRIVER_{WIDTH,HEIGHT}
Move DEF_{WIDTH,HEIGHT} to lib/driver.h
XDRIVER now defaults to 640x480
Move NCOLORS to lib/main.c
Move declarations for screen_* and NCOLORS to lib/driver.h
Document various env vars:
GRASS_BACKGROUNDCOLOR, GRASS_TRANSPARENT, XDRIVER_WINDOW
Eliminate preprocessor abuse
Remove program-specified position from XDRIVER; let WM place window
Remove gratuitous references to BUFSIZ
Remove redundant SC_{WID,HITE} variables from XDRIVER
Remove leading underscores from _text_* variables
Move definitions of text_*, cur_[xy] to lib/main.c
Move declarations of text_*, cur_[xy] to lib/driver.h
Add d.resize script

_______________________________________________
grass-commit mailing list
grass-commit@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-commit

Markus Neteler wrote:

the recent changes to XDRIVER introduced a bug:

Try:
export GRASS_HEIGHT=100
d.mon x0
using default visual which is TrueColor
ncolors: 65536
Graphics driver [x0] started

d.mon stop=x0

export GRASS_HEIGHT=

d.mon x0
using default visual which is TrueColor
X Error of failed request: BadValue (integer parameter out of range for
operation)

[snip]

Please pre-define the variable if unset (will also affect GRASS_WIDTH,
unchecked).

OK, done.

Then a question: Now PNGDriver and Xdriver use the same size variables
GRASS_HEIGHT and GRASS_WIDTH (or not?).

Yes; all monitors now use these variables. The intention was to make
it easier for programs which manage monitors, so that they don't need
a table of which monitor uses which variables.

If you want per-monitor-type variables, it would be better to
generalise the mechanism using the driver name, e.g. with something
like GRASS_WIDTH_XDRIVER, GRASS_WIDTH_PNG, GRASS_WIDTH_CELL etc rather
than having a special case for one of the drivers.

--
Glynn Clements <glynn.clements@virgin.net>

On Sat, Feb 16, 2002 at 08:35:31PM +0000, Glynn Clements wrote:

Markus Neteler wrote:
> the recent changes to XDRIVER introduced a bug:
[snip]

[snip]

> Please pre-define the variable if unset (will also affect GRASS_WIDTH,
> unchecked).
OK, done.

Thanks, working now.

> Then a question: Now PNGDriver and Xdriver use the same size variables
> GRASS_HEIGHT and GRASS_WIDTH (or not?).

Yes; all monitors now use these variables. The intention was to make
it easier for programs which manage monitors, so that they don't need
a table of which monitor uses which variables.

If you want per-monitor-type variables, it would be better to
generalise the mechanism using the driver name, e.g. with something
like GRASS_WIDTH_XDRIVER, GRASS_WIDTH_PNG, GRASS_WIDTH_CELL etc rather
than having a special case for one of the drivers.

Well, what's preferred? Individual size variables for each driver or
overall variables? Opinions?

Markus

Markus Neteler wrote:

On Sat, Feb 16, 2002 at 08:35:31PM +0000, Glynn Clements wrote:
> Markus Neteler wrote:
> > the recent changes to XDRIVER introduced a bug:
> [snip]
[snip]
> > Please pre-define the variable if unset (will also affect GRASS_WIDTH,
> > unchecked).
> OK, done.

Thanks, working now.

> > Then a question: Now PNGDriver and Xdriver use the same size variables
> > GRASS_HEIGHT and GRASS_WIDTH (or not?).
>
> Yes; all monitors now use these variables. The intention was to make
> it easier for programs which manage monitors, so that they don't need
> a table of which monitor uses which variables.
>
> If you want per-monitor-type variables, it would be better to
> generalise the mechanism using the driver name, e.g. with something
> like GRASS_WIDTH_XDRIVER, GRASS_WIDTH_PNG, GRASS_WIDTH_CELL etc rather
> than having a special case for one of the drivers.

Well, what's preferred? Individual size variables for each driver or
overall variables? Opinions?

one set of variables (GRASS_WIDTH, GRASS_HEIGHT) for all
monitors/drivers. IMHO one can change the variables after opening the
driver, so that new started monitors inherit the new values with their
environment.

Just my opinion.

Andreas
--
Andreas Lange, 65187 Wiesbaden, Germany, Tel. +49 611 807850
url: http://mitglied.tripod.de/AndreasLange
mail: Andreas.Lange_at_Rhein-Main.de - A.C.Lange_at_GMX.net