-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgwin.c
95 lines (89 loc) · 3.05 KB
/
gwin.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* File: gwin.c
*
* Graphics window widget code
* (based on the Athena template widget)
*
* Copyright (C) 1994 Risto Miikkulainen
*
* This software can be copied, modified and distributed freely for
* educational and research purposes, provided that this notice is included
* in the code, and the author is acknowledged in any materials and reports
* that result from its use. It may not be used for commercial purposes
* without expressed permission from the author.
*
* $Id: gwin.c,v 1.6 1994/08/10 10:27:28 risto Exp $
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include "GwinP.h"
/* make space for the resource data here */
static XtResource resources[] =
{
#define offset(field) XtOffset(GwinWidget, gwin.field)
/* {name, class, type, size, offset, default_type, default_addr}, */
{XtNexposeCallback, XtCCallback, XtRCallback, sizeof (XtCallbackList),
offset (expose_callback), XtRCallback, NULL},
{XtNresizeCallback, XtCCallback, XtRCallback, sizeof (XtCallbackList),
offset (resize_callback), XtRCallback, NULL},
#undef offset
};
/* redraw callback call */
/* ARGSUSED */
static void
Redisplay (w, event, region)
Widget w;
XEvent *event; /* unused */
Region region;
{
XtCallCallbacks (w, XtNexposeCallback, (XtPointer) region);
}
/* resize callback call */
/* ARGSUSED */
static void
Resize (w)
Widget w;
{
XtCallCallbacks (w, XtNresizeCallback, NULL);
}
/* widget class definition */
GwinClassRec gwinClassRec =
{
{ /* core fields */
/* superclass */ (WidgetClass) &widgetClassRec,
/* class_name */ "Gwin",
/* widget_size */ sizeof (GwinRec),
/* class_initialize */ NULL,
/* class_part_initialize */ NULL,
/* class_inited */ FALSE,
/* initialize */ NULL,
/* initialize_hook */ NULL,
/* realize */ XtInheritRealize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* num_resources */ XtNumber (resources),
/* xrm_class */ NULLQUARK,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
/* compress_enterleave */ TRUE,
/* visible_interest */ FALSE,
/* destroy */ NULL,
/* resize */ Resize,
/* expose */ Redisplay,
/* set_values */ NULL,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ NULL,
/* query_geometry */ XtInheritQueryGeometry,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
},
{ /* template fields */
/* empty */ 0
}
};
WidgetClass gwinWidgetClass = (WidgetClass) &gwinClassRec;