From 801a1f0a89a754dd7806b1fcd3006b3b364936cc Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Tue, 30 May 2017 10:34:33 +0200 Subject: [PATCH] Deprecate widget-drawing functions in gears.surface This marks the functions gears.surface.widget_to_svg() and gears.surface.widget_to_surface() as deprecated in awesome 5. This means that by the time that awesome 6 becomes a thing, we can finally remove these... Signed-off-by: Uli Schlachter --- lib/gears/surface.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/gears/surface.lua b/lib/gears/surface.lua index 21b5c795..1edfcd19 100644 --- a/lib/gears/surface.lua +++ b/lib/gears/surface.lua @@ -218,6 +218,7 @@ end --- Create an SVG file with this widget content. -- This is dynamic, so the SVG will be updated along with the widget content. -- because of this, the painting may happen hover multiple event loop cycles. +-- @deprecated wibox.widget.draw_to_svg_file -- @tparam widget widget A widget -- @tparam string path The output file path -- @tparam number width The surface width @@ -225,6 +226,8 @@ end -- @return The cairo surface -- @return The hierarchy function surface.widget_to_svg(widget, path, width, height) + gdebug.deprecate("Use wibox.widget.draw_to_svg_file instead of ".. + "gears.surface.render_to_svg", {deprecated_in=5}) local img = cairo.SvgSurface.create(path, width, height) local cr = cairo.Context(img) @@ -234,6 +237,7 @@ end --- Create a cairo surface with this widget content. -- This is dynamic, so the SVG will be updated along with the widget content. -- because of this, the painting may happen hover multiple event loop cycles. +-- @deprecated wibox.widget.draw_to_image_surface -- @tparam widget widget A widget -- @tparam number width The surface width -- @tparam number height The surface height @@ -241,6 +245,8 @@ end -- @return The cairo surface -- @return The hierarchy function surface.widget_to_surface(widget, width, height, format) + gdebug.deprecate("Use wibox.widget.draw_to_image_surface instead of ".. + "gears.surface.render_to_surface", {deprecated_in=5}) local img = cairo.ImageSurface(format or cairo.Format.ARGB32, width, height) local cr = cairo.Context(img)