Beispiel #1
0
/*EXTL_DOC
 * Get a property \var{atom} of type \var{atom_type} for window \var{win}. 
 * The \var{n32expected} parameter indicates the expected number of 32bit
 * words, and \var{more} indicates whether all or just this amount of data
 * should be fetched. Each 8, 16 or 32bit element of the property, as
 * deciphered from \var{atom_type} is a field in the returned table.
 * See \code{XGetWindowProperty}(3) manual page for more information.
 */
EXTL_SAFE
EXTL_EXPORT
ExtlTab ioncore_x_get_window_property(int win, int atom, int atom_type,
                                      int n32expected, bool more)
{
    uchar *p=NULL;
    ExtlTab tab;
    int format=0;
    int i, n;
    
    n=xwindow_get_property_(win, atom, atom_type, n32expected, more, &p, 
                            &format);
    
    if(p==NULL)
        return extl_table_none();
    
    if(n<=0 || (format!=8 && format!=16 && format!=32)){
        free(p);
        return extl_table_none();
    }
    
    tab=extl_create_table();
    
    switch(format){
    case 8: CP(char); break;
    case 16: CP(short); break;
    case 32: CP(long); break;
    }

    return tab;
}
Beispiel #2
0
ExtlTab region_size_hints_extl(WRegion *reg)
{
    WSizeHints hints;
    ExtlTab tab;

    region_size_hints(reg, &hints);

    tab=extl_create_table();

    if(hints.base_set){
        extl_table_sets_i(tab, "base_w", hints.base_width);
        extl_table_sets_i(tab, "base_h", hints.base_height);
    }
    if(hints.min_set){
        extl_table_sets_i(tab, "min_w", hints.min_width);
        extl_table_sets_i(tab, "min_h", hints.min_height);
    }
    if(hints.max_set){
        extl_table_sets_i(tab, "max_w", hints.max_width);
        extl_table_sets_i(tab, "max_h", hints.max_height);
    }
    if(hints.inc_set){
        extl_table_sets_i(tab, "inc_w", hints.width_inc);
        extl_table_sets_i(tab, "inc_h", hints.height_inc);
    }

    return tab;
}
Beispiel #3
0
/*EXTL_DOC
 * Get module basic settings. For details, see \fnref{mod_menu.set}.
 */
EXTL_SAFE
EXTL_EXPORT
ExtlTab mod_menu_get()
{
    ExtlTab tab=extl_create_table();
    extl_table_sets_i(tab, "scroll_amount", scroll_amount);
    extl_table_sets_i(tab, "scroll_delay", scroll_time);
    return tab;
}
Beispiel #4
0
/*EXTL_DOC
 * Get parameters. For details see \fnref{mod_tiling.set}.
 */
EXTL_SAFE
EXTL_EXPORT
ExtlTab mod_tiling_get()
{
    ExtlTab tab=extl_create_table();
    
    extl_table_sets_i(tab, "raise_delay", mod_tiling_raise_delay);
    
    return tab;
}
Beispiel #5
0
/*EXTL_DOC
 * Get \var{dock}'s configuration table. See \fnref{WDock.set} for a
 * description of the table.
 */
EXTL_SAFE
EXTL_EXPORT_MEMBER
ExtlTab dock_get(WDock *dock)
{
    ExtlTab conftab;

    conftab=extl_create_table();
    dock_do_get(dock, conftab);
    return conftab;
}
Beispiel #6
0
/*EXTL_DOC
 * Get important directories (the fields \var{userdir}, 
 * \var{sessiondir}, \var{searchpath} in the returned table).
 */
EXTL_SAFE
EXTL_EXPORT
ExtlTab ioncore_get_paths(ExtlTab tab)
{
    tab=extl_create_table();
    extl_table_sets_s(tab, "userdir", extl_userdir());
    extl_table_sets_s(tab, "sessiondir", extl_sessiondir());
    extl_table_sets_s(tab, "searchpath", extl_searchpath());
    return tab;
}
Beispiel #7
0
ExtlTab extl_table_from_rectangle(const WRectangle *rect)
{
    ExtlTab tab=extl_create_table();

    extl_table_sets_i(tab, "x", rect->x);
    extl_table_sets_i(tab, "y", rect->y);
    extl_table_sets_i(tab, "w", rect->w);
    extl_table_sets_i(tab, "h", rect->h);

    return tab;
}
Beispiel #8
0
/*EXTL_DOC
 * Get configuration table for module \var{name}
 */
EXTL_EXPORT
ExtlTab statusd_get_config(const char *name)
{
    if(name==NULL){
        return extl_ref_table(configtab);
    }else{
        ExtlTab t;
        if(extl_table_gets_t(configtab, name, &t))
            return t;
        else
            return extl_create_table();
    }
}
Beispiel #9
0
bool groupws_init(WGroupWS *ws, WWindow *parent, const WFitParams *fp)
{
    if(!group_init(&(ws->grp), parent, fp, "Notion GroupWS"))
        return FALSE;

    ws->initial_outputs=extl_create_table();

    ((WRegion*)ws)->flags|=REGION_GRAB_ON_PARENT;

    region_add_bindmap((WRegion*)ws, ioncore_groupws_bindmap);

    return TRUE;
}
Beispiel #10
0
/*EXTL_DOC
 * Get module configuration. For more information see
 * \fnref{mod_query.set}.
 */
EXTL_SAFE
EXTL_EXPORT
ExtlTab mod_query_get()
{
    ModQueryConfig *c=&mod_query_config;
    ExtlTab tab=extl_create_table();
    
    extl_table_sets_b(tab, "autoshowcompl", c->autoshowcompl);
    extl_table_sets_i(tab, "autoshowcompl_delay", c->autoshowcompl_delay);
    extl_table_sets_b(tab, "caseicompl", c->caseicompl);
    extl_table_sets_b(tab, "substrcompl", c->substrcompl);
    
    return tab;
}
Beispiel #11
0
ExtlTab manageparams_to_table(const WManageParams *mp)
{
    ExtlTab t=extl_create_table();
    extl_table_sets_b(t, "switchto", mp->switchto);
    extl_table_sets_b(t, "jumpto", mp->jumpto);
    extl_table_sets_b(t, "userpos", mp->userpos);
    extl_table_sets_b(t, "dockapp", mp->dockapp);
    extl_table_sets_b(t, "maprq", mp->maprq);
    extl_table_sets_i(t, "gravity", mp->gravity);
    extl_table_sets_rectangle(t, "geom", &(mp->geom));
    extl_table_sets_o(t, "tfor", (Obj*)(mp->tfor));

    return t;
}
Beispiel #12
0
EXTL_EXPORT
ExtlTab statusd_getloadavg()
{
    ExtlTab t=extl_create_table();
#ifndef CF_NO_GETLOADAVG
    double l[3];
    int n;

    n=getloadavg(l, 3);

    if(n>=1)
        extl_table_sets_d(t, "1min", l[0]);
    if(n>=2)
        extl_table_sets_d(t, "5min", l[1]);
    if(n>=3)
        extl_table_sets_d(t, "15min", l[2]);
#endif
    return t;
}
Beispiel #13
0
static bool filter_extras_iter_fn(ExtlAny k, ExtlAny v, void *p)
{
    ExtlTab *tgt=(ExtlTab*)p;
    int i;
    
    if(k.type!='s' && k.type!='S')
        return TRUE;
    
    for(i=0; known_values[i]; i++){
        if(strcmp(known_values[i], k.value.s)==0)
            return TRUE;
    }
    
    if(*tgt==extl_table_none())
        *tgt=extl_create_table();
        
    extl_table_set(*tgt, 'a', 'a', k, v);
    
    return TRUE;
}
Beispiel #14
0
/*EXTL_DOC
 * Get a text property for a window. The fields in the returned
 * table (starting from 1) are the null-separated parts of the property.
 * See the \code{XGetTextProperty}(3) manual page for more information.
 */
EXTL_SAFE
EXTL_EXPORT
ExtlTab ioncore_x_get_text_property(int win, int atom)
{
    char **list;
    int i, n;
    ExtlTab tab=extl_table_none();
    
    list=xwindow_get_text_property(win, atom, &n);
    
    if(list!=NULL){
        if(n!=0){
            tab=extl_create_table();
            for(i=0; i<n; i++)
                extl_table_seti_s(tab, i+1, list[i]);
        }
        XFreeStringList(list);
    }
    
    return tab;
}
Beispiel #15
0
/*EXTL_DOC
 * Get ioncore basic settings. For details see \fnref{ioncore.set}.
 */
EXTL_SAFE
EXTL_EXPORT
ExtlTab ioncore_get()
{
    ExtlTab tab=extl_create_table();
    
    extl_table_sets_b(tab, "opaque_resize", ioncore_g.opaque_resize);
    extl_table_sets_b(tab, "warp", ioncore_g.warp_enabled);
    extl_table_sets_b(tab, "switchto", ioncore_g.switchto_new);
    extl_table_sets_i(tab, "dblclick_delay", ioncore_g.dblclick_delay);
    extl_table_sets_b(tab, "screen_notify", ioncore_g.screen_notify);
    extl_table_sets_b(tab, "framed_transients", ioncore_g.framed_transients);
    extl_table_sets_b(tab, "unsqueeze", ioncore_g.unsqueeze_enabled);
    extl_table_sets_b(tab, "autoraise", ioncore_g.autoraise);
    extl_table_sets_b(tab, "autosave_layout", ioncore_g.autosave_layout);
    extl_table_sets_i(tab, "focuslist_insert_delay", ioncore_g.focuslist_insert_delay);
    extl_table_sets_i(tab, "workspace_indicator_timeout", ioncore_g.workspace_indicator_timeout);
    extl_table_sets_b(tab, "activity_notification_on_all_screens",
                      ioncore_g.activity_notification_on_all_screens);

    extl_table_sets_s(tab, "window_stacking_request", 
                      stringintmap_key(win_stackrq, 
                                       ioncore_g.window_stacking_request,
                                       NULL));

    extl_table_sets_s(tab, "frame_default_index", 
                      stringintmap_key(frame_idxs, 
                                       ioncore_g.frame_default_index,
                                       NULL));
    
    extl_table_sets_s(tab, "mousefocus", (ioncore_g.no_mousefocus
                                          ? "disabled" 
                                          : "sloppy"));

    ioncore_get_moveres_accel(tab);
    
    ioncore_groupws_get(tab);
    
    return tab;
}