Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/config.ld
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,14 @@ create_type {
subfield_title = "Parameters",
}

-- Documentation for objects depecated static methods
create_type {
name = "deprecatedstaticmtd",
title = "Deprecated static object methods",
project_level = false,
subfield_title = "Parameters",
}

-- Use a custom type for the methods to bypass the faulty ldoc built-in detection.
-- (yes, the space after Methods *is* on purpose to avoid clashing with ldoc
-- internal "methods" concept)
Expand Down Expand Up @@ -2304,6 +2312,7 @@ local display_return_type = {
method = true,
deprecatedmethod = true,
staticfct = true,
deprecatedstaticmtd = true,
}

-- Show return values.
Expand All @@ -2316,6 +2325,7 @@ local show_return = {
method = true,
deprecated = true,
deprecatedmethod = true,
deprecatedstaticmtd = true,
}

-- The different type of deprecation.
Expand All @@ -2324,6 +2334,7 @@ local is_deprecated = {
deprecatedproperty = true,
deprecatedmethod = true,
deprecatedsignal = true,
deprecatedstaticmtd = true,
}

custom_display_name_handler = function(item, default_handler)
Expand Down
8 changes: 3 additions & 5 deletions luaa.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,15 +326,13 @@ luaA_pixbuf_to_surface(lua_State *L)
* @tparam string name The file name.
* @treturn gears.surface A cairo surface as light user datum.
* @treturn nil|string The error message, if any.
* @staticfct load_image
* @deprecatedstaticmtd awesome.load_image
* @see awesome.pixbuf_to_surface
*/
static int
luaA_load_image(lua_State *L)
{
/* TODO: Deprecate this function, Lua can use GdkPixbuf directly plus
* awesome.pixbuf_to_surface
*/

luaA_deprecate(L, "awesome.pixbuf_to_surface");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestion for awesome.pixbuf_to_surface in that comment has since become outdated as well. I think gears.surface would be a better suggestion.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gears.surface uses awesome.pixbuf_to_surface internally, and I would argue that it's better to put a function as close to the replaced one in functionality in @deprecate

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it one step at a time, this will do.

GError *error = NULL;
const char *filename = luaL_checkstring(L, 1);
cairo_surface_t *surface = draw_load_image(L, filename, &error);
Expand Down
Loading