}
static void
-gdk_broadway_surface_begin_resize_drag (GdkSurface *surface,
- GdkSurfaceEdge edge,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
+gdk_broadway_toplevel_begin_resize (GdkToplevel *toplevel,
+ GdkSurfaceEdge edge,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
{
+ GdkSurface *surface = GDK_SURFACE (toplevel);
+ GdkBroadwaySurface *impl = GDK_BROADWAY_SURFACE (surface);
MoveResizeData *mv_resize;
- GdkBroadwaySurface *impl;
-
- impl = GDK_BROADWAY_SURFACE (surface);
if (GDK_SURFACE_DESTROYED (surface))
return;
}
static void
-gdk_broadway_surface_begin_move_drag (GdkSurface *surface,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
+gdk_broadway_toplevel_begin_move (GdkToplevel *toplevel,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
{
+ GdkSurface *surface = GDK_SURFACE (toplevel);
+ GdkBroadwaySurface *impl = GDK_BROADWAY_SURFACE (surface);
MoveResizeData *mv_resize;
- GdkBroadwaySurface *impl;
-
- impl = GDK_BROADWAY_SURFACE (surface);
if (GDK_SURFACE_DESTROYED (surface))
return;
impl_class->set_input_region = gdk_broadway_surface_set_input_region;
impl_class->destroy = _gdk_broadway_surface_destroy;
impl_class->beep = gdk_broadway_surface_beep;
- impl_class->begin_resize_drag = gdk_broadway_surface_begin_resize_drag;
- impl_class->begin_move_drag = gdk_broadway_surface_begin_move_drag;
impl_class->destroy_notify = gdk_broadway_surface_destroy_notify;
impl_class->drag_begin = _gdk_broadway_surface_drag_begin;
impl_class->get_scale_factor = gdk_broadway_surface_get_scale_factor;
iface->lower = gdk_broadway_toplevel_lower;
iface->focus = gdk_broadway_toplevel_focus;
iface->show_window_menu = gdk_broadway_toplevel_show_window_menu;
+ iface->begin_resize = gdk_broadway_toplevel_begin_resize;
+ iface->begin_move = gdk_broadway_toplevel_begin_move;
}
typedef struct
return similar_surface;
}
-/**
- * gdk_surface_begin_resize_drag:
- * @surface: a toplevel #GdkSurface
- * @edge: the edge or corner from which the drag is started
- * @device: the device used for the operation
- * @button: the button being used to drag, or 0 for a keyboard-initiated drag
- * @x: surface X coordinate of mouse click that began the drag
- * @y: surface Y coordinate of mouse click that began the drag
- * @timestamp: timestamp of mouse click that began the drag (use gdk_event_get_time())
- *
- * Begins a surface resize operation (for a toplevel surface).
- * You might use this function to implement a “window resize grip,”
- */
-void
-gdk_surface_begin_resize_drag (GdkSurface *surface,
- GdkSurfaceEdge edge,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
-{
- if (device == NULL)
- {
- GdkSeat *seat = gdk_display_get_default_seat (surface->display);
- if (button == 0)
- device = gdk_seat_get_keyboard (seat);
- else
- device = gdk_seat_get_pointer (seat);
- }
-
- GDK_SURFACE_GET_CLASS (surface)->begin_resize_drag (surface, edge, device, button, x, y, timestamp);
-}
-
-/**
- * gdk_surface_begin_move_drag:
- * @surface: a toplevel #GdkSurface
- * @device: the device used for the operation
- * @button: the button being used to drag, or 0 for a keyboard-initiated drag
- * @x: surface X coordinate of mouse click that began the drag
- * @y: surface Y coordinate of mouse click that began the drag
- * @timestamp: timestamp of mouse click that began the drag
- *
- * Begins a surface move operation (for a toplevel surface).
- */
-void
-gdk_surface_begin_move_drag (GdkSurface *surface,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
-{
- if (device == NULL)
- {
- GdkSeat *seat = gdk_display_get_default_seat (surface->display);
- if (button == 0)
- device = gdk_seat_get_keyboard (seat);
- else
- device = gdk_seat_get_pointer (seat);
- }
-
- GDK_SURFACE_GET_CLASS (surface)->begin_move_drag (surface, device, button, x, y, timestamp);
-}
-
/* This function is called when the XWindow is really gone.
*/
void
/* optional */
gboolean (* beep) (GdkSurface *surface);
- void (* begin_resize_drag) (GdkSurface *surface,
- GdkSurfaceEdge edge,
- GdkDevice *device,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp);
- void (* begin_move_drag) (GdkSurface *surface,
- GdkDevice *device,
- gint button,
- gint root_x,
- gint root_y,
- guint32 timestamp);
void (* destroy_notify) (GdkSurface *surface);
GdkDrag * (* drag_begin) (GdkSurface *surface,
GdkDevice *device,
* gdk_toplevel_begin_resize:
* @toplevel: a #GdkToplevel
* @edge: the edge or corner from which the drag is started
- * @device: the device used for the operation
+ * @device: (nullable): the device used for the operation
* @button: the button being used to drag, or 0 for a keyboard-initiated drag
* @x: surface X coordinate of mouse click that began the drag
* @y: surface Y coordinate of mouse click that began the drag
double y,
guint32 timestamp)
{
- gdk_surface_begin_resize_drag (GDK_SURFACE (toplevel), edge, device, button, round (x), round (y), timestamp);
+ g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
+
+ if (device == NULL)
+ {
+ GdkSeat *seat = gdk_display_get_default_seat (GDK_SURFACE (toplevel)->display);
+ if (button == 0)
+ device = gdk_seat_get_keyboard (seat);
+ else
+ device = gdk_seat_get_pointer (seat);
+ }
+
+ GDK_TOPLEVEL_GET_IFACE (toplevel)->begin_resize (toplevel,
+ edge,
+ device,
+ button,
+ x, y,
+ timestamp);
}
/**
double y,
guint32 timestamp)
{
- gdk_surface_begin_move_drag (GDK_SURFACE (toplevel), device, button, round (x), round (y), timestamp);
+ g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
+
+ if (device == NULL)
+ {
+ GdkSeat *seat = gdk_display_get_default_seat (GDK_SURFACE (toplevel)->display);
+ if (button == 0)
+ device = gdk_seat_get_keyboard (seat);
+ else
+ device = gdk_seat_get_pointer (seat);
+ }
+
+ GDK_TOPLEVEL_GET_IFACE (toplevel)->begin_move (toplevel,
+ device,
+ button,
+ x, y,
+ timestamp);
}
void (* inhibit_system_shortcuts) (GdkToplevel *toplevel,
GdkEvent *event);
void (* restore_system_shortcuts) (GdkToplevel *toplevel);
+ void (* begin_resize) (GdkToplevel *toplevel,
+ GdkSurfaceEdge edge,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp);
+ void (* begin_move) (GdkToplevel *toplevel,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp);
};
typedef enum
}
static void
-gdk_wayland_surface_begin_resize_drag (GdkSurface *surface,
- GdkSurfaceEdge edge,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
+gdk_wayland_toplevel_begin_resize (GdkToplevel *toplevel,
+ GdkSurfaceEdge edge,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
{
+ GdkSurface *surface = GDK_SURFACE (toplevel);
GdkWaylandSurface *impl;
GdkWaylandDisplay *display_wayland;
GdkEventSequence *sequence;
break;
default:
- g_warning ("gdk_surface_begin_resize_drag: bad resize edge %d!", edge);
+ g_warning ("gdk_toplevel_begin_resize: bad resize edge %d!", edge);
return;
}
}
static void
-gdk_wayland_surface_begin_move_drag (GdkSurface *surface,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
+gdk_wayland_toplevel_begin_move (GdkToplevel *toplevel,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
{
+ GdkSurface *surface = GDK_SURFACE (toplevel);
GdkWaylandSurface *impl;
GdkWaylandDisplay *display_wayland;
GdkEventSequence *sequence;
impl_class->destroy = gdk_wayland_surface_destroy;
impl_class->beep = gdk_wayland_surface_beep;
- impl_class->begin_resize_drag = gdk_wayland_surface_begin_resize_drag;
- impl_class->begin_move_drag = gdk_wayland_surface_begin_move_drag;
impl_class->destroy_notify = gdk_wayland_surface_destroy_notify;
impl_class->drag_begin = _gdk_wayland_surface_drag_begin;
impl_class->get_scale_factor = gdk_wayland_surface_get_scale_factor;
iface->supports_edge_constraints = gdk_wayland_toplevel_supports_edge_constraints;
iface->inhibit_system_shortcuts = gdk_wayland_toplevel_inhibit_system_shortcuts;
iface->restore_system_shortcuts = gdk_wayland_toplevel_restore_system_shortcuts;
+ iface->begin_resize = gdk_wayland_toplevel_begin_resize;
+ iface->begin_move = gdk_wayland_toplevel_begin_move;
}
static void
}
static void
-gdk_win32_surface_begin_resize_drag (GdkSurface *window,
- GdkSurfaceEdge edge,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
-{
+gdk_win32_toplevel_begin_resize (GdkToplevel *toplevel,
+ GdkSurfaceEdge edge,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
+{
+ GdkSurface *window = GDK_SURFACE (toplevel);
GdkWin32Surface *impl;
- g_return_if_fail (GDK_IS_SURFACE (window));
-
if (GDK_SURFACE_DESTROYED (window) ||
IsIconic (GDK_SURFACE_HWND (window)))
return;
}
static void
-gdk_win32_surface_begin_move_drag (GdkSurface *window,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
-{
+gdk_win32_toplevel_begin_move (GdkToplevel *toplevel,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
+{
+ GdkSurface *window = GDK_SURFACE (toplevel);
GdkWin32Surface *impl;
- g_return_if_fail (GDK_IS_SURFACE (window));
-
if (GDK_SURFACE_DESTROYED (window) ||
IsIconic (GDK_SURFACE_HWND (window)))
return;
impl_class->set_shadow_width = gdk_win32_surface_set_shadow_width;
- impl_class->begin_resize_drag = gdk_win32_surface_begin_resize_drag;
- impl_class->begin_move_drag = gdk_win32_surface_begin_move_drag;
impl_class->destroy_notify = gdk_win32_surface_destroy_notify;
impl_class->drag_begin = _gdk_win32_surface_drag_begin;
impl_class->create_gl_context = _gdk_win32_surface_create_gl_context;
iface->focus = gdk_win32_toplevel_focus;
iface->show_window_menu = gdk_win32_toplevel_show_window_menu;
iface->supports_edge_constraints = gdk_win32_toplevel_supports_edge_constraints;
+ iface->begin_resize = gdk_win32_toplevel_begin_resize;
+ iface->begin_move = gdk_win32_toplevel_begin_move;
}
typedef struct
break;
default:
- g_warning ("gdk_surface_begin_resize_drag: bad resize edge %d!",
+ g_warning ("gdk_toplevel_begin_resize: bad resize edge %d!",
edge);
return;
}
}
static void
-gdk_x11_surface_begin_resize_drag (GdkSurface *surface,
- GdkSurfaceEdge edge,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
+gdk_x11_toplevel_begin_resize (GdkToplevel *toplevel,
+ GdkSurfaceEdge edge,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
{
+ GdkSurface *surface = GDK_SURFACE (toplevel);
int root_x, root_y;
if (GDK_SURFACE_DESTROYED (surface))
}
static void
-gdk_x11_surface_begin_move_drag (GdkSurface *surface,
- GdkDevice *device,
- gint button,
- gint x,
- gint y,
- guint32 timestamp)
+gdk_x11_toplevel_begin_move (GdkToplevel *toplevel,
+ GdkDevice *device,
+ int button,
+ double x,
+ double y,
+ guint32 timestamp)
{
+ GdkSurface *surface = GDK_SURFACE (toplevel);
int root_x, root_y;
gint direction;
impl_class->destroy = gdk_x11_surface_destroy;
impl_class->beep = gdk_x11_surface_beep;
- impl_class->begin_resize_drag = gdk_x11_surface_begin_resize_drag;
- impl_class->begin_move_drag = gdk_x11_surface_begin_move_drag;
impl_class->destroy_notify = gdk_x11_surface_destroy_notify;
impl_class->drag_begin = _gdk_x11_surface_drag_begin;
impl_class->get_scale_factor = gdk_x11_surface_get_scale_factor;
iface->supports_edge_constraints = gdk_x11_toplevel_supports_edge_constraints;
iface->inhibit_system_shortcuts = gdk_x11_toplevel_inhibit_system_shortcuts;
iface->restore_system_shortcuts = gdk_x11_toplevel_restore_system_shortcuts;
+ iface->begin_resize = gdk_x11_toplevel_begin_resize;
+ iface->begin_move = gdk_x11_toplevel_begin_move;
}
typedef struct {