2002-07-31 02:10:55 -04:00
|
|
|
$OpenBSD: patch-xengine_c,v 1.1 2002/07/31 06:10:56 pvalchev Exp $
|
|
|
|
--- xengine.c.orig Sun Jul 14 21:16:31 2002
|
|
|
|
+++ xengine.c Sun Jul 14 21:16:31 2002
|
|
|
|
@@ -29,13 +29,13 @@ static char sccsid[] = "@(#)xengine.
|
1998-03-01 18:46:00 -05:00
|
|
|
|
|
|
|
#define PI 3.141592654
|
|
|
|
|
|
|
|
-XtCallbackProc redraw_callback();
|
|
|
|
-XtTimerCallbackProc Cylcle();
|
|
|
|
+void redraw_callback( Widget, XEvent*, String*, Cardinal*);
|
|
|
|
+void Cycle( XtPointer, XtIntervalId* );
|
|
|
|
|
|
|
|
Widget toplevel, base, rpm_info, engine;
|
|
|
|
GC gcPiston, gcShaft, gcCylinder, gcRoter, gcBack, gcDep, gcPre, gcEngine;
|
2000-08-20 16:15:57 -04:00
|
|
|
Pixmap enginePixmap;
|
|
|
|
-int width, height;
|
|
|
|
+Dimension width, height;
|
|
|
|
|
|
|
|
String colors[] = {"gray", "lightseagreen", "dimgrey", "forestgreen", "black", "red", "cyan", "firebrick"};
|
|
|
|
|
2002-07-31 02:10:55 -04:00
|
|
|
@@ -47,7 +47,7 @@ main(argc, argv)
|
1998-03-01 18:46:00 -05:00
|
|
|
Arg args[10];
|
|
|
|
XtTranslations newTranslations;
|
|
|
|
static XtActionsRec redrawActions[] = {
|
|
|
|
- {"expose", (XtCallbackProc) redraw_callback},
|
|
|
|
+ {"expose", redraw_callback},
|
|
|
|
};
|
|
|
|
|
|
|
|
static char *overrideTranslations =
|
2002-07-31 02:10:55 -04:00
|
|
|
@@ -59,8 +59,6 @@ main(argc, argv)
|
1998-03-01 18:46:00 -05:00
|
|
|
int i;
|
|
|
|
int count;
|
|
|
|
|
|
|
|
- XtTimerCallbackProc Cycle();
|
|
|
|
-
|
|
|
|
toplevel = XtInitialize("xengine", "XEngine", NULL, 0, &argc, argv);
|
|
|
|
|
|
|
|
for (count = 1; count < argc; count++) {
|
2002-07-31 02:10:55 -04:00
|
|
|
@@ -170,7 +168,7 @@ main(argc, argv)
|
1998-03-01 18:46:00 -05:00
|
|
|
XtMainLoop();
|
|
|
|
}
|
|
|
|
|
|
|
|
-XtCallbackProc
|
|
|
|
+void
|
|
|
|
redraw_callback(w, event, params, nparams)
|
|
|
|
Widget w;
|
|
|
|
XEvent *event;
|
2002-07-31 02:10:55 -04:00
|
|
|
@@ -180,22 +178,19 @@ redraw_callback(w, event, params, nparam
|
1998-03-01 18:46:00 -05:00
|
|
|
|
|
|
|
Arg args[10];
|
|
|
|
|
|
|
|
- XtSetArg(args[0], XtNwidth, 0);
|
|
|
|
- XtSetArg(args[1], XtNheight, 0);
|
|
|
|
+ XtSetArg(args[0], XtNwidth, &width);
|
|
|
|
+ XtSetArg(args[1], XtNheight, &height);
|
|
|
|
XtGetValues(w, args, 2);
|
|
|
|
|
|
|
|
- width = args[0].value;
|
|
|
|
- height = args[1].value;
|
|
|
|
-
|
|
|
|
XFreePixmap(XtDisplay(engine), enginePixmap);
|
|
|
|
enginePixmap = XCreatePixmap(XtDisplay(engine), XtWindow(engine), width, height, DefaultDepthOfScreen(XtScreen(engine)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
-XtTimerCallbackProc
|
|
|
|
+void
|
|
|
|
Cycle(client_data, id)
|
|
|
|
- caddr_t client_data;
|
|
|
|
- XtIntervalId id;
|
|
|
|
+ XtPointer client_data;
|
|
|
|
+ XtIntervalId* id;
|
|
|
|
{
|
|
|
|
|
|
|
|
Arg args[10];
|