Ejemplo n.º 1
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);
}
Ejemplo n.º 2
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);
}