Ejemplo n.º 1
0
static void menu_draw_entry(WMenu *menu, int i, const WRectangle *igeom,
                            bool complete)
{
    WRectangle geom;
    GrAttr sa, aa;

    aa=(REGION_IS_ACTIVE(menu) ? GR_ATTR(active) : GR_ATTR(inactive));
    sa=(menu->selected_entry==i ? GR_ATTR(selected) : GR_ATTR(unselected));
    
    if(menu->entry_brush==NULL)
        return;
    
    geom=*igeom;
    geom.h=menu->entry_h;
    geom.y+=(i-menu->first_entry)*(menu->entry_h+menu->entry_spacing);
    
    grbrush_begin(menu->entry_brush, &geom, GRBRUSH_AMEND|GRBRUSH_KEEP_ATTR);
    
    grbrush_init_attr(menu->entry_brush, &menu->entries[i].attr);
    
    grbrush_set_attr(menu->entry_brush, aa);
    grbrush_set_attr(menu->entry_brush, sa);

    grbrush_draw_textbox(menu->entry_brush, &geom, menu->entries[i].title, 
                         complete);
    
    grbrush_end(menu->entry_brush);
}
Ejemplo n.º 2
0
void infowin_draw(WInfoWin *p, bool complete)
{
    WRectangle g;
    
    if(p->brush==NULL)
        return;
    
    g.x=0;
    g.y=0;
    g.w=REGION_GEOM(p).w;
    g.h=REGION_GEOM(p).h;

    grbrush_begin(p->brush, &g, GRBRUSH_NO_CLEAR_OK);
    grbrush_init_attr(p->brush, &p->attr);
    grbrush_draw_textbox(p->brush, &g, p->buffer, TRUE);
    grbrush_end(p->brush);
}
Ejemplo n.º 3
0
static void panehandle_draw(WPaneHandle *pwin, bool complete)
{
    WRectangle g;
    
    if(pwin->brush==NULL)
        return;
    
    g.x=0;
    g.y=0;
    g.w=REGION_GEOM(pwin).w;
    g.h=REGION_GEOM(pwin).h;
    
    grbrush_begin(pwin->brush, &g, (complete ? 0 : GRBRUSH_NO_CLEAR_OK));
    
    grbrush_draw_borderline(pwin->brush, &g, pwin->bline);
    
    grbrush_end(pwin->brush);
}
Ejemplo n.º 4
0
void menu_draw(WMenu *menu, bool complete)
{
    GrAttr aa=(REGION_IS_ACTIVE(menu) ? GR_ATTR(active) : GR_ATTR(inactive));
    WRectangle geom;
    
    if(menu->brush==NULL)
        return;
    
    get_outer_geom(menu, &geom);
    
    grbrush_begin(menu->brush, &geom, 
                  (complete ? 0 : GRBRUSH_NO_CLEAR_OK));
    
    grbrush_set_attr(menu->brush, aa);
    
    grbrush_draw_border(menu->brush, &geom);
    
    menu_draw_entries(menu, FALSE);
    
    grbrush_end(menu->brush);
}
Ejemplo n.º 5
0
Archivo: dock.c Proyecto: dkogan/notion
static void dock_draw(WDock *dock, bool complete)
{
    int outline_style;
    WRectangle g;

    if(dock->brush==NULL)
        return;

    g.x=0;
    g.y=0;
    g.w=REGION_GEOM(dock).w;
    g.h=REGION_GEOM(dock).h;

    grbrush_begin(dock->brush, &g, (complete ? 0 : GRBRUSH_NO_CLEAR_OK));

    dock_get_outline_style(dock, &outline_style);
    switch(outline_style){
    case DOCK_OUTLINE_STYLE_NONE:
        break;
    case DOCK_OUTLINE_STYLE_ALL:
        {
            WRectangle geom=REGION_GEOM(dock);
            geom.x=geom.y=0;
            grbrush_draw_border(dock->brush, &geom);
        }
        break;
    case DOCK_OUTLINE_STYLE_EACH:
        {
            WDockApp *dockapp;
            for(dockapp=dock->dockapps; dockapp!=NULL;
                dockapp=dockapp->next){
                grbrush_draw_border(dock->brush, &dockapp->tile_geom);
            }
        }
        break;
    }

    grbrush_end(dock->brush);
}