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/imlib/pmenu.hpp

    r57 r106  
    3131  pmenu_item *find_id(int search_id);
    3232  pmenu_item *find_key(int key);
    33   void draw       (jwindow *parent, int x, int y, int w, int top, window_manager *wm, int active);
    34   void draw_self  (jwindow *parent, int x, int y, int w, int top, window_manager *wm, int active);
    35   int handle_event(jwindow *parent, int x, int y, int w, int top, window_manager *wm, event &ev);
     33  void draw       (jwindow *parent, int x, int y, int w, int top, int active);
     34  void draw_self  (jwindow *parent, int x, int y, int w, int top, int active);
     35  int handle_event(jwindow *parent, int x, int y, int w, int top, event &ev);
    3636  int own_event(event &ev);
    3737  ~pmenu_item();
     
    4444  psub_menu *next;
    4545  int active;
    46   window_manager *wm;
    4746  jwindow *win;
    4847  pmenu_item *item_num(int x) { pmenu_item *p=first; while (x-- && p) p=p->next; return p; }
    4948public :
    50   void calc_size(int &w, int &h, window_manager *wm);
     49  void calc_size(int &w, int &h);
    5150  pmenu_item *find_id(int search_id);
    5251  pmenu_item *find_key(int key);
    5352  psub_menu(pmenu_item *First, psub_menu *Next)
    5453  { first=First; Next=Next; win=0; active=0; }
    55   int handle_event(jwindow *parent, int x, int y, window_manager *wm, event &ev);
    56   void draw(jwindow *parent, int x, int y, window_manager *wm);
    57   void hide(jwindow *parent, int x, int y, window_manager *wm);
     54  int handle_event(jwindow *parent, int x, int y, event &ev);
     55  void draw(jwindow *parent, int x, int y);
     56  void hide(jwindow *parent, int x, int y);
    5857  int own_event(event &ev);
    5958  ~psub_menu();
     
    6261class pmenu
    6362{
    64   window_manager *wm;
    6563  jwindow *bar;
    6664  pmenu_item *top,*active;
    67   int itemw(pmenu_item *p, window_manager *wm)
     65  int itemw(pmenu_item *p)
    6866  { return strlen(p->name())*wm->font()->width()+2; }
    69   int itemx(pmenu_item *p, window_manager *wm);
    70   pmenu_item *inarea(int mx, int my, image *screen, window_manager *wm);
     67  int itemx(pmenu_item *p);
     68  pmenu_item *inarea(int mx, int my, image *screen);
    7169public :
    7270  ~pmenu();
    73   pmenu(int X, int Y, pmenu_item *first, image *screen, window_manager *wm);
     71  pmenu(int X, int Y, pmenu_item *first, image *screen);
    7472  void move(int new_x, int new_y);
    75   void draw(image *screen, window_manager *wm, int top_only=0);
    76   int handle_event(event &ev, image *screen, window_manager *wm); 
     73  void draw(image *screen, int top_only=0);
     74  int handle_event(event &ev, image *screen); 
    7775
    7876} ;
Note: See TracChangeset for help on using the changeset viewer.