Ignore:
Timestamp:
Mar 17, 2008, 3:25:09 AM (12 years ago)
Author:
Sam Hocevar
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/jwindow.hpp

    r119 r120  
    1818
    1919class ifield;
    20 class window_manager;
    21 class jwindow;
     20class WindowManager;
     21class Jwindow;
    2222
    2323extern int frame_top();
     
    2828void set_frame_size(int x);
    2929
    30 class input_manager
     30class InputManager
    3131{
    32   friend class jwindow;
     32  friend class Jwindow;
    3333
    3434private:
    3535  image *screen;
    3636  ifield *first, *active, *grab;
    37   jwindow *cur, *owner;
     37  Jwindow *cur, *owner;
    3838  int no_selections_allowed;
    3939
    4040public:
    41   input_manager(image *Screen, ifield *First);
    42   input_manager(jwindow *owner, ifield *First);
    43   void handle_event(event &ev, jwindow *j);
     41  InputManager(image *Screen, ifield *First);
     42  InputManager(Jwindow *owner, ifield *First);
     43  void handle_event(event &ev, Jwindow *j);
    4444  ifield *get(int id);
    4545  void redraw();
     
    5252  void release_focus();
    5353  void allow_no_selections();
    54   ~input_manager();
     54  ~InputManager();
    5555} ;
    5656
    5757class ifield
    5858{
    59     friend class jwindow;
    60     friend class input_manager;
     59    friend class Jwindow;
     60    friend class InputManager;
    6161
    6262protected:
    63     jwindow *owner;
     63    Jwindow *owner;
    6464
    6565public :
     
    6969    int id;
    7070    ifield *next;
    71     virtual void set_owner(jwindow *owner);
     71    virtual void set_owner(Jwindow *owner);
    7272    virtual void move(int newx, int newy) { x = newx; y = newy; }
    7373    virtual void area(int &x1, int &y1, int &x2, int &y2) = 0;
    7474    virtual void draw_first(image *screen) = 0;
    7575    virtual void draw(int active, image *screen) = 0;
    76     virtual void handle_event(event &ev, image *screen, input_manager *im) = 0;
     76    virtual void handle_event(event &ev, image *screen, InputManager *im) = 0;
    7777    virtual int selectable() { return 1; }
    7878    virtual void remap(filter *f) { ; }
     
    8383} ;
    8484
    85 class jwindow
     85class Jwindow
    8686{
    87     friend class input_manager;
     87    friend class InputManager;
    8888
    8989private:
     
    9595
    9696protected:
    97     jwindow *owner;
     97    Jwindow *owner;
    9898    int _x1, _y1, _x2, _y2;
    9999
    100100public:
    101     jwindow *next;
     101    Jwindow *next;
    102102    int x, y, l, h, backg;
    103103    image *screen;
    104     input_manager *inm;
     104    InputManager *inm;
    105105    void *local_info;  // pointer to info block for local system (may support windows)
    106106
    107     jwindow(char const *name = NULL);
    108     jwindow(int X, int Y, int L, int H, ifield *f, char const *name = NULL);
    109     ~jwindow();
     107    Jwindow(char const *name = NULL);
     108    Jwindow(int X, int Y, int L, int H, ifield *f, char const *name = NULL);
     109    ~Jwindow();
    110110
    111111    virtual void redraw();
     
    133133};
    134134
    135 class window_manager
     135class WindowManager
    136136{
    137     friend class jwindow;
     137    friend class Jwindow;
    138138
    139139protected:
    140     void add_window(jwindow *);
    141     void remove_window(jwindow *);
     140    void add_window(Jwindow *);
     141    void remove_window(Jwindow *);
    142142
    143143public:
    144144    event_handler *eh;
    145     jwindow *first, *grab;
     145    Jwindow *first, *grab;
    146146    image *screen, *mouse_pic, *mouse_save;
    147147    palette *pal;
     
    150150    enum { inputing, dragging } state;
    151151    int drag_mousex, drag_mousey, frame_suppress;
    152     jwindow *drag_window;
     152    Jwindow *drag_window;
    153153    JCFont *fnt, *wframe_fnt;
    154154
    155     window_manager(image *, palette *, int hi, int med, int low, JCFont *);
    156     ~window_manager();
     155    WindowManager(image *, palette *, int hi, int med, int low, JCFont *);
     156    ~WindowManager();
    157157
    158     jwindow *new_window(int x, int y, int l, int h,
     158    Jwindow *new_window(int x, int y, int l, int h,
    159159                        ifield *fields = NULL, char const *Name = NULL);
    160160
    161161    void set_frame_font(JCFont *fnt) { wframe_fnt = fnt; }
    162162    JCFont *frame_font() { return wframe_fnt; }
    163     void close_window(jwindow *j);
    164     void resize_window(jwindow *j, int l, int h);
    165     void move_window(jwindow *j, int x, int y);
     163    void close_window(Jwindow *j);
     164    void resize_window(Jwindow *j, int l, int h);
     165    void move_window(Jwindow *j, int x, int y);
    166166    void get_event(event &ev);
    167167    void push_event(event *ev) { eh->push_event(ev); }
     
    185185    void hide_windows();
    186186    void show_windows();
    187     void hide_window(jwindow *j);
    188     void show_window(jwindow *j);
     187    void hide_window(Jwindow *j);
     188    void show_window(Jwindow *j);
    189189    void set_frame_suppress(int x) { frame_suppress=x; }
    190     void grab_focus(jwindow *j);
     190    void grab_focus(Jwindow *j);
    191191    void release_focus();
    192192    int window_in_area(int x1, int y1, int x2, int y2); // true if a window lies in this area
Note: See TracChangeset for help on using the changeset viewer.