Article View: fj.windows.x
Article #14Q: PEX on SPARC station ELC
From: michiharu shiiba
Date: Wed, 04 Nov 1992 13:15
Date: Wed, 04 Nov 1992 13:15
143 lines
5737 bytes
5737 bytes
$@DGMU=<@2!w5~Bg9)(J.$@EZLZ65<<$H$$$$$^$9!#(J
fj.sys.sun $@$K$b;w$?$h$&$J(J$@<ALd$r$@$7$?$N$G$9$,!"$^$@2r7h$7$F(J
$@$$$J$$$N$G!"$3$N%K%e!<%9%0%k!<%W$G$b<ALd$5$;$F$$$?$@$-$?$$$H(J
$@;W$$$^(J$@$9!#(J
$@8&5f<<$K$O!"(JSPARC station IPX $@$,$"$C$F!"(JSun OS 4.1.1 $@$,%$%s(J
$@%9%H!<%k$5$l$F$$$^$9!#$3$l$K!"(JX11R5 $@$r%$%s%9%H!<%k$7$F$"$j$^(J
$@$9!#(JPEX-SI $@$b%$%s%9%H!<%k$7$F$"$j$^$9!#(J
$@:#2s!"$3$N%O!<%I%G%#%9%/$r6&M-$9$k(J$@7A$G!"(JSPARC station ELC $@$r(J
$@F3F~$7$^$7$?!#$3$l$O!"%j%b!<%H%V!<%H$7$^$9!#$3$A$i$N%+!<%M%k(J
$@$O!"(JSPARC station IPX $@$N$b$N$HF1$8$K$7$F$$$^$9!#(J
$@<B$O!"(JPEX $@$r$D$+$&%W%m%0%i%`$,!"(JIPX $@$G$OF0$/$N$K!"(JELC $@$G$OF0(J
$@:n$,(J$@$*$+$7$$$N$G$9!#(J
$@%W%m%0%i%`$O!"$D$.$N$h$&$J$b$N$G$9!#!J(Jfj.sys.sun $@$G<ALd$7$?$H$-(J
$@$N$b$N$H$OJQ$($F$$$^(J$@$9!#(J)
/* uxlib.c ;-*- c -*- */
#include <phigs/phigs.h>
/* PHIGS Identifiers */
#define WS_ID (Pint) 1
#define STRUCTURE_ID (Pint) 1
/* Window layout information */
#define WS_X 50
#define WS_Y 50
#define WS_WIDTH 300
#define WS_HEIGHT 300
#define WS_BORDER_WIDTH 1
main(argc, argv)
int argc;
char* argv[];
{
Display *display;
Window window;
XEvent event;
int done;
XSetWindowAttributes win_attrs;
Pconnid_x_drawable conn_id;
Pxphigs_info xphigs_info;
unsigned long mask;
Pint ws_type;
static Ppoint points[] = {{.2,.2},{.8,.2},{.5,.8}};
static Ppoint_list triangle = {3, points};
/* Connect to the server and create a window */
if (!(display = XOpenDisplay( NULL )) )
{
fprintf( stderr, "Can't open defauldisplay\n" );
return -1;
}
win_attrs.backing_store = NotUseful;
win_attrs.border_pixel = win_attrs.background_pixel =
BlackPixel(display, DefaultScreen(display));
window = XCreateWindow(display,
RootWindow(display, DefaultScreen(display)),
WS_X, WS_Y, WS_WIDTH, WS_HEIGHT,WS_BORDER_WIDTH,
CopyFromParent, InputOutput, CopyFromParent,
CWBackingStore | CWBorderPixel |CWBackPixel, &win_attrs);
XMapWindow(display, window);
/* Open PHIGS, telling it not to monitor windowevents. */
mask = PXPHIGS_INFO_FLAGS_NO_MON;
xphigs_info.flags.no_monitor = 1;
popen_xphigs(PDEF_ERR_FILE, PDEF_MEM_SIZE, mask,&xphigs_info);
/* Build the structure that uses the window we've created. */
popen_struct(STRUCTURE_ID);
pset_int_style(PSTYLE_SOLID);
pfill_area(&triangle);
pclose_struct();
ws_type = phigs_ws_type_create(phigs_ws_type_x_drawable,PHIGS_WS_CATEGORY, PCAT_OUT, NULL);
/* Open a PHIGS workstation that uses the window we've created. */
conn_id.display = display;
conn_id.drawable_id = window;
popen_ws(WS_ID, (void *)&conn_id, ws_type);
/* Post the structure */
ppost_struct(WS_ID, STRUCTURE_ID, (Pfloat)1.0);
/* Read and respont to X events */
XSelectInput(display, window, ExposureMask | ButtonPressMask);
done = 0;
while (!done)
{
XNextEvent(display, &event);
switch (event.type)
{
case Expose:
if (event.xexpose.count == 0)
predraw_all_structs(WS_ID, PFLAG_ALWAYS);
break;
case ButtonPress:
done = 1;
break;
}
}
pclose_ws(WS_ID);
pclose_phigs();
XCloseDisplay(display);
}
$@$3$N%W%m%0%i%`$O!"(JPhigs Programming Manual $@$H$$$&K\$K$"$k$b(J
$@$N$G!"(JIPX $@$G$O$=$NK\$K=q$$$F$"$k$H$*$j$N?^$,I=<($5$l$^$9!#(J
$@$H$3$m$,!"$3$l$r(J ELC $@$N>e$GF0$+$9$H!"!J(JELC $@$G%3%s%Q%$%k$7$F(J
$@$bF1$8$G$9!#$I$C$A$G%3%s%Q%$%k$7$F$b!"(JIPX $@$G$O$A$c$s$HF0$-$^(J
$@$9!#!K(J Window $@$r:n$C(J$@$F$/$l$k=j$O$&$^$/$$$C$F$$$^$9$,!"$=$N(J
$@8e$G?^$rI=<($;$:!"<!$N$h$&$J%(%i!<%a%C%;!<%8$r=P$7$^$9!#(J
PHIGS error -168 in OPEN WORKSTATION: Ignoring function,
cannot open
workstation on a read-only visual with no predefined
colormap properties
PHIGS error 3 in POST STRUCTURE: Ignoring function, function
requires state
(PHOP,WSOP,*,*)
PHIGS error 3 in CLOSE WORKSTATION: Ignoring function,
function requires state
(PHOP,WSOP,*,*)
$@$3$l$O$I$3$K860x$,$"$k$N$G$7$g$&$+!#(JELC $@!JEl<G$G$O!"(JAS4025
$@$H$$$C$F$$$^$9$,!K$G(J$@$O!"(JPEX-SI $@$OF0:n$7$J$$$N$G$7$g$&$+!#(J
$@=u$1$F$/$@$5$$!#(J
--
--
Michiharu SHIIBA @ Civil Eng., KYOTO UNIV.
E-mail a52280@sakura.kudpc.kyoto-u.ac.jp
tel 075-753-5095 fax 075-761-0646
Technical Details
Message-ID:
<A52280.92Nov4221540@sakura.sakura.kudpc.kyoto-u.ac.jp>Path:
arc1-ca.pugleaf.net!sparky!uunet!ccut!sh.wide!wnoc-kyo!kuis!kudpc!sakura.kudpc.kyoto-u.ac.jp!a52280Show Full Headers
Complete Article Headers
Newsgroups: fj.windows.x Path: arc1-ca.pugleaf.net!sparky!uunet!ccut!sh.wide!wnoc-kyo!kuis!kudpc!sakura.kudpc.kyoto-u.ac.jp!a52280 From: a52280@sakura.kudpc.kyoto-u.ac.jp (michiharu shiiba) Subject: Q: PEX on SPARC station ELC Message-ID: <A52280.92Nov4221540@sakura.sakura.kudpc.kyoto-u.ac.jp> Sender: news@kudpc.kyoto-u.ac.jp Nntp-Posting-Host: sakura.kudpc.kyoto-u.ac.jp Organization: Data Processing Center, Kyoto University, Kyoto, JAPAN Distribution: fj Date: Wed, 4 Nov 1992 13:15:40 GMT Lines: 143