wayland: Various whitespace cleanups

Broke up a long line, added an empty one, indented another one, and re-aligned
a large amount of function parameter names that got misaligned in some past
refactoring.

https://bugzilla.gnome.org/show_bug.cgi?id=791939
This commit is contained in:
Jonas Ådahl 2017-12-18 20:10:47 +08:00
parent a40923b03a
commit 5f19421bc9

View File

@ -211,9 +211,9 @@ struct _GdkSurfaceImplWaylandClass
};
static void gdk_wayland_surface_maybe_configure (GdkSurface *surface,
int width,
int height,
int scale);
int width,
int height,
int scale);
static void maybe_set_gtk_surface_dbus_properties (GdkSurface *surface);
static void maybe_set_gtk_surface_modal (GdkSurface *surface);
@ -227,14 +227,14 @@ static void gdk_wayland_surface_sync_opaque_region (GdkSurface *surface);
static void unset_transient_for_exported (GdkSurface *surface);
static void calculate_moved_to_rect_result (GdkSurface *surface,
int x,
int y,
int width,
int height,
GdkRectangle *flipped_rect,
GdkRectangle *final_rect,
gboolean *flipped_x,
gboolean *flipped_y);
int x,
int y,
int width,
int height,
GdkRectangle *flipped_rect,
GdkRectangle *final_rect,
gboolean *flipped_x,
gboolean *flipped_y);
static gboolean gdk_wayland_surface_is_exported (GdkSurface *surface);
@ -295,9 +295,9 @@ _gdk_wayland_surface_clear_saved_size (GdkSurface *surface)
*/
static void
gdk_wayland_surface_update_size (GdkSurface *surface,
int32_t width,
int32_t height,
int scale)
int32_t width,
int32_t height,
int scale)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -553,11 +553,11 @@ gdk_wayland_surface_update_scale (GdkSurface *surface)
static void gdk_wayland_surface_create_surface (GdkSurface *surface);
void
_gdk_wayland_display_create_surface_impl (GdkDisplay *display,
GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes)
_gdk_wayland_display_create_surface_impl (GdkDisplay *display,
GdkSurface *surface,
GdkSurface *real_parent,
GdkEventMask event_mask,
GdkSurfaceAttr *attributes)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkSurfaceImplWayland *impl;
@ -695,9 +695,9 @@ gdk_surface_impl_wayland_finalize (GObject *object)
static void
gdk_wayland_surface_configure (GdkSurface *surface,
int width,
int height,
int scale)
int width,
int height,
int scale)
{
GdkDisplay *display;
GdkEvent *event;
@ -744,9 +744,9 @@ is_realized_popup (GdkSurface *surface)
static void
gdk_wayland_surface_maybe_configure (GdkSurface *surface,
int width,
int height,
int scale)
int width,
int height,
int scale)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
gboolean is_xdg_popup;
@ -911,7 +911,7 @@ gdk_wayland_surface_sync_title (GdkSurface *surface)
}
static void
gdk_wayland_surface_get_window_geometry (GdkSurface *surface,
gdk_wayland_surface_get_window_geometry (GdkSurface *surface,
GdkRectangle *geometry)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -1194,7 +1194,9 @@ gdk_wayland_surface_handle_configure (GdkSurface *surface,
impl->pending.state = 0;
fixed_size =
new_state & (GDK_SURFACE_STATE_MAXIMIZED | GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_TILED);
new_state & (GDK_SURFACE_STATE_MAXIMIZED |
GDK_SURFACE_STATE_FULLSCREEN |
GDK_SURFACE_STATE_TILED);
saved_size = (width == 0 && height == 0);
/* According to xdg_shell, an xdg_surface.configure with size 0x0
@ -1780,8 +1782,8 @@ gdk_wayland_surface_announce_csd (GdkSurface *surface)
static GdkSurface *
get_real_parent_and_translate (GdkSurface *surface,
gint *x,
gint *y)
gint *x,
gint *y)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkSurface *parent = impl->transient_for;
@ -1812,8 +1814,8 @@ get_real_parent_and_translate (GdkSurface *surface,
static void
translate_to_real_parent_surface_geometry (GdkSurface *surface,
gint *x,
gint *y)
gint *x,
gint *y)
{
GdkSurface *parent;
@ -1825,8 +1827,8 @@ translate_to_real_parent_surface_geometry (GdkSurface *surface,
static GdkSurface *
translate_from_real_parent_surface_geometry (GdkSurface *surface,
gint *x,
gint *y)
gint *x,
gint *y)
{
GdkSurface *parent;
gint dx = 0;
@ -1841,7 +1843,7 @@ translate_from_real_parent_surface_geometry (GdkSurface *surface,
}
static void
calculate_popup_rect (GdkSurface *surface,
calculate_popup_rect (GdkSurface *surface,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
GdkRectangle *out_rect)
@ -2009,7 +2011,7 @@ flip_anchor_vertically (GdkGravity anchor)
}
static void
calculate_moved_to_rect_result (GdkSurface *surface,
calculate_moved_to_rect_result (GdkSurface *surface,
int x,
int y,
int width,
@ -2270,9 +2272,9 @@ create_simple_positioner (GdkSurface *surface,
}
static void
gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
GdkSurface *parent,
struct wl_seat *seat)
gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
GdkSurface *parent,
struct wl_seat *seat)
{
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -2376,7 +2378,8 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
}
static struct wl_seat *
find_grab_input_seat (GdkSurface *surface, GdkSurface *transient_for)
find_grab_input_seat (GdkSurface *surface,
GdkSurface *transient_for)
{
GdkSurface *attached_grab_surface;
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -2629,7 +2632,7 @@ gdk_wayland_surface_map (GdkSurface *surface)
static void
gdk_wayland_surface_show (GdkSurface *surface,
gboolean already_mapped)
gboolean already_mapped)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -2821,8 +2824,8 @@ gdk_surface_wayland_withdraw (GdkSurface *surface)
}
static void
gdk_surface_wayland_set_events (GdkSurface *surface,
GdkEventMask event_mask)
gdk_surface_wayland_set_events (GdkSurface *surface,
GdkEventMask event_mask)
{
GDK_SURFACE (surface)->event_mask = event_mask;
}
@ -2848,8 +2851,8 @@ gdk_surface_wayland_lower (GdkSurface *surface)
static void
gdk_surface_wayland_restack_toplevel (GdkSurface *surface,
GdkSurface *sibling,
gboolean above)
GdkSurface *sibling,
gboolean above)
{
}
@ -2881,11 +2884,11 @@ gdk_surface_request_transient_parent_commit (GdkSurface *surface)
static void
gdk_surface_wayland_move_resize (GdkSurface *surface,
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
gboolean with_move,
gint x,
gint y,
gint width,
gint height)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -2917,7 +2920,7 @@ gdk_surface_wayland_move_resize (GdkSurface *surface,
/* Avoid zero width/height as this is a protocol error */
static void
sanitize_anchor_rect (GdkSurface *surface,
sanitize_anchor_rect (GdkSurface *surface,
GdkRectangle *rect)
{
gint original_width = rect->width;
@ -2930,13 +2933,13 @@ sanitize_anchor_rect (GdkSurface *surface,
}
static void
gdk_surface_wayland_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
GdkAnchorHints anchor_hints,
gint rect_anchor_dx,
gint rect_anchor_dy)
gdk_surface_wayland_move_to_rect (GdkSurface *surface,
const GdkRectangle *rect,
GdkGravity rect_anchor,
GdkGravity surface_anchor,
GdkAnchorHints anchor_hints,
gint rect_anchor_dx,
gint rect_anchor_dy)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -2954,10 +2957,10 @@ gdk_surface_wayland_move_to_rect (GdkSurface *surface,
static void
gdk_surface_wayland_get_geometry (GdkSurface *surface,
gint *x,
gint *y,
gint *width,
gint *height)
gint *x,
gint *y,
gint *width,
gint *height)
{
if (!GDK_SURFACE_DESTROYED (surface))
{
@ -2974,10 +2977,10 @@ gdk_surface_wayland_get_geometry (GdkSurface *surface,
static void
gdk_surface_wayland_get_root_coords (GdkSurface *surface,
gint x,
gint y,
gint *root_x,
gint *root_y)
gint x,
gint y,
gint *root_x,
gint *root_y)
{
/*
* Wayland does not have a global coordinate space shared between surfaces. In
@ -3010,10 +3013,10 @@ gdk_surface_wayland_get_root_coords (GdkSurface *surface,
static gboolean
gdk_surface_wayland_get_device_state (GdkSurface *surface,
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
GdkDevice *device,
gdouble *x,
gdouble *y,
GdkModifierType *mask)
{
gboolean return_val;
@ -3036,10 +3039,10 @@ gdk_surface_wayland_get_device_state (GdkSurface *surface,
}
static void
gdk_surface_wayland_input_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
gdk_surface_wayland_input_shape_combine_region (GdkSurface *surface,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -3059,8 +3062,8 @@ gdk_surface_wayland_input_shape_combine_region (GdkSurface *surface,
static void
gdk_wayland_surface_destroy (GdkSurface *surface,
gboolean recursing,
gboolean foreign_destroy)
gboolean recursing,
gboolean foreign_destroy)
{
g_return_if_fail (GDK_IS_SURFACE (surface));
@ -3080,7 +3083,7 @@ gdk_wayland_surface_destroy (GdkSurface *surface,
static void
gdk_wayland_surface_focus (GdkSurface *surface,
guint32 timestamp)
guint32 timestamp)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -3099,7 +3102,7 @@ gdk_wayland_surface_focus (GdkSurface *surface,
static void
gdk_wayland_surface_set_type_hint (GdkSurface *surface,
GdkSurfaceTypeHint hint)
GdkSurfaceTypeHint hint)
{
GdkSurfaceImplWayland *impl;
@ -3251,7 +3254,7 @@ maybe_set_gtk_surface_modal (GdkSurface *surface)
static void
gdk_wayland_surface_set_modal_hint (GdkSurface *surface,
gboolean modal)
gboolean modal)
{
surface->modal_hint = modal;
maybe_set_gtk_surface_modal (surface);
@ -3259,26 +3262,26 @@ gdk_wayland_surface_set_modal_hint (GdkSurface *surface,
static void
gdk_wayland_surface_set_skip_taskbar_hint (GdkSurface *surface,
gboolean skips_taskbar)
gboolean skips_taskbar)
{
}
static void
gdk_wayland_surface_set_skip_pager_hint (GdkSurface *surface,
gboolean skips_pager)
gboolean skips_pager)
{
}
static void
gdk_wayland_surface_set_urgency_hint (GdkSurface *surface,
gboolean urgent)
gboolean urgent)
{
}
static void
gdk_wayland_surface_set_geometry_hints (GdkSurface *surface,
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask)
const GdkGeometry *geometry,
GdkSurfaceHints geom_mask)
{
GdkWaylandDisplay *display_wayland;
GdkSurfaceImplWayland *impl;
@ -3344,8 +3347,8 @@ gdk_wayland_surface_set_geometry_hints (GdkSurface *surface,
}
static void
gdk_wayland_surface_set_title (GdkSurface *surface,
const gchar *title)
gdk_wayland_surface_set_title (GdkSurface *surface,
const gchar *title)
{
GdkSurfaceImplWayland *impl;
const char *end;
@ -3380,14 +3383,14 @@ gdk_wayland_surface_set_title (GdkSurface *surface,
}
static void
gdk_wayland_surface_set_role (GdkSurface *surface,
const gchar *role)
gdk_wayland_surface_set_role (GdkSurface *surface,
const gchar *role)
{
}
static void
gdk_wayland_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
gdk_wayland_surface_set_startup_id (GdkSurface *surface,
const gchar *startup_id)
{
}
@ -3412,7 +3415,7 @@ check_transient_for_loop (GdkSurface *surface,
static void
gdk_wayland_surface_set_transient_for (GdkSurface *surface,
GdkSurface *parent)
GdkSurface *parent)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display_wayland =
@ -3451,8 +3454,8 @@ gdk_wayland_surface_set_transient_for (GdkSurface *surface,
}
static void
gdk_wayland_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect)
gdk_wayland_surface_get_frame_extents (GdkSurface *surface,
GdkRectangle *rect)
{
*rect = (GdkRectangle) {
.x = surface->x,
@ -3464,25 +3467,25 @@ gdk_wayland_surface_get_frame_extents (GdkSurface *surface,
static void
gdk_wayland_surface_set_accept_focus (GdkSurface *surface,
gboolean accept_focus)
gboolean accept_focus)
{
}
static void
gdk_wayland_surface_set_focus_on_map (GdkSurface *surface,
gboolean focus_on_map)
gboolean focus_on_map)
{
}
static void
gdk_wayland_surface_set_icon_list (GdkSurface *surface,
GList *surfaces)
GList *surfaces)
{
}
static void
gdk_wayland_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
gdk_wayland_surface_set_icon_name (GdkSurface *surface,
const gchar *name)
{
if (GDK_SURFACE_DESTROYED (surface))
return;
@ -3604,8 +3607,8 @@ gdk_wayland_surface_unmaximize (GdkSurface *surface)
}
static void
gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *surface,
GdkMonitor *monitor)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_output *output = ((GdkWaylandMonitor *)monitor)->output;
@ -3712,12 +3715,14 @@ gdk_wayland_surface_unfullscreen (GdkSurface *surface)
}
static void
gdk_wayland_surface_set_keep_above (GdkSurface *surface, gboolean setting)
gdk_wayland_surface_set_keep_above (GdkSurface *surface,
gboolean setting)
{
}
static void
gdk_wayland_surface_set_keep_below (GdkSurface *surface, gboolean setting)
gdk_wayland_surface_set_keep_below (GdkSurface *surface,
gboolean setting)
{
}
@ -3729,37 +3734,37 @@ gdk_wayland_surface_get_group (GdkSurface *surface)
static void
gdk_wayland_surface_set_group (GdkSurface *surface,
GdkSurface *leader)
GdkSurface *leader)
{
}
static void
gdk_wayland_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
gdk_wayland_surface_set_decorations (GdkSurface *surface,
GdkWMDecoration decorations)
{
}
static gboolean
gdk_wayland_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations)
gdk_wayland_surface_get_decorations (GdkSurface *surface,
GdkWMDecoration *decorations)
{
return FALSE;
}
static void
gdk_wayland_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
gdk_wayland_surface_set_functions (GdkSurface *surface,
GdkWMFunction functions)
{
}
static void
gdk_wayland_surface_begin_resize_drag (GdkSurface *surface,
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
GdkSurfaceEdge edge,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
@ -3845,11 +3850,11 @@ gdk_wayland_surface_begin_resize_drag (GdkSurface *surface,
static void
gdk_wayland_surface_begin_move_drag (GdkSurface *surface,
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
GdkDevice *device,
gint button,
gint root_x,
gint root_y,
guint32 timestamp)
{
GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
@ -3895,7 +3900,7 @@ gdk_wayland_surface_begin_move_drag (GdkSurface *surface,
static void
gdk_wayland_surface_set_opacity (GdkSurface *surface,
gdouble opacity)
gdouble opacity)
{
}
@ -3923,8 +3928,8 @@ gdk_wayland_surface_get_scale_factor (GdkSurface *surface)
}
static void
gdk_wayland_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region)
gdk_wayland_surface_set_opaque_region (GdkSurface *surface,
cairo_region_t *region)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
@ -3938,10 +3943,10 @@ gdk_wayland_surface_set_opaque_region (GdkSurface *surface,
static void
gdk_wayland_surface_set_shadow_width (GdkSurface *surface,
int left,
int right,
int top,
int bottom)
int left,
int right,
int top,
int bottom)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
gint new_width, new_height;
@ -3964,7 +3969,7 @@ gdk_wayland_surface_set_shadow_width (GdkSurface *surface,
static gboolean
gdk_wayland_surface_show_window_menu (GdkSurface *surface,
GdkEvent *event)
GdkEvent *event)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display_wayland =
@ -4104,7 +4109,7 @@ _gdk_surface_impl_wayland_class_init (GdkSurfaceImplWaylandClass *klass)
void
_gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
GdkSeat *seat)
GdkSeat *seat)
{
GdkSurfaceImplWayland *impl;
@ -4125,7 +4130,7 @@ _gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
**/
GdkSurface *
gdk_wayland_surface_new_subsurface (GdkDisplay *display,
const GdkRectangle *position)
const GdkRectangle *position)
{
GdkSurfaceAttr attr;
@ -4192,7 +4197,7 @@ gdk_wayland_surface_get_wl_egl_window (GdkSurface *surface)
EGLSurface
gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
EGLConfig config)
EGLConfig config)
{
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkSurfaceImplWayland *impl;
@ -4215,7 +4220,7 @@ gdk_wayland_surface_get_egl_surface (GdkSurface *surface,
EGLSurface
gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *surface,
EGLConfig config)
EGLConfig config)
{
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
GdkSurfaceImplWayland *impl;
@ -4332,13 +4337,13 @@ maybe_set_gtk_surface_dbus_properties (GdkSurface *surface)
}
void
gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *surface,
const char *application_id,
const char *app_menu_path,
const char *menubar_path,
const char *window_object_path,
const char *application_object_path,
const char *unique_bus_name)
gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *surface,
const char *application_id,
const char *app_menu_path,
const char *menubar_path,
const char *window_object_path,
const char *application_object_path,
const char *unique_bus_name)
{
GdkSurfaceImplWayland *impl;
@ -4359,8 +4364,8 @@ gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *surface,
void
_gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *surface,
int x,
int y)
int x,
int y)
{
GdkSurfaceImplWayland *impl;
@ -4438,9 +4443,9 @@ gdk_wayland_surface_is_exported (GdkSurface *surface)
*/
gboolean
gdk_wayland_surface_export_handle (GdkSurface *surface,
GdkWaylandSurfaceExported callback,
gpointer user_data,
GDestroyNotify destroy_func)
GdkWaylandSurfaceExported callback,
gpointer user_data,
GDestroyNotify destroy_func)
{
GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
@ -4541,7 +4546,7 @@ static const struct zxdg_imported_v1_listener xdg_imported_listener = {
*/
gboolean
gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface,
char *parent_handle_str)
char *parent_handle_str)
{
GdkSurfaceImplWayland *impl;
GdkWaylandDisplay *display_wayland;
@ -4583,7 +4588,7 @@ gdk_wayland_surface_get_inhibitor (GdkSurfaceImplWayland *impl,
void
gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
GdkSeat *gdk_seat)
{
GdkSurfaceImplWayland *impl= GDK_SURFACE_IMPL_WAYLAND (surface->impl);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
@ -4606,7 +4611,7 @@ gdk_wayland_surface_inhibit_shortcuts (GdkSurface *surface,
void
gdk_wayland_surface_restore_shortcuts (GdkSurface *surface,
GdkSeat *gdk_seat)
GdkSeat *gdk_seat)
{
GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (surface->impl);
struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat);