Merge pull request #838 from blueyed/streamline-util.deprecate-calls

Streamline/cleanup util.deprecate calls
This commit is contained in:
Daniel Hahler 2016-04-19 10:49:24 +02:00
commit 4d49f76e16
2 changed files with 18 additions and 29 deletions

View File

@ -69,8 +69,7 @@ client.focus = require("awful.client.focus")
-- If it is a function, it will be called with the client and its first -- If it is a function, it will be called with the client and its first
-- tag as arguments. -- tag as arguments.
function client.jumpto(c, merge) function client.jumpto(c, merge)
util.deprecate "Use c:jump_to(merge) instead of awful.client.jumpto" util.deprecate("Use c:jump_to(merge) instead of awful.client.jumpto")
client.object.jump_to(c, merge) client.object.jump_to(c, merge)
end end
@ -316,7 +315,7 @@ end
-- @client[opt] c The client, otherwise focused one is used. -- @client[opt] c The client, otherwise focused one is used.
-- @see client.relative_move -- @see client.relative_move
function client.moveresize(x, y, w, h, c) function client.moveresize(x, y, w, h, c)
util.deprecate "Use c:relative_move(x, y, w, h) instead of awful.client.moveresize" util.deprecate("Use c:relative_move(x, y, w, h) instead of awful.client.moveresize")
client.object.relative_move(c or capi.client.focus, x, y, w, h) client.object.relative_move(c or capi.client.focus, x, y, w, h)
end end
@ -342,7 +341,7 @@ end
-- @client[opt] c The client to move, otherwise the focused one is used. -- @client[opt] c The client to move, otherwise the focused one is used.
-- @see client.move_to_tag -- @see client.move_to_tag
function client.movetotag(target, c) function client.movetotag(target, c)
util.deprecate "Use c:move_to_tag(target) instead of awful.client.movetotag" util.deprecate("Use c:move_to_tag(target) instead of awful.client.movetotag")
client.object.move_to_tag(c or capi.client.focus, target) client.object.move_to_tag(c or capi.client.focus, target)
end end
@ -367,7 +366,7 @@ end
-- @client[opt] c The client to toggle, otherwise the focused one is used. -- @client[opt] c The client to toggle, otherwise the focused one is used.
-- @see client.toggle_tag -- @see client.toggle_tag
function client.toggletag(target, c) function client.toggletag(target, c)
util.deprecate "Use c:toggle_tag(target) instead of awful.client.toggletag" util.deprecate("Use c:toggle_tag(target) instead of awful.client.toggletag")
client.object.toggle_tag(c or capi.client.focus, target) client.object.toggle_tag(c or capi.client.focus, target)
end end
@ -403,8 +402,7 @@ end
-- @see screen -- @see screen
-- @see client.move_to_screen -- @see client.move_to_screen
function client.movetoscreen(c, s) function client.movetoscreen(c, s)
util.deprecate "Use c:move_to_screen(s) instead of awful.client.movetoscreen" util.deprecate("Use c:move_to_screen(s) instead of awful.client.movetoscreen")
client.object.move_to_screen(c or capi.client.focus, s) client.object.move_to_screen(c or capi.client.focus, s)
end end
@ -504,8 +502,7 @@ end
-- @deprecated awful.client.mark -- @deprecated awful.client.mark
-- @client c The client to mark, the focused one if not specified. -- @client c The client to mark, the focused one if not specified.
function client.mark(c) function client.mark(c)
util.deprecate "Use c.marked = true instead of awful.client.mark" util.deprecate("Use c.marked = true instead of awful.client.mark")
client.object.set_marked(c or capi.client.focus, true) client.object.set_marked(c or capi.client.focus, true)
end end
@ -513,8 +510,7 @@ end
-- @deprecated awful.client.unmark -- @deprecated awful.client.unmark
-- @client c The client to unmark, or the focused one if not specified. -- @client c The client to unmark, or the focused one if not specified.
function client.unmark(c) function client.unmark(c)
util.deprecate "Use c.marked = false instead of awful.client.unmark" util.deprecate("Use c.marked = false instead of awful.client.unmark")
client.object.set_marked(c or capi.client.focus, false) client.object.set_marked(c or capi.client.focus, false)
end end
@ -522,8 +518,7 @@ end
-- @deprecated awful.client.ismarked -- @deprecated awful.client.ismarked
-- @client c The client to check, or the focused one otherwise. -- @client c The client to check, or the focused one otherwise.
function client.ismarked(c) function client.ismarked(c)
util.deprecate "Use c.marked instead of awful.client.ismarked" util.deprecate("Use c.marked instead of awful.client.ismarked")
return client.object.get_marked(c or capi.client.focus) return client.object.get_marked(c or capi.client.focus)
end end
@ -531,8 +526,7 @@ end
-- @deprecated awful.client.togglemarked -- @deprecated awful.client.togglemarked
-- @client c The client to toggle mark. -- @client c The client to toggle mark.
function client.togglemarked(c) function client.togglemarked(c)
util.deprecate "Use c.marked = not c.marked instead of awful.client.togglemarked" util.deprecate("Use c.marked = not c.marked instead of awful.client.togglemarked")
c = c or capi.client.focus c = c or capi.client.focus
if c then if c then
c.marked = not c.marked c.marked = not c.marked
@ -561,7 +555,7 @@ end
-- @client c A client. -- @client c A client.
-- @param s True or false. -- @param s True or false.
function client.floating.set(c, s) function client.floating.set(c, s)
util.deprecate "Use c.floating = true instead of awful.client.floating.set" util.deprecate("Use c.floating = true instead of awful.client.floating.set")
client.object.set_floating(c, s) client.object.set_floating(c, s)
end end
@ -605,7 +599,7 @@ capi.client.connect_signal("property::geometry", store_floating_geometry)
-- @see is_fixed -- @see is_fixed
-- @see size_hints_honor -- @see size_hints_honor
function client.isfixed(c) function client.isfixed(c)
util.deprecate "Use c.is_fixed instead of awful.client.isfixed" util.deprecate("Use c.is_fixed instead of awful.client.isfixed")
c = c or capi.client.focus c = c or capi.client.focus
return client.object.is_fixed(c) return client.object.is_fixed(c)
end end
@ -644,7 +638,7 @@ end
-- did not set them manually. For example, windows with a type different than -- did not set them manually. For example, windows with a type different than
-- normal. -- normal.
function client.floating.get(c) function client.floating.get(c)
util.deprecate "Use c.floating instead of awful.client.floating.get" util.deprecate("Use c.floating instead of awful.client.floating.get")
return client.object.get_floating(c) return client.object.get_floating(c)
end end
@ -890,8 +884,7 @@ end
-- "toolbar" or "dock" -- "toolbar" or "dock"
-- @deprecated awful.client.dockable.get -- @deprecated awful.client.dockable.get
function client.dockable.get(c) function client.dockable.get(c)
util.deprecate "Use c.dockable instead of awful.client.dockable.get" util.deprecate("Use c.dockable instead of awful.client.dockable.get")
return client.object.get_dockable(c) return client.object.get_dockable(c)
end end
@ -929,7 +922,7 @@ end
-- @param value True or false. -- @param value True or false.
-- @deprecated awful.client.dockable.set -- @deprecated awful.client.dockable.set
function client.dockable.set(c, value) function client.dockable.set(c, value)
util.deprecate "Use c.dockable = value instead of awful.client.dockable.set" util.deprecate("Use c.dockable = value instead of awful.client.dockable.set")
client.property.set(c, "dockable", value) client.property.set(c, "dockable", value)
end end
@ -1062,7 +1055,7 @@ end
-- a matching parent client is found. -- a matching parent client is found.
-- @treturn client.client|nil The matching parent client or nil. -- @treturn client.client|nil The matching parent client or nil.
function client.get_transient_for_matching(c, matcher) function client.get_transient_for_matching(c, matcher)
util.deprecate ("Use c:get_transient_for_matching(matcher) instead of".. util.deprecate("Use c:get_transient_for_matching(matcher) instead of"..
"awful.client.get_transient_for_matching") "awful.client.get_transient_for_matching")
return client.object.get_transient_for_matching(c, matcher) return client.object.get_transient_for_matching(c, matcher)
@ -1091,9 +1084,8 @@ end
-- @client c2 The parent client to check. -- @client c2 The parent client to check.
-- @treturn client.client|nil The parent client or nil. -- @treturn client.client|nil The parent client or nil.
function client.is_transient_for(c, c2) function client.is_transient_for(c, c2)
util.deprecate ("Use c:is_transient_for(c2) instead of".. util.deprecate("Use c:is_transient_for(c2) instead of"..
"awful.client.is_transient_for") "awful.client.is_transient_for")
return client.object.is_transient_for(c, c2) return client.object.is_transient_for(c, c2)
end end

View File

@ -52,8 +52,7 @@ end
-- @return The squared distance of the screen to the provided point -- @return The squared distance of the screen to the provided point
-- @see screen.get_square_distance -- @see screen.get_square_distance
function screen.getdistance_sq(s, x, y) function screen.getdistance_sq(s, x, y)
util.deprecate "Use s:get_square_distance(x, y) instead of awful.screen.getdistance_sq" util.deprecate("Use s:get_square_distance(x, y) instead of awful.screen.getdistance_sq")
return screen.object.get_square_distance(s, x, y) return screen.object.get_square_distance(s, x, y)
end end
@ -174,12 +173,10 @@ end
-- @treturn table A table with left, right, top and bottom number values. -- @treturn table A table with left, right, top and bottom number values.
-- @see padding -- @see padding
function screen.padding(_screen, padding) function screen.padding(_screen, padding)
util.deprecate "Use _screen.padding = value instead of awful.screen.padding" util.deprecate("Use _screen.padding = value instead of awful.screen.padding")
if padding then if padding then
screen.object.set_padding(_screen, padding) screen.object.set_padding(_screen, padding)
end end
return screen.object.get_padding(_screen) return screen.object.get_padding(_screen)
end end