diff --git a/layout.h b/layout.h index e0de7196..7ba5030d 100644 --- a/layout.h +++ b/layout.h @@ -27,8 +27,8 @@ #define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False) void arrange(int); -Layout * get_current_layout(int); -Tag * get_current_tag(int); +Layout * get_current_layout(int) __attribute__ ((deprecated)); +Tag * get_current_tag(int) __attribute__ ((deprecated)); void restack(int); void loadawesomeprops(int); void saveawesomeprops(int); diff --git a/tag.c b/tag.c index 3139b903..bf8d7c04 100644 --- a/tag.c +++ b/tag.c @@ -137,6 +137,27 @@ tag_client_with_rules(Client *c) } } + +Tag ** +get_current_tags(int screen) +{ + Tag *tag, **tags = NULL; + int n = 0; + + for(tag = globalconf.screens[screen].tags; tag; tag = tag->next) + if(tag->selected) + { + p_realloc(tags, ++n); + tags[n - 1] = tag; + } + + /* finish with null */ + p_realloc(tags, ++n); + tags[n - 1] = NULL; + + return tags; +} + /** Tag selected window with tag * \param screen Screen ID * \param arg Tag name diff --git a/tag.h b/tag.h index 264a3527..cf6c3534 100644 --- a/tag.h +++ b/tag.h @@ -27,6 +27,7 @@ /** Check if a client is tiled */ #define IS_TILED(client, screen) (client && !client->isfloating && client_isvisible(client, screen)) +Tag ** get_current_tags(int ); void tag_client(Client *, Tag *, int); void untag_client(Client *, Tag *, int); Bool is_client_tagged(Client *, Tag *, int);