aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-29 16:01:52 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-29 16:01:52 +0000
commit6098652ed7d28468ab38931a87a4fa9caec337d3 (patch)
tree606f7e7461a83cd0788cf44a824241da0f48b520
parent11819eb2b7b08c8e0cd0863cdfeb030537d2a257 (diff)
C99
-rw-r--r--Sgraph.c74
-rw-r--r--SgraphP.h32
2 files changed, 51 insertions, 55 deletions
diff --git a/Sgraph.c b/Sgraph.c
index 704583f..c278f0b 100644
--- a/Sgraph.c
+++ b/Sgraph.c
@@ -70,50 +70,46 @@ static XtResource resources[] = {
#undef offset
SgraphClassRec sgraphClassRec = {
- /* core */
- {
- &widgetClassRec, /* superclass */
- "Sgraph", /* class_name */
- sizeof(SgraphRec), /* widget_size */
- NULL, /* class_initialize */
- NULL, /* class_part_initialize */
- False, /* class_inited */
- Initialize, /* initialize */
- NULL, /* initialize_hook */
- Realize, /* realize */
- NULL, /* actions */
- 0, /* num_actions */
- resources, /* resources */
- XtNumber(resources), /* num_resources */
- NULLQUARK, /* xrm_class */
- True, /* compress_motion */
- True, /* compress_exposure */
- True, /* compress_enterleave */
- False, /* visible_interest */
- NULL, /* destroy */
- Resize, /* resize */
- Redisplay, /* expose */
- NULL, /* set_values */
- NULL, /* set_values_hook */
- XtInheritSetValuesAlmost, /* set_values_almost */
- NULL, /* get_values_hook */
- NULL, /* accept_focus */
- XtVersion, /* version */
- NULL, /* callback_private */
- XtInheritTranslations, /* tm_table */
- XtInheritQueryGeometry, /* query_geometry */
- XtInheritDisplayAccelerator, /* display_accelerator */
- NULL, /* extension */
+ .core_class = {
+ .superclass = (WidgetClass)&widgetClassRec,
+ .class_name = "Sgraph",
+ .widget_size = sizeof(SgraphRec),
+ .class_initialize = NULL,
+ .class_part_initialize = NULL,
+ .class_inited = False,
+ .initialize = Initialize,
+ .initialize_hook = NULL,
+ .realize = Realize,
+ .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 = XtInheritTranslations,
+ .query_geometry = XtInheritQueryGeometry,
+ .display_accelerator = XtInheritDisplayAccelerator,
+ .extension = NULL,
},
- /* sgraph */
- {
- NULL, /* extension */
+ .sgraph_class = {
+ .extension = NULL,
}
};
WidgetClass sgraphWidgetClass = (WidgetClass)&sgraphClassRec;
-/* Implementation */
-
static void
GetGC(Widget w)
{
diff --git a/SgraphP.h b/SgraphP.h
index 7a08950..19ed24b 100644
--- a/SgraphP.h
+++ b/SgraphP.h
@@ -27,7 +27,7 @@
#define XtRSgraphResource "SgraphResource"
typedef struct {
- XtPointer dummy;
+ XtPointer extension;
} SgraphClassPart;
typedef struct _SgraphClassRec {
@@ -38,30 +38,30 @@ typedef struct _SgraphClassRec {
extern SgraphClassRec sgraphClassRec;
typedef struct {
- Pixel background;
- Pixel foreground;
- Boolean mirror;
- int *data;
- size_t size;
- size_t samples;
+ Pixel background;
+ Pixel foreground;
+ Boolean mirror;
+ int *data;
+ size_t size;
+ size_t samples;
/*
XtCallbackProc data;
XtCallbackProc fft;
*/
XdbeBackBuffer backBuf;
- GC foreGC;
- GC backGC;
- GC maskGC;
- GC clipGC;
- Pixmap bg;
- Pixmap mask;
- Pixmap waterfall;
+ GC foreGC;
+ GC backGC;
+ GC maskGC;
+ GC clipGC;
+ Pixmap bg;
+ Pixmap mask;
+ Pixmap waterfall;
} SgraphPart;
typedef struct _SgraphRec {
- CorePart core;
- SgraphPart sgraph;
+ CorePart core;
+ SgraphPart sgraph;
} SgraphRec;
#endif