introduce get_current_tags() and deprecate get_current_{tag,layout}()

This commit is contained in:
Julien Danjou 2007-12-23 16:28:40 +01:00
parent 58a3c0c494
commit a0e7aee072
3 changed files with 24 additions and 2 deletions

View File

@ -27,8 +27,8 @@
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False) #define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)
void arrange(int); void arrange(int);
Layout * get_current_layout(int); Layout * get_current_layout(int) __attribute__ ((deprecated));
Tag * get_current_tag(int); Tag * get_current_tag(int) __attribute__ ((deprecated));
void restack(int); void restack(int);
void loadawesomeprops(int); void loadawesomeprops(int);
void saveawesomeprops(int); void saveawesomeprops(int);

21
tag.c
View File

@ -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 /** Tag selected window with tag
* \param screen Screen ID * \param screen Screen ID
* \param arg Tag name * \param arg Tag name

1
tag.h
View File

@ -27,6 +27,7 @@
/** Check if a client is tiled */ /** Check if a client is tiled */
#define IS_TILED(client, screen) (client && !client->isfloating && client_isvisible(client, screen)) #define IS_TILED(client, screen) (client && !client->isfloating && client_isvisible(client, screen))
Tag ** get_current_tags(int );
void tag_client(Client *, Tag *, int); void tag_client(Client *, Tag *, int);
void untag_client(Client *, Tag *, int); void untag_client(Client *, Tag *, int);
Bool is_client_tagged(Client *, Tag *, int); Bool is_client_tagged(Client *, Tag *, int);