extern "C" {
#endif
-/* Lefteris Koutsofios - AT&T Bell Laboratories */
+/* Lefteris Koutsofios - AT&T Labs Research */
#ifndef _GCOMMON_H
#define _GCOMMON_H
- extern HANDLE hinstance, hprevinstance;
+extern HANDLE hinstance, hprevinstance;
/* point and rect structures */
- typedef POINT PIXxy_t;
- typedef PIXxy_t PIXpoint_t;
- typedef PIXxy_t PIXsize_t;
- typedef struct PIXrect_t {
- PIXxy_t o, c;
- } PIXrect_t;
-
- extern int Gpopdownflag;
- extern int Gdepth;
- extern int Gnocallbacks;
- extern int menuselected;
- extern int menupoped;
-
- extern char *Gbufp;
- extern int Gbufn, Gbufi;
+typedef POINT PIXxy_t;
+typedef PIXxy_t PIXpoint_t;
+typedef PIXxy_t PIXsize_t;
+typedef struct PIXrect_t {
+ PIXxy_t o, c;
+} PIXrect_t;
+
+extern int Gpopdownflag;
+extern int Gdepth;
+extern int Gnocallbacks;
+extern int menuselected;
+extern int menupoped;
+
+extern char *Gbufp;
+extern int Gbufn, Gbufi;
#define BUFINCR 1024
#define BUFSIZE sizeof (char)
- extern PIXpoint_t *Gppp;
- extern int Gppn, Gppi;
+extern PIXpoint_t *Gppp;
+extern int Gppn, Gppi;
#define PPINCR 100
#define PPSIZE sizeof (PIXpoint_t)
- typedef struct Gfont_t {
- char *name;
- int size;
- HFONT font;
- } Gfont_t;
- extern Gfont_t *Gfontp;
- extern int Gfontn;
+typedef struct Gfont_t {
+ char *name;
+ int size;
+ HFONT font;
+} Gfont_t;
+extern Gfont_t *Gfontp;
+extern int Gfontn;
#define FONTSIZE sizeof (Gfont_t)
#define SETFONT(font) { \
if (font != WCU->font) { \
} \
}
-#define GETSIZE(sin, sout, smin) \
+#define GETSIZE(sin, sout, smin) ( \
sout.x = (sin.x > smin) ? sin.x + 0.5 : smin, \
- sout.y = (sin.y > smin) ? sin.y + 0.5 : smin
-#define GETORIGIN(oin, oout) \
- oout.x = oin.x + 0.5, oout.y = oin.y + 0.5
-
- int Ginitgraphics(void);
- int Gtermgraphics(void);
- int Gsync(void);
-
- int GAcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GAsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GAgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GAdestroywidget(Gwidget_t *);
-
- int GBcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GBsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GBgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GBdestroywidget(Gwidget_t *);
-
- int GCcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GCsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GCgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GCdestroywidget(Gwidget_t *);
- int GCcanvasclear(Gwidget_t *);
- int GCsetgfxattr(Gwidget_t *, Ggattr_t *);
- int GCgetgfxattr(Gwidget_t *, Ggattr_t *);
- int GCarrow(Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
- int GCline(Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
- int GCbox(Gwidget_t *, Grect_t, Ggattr_t *);
- int GCpolygon(Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
- int GCsplinegon(Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
- int GCarc(Gwidget_t *, Gpoint_t, Gsize_t, double, double, Ggattr_t *);
- int GCtext(Gwidget_t *, Gtextline_t *, int, Gpoint_t,
- char *, double, char *, Ggattr_t *);
- int GCgettextsize(Gwidget_t *, Gtextline_t *, int, char *, double,
- Gsize_t *);
- int GCcreatebitmap(Gwidget_t *, Gbitmap_t *, Gsize_t);
- int GCdestroybitmap(Gbitmap_t *);
- int GCreadbitmap(Gwidget_t *, Gbitmap_t *, FILE *);
- int GCwritebitmap(Gbitmap_t *, FILE *);
- int GCbitblt(Gwidget_t *, Gpoint_t, Grect_t, Gbitmap_t *, char *,
- Ggattr_t *);
- int GCgetmousecoords(Gwidget_t *, Gpoint_t *, int *);
-
- int GLcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GLsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GLgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GLdestroywidget(Gwidget_t *);
-
- int GMcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GMsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GMgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GMdestroywidget(Gwidget_t *);
- int GMmenuaddentries(Gwidget_t *, int, char **);
- int GMmenudisplay(Gwidget_t *, Gwidget_t *);
-
- int GPcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GPsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GPgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GPdestroywidget(Gwidget_t *);
- int GPcanvasclear(Gwidget_t *);
- int GPsetgfxattr(Gwidget_t *, Ggattr_t *);
- int GPgetgfxattr(Gwidget_t *, Ggattr_t *);
- int GParrow(Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
- int GPline(Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
- int GPbox(Gwidget_t *, Grect_t, Ggattr_t *);
- int GPpolygon(Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
- int GPsplinegon(Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
- int GParc(Gwidget_t *, Gpoint_t, Gsize_t, double, double, Ggattr_t *);
- int GPtext(Gwidget_t *, Gtextline_t *, int, Gpoint_t,
- char *, double, char *, Ggattr_t *);
- int GPcreatebitmap(Gwidget_t *, Gbitmap_t *, Gsize_t);
- int GPdestroybitmap(Gbitmap_t *);
- int GPreadbitmap(Gwidget_t *, Gbitmap_t *, FILE *);
- int GPwritebitmap(Gbitmap_t *, FILE *);
- int GPbitblt(Gwidget_t *, Gpoint_t, Grect_t, Gbitmap_t *, char *,
- Ggattr_t *);
-
- int GQcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GQsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GQgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GQdestroywidget(Gwidget_t *);
- int GQqueryask(Gwidget_t *, char *, char *, char *, int);
-
- int GScreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GSsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GSgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GSdestroywidget(Gwidget_t *);
-
- int GTcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GTsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GTgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GTdestroywidget(Gwidget_t *);
-
- int GVcreatewidget(Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
- int GVsetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GVgetwidgetattr(Gwidget_t *, int, Gwattr_t *);
- int GVdestroywidget(Gwidget_t *);
-
- void Gawinitialize(Gwidget_t *, int);
- void Gawdestroy(Gwidget_t *);
- void Gawresize(Gwidget_t *);
- void Gawinsertchild(Gwidget_t *, Gwidget_t *);
- void Gawdeletechild(Gwidget_t *, Gwidget_t *);
-
- void Gadjustwrect(Gwidget_t *, PIXsize_t *);
- void Gadjustclip(Gwidget_t *);
- Gpoint_t ppixtodraw(Gwidget_t *, PIXpoint_t);
-#endif /* _GCOMMON_H */
+ sout.y = (sin.y > smin) ? sin.y + 0.5 : smin \
+)
+#define GETORIGIN(oin, oout) ( \
+ oout.x = oin.x + 0.5, oout.y = oin.y + 0.5 \
+)
+
+int Ginitgraphics (void);
+int Gtermgraphics (void);
+int Gsync (void);
+
+int GAcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GAsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GAgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GAdestroywidget (Gwidget_t *);
+
+int GBcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GBsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GBgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GBdestroywidget (Gwidget_t *);
+
+int GCcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GCsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GCgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GCdestroywidget (Gwidget_t *);
+int GCcanvasclear (Gwidget_t *);
+int GCsetgfxattr (Gwidget_t *, Ggattr_t *);
+int GCgetgfxattr (Gwidget_t *, Ggattr_t *);
+int GCarrow (Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
+int GCline (Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
+int GCbox (Gwidget_t *, Grect_t, Ggattr_t *);
+int GCpolygon (Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
+int GCsplinegon (Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
+int GCarc (Gwidget_t *, Gpoint_t, Gsize_t, double, double, Ggattr_t *);
+int GCtext (
+ Gwidget_t *, Gtextline_t *, int, Gpoint_t,
+ char *, double, char *, Ggattr_t *
+);
+int GCgettextsize (Gwidget_t *, Gtextline_t *, int, char *, double, Gsize_t *);
+int GCcreatebitmap (Gwidget_t *, Gbitmap_t *, Gsize_t);
+int GCdestroybitmap (Gbitmap_t *);
+int GCreadbitmap (Gwidget_t *, Gbitmap_t *, FILE *);
+int GCwritebitmap (Gbitmap_t *, FILE *);
+int GCbitblt (Gwidget_t *, Gpoint_t, Grect_t, Gbitmap_t *, char *, Ggattr_t *);
+int GCgetmousecoords (Gwidget_t *, Gpoint_t *, int *);
+
+int GLcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GLsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GLgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GLdestroywidget (Gwidget_t *);
+
+int GMcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GMsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GMgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GMdestroywidget (Gwidget_t *);
+int GMmenuaddentries (Gwidget_t *, int, char **);
+int GMmenudisplay (Gwidget_t *, Gwidget_t *);
+
+int GPcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GPsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GPgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GPdestroywidget (Gwidget_t *);
+int GPcanvasclear (Gwidget_t *);
+int GPsetgfxattr (Gwidget_t *, Ggattr_t *);
+int GPgetgfxattr (Gwidget_t *, Ggattr_t *);
+int GParrow (Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
+int GPline (Gwidget_t *, Gpoint_t, Gpoint_t, Ggattr_t *);
+int GPbox (Gwidget_t *, Grect_t, Ggattr_t *);
+int GPpolygon (Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
+int GPsplinegon (Gwidget_t *, int, Gpoint_t *, Ggattr_t *);
+int GParc (Gwidget_t *, Gpoint_t, Gsize_t, double, double, Ggattr_t *);
+int GPtext (
+ Gwidget_t *, Gtextline_t *, int, Gpoint_t,
+ char *, double, char *, Ggattr_t *
+);
+int GPcreatebitmap (Gwidget_t *, Gbitmap_t *, Gsize_t);
+int GPdestroybitmap (Gbitmap_t *);
+int GPreadbitmap (Gwidget_t *, Gbitmap_t *, FILE *);
+int GPwritebitmap (Gbitmap_t *, FILE *);
+int GPbitblt (Gwidget_t *, Gpoint_t, Grect_t, Gbitmap_t *, char *, Ggattr_t *);
+
+int GQcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GQsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GQgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GQdestroywidget (Gwidget_t *);
+int GQqueryask (Gwidget_t *, char *, char *, char *, int);
+
+int GScreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GSsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GSgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GSdestroywidget (Gwidget_t *);
+
+int GTcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GTsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GTgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GTdestroywidget (Gwidget_t *);
+
+int GVcreatewidget (Gwidget_t *, Gwidget_t *, int, Gwattr_t *);
+int GVsetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GVgetwidgetattr (Gwidget_t *, int, Gwattr_t *);
+int GVdestroywidget (Gwidget_t *);
+
+void Gawinitialize (Gwidget_t *, int);
+void Gawdestroy (Gwidget_t *);
+void Gawresize (Gwidget_t *);
+void Gawinsertchild (Gwidget_t *, Gwidget_t *);
+void Gawdeletechild (Gwidget_t *, Gwidget_t *);
+
+void Gadjustwrect (Gwidget_t *, PIXsize_t *);
+void Gadjustclip (Gwidget_t *);
+Gpoint_t ppixtodraw (Gwidget_t *, PIXpoint_t);
+#endif /* _GCOMMON_H */
#ifdef __cplusplus
}
#endif
+
* AT&T Research, Florham Park NJ *
**********************************************************/
-/* Lefteris Koutsofios - AT&T Bell Laboratories */
+/* Lefteris Koutsofios - AT&T Labs Research */
#include "common.h"
#include "g.h"
#define WLU widget->u.l
-int GLcreatewidget(Gwidget_t * parent, Gwidget_t * widget,
- int attrn, Gwattr_t * attrp)
-{
+int GLcreatewidget (
+ Gwidget_t *parent, Gwidget_t *widget, int attrn, Gwattr_t *attrp
+) {
PIXsize_t ps;
DWORD wflags;
char *s;
int ai;
if (!parent) {
- Gerr(POS, G_ERRNOPARENTWIDGET);
- return -1;
+ Gerr (POS, G_ERRNOPARENTWIDGET);
+ return -1;
}
wflags = WS_CHILDWINDOW;
WLU->func = NULL;
ps.x = ps.y = MINLWSIZE;
s = "";
for (ai = 0; ai < attrn; ai++) {
- switch (attrp[ai].id) {
- case G_ATTRSIZE:
- GETSIZE(attrp[ai].u.s, ps, MINLWSIZE);
- break;
- case G_ATTRBORDERWIDTH:
- wflags |= WS_BORDER;
- break;
- case G_ATTRTEXT:
- s = attrp[ai].u.t;
- break;
- case G_ATTRWINDOWID:
- Gerr(POS, G_ERRCANNOTSETATTR1, "windowid");
- return -1;
- case G_ATTREVENTCB:
- WLU->func = attrp[ai].u.func;
- break;
- case G_ATTRUSERDATA:
- widget->udata = attrp[ai].u.u;
- break;
- default:
- Gerr(POS, G_ERRBADATTRID, attrp[ai].id);
- return -1;
- }
+ switch (attrp[ai].id) {
+ case G_ATTRSIZE:
+ GETSIZE (attrp[ai].u.s, ps, MINLWSIZE);
+ break;
+ case G_ATTRBORDERWIDTH:
+ wflags |= WS_BORDER;
+ break;
+ case G_ATTRTEXT:
+ s = attrp[ai].u.t;
+ break;
+ case G_ATTRWINDOWID:
+ Gerr (POS, G_ERRCANNOTSETATTR1, "windowid");
+ return -1;
+ case G_ATTREVENTCB:
+ WLU->func = attrp[ai].u.func;
+ break;
+ case G_ATTRUSERDATA:
+ widget->udata = attrp[ai].u.u;
+ break;
+ default:
+ Gerr (POS, G_ERRBADATTRID, attrp[ai].id);
+ return -1;
+ }
}
- Gadjustwrect(parent, &ps);
- if (!
- (widget->w =
- CreateWindow("LabelClass", s, wflags, 0, 0, ps.x, ps.y, parent->w,
- (HMENU) (widget - &Gwidgets[0]), hinstance, NULL))) {
- Gerr(POS, G_ERRCANNOTCREATEWIDGET);
- return -1;
+ Gadjustwrect (parent, &ps);
+ if (!(widget->w = CreateWindow (
+ "LabelClass", s, wflags, 0, 0, ps.x, ps.y,
+ parent->w, (HMENU) (widget - &Gwidgets[0]), hinstance, NULL
+ ))) {
+ Gerr (POS, G_ERRCANNOTCREATEWIDGET);
+ return -1;
}
- ShowWindow(widget->w, SW_SHOW);
- UpdateWindow(widget->w);
+ ShowWindow (widget->w, SW_SHOW);
+ UpdateWindow (widget->w);
if (parent && parent->type == G_ARRAYWIDGET)
- Gawinsertchild(parent, widget);
+ Gawinsertchild (parent, widget);
return 0;
}
-int GLsetwidgetattr(Gwidget_t * widget, int attrn, Gwattr_t * attrp)
-{
+int GLsetwidgetattr (Gwidget_t *widget, int attrn, Gwattr_t *attrp) {
Gwidget_t *parent;
PIXsize_t ps;
RECT r;
parent = (widget->pwi == -1) ? NULL : &Gwidgets[widget->pwi];
wflags1 = SWP_NOMOVE | SWP_NOZORDER;
for (ai = 0; ai < attrn; ai++) {
- switch (attrp[ai].id) {
- case G_ATTRSIZE:
- GETSIZE(attrp[ai].u.s, ps, MINLWSIZE);
- Gadjustwrect(parent, &ps);
- SetWindowPos(widget->w, (HWND) NULL, 0, 0, ps.x, ps.y,
- wflags1);
- r.top = r.left = 0;
- r.bottom = ps.y, r.right = ps.x;
- InvalidateRect(widget->w, NULL, FALSE);
- break;
- case G_ATTRBORDERWIDTH:
- Gerr(POS, G_ERRCANNOTSETATTR2, "borderwidth");
- return -1;
- case G_ATTRTEXT:
- SetWindowText(widget->w, attrp[ai].u.t);
- GetClientRect(widget->w, &r);
- InvalidateRect(widget->w, &r, TRUE);
- break;
- case G_ATTRWINDOWID:
- Gerr(POS, G_ERRCANNOTSETATTR2, "windowid");
- return -1;
- case G_ATTREVENTCB:
- attrp[ai].u.func = WLU->func;
- break;
- case G_ATTRUSERDATA:
- widget->udata = attrp[ai].u.u;
- break;
- default:
- Gerr(POS, G_ERRBADATTRID, attrp[ai].id);
- return -1;
- }
+ switch (attrp[ai].id) {
+ case G_ATTRSIZE:
+ GETSIZE (attrp[ai].u.s, ps, MINLWSIZE);
+ Gadjustwrect (parent, &ps);
+ SetWindowPos (widget->w, (HWND) NULL, 0, 0, ps.x, ps.y, wflags1);
+ r.top = r.left = 0;
+ r.bottom = ps.y, r.right = ps.x;
+ InvalidateRect (widget->w, NULL, FALSE);
+ break;
+ case G_ATTRBORDERWIDTH:
+ Gerr (POS, G_ERRCANNOTSETATTR2, "borderwidth");
+ return -1;
+ case G_ATTRTEXT:
+ SetWindowText (widget->w, attrp[ai].u.t);
+ GetClientRect (widget->w, &r);
+ InvalidateRect (widget->w, &r, TRUE);
+ break;
+ case G_ATTRWINDOWID:
+ Gerr (POS, G_ERRCANNOTSETATTR2, "windowid");
+ return -1;
+ case G_ATTREVENTCB:
+ attrp[ai].u.func = WLU->func;
+ break;
+ case G_ATTRUSERDATA:
+ widget->udata = attrp[ai].u.u;
+ break;
+ default:
+ Gerr (POS, G_ERRBADATTRID, attrp[ai].id);
+ return -1;
+ }
}
return 0;
}
-int GLgetwidgetattr(Gwidget_t * widget, int attrn, Gwattr_t * attrp)
-{
+int GLgetwidgetattr (Gwidget_t *widget, int attrn, Gwattr_t *attrp) {
RECT r;
int ai;
for (ai = 0; ai < attrn; ai++) {
- switch (attrp[ai].id) {
- case G_ATTRSIZE:
- GetWindowRect(widget->w, &r);
- attrp[ai].u.s.x = r.right - r.left;
- attrp[ai].u.s.y = r.bottom - r.top;
- break;
- case G_ATTRBORDERWIDTH:
- Gerr(POS, G_ERRCANNOTGETATTR, "borderwidth");
- return -1;
- case G_ATTRTEXT:
- GetWindowText(widget->w, &Gbufp[0], Gbufn);
- attrp[ai].u.t = &Gbufp[0];
- break;
- case G_ATTRWINDOWID:
- sprintf(&Gbufp[0], "0x%lx", widget->w);
- attrp[ai].u.t = &Gbufp[0];
- break;
- case G_ATTREVENTCB:
- attrp[ai].u.func = WLU->func;
- break;
- case G_ATTRUSERDATA:
- attrp[ai].u.u = widget->udata;
- break;
- default:
- Gerr(POS, G_ERRBADATTRID, attrp[ai].id);
- return -1;
- }
+ switch (attrp[ai].id) {
+ case G_ATTRSIZE:
+ GetWindowRect (widget->w, &r);
+ attrp[ai].u.s.x = r.right - r.left;
+ attrp[ai].u.s.y = r.bottom - r.top;
+ break;
+ case G_ATTRBORDERWIDTH:
+ Gerr (POS, G_ERRCANNOTGETATTR, "borderwidth");
+ return -1;
+ case G_ATTRTEXT:
+ GetWindowText (widget->w, &Gbufp[0], Gbufn);
+ attrp[ai].u.t = &Gbufp[0];
+ break;
+ case G_ATTRWINDOWID:
+ sprintf (&Gbufp[0], "0x%lx", widget->w);
+ attrp[ai].u.t = &Gbufp[0];
+ break;
+ case G_ATTREVENTCB:
+ attrp[ai].u.func = WLU->func;
+ break;
+ case G_ATTRUSERDATA:
+ attrp[ai].u.u = widget->udata;
+ break;
+ default:
+ Gerr (POS, G_ERRBADATTRID, attrp[ai].id);
+ return -1;
+ }
}
return 0;
}
-int GLdestroywidget(Gwidget_t * widget)
-{
+int GLdestroywidget (Gwidget_t *widget) {
Gwidget_t *parent;
parent = (widget->pwi == -1) ? NULL : &Gwidgets[widget->pwi];
if (parent && parent->type == G_ARRAYWIDGET)
- Gawdeletechild(parent, widget);
- DestroyWindow(widget->w);
+ Gawdeletechild (parent, widget);
+ DestroyWindow (widget->w);
return 0;
}