Ignore:
Timestamp:
May 15, 2011, 6:22:08 AM (12 years ago)
Author:
Sam Hocevar
Message:

imlib: refactor a few image methods so that they use vec2i.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/scroller.cpp

    r650 r655  
    123123  if (sx>=t) sx=t-1;
    124124  draw(0,screen);
    125   screen->widget_bar(b1x(),b1y(),b1x()+bw()-1,b1y()+bh()-1,
    126             wm->bright_color(),wm->medium_color(),wm->dark_color());
    127   screen->widget_bar(b2x(),b2y(),b2x()+bw()-1,b2y()+bh()-1,
    128             wm->bright_color(),wm->medium_color(),wm->dark_color());
     125  screen->WidgetBar(vec2i(b1x(), b1y()),
     126                    vec2i(b1x() + bw() - 1, b1y() + bh() - 1),
     127                    wm->bright_color(), wm->medium_color(), wm->dark_color());
     128  screen->WidgetBar(vec2i(b2x(), b2y()),
     129                    vec2i(b2x() + bw() - 1, b2y() + bh() - 1),
     130                    wm->bright_color(), wm->medium_color(), wm->dark_color());
    129131  show_icon(screen,b1x()+2,b1y()+2,bw()-4,bh()-4,b1());
    130132  show_icon(screen,b2x()+2,b2y()+2,bw()-4,bh()-4,b2());
     
    132134  int x1,y1,x2,y2;
    133135  dragger_area(x1,y1,x2,y2);
    134   screen->bar(x1,y1,x2,y2,wm->black());
    135   screen->bar(x1+1,y1+1,x2-1,y2-1,wm->medium_color());
     136  screen->Bar(vec2i(x1, y1), vec2i(x2, y2), wm->black());
     137  screen->Bar(vec2i(x1 + 1, y1 + 1), vec2i(x2 - 1, y2 - 1), wm->medium_color());
    136138  draw_widget(screen,0);
    137139  scroll_event(sx,screen);
     
    160162}
    161163
    162 
    163164void scroller::draw_widget(image *screen, int erase)
    164165{
     
    166167  wig_area(x1,y1,x2,y2);
    167168  if (erase)
    168     screen->bar(x1,y1,x2,y2,wm->medium_color());
     169    screen->Bar(vec2i(x1, y1), vec2i(x2, y2), wm->medium_color());
    169170  else
    170     screen->widget_bar(x1,y1,x2,y2,
    171               wm->bright_color(),wm->medium_color(),wm->dark_color());
     171    screen->WidgetBar(vec2i(x1, y1), vec2i(x2, y2), wm->bright_color(),
     172                      wm->medium_color(), wm->dark_color());
    172173}
    173174
     
    176177  int x1,y1,x2,y2;
    177178  area(x1,y1,x2,y2);
    178   screen->rectangle(x1,y1,x2,y2,active ? wm->bright_color() : wm->dark_color());
    179 }
    180 
     179  screen->Rectangle(vec2i(x1, y1), vec2i(x2, y2),
     180                    active ? wm->bright_color() : wm->dark_color());
     181}
    181182
    182183void scroller::handle_event(Event &ev, image *screen, InputManager *inm)
     
    365366void scroller::scroll_event(int newx, image *screen)
    366367{
    367   screen->bar(x,y,x+l-1,y+h-1,wm->black());
     368  screen->Bar(vec2i(x, y), vec2i(x + l - 1, y + h - 1), wm->black());
    368369  int xa,ya,xo=0,yo;
    369370  if (vert) { xa=0; ya=30; yo=x+5; yo=y+5; } else { xa=30; ya=0; xo=x+5; yo=y+5; }
     
    504505
    505506    screen->SetClip(cx1, cy1, cx2, cy2);
    506   } else screen->bar(x,y,x+l-1,y+h-1,wm->black());
     507  } else screen->Bar(vec2i(x, y), vec2i(x + l - 1, y + h - 1), wm->black());
    507508
    508509  int dy=y;
     
    510511  {
    511512    if (i+newx==cur_sel)
    512       screen->bar(x,dy,x+wid*wm->font()->width()-1,dy+wm->font()->height(),wm->dark_color());
     513      screen->Bar(vec2i(x, dy), vec2i(x + wid * wm->font()->width() - 1,
     514                                      dy + wm->font()->height()),
     515                  wm->dark_color());
    513516    if (i+newx<t)
    514517      wm->font()->put_string(screen,x,dy,lis[i+newx].name,wm->bright_color());
     
    578581void spicker::draw_background(image *screen)
    579582{
    580   screen->bar(x,y,x+l-1,y+h-1,wm->dark_color());
     583    screen->Bar(vec2i(x, y), vec2i(x + l - 1, y + h - 1), wm->dark_color());
    581584}
    582585
Note: See TracChangeset for help on using the changeset viewer.