static void x_scroll_bar_redraw (struct scroll_bar *);
#endif
+\f
+
/* Global state maintained during a drag-and-drop operation. */
/* Flag that indicates if a drag-and-drop operation is in progress. */
for `x_dnd_toplevels' to work. */
static bool x_dnd_use_toplevels;
+\f
+
/* Motif drag-and-drop protocol support. */
/* Pointer to a variable which stores whether or not an X error
wdesc, &lmsg);
}
+\f
+
+/* Drag-and-drop and XDND protocol primitives employed by the event
+ loop. */
+
static void
x_dnd_free_toplevels (bool display_alive)
{
if (!xm_property_reply)
free (error);
- extent_property_reply = xcb_get_property_reply (dpyinfo->xcb_connection,
- extent_property_cookies[i],
- &error);
+ extent_property_reply
+ = xcb_get_property_reply (dpyinfo->xcb_connection,
+ extent_property_cookies[i],
+ &error);
if (!extent_property_reply)
free (error);
#else
if (xm_property_reply
&& xm_property_reply->format == 8
- && xm_property_reply->type == dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO
+ && (xm_property_reply->type
+ == dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO)
&& xcb_get_property_value_length (xm_property_reply) >= 4)
{
xmdata = xcb_get_property_value (xm_property_reply);
XFree (rects);
}
#else
- bounding_rect_reply = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
- bounding_rect_cookies[i],
- &error);
+ bounding_rect_reply
+ = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
+ bounding_rect_cookies[i],
+ &error);
if (bounding_rect_reply)
{
* sizeof *tem->bounding_rects);
tem->n_bounding_rects = 0;
- for (; bounding_rect_iterator.rem; xcb_rectangle_next (&bounding_rect_iterator))
+ for (; bounding_rect_iterator.rem;
+ xcb_rectangle_next (&bounding_rect_iterator))
{
tem->bounding_rects[tem->n_bounding_rects].x
= bounding_rect_iterator.data->x;
|| (dpyinfo->xshape_major == 1
&& dpyinfo->xshape_minor >= 1))
{
- input_rect_reply = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
- input_rect_cookies[i],
- &error);
+ input_rect_reply
+ = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
+ input_rect_cookies[i],
+ &error);
if (input_rect_reply)
{
* sizeof *tem->input_rects);
tem->n_input_rects = 0;
- for (; input_rect_iterator.rem; xcb_rectangle_next (&input_rect_iterator))
+ for (; input_rect_iterator.rem;
+ xcb_rectangle_next (&input_rect_iterator))
{
tem->input_rects[tem->n_input_rects].x
= input_rect_iterator.data->x;
if (tem->n_input_rects == -1
&& tem->n_bounding_rects == 1
#ifdef USE_XCB
- && tem->bounding_rects[0].width == (geometry_reply->width
- + geometry_reply->border_width)
- && tem->bounding_rects[0].height == (geometry_reply->height
- + geometry_reply->border_width)
- && tem->bounding_rects[0].x == -geometry_reply->border_width
- && tem->bounding_rects[0].y == -geometry_reply->border_width
+ && (tem->bounding_rects[0].width
+ == (geometry_reply->width
+ + geometry_reply->border_width))
+ && (tem->bounding_rects[0].height
+ == (geometry_reply->height
+ + geometry_reply->border_width))
+ && (tem->bounding_rects[0].x
+ == -geometry_reply->border_width)
+ && (tem->bounding_rects[0].y
+ == -geometry_reply->border_width)
#else
- && tem->bounding_rects[0].width == attrs.width + attrs.border_width
- && tem->bounding_rects[0].height == attrs.height + attrs.border_width
- && tem->bounding_rects[0].x == -attrs.border_width
- && tem->bounding_rects[0].y == -attrs.border_width
+ && (tem->bounding_rects[0].width
+ == attrs.width + attrs.border_width)
+ && (tem->bounding_rects[0].height
+ == attrs.height + attrs.border_width)
+ && (tem->bounding_rects[0].x
+ == -attrs.border_width)
+ && (tem->bounding_rects[0].y
+ == -attrs.border_width)
#endif
)
{
#ifdef HAVE_XCB_SHAPE
if (dpyinfo->xshape_supported_p)
{
- bounding_rect_reply = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
- bounding_rect_cookies[i],
- &error);
+ bounding_rect_reply
+ = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
+ bounding_rect_cookies[i],
+ &error);
if (bounding_rect_reply)
free (bounding_rect_reply);
|| (dpyinfo->xshape_major == 1
&& dpyinfo->xshape_minor >= 1)))
{
- input_rect_reply = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
- input_rect_cookies[i],
- &error);
+ input_rect_reply
+ = xcb_shape_get_rectangles_reply (dpyinfo->xcb_connection,
+ input_rect_cookies[i],
+ &error);
if (input_rect_reply)
free (input_rect_reply);
if (tem->n_input_rects == -1
|| x_dnd_get_target_window_2 (tem->input_rects,
tem->n_input_rects,
- tem->border_width + root_x - tem->x,
- tem->border_width + root_y - tem->y))
+ (tem->border_width
+ + root_x - tem->x),
+ (tem->border_width
+ + root_y - tem->y)))
{
chosen = tem;
break;
(xcb_window_t) window,
(xcb_atom_t) dpyinfo->Xatom_XdndProxy,
XA_WINDOW, 0, 1);
- xm_style_cookie = xcb_get_property (dpyinfo->xcb_connection, 0,
- (xcb_window_t) window,
- (xcb_atom_t) dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO,
- (xcb_atom_t) dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO,
- 0, 4);
+ xm_style_cookie
+ = xcb_get_property (dpyinfo->xcb_connection, 0,
+ (xcb_window_t) window,
+ (xcb_atom_t) dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO,
+ (xcb_atom_t) dpyinfo->Xatom_MOTIF_DRAG_RECEIVER_INFO,
+ 0, 4);
reply = xcb_get_property_reply (dpyinfo->xcb_connection,
wmstate_cookie, &error);
x_restore_events_after_dnd (f, &x_dnd_old_window_attrs);
}
+\f
+
+/* Primitives for simplified drag-and-drop tracking when items are
+ being dragged between frames comprising the same Emacs session. */
+
static void
x_dnd_note_self_position (struct x_display_info *dpyinfo, Window target,
unsigned short root_x, unsigned short root_y)
kbd_buffer_store_event (&ie);
}
+\f
+
+/* Miscellaneous X event and graphics extension functions. */
+
/* Flush display of frame F. */
static void
#endif
-#ifdef HAVE_XINPUT2
-bool
-xi_frame_selected_for (struct frame *f, unsigned long event)
-{
- XIEventMask *masks;
- int i;
-
- masks = FRAME_X_OUTPUT (f)->xi_masks;
-
- if (!masks)
- return false;
-
- for (i = 0; i < FRAME_X_OUTPUT (f)->num_xi_masks; ++i)
- {
- if (masks[i].mask_len >= XIMaskLen (event)
- && XIMaskIsSet (masks[i].mask, event))
- return true;
- }
+\f
- return false;
-}
-#endif
+/* Miscelaneous event handling functions. */
static void
x_toolkit_position (struct frame *f, int x, int y,
#endif /* HAVE_CAIRO */
+\f
+
+/* X input extension device and event mask management functions. */
+
#ifdef HAVE_XINPUT2
+bool
+xi_frame_selected_for (struct frame *f, unsigned long event)
+{
+ XIEventMask *masks;
+ int i;
+
+ masks = FRAME_X_OUTPUT (f)->xi_masks;
+
+ if (!masks)
+ return false;
+
+ for (i = 0; i < FRAME_X_OUTPUT (f)->num_xi_masks; ++i)
+ {
+ if (masks[i].mask_len >= XIMaskLen (event)
+ && XIMaskIsSet (masks[i].mask, event))
+ return true;
+ }
+
+ return false;
+}
+
/* Convert XI2 button state IN to a standard X button modifier
mask, and place it in OUT. */
+
static void
xi_convert_button_state (XIButtonState *in, unsigned int *out)
{
#ifdef USE_GTK
static
-#endif
+#endif /* USE_GTK */
unsigned int
xi_convert_event_state (XIDeviceEvent *xev)
{
}
/* Free all XI2 devices on DPYINFO. */
+
static void
x_free_xi_devices (struct x_display_info *dpyinfo)
{
#ifdef HAVE_XINPUT2_2
struct xi_touch_point_t *tem, *last;
-#endif
+#endif /* HAVE_XINPUT2_2 */
block_input ();
{
#ifdef HAVE_XINPUT2_1
xfree (dpyinfo->devices[i].valuators);
-#endif
+#endif /* HAVE_XINPUT2_1 */
#ifdef HAVE_XINPUT2_2
tem = dpyinfo->devices[i].touchpoints;
tem = tem->next;
xfree (last);
}
-#endif
+#endif /* HAVE_XINPUT2_2 */
}
xfree (dpyinfo->devices);
valuator->number = info->number;
}
-#endif
+#endif /* HAVE_XINPUT2_1 */
static void
xi_populate_device_from_info (struct x_display_info *dpyinfo,
int actual_valuator_count, c;
XIScrollClassInfo *info;
XIValuatorClassInfo *valuator_info;
-#endif
+#endif /* HAVE_XINPUT2_1 */
#ifdef HAVE_XINPUT2_2
XITouchClassInfo *touch_info;
-#endif
+#endif /* HAVE_XINPUT2_2 */
#ifdef HAVE_XINPUT2_1
USE_SAFE_ALLOCA;
-#endif
+#endif /* HAVE_XINPUT2_1 */
/* Initialize generic information about the device: its ID, which
buttons are currently pressed and thus presumably actively
}
#endif /* HAVE_XINPUT2_1 */
+#endif /* HAVE_XINPUT2 */
-#endif
+\f
+
+/* Cairo context, X rendering extension, and GC auxiliary data
+ management functions. */
#ifdef USE_CAIRO
#endif /* USE_CAIRO */
#if defined HAVE_XRENDER
+
void
x_xr_apply_ext_clip (struct frame *f, GC gc)
{
FRAME_X_PICTURE (f),
CPClipMask, &attrs);
}
-#endif
+
+#endif /* HAVE_XRENDER */
static void
x_set_clip_rectangles (struct frame *f, GC gc, XRectangle *rectangles, int n)
#endif
}
+\f
+
+/* Graphics primitives. */
static void
x_clear_rectangle (struct frame *f, GC gc, int x, int y, int width, int height,
x_stop_ignoring_errors (dpyinfo);
}
+\f
+
/***********************************************************************
Starting and ending an update
***********************************************************************/
}
#endif
+\f
+
/**
* x_clear_under_internal_border:
*