Ignore:
Timestamp:
Mar 15, 2008, 12:55:44 AM (11 years ago)
Author:
Sam Hocevar
Message:
  • Rename the "eh" variable to "wm" because it's a window manager, not an event handler.
  • No longer pass the window manager to functions, there's only one.

Inspired by Win32 Abuse changelog for January 28, 2001:

  • Starting work on singleton code; will get rid of all

references to an arbitrary window_manager* because
there's only going to be one, and it's not ever
going to change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/gui.cpp

    r67 r106  
    3131}
    3232
    33 void ico_switch_button::area(int &x1, int &y1, int &x2, int &y2, window_manager *wm)
     33void ico_switch_button::area(int &x1, int &y1, int &x2, int &y2)
    3434{
    3535  x1=10000;
     
    4040  for (ifield *b=blist;b;b=b->next)
    4141  {   
    42     b->area(X1,Y1,X2,Y2,wm);
     42    b->area(X1,Y1,X2,Y2);
    4343    if (X1<x1) x1=X1;
    4444    if (Y1<y1) y1=Y1;
     
    6868}
    6969
    70 void ico_switch_button::handle_event(event &ev, image *screen, window_manager *wm, input_manager *im)
     70void ico_switch_button::handle_event(event &ev, image *screen, input_manager *im)
    7171{
    7272  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
     
    7575    cur_but=cur_but->next;
    7676    if (!cur_but) cur_but=blist;
    77     cur_but->draw(act,screen,wm);
    78     cur_but->handle_event(ev,screen,wm,im);
     77    cur_but->draw(act,screen);
     78    cur_but->handle_event(ev,screen,im);
    7979  }
    8080
    8181}
    8282
    83 void ico_button::draw(int active, image *screen, window_manager *wm)
     83void ico_button::draw(int active, image *screen)
    8484{
    8585  int x1,y1,x2,y2;
    86   area(x1,y1,x2,y2,wm);
     86  area(x1,y1,x2,y2);
    8787 
    8888  if (active!=act  && activate_id!=-1 && active)
     
    116116extern int sfx_volume;
    117117
    118 void ico_button::handle_event(event &ev, image *screen, window_manager *wm, input_manager *im)
     118void ico_button::handle_event(event &ev, image *screen, input_manager *im)
    119119{
    120120  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
     
    122122  {
    123123    int  x1,y1,x2,y2;
    124     area(x1,y1,x2,y2,wm);
     124    area(x1,y1,x2,y2);
    125125    up=!up;
    126     draw(act,screen,wm);
     126    draw(act,screen);
    127127    wm->push_event(new event(id,(char *)this));
    128128    if (S_BUTTON_PRESS_SND)
     
    131131}
    132132
    133 void ico_button::area(int &x1, int &y1, int &x2, int &y2, window_manager *wm)
     133void ico_button::area(int &x1, int &y1, int &x2, int &y2)
    134134{
    135135  x1=x; y1=y;
Note: See TracChangeset for help on using the changeset viewer.