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/scroller.hpp

    r57 r106  
    3333  int wig_x();
    3434  int darea() { return (l-bw()-2)-bw()-bw(); }
    35   void draw_wiget(image *screen, window_manager *wm, int erase);
     35  void draw_wiget(image *screen, int erase);
    3636  int mouse_to_drag(int mx,int my);
    3737public :
    3838  int t,sx;
    3939  scroller(int X, int Y, int ID, int L, int H, int Vert, int Total_items, ifield *Next);
    40   virtual void area(int &x1, int &y1, int &x2, int &y2, window_manager *wm);
    41   virtual void draw_first(image *screen, window_manager *wm);
    42   virtual void draw(int active, image *screen, window_manager *wm);
    43   virtual void handle_event(event &ev, image *screen, window_manager *wm, input_manager *im);
     40  virtual void area(int &x1, int &y1, int &x2, int &y2);
     41  virtual void draw_first(image *screen);
     42  virtual void draw(int active, image *screen);
     43  virtual void handle_event(event &ev, image *screen, input_manager *im);
    4444  virtual char *read() { return (char *)&sx; }
    4545
    4646  virtual int activate_on_mouse_move() { return 1; }
    47   virtual void handle_inside_event(event &ev, image *screen, window_manager *wm, input_manager *inm) {;}
    48   virtual void scroll_event(int newx, image *screen, window_manager *wm);
    49   virtual void handle_up(image *screen, window_manager *wm, input_manager *inm);
    50   virtual void handle_down(image *screen, window_manager *wm, input_manager *inm);
    51   virtual void handle_left(image *screen, window_manager *wm, input_manager *inm);
    52   virtual void handle_right(image *screen, window_manager *wm, input_manager *inm);
    53   virtual void area_config(window_manager *wm) { ; }
     47  virtual void handle_inside_event(event &ev, image *screen, input_manager *inm) {;}
     48  virtual void scroll_event(int newx, image *screen);
     49  virtual void handle_up(image *screen, input_manager *inm);
     50  virtual void handle_down(image *screen, input_manager *inm);
     51  virtual void handle_left(image *screen, input_manager *inm);
     52  virtual void handle_right(image *screen, input_manager *inm);
     53  virtual void area_config() { ; }
    5454  void set_size(int width, int height) { l=width; h=height; }
    55   virtual void set_x(int x, image *screen, window_manager *wm);
     55  virtual void set_x(int x, image *screen);
    5656} ;
    5757
     
    6464  spicker(int X, int Y, int ID, int Rows, int Cols, int Vert, int MultiSelect, ifield *Next);
    6565  int vis() { if (vert) return r; else return c; }
    66   virtual void area_config(window_manager *wm);
     66  virtual void area_config();
    6767  void set_select(int x, int on);
    6868  int get_select(int x);
    6969  int first_selected();
    70   virtual void scroll_event(int newx, image *screen, window_manager *wm);
    71   virtual void handle_inside_event(event &ev, image *screen, window_manager *wm, input_manager *inm);
     70  virtual void scroll_event(int newx, image *screen);
     71  virtual void handle_inside_event(event &ev, image *screen, input_manager *inm);
    7272
    7373  // you should define \/
    74   virtual void draw_background(window_manager *wm, image *screen);
    75   virtual void draw_item(window_manager *wm, image *screen, int x, int y, int num, int active) = 0;
     74  virtual void draw_background(image *screen);
     75  virtual void draw_item(image *screen, int x, int y, int num, int active) = 0;
    7676  virtual int total() = 0;
    77   virtual int item_width(window_manager *wm) = 0;
    78   virtual int item_height(window_manager *wm) = 0;
    79   virtual void note_selection(window_manager *wm, image *screen, input_manager *inm, int x) { ; }
    80   virtual void note_new_current(window_manager *wm, image *screen, input_manager *inm, int x) { ; }
     77  virtual int item_width() = 0;
     78  virtual int item_height() = 0;
     79  virtual void note_selection(image *screen, input_manager *inm, int x) { ; }
     80  virtual void note_new_current(image *screen, input_manager *inm, int x) { ; }
    8181  virtual int ok_to_select(int num) { return 1; }
    82   virtual void handle_up(image *screen, window_manager *wm, input_manager *inm);
    83   virtual void handle_down(image *screen, window_manager *wm, input_manager *inm);
    84   virtual void handle_left(image *screen, window_manager *wm, input_manager *inm);
    85   virtual void handle_right(image *screen, window_manager *wm, input_manager *inm);
    86   virtual void set_x(int x, image *screen, window_manager *wm);
     82  virtual void handle_up(image *screen, input_manager *inm);
     83  virtual void handle_down(image *screen, input_manager *inm);
     84  virtual void handle_left(image *screen, input_manager *inm);
     85  virtual void handle_right(image *screen, input_manager *inm);
     86  virtual void set_x(int x, image *screen);
    8787  void reconfigure();   // should be called by constructor after class is ready to take virtual calls
    8888  ~spicker() { if (select) jfree(select); }
     
    104104  pick_list(int X, int Y, int ID, int height,
    105105            char **List, int num_entries, int start_yoffset, ifield *Next, image *texture=NULL);
    106   virtual void handle_inside_event(event &ev, image *screen, window_manager *wm, input_manager *inm);
    107   virtual void scroll_event(int newx, image *screen, window_manager *wm);
     106  virtual void handle_inside_event(event &ev, image *screen, input_manager *inm);
     107  virtual void scroll_event(int newx, image *screen);
    108108  virtual char *read() { return (char *)this; }
    109   virtual void area_config(window_manager *wm);
    110   virtual void handle_up(image *screen, window_manager *wm, input_manager *inm);
    111   virtual void handle_down(image *screen, window_manager *wm, input_manager *inm);
     109  virtual void area_config();
     110  virtual void handle_up(image *screen, input_manager *inm);
     111  virtual void handle_down(image *screen, input_manager *inm);
    112112  int get_selection() { return lis[cur_sel].number; }
    113113  ~pick_list() { jfree(lis); }
Note: See TracChangeset for help on using the changeset viewer.