…lines 1–48 unchanged (48 lines)
49end
50
51--- Add an initialization callback.
52-- This callback will be executed before the mouse grabbing starts.
53-- @function awful.mouse.resize.add_enter_callback
54-- @tparam function cb The callback (or nil)
55-- @tparam[opt="other"] string context The callback context
56function module.add_enter_callback(cb, context)
57 context = context or "other"
58 callbacks.enter[context] = callbacks.enter[context] or {}
59 table.insert(callbacks.enter[context], cb)
60end
61
62--- Add a "move" callback.
63-- This callback is executed in "after" mode (see `set_mode`) instead of
64-- applying the operation.
65-- @function awful.mouse.resize.add_move_callback
66-- @tparam function cb The callback (or nil)
67-- @tparam[opt="other"] string context The callback context
68function module.add_move_callback(cb, context)
69 context = context or "other"
70 callbacks.move[context] = callbacks.move[context] or {}
71 table.insert(callbacks.move[context], cb)
72end
73
74--- Add a "leave" callback
75-- This callback is executed just before the `mousegrabber` stop
76-- @function awful.mouse.resize.add_leave_callback
77-- @tparam function cb The callback (or nil)
78-- @tparam[opt="other"] string context The callback context
79function module.add_leave_callback(cb, context)
80 context = context or "other"
81 callbacks.leave[context] = callbacks.leave[context] or {}
82 table.insert(callbacks.leave[context], cb)
83end
84
…lines 85–89 unchanged (5 lines)
90-- * *move_callback*: A function called when the mouse moves.
91-- * *leave_callback*: A function called before the `mousegrabber` is released.
92-- * *mode*: The resize mode.
93--
94-- @function awful.mouse.resize
95-- @tparam client client A client.
96-- @tparam[opt=mouse.resize] string context The resizing context.
97-- @tparam[opt={}] table args A set of `awful.placement` arguments.
98-- @request wibox geometry mouse.resize granted Requests to resize the wibox.
99-- @usebeautiful beautiful.cursor_mouse_move
100-- @usebeautiful beautiful.cursor_mouse_resize
101local function handler(_, client, context, args) --luacheck: no unused_args
102 args = args or {}
103 context = context or "mouse.resize"
104
105 local placement = args.placement
106
…lines 107–252 unchanged (146 lines)