/* The offset we need to add to compensate for type A WMs. */
int move_offset_x;
int move_offset_y;
-
- void * extra;
};
#define XW_ALLOCATION_INDEX(xw) ((xw) -> allocation_index)
int y_size,
struct drawing_attributes * attributes,
struct xwindow_methods * methods,
- unsigned int extra);
+ unsigned int size);
extern void xw_set_wm_input_hint (struct xwindow * xw, int input_hint);
extern void xw_set_wm_name (struct xwindow * xw, const char * name);
int y_size,
struct drawing_attributes * attributes,
struct xwindow_methods * methods,
- unsigned int extra)
+ unsigned int size)
{
GC normal_gc;
GC reverse_gc;
background_pixel);
XDefineCursor (display, window, mouse_cursor);
XSelectInput (display, window, 0);
- xw
- = (x_malloc (((sizeof (struct xwindow)) - (sizeof (xw->extra)))
- + extra));
+ if (size < (sizeof (struct xwindow)))
+ error_external_return ();
+ xw = (x_malloc (size));
(XW_ALLOCATION_INDEX (xw)) = (allocate_table_index ((&x_window_table), xw));
(XW_XD (xw)) = xd;
(XW_WINDOW (xw)) = window;
int y_cursor;
};
-#define XW_EXTRA(xw) ((struct gw_extra *) ((xw) -> extra))
+struct xwindow_graphics
+{
+ struct xwindow xw;
+ struct gw_extra extra;
+};
+
+#define XW_EXTRA(xw) (& (((struct xwindow_graphics *) xw) -> extra))
#define XW_X_LEFT(xw) ((XW_EXTRA (xw)) -> x_left)
#define XW_X_RIGHT(xw) ((XW_EXTRA (xw)) -> x_right)
struct xwindow * xw =
(x_make_window
(xd, window, x_size, y_size, (&attributes), (&methods),
- (sizeof (struct gw_extra))));
+ (sizeof (struct xwindow_graphics))));
(XW_X_LEFT (xw)) = ((float) (-1));
(XW_X_RIGHT (xw)) = ((float) 1);
(XW_Y_BOTTOM (xw)) = ((float) (-1));
char cursor_enabled_p;
};
-#define XW_EXTRA(xw) ((struct xterm_extra *) ((xw) -> extra))
+struct xwindow_term
+{
+ struct xwindow xw;
+ struct xterm_extra extra;
+};
+
+#define XW_EXTRA(xw) (& (((struct xwindow_term *) xw) -> extra))
#define XW_X_CSIZE(xw) ((XW_EXTRA (xw)) -> x_size)
#define XW_Y_CSIZE(xw) ((XW_EXTRA (xw)) -> y_size)
(y_size - (size_hints->base_height)),
(&attributes),
(&methods),
- (sizeof (struct xterm_extra))));
+ (sizeof (struct xwindow_term))));
(XW_X_CSIZE (xw)) = x_csize;
(XW_Y_CSIZE (xw)) = y_csize;
(XW_CURSOR_X (xw)) = 0;