X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=ioncore%2Fconf.c;h=62c91f117679ace71fd879314ecc7816058a7f36;hp=207c1c1c471ed610a77cc491ecf51f892e968fe1;hb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;hpb=8366314611bf30a0f31d25bf5f5023186fa87692 diff --git a/ioncore/conf.c b/ioncore/conf.c index 207c1c1..62c91f1 100644 --- a/ioncore/conf.c +++ b/ioncore/conf.c @@ -1,7 +1,7 @@ /* * ion/ioncore/conf.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -36,6 +36,12 @@ StringIntMap frame_idxs[]={ END_STRINGINTMAP }; +static bool get_winprop_fn_set=FALSE; +static ExtlFn get_winprop_fn; + +static bool get_layout_fn_set=FALSE; +static ExtlFn get_layout_fn; + /*EXTL_DOC * Set ioncore basic settings. The table \var{tab} may contain the @@ -70,8 +76,6 @@ StringIntMap frame_idxs[]={ * \var{float_placement_method} & (string) How to place floating frames. * One of ''udlr'' (up-down, then left-right), * ''lrud'' (left-right, then up-down) or ''random''. \\ - * \var{default_ws_params} & (table) Default workspace layout; the - * attach/creation parameters for a \type{WGroup}. \\ * \end{tabularx} * * When a keyboard resize function is called, and at most \var{kbresize_t_max} @@ -88,6 +92,7 @@ void ioncore_set(ExtlTab tab) int dd, rd; char *wst, *tmp; ExtlTab t; + ExtlFn fn; extl_table_gets_b(tab, "opaque_resize", &(ioncore_g.opaque_resize)); extl_table_gets_b(tab, "warp", &(ioncore_g.warp_enabled)); @@ -108,6 +113,22 @@ void ioncore_set(ExtlTab tab) ioncore_set_moveres_accel(tab); ioncore_groupws_set(tab); + + /* Internal -- therefore undocumented above */ + if(extl_table_gets_f(tab, "_get_winprop", &fn)){ + if(get_winprop_fn_set) + extl_unref_fn(get_winprop_fn); + get_winprop_fn=fn; + get_winprop_fn_set=TRUE; + } + + if(extl_table_gets_f(tab, "_get_layout", &fn)){ + if(get_layout_fn_set) + extl_unref_fn(get_layout_fn); + get_layout_fn=fn; + get_layout_fn_set=TRUE; + } + } @@ -137,7 +158,35 @@ ExtlTab ioncore_get() return tab; } - + + +ExtlTab ioncore_get_winprop(WClientWin *cwin) +{ + ExtlTab tab=extl_table_none(); + + if(get_winprop_fn_set){ + extl_protect(NULL); + extl_call(get_winprop_fn, "o", "t", cwin, &tab); + extl_unprotect(NULL); + } + + return tab; +} + + +ExtlTab ioncore_get_layout(const char *layout) +{ + ExtlTab tab=extl_table_none(); + + if(get_layout_fn_set){ + extl_protect(NULL); + extl_call(get_layout_fn, "s", "t", layout, &tab); + extl_unprotect(NULL); + } + + return tab; +} + /*EXTL_DOC * Get important directories (userdir, sessiondir, searchpath). @@ -232,7 +281,7 @@ bool ioncore_read_main_config(const char *cfgfile) ret=extl_read_config(cfgfile, ".", TRUE); - unset+=(ioncore_rootwin_bindmap->nbindings==0); + unset+=(ioncore_screen_bindmap->nbindings==0); unset+=(ioncore_mplex_bindmap->nbindings==0); unset+=(ioncore_frame_bindmap->nbindings==0);