move clients' uicb away from layout.c

This commit is contained in:
Julien Danjou 2008-01-17 14:16:45 +01:00
parent 7f4dc5a871
commit ed3f624fc0
4 changed files with 68 additions and 68 deletions

View File

@ -929,4 +929,69 @@ uicb_client_zoom(int screen, char *arg __attribute__ ((unused)))
arrange(screen);
}
/** Send focus to next client in stack
* \param screen Screen ID
* \param arg Unused
* \ingroup ui_callback
*/
void
uicb_client_focusnext(int screen, char *arg __attribute__ ((unused)))
{
Client *c, *sel = globalconf.focus->client;
if(!sel)
return;
for(c = sel->next; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
if(!c)
for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
if(c)
{
focus(c, True, screen);
restack(screen);
}
}
/** Send focus to previous client in stack
* \param screen Screen ID
* \param arg Unused
* \ingroup ui_callback
*/
void
uicb_client_focusprev(int screen, char *arg __attribute__ ((unused)))
{
Client *prev;
if((prev = client_find_prev_visible(globalconf.focus->client)))
{
focus(prev, True, screen);
restack(screen);
}
}
/** Toggle floating state of a client
* \param screen Screen ID
* \param arg unused
* \ingroup ui_callback
*/
void
uicb_client_togglefloating(int screen, char *arg)
{
Client *sel = globalconf.focus->client;
if(!sel)
return;
if((sel->isfloating = !sel->isfloating))
{
if(!arg)
client_resize(sel, sel->f_geometry, False);
}
else if(sel->ismax)
client_resize(sel, sel->m_geometry, False);
widget_invalidate_cache(sel->screen, WIDGET_CACHE_CLIENTS);
client_saveprops(sel);
arrange(screen);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -50,6 +50,9 @@ Uicb uicb_client_togglemax;
Uicb uicb_client_toggleverticalmax;
Uicb uicb_client_togglehorizontalmax;
Uicb uicb_client_zoom;
Uicb uicb_client_focusnext;
Uicb uicb_client_focusprev;
Uicb uicb_client_togglefloating;
DO_SLIST(Client, client, p_delete);

View File

@ -89,45 +89,6 @@ get_current_layout(int screen)
return l;
}
/** Send focus to next client in stack
* \param screen Screen ID
* \param arg Unused
* \ingroup ui_callback
*/
void
uicb_client_focusnext(int screen, char *arg __attribute__ ((unused)))
{
Client *c, *sel = globalconf.focus->client;
if(!sel)
return;
for(c = sel->next; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
if(!c)
for(c = globalconf.clients; c && (c->skip || !client_isvisible(c, screen)); c = c->next);
if(c)
{
focus(c, True, screen);
restack(screen);
}
}
/** Send focus to previous client in stack
* \param screen Screen ID
* \param arg Unused
* \ingroup ui_callback
*/
void
uicb_client_focusprev(int screen, char *arg __attribute__ ((unused)))
{
Client *prev;
if((prev = client_find_prev_visible(globalconf.focus->client)))
{
focus(prev, True, screen);
restack(screen);
}
}
void
loadawesomeprops(int screen)
{
@ -260,30 +221,4 @@ uicb_tag_setlayout(int screen, char *arg)
saveawesomeprops(screen);
}
/** Toggle floating state of a client
* \param screen Screen ID
* \param arg unused
* \ingroup ui_callback
*/
void
uicb_client_togglefloating(int screen, char *arg)
{
Client *sel = globalconf.focus->client;
if(!sel)
return;
if((sel->isfloating = !sel->isfloating))
{
if(!arg)
client_resize(sel, sel->f_geometry, False);
}
else if(sel->ismax)
client_resize(sel, sel->m_geometry, False);
widget_invalidate_cache(sel->screen, WIDGET_CACHE_CLIENTS);
client_saveprops(sel);
arrange(screen);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -44,10 +44,7 @@ void restack(int);
void loadawesomeprops(int);
void saveawesomeprops(int);
Uicb uicb_client_focusnext;
Uicb uicb_client_focusprev;
Uicb uicb_tag_setlayout;
Uicb uicb_client_togglefloating;
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80