🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #13343

SunView 4.x bug?

#13343
From: csvsj
Date: Wed, 20 Dec 1989 22:40
62 lines
1905 bytes
The following program behaves differently in 4.x SunView than it did in
3.x Sunview:

#include <stdio.h>
#include <suntool/sunview.h>
#include <suntool/canvas.h>
#include <suntool/panel.h>

Canvas	canvas;
void done_proc();

main()
{
	Frame	frame;
	Panel panel;

    frame = window_create(NULL, FRAME,
				0);
	canvas = window_create(frame, CANVAS,
				WIN_HEIGHT,	102,
				WIN_WIDTH,	102,
				CANVAS_WIDTH,	102,
				CANVAS_HEIGHT,	102,
				0);
	panel = window_create(frame, PANEL, 0);
	panel_create_item(panel, PANEL_BUTTON, 
				PANEL_LABEL_STRING, "EXIT",
				PANEL_NOTIFY_PROC, done_proc, 0);
	window_fit(panel);
	window_fit(frame);
	window_main_loop(frame);
}

void
done_proc(item, event)
Panel_item item;
Event *event;
{
	Pixwin	*pw;
	Pixrect *pr;
	struct mpr_data *d;

	pw = canvas_pixwin(canvas);
	pr = pw->pw_prretained;
	d = mpr_d(pr);
	printf("width = %d linebytes = %d\n", pr->pr_size.x, d->md_linebytes);
	exit();
}


Under SunView 4.x, the program outputs "width = 102 linebytes = 16" when
the "EXIT" button is selected.  Under SunView 3.x, the program outputs
"width = 102 linebytes = 14".

Apparently, under SunView 4.x, the pixrect data for the canvas pixwin's
retained pixrect is padded to a 32 bit boundary for each row, rather than
a 16 bit boundary.

The documentation in the Pixrect Reference Manual says that data for
memory pixrect rows are rounded up to 16-bit boundaries.

So is this behavior a bug, or what?
Technical Details
Message-ID: <4019@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!sun-spots-request
From: csvsj@garnet.Berkeley.EDU
Newsgroups: comp.sys.sun
Subject: SunView 4.x bug?
Keywords: Windows
Message-ID: <4019@brazos.Rice.edu>
Date: 20 Dec 89 22:40:43 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 62
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 8, Issue 229, message 11 of 16