Changeset 120


Ignore:
Timestamp:
Mar 17, 2008, 3:25:09 AM (10 years ago)
Author:
Sam Hocevar
Message:
Location:
abuse/trunk/src
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/automap.hpp

    r57 r120  
    1616class automap
    1717{
    18   jwindow *automap_window;
     18  Jwindow *automap_window;
    1919  level *cur_lev;
    2020  int tick,w,h;                // used to draw your position as a blinking spot
  • abuse/trunk/src/console.hpp

    r106 r120  
    1818  JCFont *fnt;
    1919  char *screen;
    20   jwindow *con_win;
     20  Jwindow *con_win;
    2121  char *name;
    2222  public :
  • abuse/trunk/src/dev.cpp

    r115 r120  
    8484
    8585pmenu *dev_menu=NULL;
    86 jwindow *mess_win=NULL,*warn_win=NULL;
     86Jwindow *mess_win=NULL,*warn_win=NULL;
    8787
    8888game_object *edit_object;
     
    155155int confirm_quit()
    156156{
    157     jwindow *quitw;
     157    Jwindow *quitw;
    158158    image *ok_image, *cancel_image;
    159159
     
    32693269}
    32703270
    3271 int dev_controll::is_pal_win(jwindow *win)
     3271int dev_controll::is_pal_win(Jwindow *win)
    32723272{
    32733273  int i;
  • abuse/trunk/src/dev.hpp

    r106 r120  
    3636
    3737public :
    38   jwindow *me;
     38  Jwindow *me;
    3939  void close_window();
    4040  void open_window();
     
    7777  time_marker last_area_click;
    7878public :
    79   jwindow *backw,*forew,*commandw,*modew,*omenu,*oedit,*ledit,
     79  Jwindow *backw,*forew,*commandw,*modew,*omenu,*oedit,*ledit,
    8080          *music_window,*pmenu,*show_menu,*lightw,*aiw,*ambw,*tbw,*area_win,
    8181          *search_window,*memprof;
     
    103103  void handle_event(event &ev);
    104104  void do_command(char const *st, event &ev);
    105   int is_pal_win(jwindow *win);
     105  int is_pal_win(Jwindow *win);
    106106  void dev_draw(view *v);
    107107  void load_stuff();
  • abuse/trunk/src/devsel.cpp

    r106 r120  
    142142
    143143
    144 void tile_picker::handle_inside_event(event &ev, image *screen, input_manager *inm)
     144void tile_picker::handle_inside_event(event &ev, image *screen, InputManager *inm)
    145145{
    146146  if (ev.type==EV_MOUSE_BUTTON)
  • abuse/trunk/src/devsel.hpp

    r106 r120  
    1818  tile_picker(int X, int Y, int ID, int spec_type,
    1919                 int scale, int scroll_h, int Wid, ifield *Next);
    20   virtual void handle_inside_event(event &ev, image *screen, input_manager *inm);
     20  virtual void handle_inside_event(event &ev, image *screen, InputManager *inm);
    2121  virtual void scroll_event(int newx, image *screen);
    2222  virtual char *read() { return (char *)this; }
  • abuse/trunk/src/game.cpp

    r115 r120  
    6060extern crc_manager *net_crcs;
    6161game *the_game;
    62 window_manager *wm = NULL;
     62WindowManager *wm = NULL;
    6363int dev, shift_down = SHIFT_DOWN_DEFAULT, shift_right = SHIFT_RIGHT_DEFAULT;
    6464double sum_diffs = 1, total_diffs = 12;
     
    110110                                     no_space_msg, NULL);
    111111    button *b = new button(0, 0, ID_QUIT_OK, "Quit", inf);
    112     jwindow *no_space = wm->new_window(0, 0, -1, -1, b, "ERROR");
     112    Jwindow *no_space = wm->new_window(0, 0, -1, -1, b, "ERROR");
    113113
    114114    event ev;
     
    14831483  console_font = new JCFont(cash.img(console_font_pict));
    14841484
    1485   wm = new window_manager(screen, pal, bright_color,
    1486                                    med_color,
    1487                                    dark_color,
    1488                                    game_font);
     1485  wm = new WindowManager(screen, pal, bright_color,
     1486                         med_color, dark_color, game_font);
    14891487
    14901488  delete stat_man;  // move to a graphical status manager
  • abuse/trunk/src/game.hpp

    r106 r120  
    4646
    4747/* Cleaned-up externs */
    48 extern window_manager *wm;
     48extern WindowManager *wm;
    4949
    5050
     
    7777
    7878
    79   jwindow *top_menu,*joy_win,*last_input;
     79  Jwindow *top_menu,*joy_win,*last_input;
    8080  JCFont *game_font;
    8181  uint8_t keymap[512/8];
  • abuse/trunk/src/gamma.cpp

    r111 r120  
    137137        gp->set_pos(dg / 4);
    138138
    139         jwindow *gw = wm->new_window(xres / 2 - 190, yres / 2 - 90, -1, -1, gp);
     139        Jwindow *gw = wm->new_window(xres / 2 - 190, yres / 2 - 90, -1, -1, gp);
    140140
    141141        event ev;
  • abuse/trunk/src/go.cpp

    r106 r120  
    3838
    3939
    40 void elevator::gather_input(input_manager *inm)
     40void elevator::gather_input(InputManager *inm)
    4141{
    4242  dir=atoi(inm->get(ELEVATOR_DIR)->read()); 
     
    5454}
    5555
    56 void elcontrol::gather_input(input_manager *inm)
     56void elcontrol::gather_input(InputManager *inm)
    5757{
    5858  allow_dir=atoi(inm->get(ELCONTROL_ALLOW_DIR)->read()); 
     
    354354
    355355
    356 void sensor::gather_input(input_manager *inm)
     356void sensor::gather_input(InputManager *inm)
    357357{
    358358  xrange=atoi(inm->get(SENSOR_XRANGE)->read());
  • abuse/trunk/src/go.hpp

    r57 r120  
    2121  virtual game_objects type() { return O_elcontrol; } 
    2222  virtual ifield *make_fields(int ystart, ifield *Next);
    23   virtual void gather_input(input_manager *inm);
     23  virtual void gather_input(InputManager *inm);
    2424  virtual void save(FILE *fp) { game_object::save(fp); write_short(fp,allow_dir); }
    2525  virtual int decide() { return 1; }  // not dead
     
    4141  virtual game_objects type() { return O_elevator; }
    4242  virtual ifield *make_fields(int ystart, ifield *Next); 
    43   virtual void gather_input(input_manager *inm); 
     43  virtual void gather_input(InputManager *inm); 
    4444  virtual void save(FILE *fp);
    4545  virtual int can_block(game_object *who);
     
    5757  virtual game_objects type() { return O_sensor; }
    5858  virtual ifield *make_fields(int ystart, ifield *Next);
    59   virtual void gather_input(input_manager *inm); 
     59  virtual void gather_input(InputManager *inm); 
    6060  virtual void save(FILE *fp);
    6161
  • abuse/trunk/src/gui.cpp

    r106 r120  
    6868}
    6969
    70 void ico_switch_button::handle_event(event &ev, image *screen, input_manager *im)
     70void ico_switch_button::handle_event(event &ev, image *screen, InputManager *im)
    7171{
    7272  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
     
    116116extern int sfx_volume;
    117117
    118 void ico_button::handle_event(event &ev, image *screen, input_manager *im)
     118void ico_button::handle_event(event &ev, image *screen, InputManager *im)
    119119{
    120120  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
  • abuse/trunk/src/gui.hpp

    r106 r120  
    2424  virtual void draw_first(image *screen) { draw(0,screen); }
    2525  virtual void draw(int active, image *screen);
    26   virtual void handle_event(event &ev, image *screen, input_manager *im);
     26  virtual void handle_event(event &ev, image *screen, InputManager *im);
    2727
    2828  virtual char *read() { return (char *)&up; }
     
    4343  virtual void draw_first(image *screen) { cur_but->draw_first(screen); }
    4444  virtual void draw(int active, image *screen) { cur_but->draw(active,screen); act=active; }
    45   virtual void handle_event(event &ev, image *screen, input_manager *im);
     45  virtual void handle_event(event &ev, image *screen, InputManager *im);
    4646  virtual ifield *unlink(int id);
    4747  virtual char *read() { return cur_but->read(); }
  • abuse/trunk/src/imlib/event.hpp

    r57 r120  
    2929#include "mouse.hpp"
    3030
    31 class jwindow;
     31class Jwindow;
    3232
    3333class event : public linked_node
     
    4141  struct { int x1,y1,x2,y2;
    4242           void *start; }         redraw;
    43   jwindow                        *window;      // NULL is root
     43  Jwindow                        *window;      // NULL is root
    4444  struct { int x,y; }             window_position;
    4545  struct { int id; char *data; }  message;
  • abuse/trunk/src/imlib/filesel.cpp

    r111 r120  
    2626  virtual int item_height() { return wm->font()->height()+1; }
    2727  virtual void draw_item(image *screen, int x, int y, int num, int active);
    28   virtual void note_selection(image *screen, input_manager *inm, int x);
     28  virtual void note_selection(image *screen, InputManager *inm, int x);
    2929  void free_up();
    3030  ~file_picker() { free_up(); }
     
    4242}
    4343
    44 void file_picker::note_selection(image *screen, input_manager *inm, int x)
     44void file_picker::note_selection(image *screen, InputManager *inm, int x)
    4545{
    4646  if (x<td)
     
    116116}
    117117
    118 jwindow *file_dialog(char const *prompt, char const *def,
     118Jwindow *file_dialog(char const *prompt, char const *def,
    119119                     int ok_id, char const *ok_name, int cancel_id,
    120120                     char const *cancel_name, char const *FILENAME_str,
     
    123123  int wh2 = 5 + wm->font()->height() + 5;
    124124  int wh3 = wh2 + wm->font()->height() + 12;
    125   jwindow *j=wm->new_window(0,0,-1,-1,
     125  Jwindow *j=wm->new_window(0,0,-1,-1,
    126126                            new info_field(5, 5, 0, prompt,
    127127                            new text_field(0, wh2, filename_id,
  • abuse/trunk/src/imlib/filesel.hpp

    r106 r120  
    1313#include "jwindow.hpp"
    1414
    15 jwindow *file_dialog(char const *prompt, char const *def,
     15Jwindow *file_dialog(char const *prompt, char const *def,
    1616                     int ok_id, char const *ok_name, int cancel_id,
    1717                     char const *cancel_name, char const *FILENAME_str,
  • abuse/trunk/src/imlib/guistat.cpp

    r111 r120  
    2121  gui_status_node *next;
    2222  visual_object *show;
    23   jwindow *stat_win;
     23  Jwindow *stat_win;
    2424  int last_update;
    2525  time_marker last_time;
  • abuse/trunk/src/imlib/input.cpp

    r112 r120  
    108108}
    109109
    110 void button_box::handle_event(event &ev, image *screen, input_manager *im)
     110void button_box::handle_event(event &ev, image *screen, InputManager *im)
    111111{
    112112  switch (ev.type)
     
    263263}
    264264
    265 void text_field::handle_event(event &ev, image *screen, input_manager *im)
     265void text_field::handle_event(event &ev, image *screen, InputManager *im)
    266266{
    267267  int xx;
     
    361361{ up=!up; }
    362362
    363 void button::handle_event(event &ev, image *screen, input_manager *im)
     363void button::handle_event(event &ev, image *screen, InputManager *im)
    364364{
    365365  if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON &&
  • abuse/trunk/src/imlib/input.hpp

    r109 r120  
    1313#include "filter.hpp"
    1414
    15 extern window_manager *wm; /* FIXME: get rid of this if possible */
     15extern WindowManager *wm; /* FIXME: get rid of this if possible */
    1616
    1717class button : public ifield
     
    2929  virtual void draw_first(image *screen);
    3030  virtual void draw(int active, image *screen);
    31   virtual void handle_event(event &ev, image *screen, input_manager *im);
     31  virtual void handle_event(event &ev, image *screen, InputManager *im);
    3232  void change_visual(image *new_visual);
    3333  virtual void remap(filter *f);
     
    5252  virtual void draw_first(image *screen);
    5353  virtual void draw(int active, image *screen);
    54   virtual void handle_event(event &ev, image *screen, input_manager *im); 
     54  virtual void handle_event(event &ev, image *screen, InputManager *im); 
    5555  virtual ~button_box();
    5656  virtual char *read();   // return pointer to first button which is depressed
     
    8383  virtual void draw_first(image *screen);
    8484  virtual void draw(int active, image *screen);
    85   virtual void handle_event(event &ev, image *screen, input_manager *im);
     85  virtual void handle_event(event &ev, image *screen, InputManager *im);
    8686 
    8787  virtual ~text_field() { jfree(prompt); jfree(format); jfree(data); }
     
    103103  virtual void draw_first(image *screen);
    104104  virtual void draw(int active, image *screen) { ; }
    105   virtual void handle_event(event &ev, image *screen, input_manager *im) { ; }
     105  virtual void handle_event(event &ev, image *screen, InputManager *im) { ; }
    106106  virtual char *read() { return text; }
    107107  virtual int selectable() { return 0; }
  • abuse/trunk/src/imlib/jwindow.cpp

    r119 r120  
    3939
    4040 // true if a window lies in this area
    41 int window_manager::window_in_area(int x1, int y1, int x2, int y2)
    42 {
    43   for (jwindow *f=first;f;f=f->next)
     41int WindowManager::window_in_area(int x1, int y1, int x2, int y2)
     42{
     43  for (Jwindow *f=first;f;f=f->next)
    4444    if (f->x<=x2 && f->y<=y2 && f->x+f->l-1>=x1 && f->y+f->h-1>=y1)
    4545      return 1;
     
    4747}
    4848
    49 void window_manager::grab_focus(jwindow *j)
     49void WindowManager::grab_focus(Jwindow *j)
    5050{ grab=j; }
    5151
    52 void window_manager::release_focus()
     52void WindowManager::release_focus()
    5353{ grab=NULL; }
    5454
    5555
    56 void window_manager::close_window(jwindow *j)
     56void WindowManager::close_window(Jwindow *j)
    5757{
    5858    delete j;
    5959}
    6060
    61 void window_manager::hide_windows()
    62 {
    63   jwindow *p;
     61void WindowManager::hide_windows()
     62{
     63  Jwindow *p;
    6464  for (p=first;p;p=p->next)
    6565  {
     
    7272}
    7373
    74 void window_manager::show_windows()
    75 {
    76   jwindow *p;
     74void WindowManager::show_windows()
     75{
     76  Jwindow *p;
    7777  for (p=first;p;p=p->next)
    7878    if (p->is_hidden())
     
    8080}
    8181
    82 void window_manager::hide_window(jwindow *j)
    83 {
    84   jwindow *k;
     82void WindowManager::hide_window(Jwindow *j)
     83{
     84  Jwindow *k;
    8585  if (j==first)
    8686    first=first->next;
     
    9898}
    9999
    100 void window_manager::show_window(jwindow *j)
     100void WindowManager::show_window(Jwindow *j)
    101101{
    102102  if (j->is_hidden())
     
    107107}
    108108
    109 void window_manager::get_event(event &ev)
    110 {
    111   jwindow *j;
     109void WindowManager::get_event(event &ev)
     110{
     111  Jwindow *j;
    112112  eh->get_event(ev);
    113113  if (ev.type==EV_KEY)
     
    156156        else
    157157        {
    158           jwindow *last=first;
     158          Jwindow *last=first;
    159159          for (;last->next!=ev.window;last=last->next);
    160160          if (ev.window->next)
     
    166166        else
    167167        {
    168           jwindow *last=first;
     168          Jwindow *last=first;
    169169          for (;last->next;last=last->next);
    170170          last->next=ev.window;
     
    173173        if (red)
    174174        {
    175           jwindow *j=ev.window;
     175          Jwindow *j=ev.window;
    176176/*        screen->add_dirty(j->x,j->y,j->x+j->l-1,j->y+j->h-1);
    177177          for (p=first;p!=j;p=p->next)
     
    216216}
    217217
    218 void jwindow::resize(int L, int H)
     218void Jwindow::resize(int L, int H)
    219219{
    220220  screen->change_size(L,H);
     
    222222}
    223223
    224 void window_manager::resize_window(jwindow *j, int l, int h)
    225 {
    226   jwindow *p;
     224void WindowManager::resize_window(Jwindow *j, int l, int h)
     225{
     226  Jwindow *p;
    227227  screen->add_dirty(j->x,j->y,j->x+j->l-1,j->y+j->h-1);
    228228  for (p=first;p!=j;p=p->next)
     
    233233}
    234234
    235 void window_manager::move_window(jwindow *j, int x, int y)
     235void WindowManager::move_window(Jwindow *j, int x, int y)
    236236{
    237237    screen->add_dirty(j->x, j->y, j->x + j->l - 1, j->y + j->h - 1);
    238     for(jwindow *p = first; p != j; p = p->next)
     238    for(Jwindow *p = first; p != j; p = p->next)
    239239        p->screen->add_dirty(j->x - p->x, j->y - p->y, j->x + j->l - 1 - p->x,
    240240                             j->y + j->h - 1 - p->y);
     
    244244}
    245245
    246 window_manager::window_manager(image *Screen, palette *Pal, int Hi,
    247                                int Med, int Low, JCFont *Font)
     246WindowManager::WindowManager(image *Screen, palette *Pal, int Hi,
     247                              int Med, int Low, JCFont *Font)
    248248{
    249249    wm = this;
     
    257257}
    258258
    259 window_manager::~window_manager()
     259WindowManager::~WindowManager()
    260260{
    261261    delete eh;
     
    265265}
    266266
    267 void window_manager::add_window(jwindow *win)
     267void WindowManager::add_window(Jwindow *win)
    268268{
    269269    if(!first)
     
    271271    else
    272272    {
    273         jwindow *tmp = first;
     273        Jwindow *tmp = first;
    274274        while(tmp->next)
    275275            tmp = tmp->next;
     
    279279}
    280280
    281 void window_manager::remove_window(jwindow *win)
     281void WindowManager::remove_window(Jwindow *win)
    282282{
    283283    if(grab == win)
     
    292292    else
    293293    {
    294         jwindow * search;
     294        Jwindow * search;
    295295        for(search = first; search->next != win; search = search->next)
    296296            search->screen->add_dirty(win->x - search->x,
     
    308308}
    309309
    310 jwindow * window_manager::new_window(int x, int y, int l, int h,
     310Jwindow * WindowManager::new_window(int x, int y, int l, int h,
    311311                                     ifield * fields, char const *name)
    312312{
     
    316316        y = screen->height () - 10;
    317317 
    318     jwindow * j = new jwindow (x, y, l, h, fields, name);
     318    Jwindow * j = new Jwindow (x, y, l, h, fields, name);
    319319    j->show();
    320320
     
    322322}
    323323
    324 void window_manager::flush_screen()
    325 {
    326   jwindow *p,*q;
     324void WindowManager::flush_screen()
     325{
     326  Jwindow *p,*q;
    327327
    328328  int mx=0,my=0;
     
    377377}
    378378
    379 jwindow::jwindow(char const *name)
     379Jwindow::Jwindow(char const *name)
    380380{
    381381    _x1 = left_border();
     
    387387    // property.flags = JWINDOW_NOAUTOHIDE_FLAG;
    388388
    389     inm = new input_manager(this, NULL);
     389    inm = new InputManager(this, NULL);
    390390    reconfigure();
    391391
     
    396396    if(name)
    397397        _name = strcpy((char *)jmalloc(strlen(name) + 1,
    398                                        "jwindow::window name"), name);
     398                                       "Jwindow::window name"), name);
    399399    wm->add_window(this);
    400400}
    401401
    402 jwindow::jwindow(int X, int Y, int L, int H, ifield *f, char const *name)
     402Jwindow::Jwindow(int X, int Y, int L, int H, ifield *f, char const *name)
    403403{
    404404    l = 0;
     
    411411
    412412    screen = NULL;
    413     inm = new input_manager(screen, f);
     413    inm = new InputManager(screen, f);
    414414    reconfigure(); /* FIXME: TODO */
    415415
     
    443443    if(name)
    444444        _name = strcpy((char *)jmalloc(strlen(name) + 1,
    445                                        "jwindow::window name"), name);
     445                                       "Jwindow::window name"), name);
    446446
    447447    wm->add_window(this);
     
    450450}
    451451
    452 jwindow::~jwindow()
     452Jwindow::~Jwindow()
    453453{
    454454    wm->remove_window(this);
     
    461461}
    462462
    463 void jwindow::reconfigure()
     463void Jwindow::reconfigure()
    464464{
    465465    int x1, y1, x2, y2;
     
    478478}
    479479
    480 void jwindow::local_close()
     480void Jwindow::local_close()
    481481{
    482482    ;
    483483}
    484484
    485 void jwindow::redraw()
     485void Jwindow::redraw()
    486486{
    487487    int hi = wm->bright_color ();
     
    537537}
    538538
    539 int jwindow::left_border()
     539int Jwindow::left_border()
    540540{
    541541    return frame_left();
    542542}
    543543
    544 int jwindow::right_border()
     544int Jwindow::right_border()
    545545{
    546546    return frame_right();
    547547}
    548548
    549 int jwindow::top_border()
     549int Jwindow::top_border()
    550550{
    551551    return wm->font()->height() + frame_top();
    552552}
    553553
    554 int jwindow::bottom_border()
     554int Jwindow::bottom_border()
    555555{
    556556    return frame_bottom();
     
    558558
    559559
    560 ifield *input_manager::unlink(int id)     // unlinks ID from fields list and return the pointer to it
     560ifield *InputManager::unlink(int id)     // unlinks ID from fields list and return the pointer to it
    561561{
    562562  for (ifield *i=first,*last=NULL;i;i=i->next)
     
    579579}
    580580
    581 input_manager::~input_manager()
     581InputManager::~InputManager()
    582582{ ifield *i;
    583583  while (first)
     
    588588}
    589589
    590 void input_manager::clear_current()
     590void InputManager::clear_current()
    591591{
    592592    if(owner)
     
    597597}
    598598
    599 void input_manager::handle_event(event &ev, jwindow *j)
     599void InputManager::handle_event(event &ev, Jwindow *j)
    600600{
    601601  ifield *i,*in_area=NULL;
     
    670670}
    671671
    672 void input_manager::allow_no_selections()
     672void InputManager::allow_no_selections()
    673673{
    674674  no_selections_allowed=1;
    675675}
    676676
    677 void input_manager::redraw()
     677void InputManager::redraw()
    678678{
    679679    ifield *i;
     
    686686}
    687687
    688 input_manager::input_manager(image *Screen, ifield *First)
     688InputManager::InputManager(image *Screen, ifield *First)
    689689{
    690690    no_selections_allowed = 0;
     
    700700}
    701701
    702 input_manager::input_manager(jwindow *Owner, ifield *First)
     702InputManager::InputManager(Jwindow *Owner, ifield *First)
    703703{
    704704    no_selections_allowed = 0;
     
    712712}
    713713
    714 void input_manager::grab_focus(ifield *i)
     714void InputManager::grab_focus(ifield *i)
    715715{ grab=i;
    716716  if (cur)
     
    718718}
    719719
    720 void input_manager::release_focus()
     720void InputManager::release_focus()
    721721{ grab=NULL;
    722722  if (cur)
     
    724724}
    725725
    726 void input_manager::remap(filter *f)
     726void InputManager::remap(filter *f)
    727727{
    728728  for (ifield *i=first;i;i=i->next)
     
    731731}
    732732
    733 void input_manager::add(ifield *i)
     733void InputManager::add(ifield *i)
    734734{ ifield *f=first;
    735735  if (i->selectable())
     
    745745}
    746746
    747 ifield *input_manager::get(int id)
     747ifield *InputManager::get(int id)
    748748{
    749749  ifield *f;
     
    771771
    772772/* re-position the control with respect to the "client" area of the window */
    773 void ifield::set_owner(jwindow * newowner)
     773void ifield::set_owner(Jwindow * newowner)
    774774{
    775775    if(owner)
  • 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
  • abuse/trunk/src/imlib/pmenu.cpp

    r112 r120  
    2525  screen->get_clip(cx1,cy1,cx2,cy2);
    2626  if (cx1<X) cx1=X;
    27   int w = cx2 - cx1 - jwindow::left_border() - jwindow::right_border() + 1;
    28   int h = jwindow::top_border() + jwindow::bottom_border();
     27  int w = cx2 - cx1 - Jwindow::left_border() - Jwindow::right_border() + 1;
     28  int h = Jwindow::top_border() + Jwindow::bottom_border();
    2929
    3030  bar=wm->new_window(X, Y, w, 0, NULL);
     
    136136
    137137
    138 void psub_menu::hide(jwindow *parent, int x, int y)
     138void psub_menu::hide(Jwindow *parent, int x, int y)
    139139{
    140140  int w,h;
     
    176176}
    177177
    178 void psub_menu::draw(jwindow *parent, int x, int y)
     178void psub_menu::draw(Jwindow *parent, int x, int y)
    179179{
    180180  if (win) wm->close_window(win);
     
    193193
    194194  win=wm->new_window(parent->x+x,parent->y+y,
    195                      w - jwindow::left_border() - jwindow::right_border(),
    196                      h - jwindow::top_border() - jwindow::bottom_border(),
     195                     w - Jwindow::left_border() - Jwindow::right_border(),
     196                     h - Jwindow::top_border() - Jwindow::bottom_border(),
    197197                     NULL);
    198198  win->freeze();
     
    210210}
    211211
    212 void pmenu_item::draw_self(jwindow *parent, int x, int y, int w, int top, int active)
     212void pmenu_item::draw_self(Jwindow *parent, int x, int y, int w, int top, int active)
    213213{
    214214  int bx=x;
     
    245245}
    246246
    247 void pmenu_item::draw(jwindow *parent, int x, int y, int w, int top,
     247void pmenu_item::draw(Jwindow *parent, int x, int y, int w, int top,
    248248                      int active)
    249249
     
    301301
    302302
    303 int psub_menu::handle_event(jwindow *parent, int x, int y, event &ev)
     303int psub_menu::handle_event(Jwindow *parent, int x, int y, event &ev)
    304304{
    305305  int w,h;
     
    342342}
    343343
    344 int pmenu_item::handle_event(jwindow *parent, int x, int y, int w, int top,
     344int pmenu_item::handle_event(Jwindow *parent, int x, int y, int w, int top,
    345345                             event &ev)
    346346{
  • abuse/trunk/src/imlib/pmenu.hpp

    r106 r120  
    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, 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);
     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   jwindow *win;
     46  Jwindow *win;
    4747  pmenu_item *item_num(int x) { pmenu_item *p=first; while (x-- && p) p=p->next; return p; }
    4848public :
     
    5252  psub_menu(pmenu_item *First, psub_menu *Next)
    5353  { first=First; Next=Next; win=0; active=0; }
    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);
     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);
    5757  int own_event(event &ev);
    5858  ~psub_menu();
     
    6161class pmenu
    6262{
    63   jwindow *bar;
     63  Jwindow *bar;
    6464  pmenu_item *top,*active;
    6565  int itemw(pmenu_item *p)
  • abuse/trunk/src/imlib/scroller.cpp

    r115 r120  
    175175
    176176
    177 void scroller::handle_event(event &ev, image *screen, input_manager *inm)
     177void scroller::handle_event(event &ev, image *screen, InputManager *inm)
    178178{
    179179  int mx=ev.mouse_move.x,my=ev.mouse_move.y;
     
    279279
    280280
    281 void scroller::handle_right(image *screen, input_manager *inm)
     281void scroller::handle_right(image *screen, InputManager *inm)
    282282{
    283283  if (!vert && sx<t-1)
     
    290290}
    291291
    292 void scroller::handle_left(image *screen, input_manager *inm)
     292void scroller::handle_left(image *screen, InputManager *inm)
    293293{
    294294  if (!vert && sx>1)
     
    301301}
    302302
    303 void scroller::handle_up(image *screen, input_manager *inm)
     303void scroller::handle_up(image *screen, InputManager *inm)
    304304{
    305305  if (vert && sx>1)
     
    312312}
    313313
    314 void scroller::handle_down(image *screen, input_manager *inm)
     314void scroller::handle_down(image *screen, InputManager *inm)
    315315{
    316316  if (vert && sx<t-1)
     
    409409}
    410410
    411 void pick_list::handle_inside_event(event &ev, image *screen, input_manager *inm)
     411void pick_list::handle_inside_event(event &ev, image *screen, InputManager *inm)
    412412{
    413413  if (ev.type==EV_MOUSE_MOVE && activate_on_mouse_move())
     
    455455}
    456456
    457 void pick_list::handle_up(image *screen, input_manager *inm)
     457void pick_list::handle_up(image *screen, InputManager *inm)
    458458{
    459459  if (cur_sel>0)
     
    469469}
    470470
    471 void pick_list::handle_down(image *screen, input_manager *inm)
     471void pick_list::handle_down(image *screen, InputManager *inm)
    472472{
    473473  if (cur_sel<t-1)
     
    623623
    624624
    625 void spicker::handle_inside_event(event &ev, image *screen, input_manager *inm)
     625void spicker::handle_inside_event(event &ev, image *screen, InputManager *inm)
    626626{
    627627  switch (ev.type)
     
    686686
    687687
    688 void spicker::handle_up(image *screen, input_manager *inm)
     688void spicker::handle_up(image *screen, InputManager *inm)
    689689{
    690690  if (vert && cur_sel>0)
     
    703703}
    704704
    705 void spicker::handle_down(image *screen, input_manager *inm)
     705void spicker::handle_down(image *screen, InputManager *inm)
    706706{
    707707  if (vert && cur_sel<t-1)
     
    718718}
    719719
    720 void spicker::handle_left(image *screen, input_manager *inm)
    721 {
    722 }
    723 
    724 void spicker::handle_right(image *screen, input_manager *inm)
    725 {
    726 }
    727 
    728 
    729 
    730 
     720void spicker::handle_left(image *screen, InputManager *inm)
     721{
     722}
     723
     724void spicker::handle_right(image *screen, InputManager *inm)
     725{
     726}
     727
     728
     729
     730
  • abuse/trunk/src/imlib/scroller.hpp

    r112 r120  
    4141  virtual void draw_first(image *screen);
    4242  virtual void draw(int active, image *screen);
    43   virtual void handle_event(event &ev, image *screen, input_manager *im);
     43  virtual void handle_event(event &ev, image *screen, InputManager *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, input_manager *inm) {;}
     47  virtual void handle_inside_event(event &ev, image *screen, InputManager *inm) {;}
    4848  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);
     49  virtual void handle_up(image *screen, InputManager *inm);
     50  virtual void handle_down(image *screen, InputManager *inm);
     51  virtual void handle_left(image *screen, InputManager *inm);
     52  virtual void handle_right(image *screen, InputManager *inm);
    5353  virtual void area_config() { ; }
    5454  void set_size(int width, int height) { l=width; h=height; }
     
    6969  int first_selected();
    7070  virtual void scroll_event(int newx, image *screen);
    71   virtual void handle_inside_event(event &ev, image *screen, input_manager *inm);
     71  virtual void handle_inside_event(event &ev, image *screen, InputManager *inm);
    7272
    7373  // you should define \/
     
    7777  virtual int item_width() = 0;
    7878  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) { ; }
     79  virtual void note_selection(image *screen, InputManager *inm, int x) { ; }
     80  virtual void note_new_current(image *screen, InputManager *inm, int x) { ; }
    8181  virtual int ok_to_select(int num) { return 1; }
    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);
     82  virtual void handle_up(image *screen, InputManager *inm);
     83  virtual void handle_down(image *screen, InputManager *inm);
     84  virtual void handle_left(image *screen, InputManager *inm);
     85  virtual void handle_right(image *screen, InputManager *inm);
    8686  virtual void set_x(int x, image *screen);
    8787  void reconfigure();   // should be called by constructor after class is ready to take virtual calls
     
    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, input_manager *inm);
     106  virtual void handle_inside_event(event &ev, image *screen, InputManager *inm);
    107107  virtual void scroll_event(int newx, image *screen);
    108108  virtual char *read() { return (char *)this; }
    109109  virtual void area_config();
    110   virtual void handle_up(image *screen, input_manager *inm);
    111   virtual void handle_down(image *screen, input_manager *inm);
     110  virtual void handle_up(image *screen, InputManager *inm);
     111  virtual void handle_down(image *screen, InputManager *inm);
    112112  int get_selection() { return lis[cur_sel].number; }
    113113  ~pick_list() { jfree(lis); }
  • abuse/trunk/src/imlib/tools.hpp

    r106 r120  
    3737  virtual int item_width() { return iw; }
    3838  virtual int item_height() { return ih; }
    39   virtual void note_new_current(image *screen, input_manager *inm, int x)
     39  virtual void note_new_current(image *screen, InputManager *inm, int x)
    4040  { wm->push_event(new event(ids[x],NULL)); }
    4141
  • abuse/trunk/src/innet.cpp

    r111 r120  
    542542
    543543
    544       jwindow *j=wm->new_window(0,yres/2,-1,-1,new info_field(0, 0, 0, symbol_str("resync"),
     544      Jwindow *j=wm->new_window(0,yres/2,-1,-1,new info_field(0, 0, 0, symbol_str("resync"),
    545545                                              new button(0, wm->font()->height() + 5, ID_NET_DISCONNECT,
    546546                                                         symbol_str("slack"),NULL)),symbol_str("hold!"))
     
    623623
    624624    int total_retry=0;
    625     jwindow *abort=NULL;
     625    Jwindow *abort=NULL;
    626626
    627627    while (base->input_state!=INPUT_PROCESSING)
  • abuse/trunk/src/loadgame.cpp

    r113 r120  
    5555}
    5656
    57 jwindow *create_num_window(int mx, int total_saved, image **thumb_nails)
     57Jwindow *create_num_window(int mx, int total_saved, image **thumb_nails)
    5858{
    5959  ico_button *buts[MAX_SAVE_GAMES];
     
    7373    buts[i]->next=buts[i+1];
    7474
    75   return wm->new_window(mx,yres/2-(jwindow::top_border()+ih*5)/2,-1,-1,buts[0]);
     75  return wm->new_window(mx,yres/2-(Jwindow::top_border()+ih*5)/2,-1,-1,buts[0]);
    7676}
    7777
     
    9797  if( mx < 0) mx = 0;
    9898
    99   jwindow *l_win=create_num_window(mx,MAX_SAVE_GAMES,NULL);
     99  Jwindow *l_win=create_num_window(mx,MAX_SAVE_GAMES,NULL);
    100100  event ev;
    101101  int got_level=0;
     
    219219
    220220
    221         jwindow *l_win=create_num_window(0,total_saved,thumb_nails);
    222         jwindow *preview=wm->new_window(l_win->x+l_win->l+5,l_win->y,max_w,max_h,NULL,title);
     221        Jwindow *l_win=create_num_window(0,total_saved,thumb_nails);
     222        Jwindow *preview=wm->new_window(l_win->x+l_win->l+5,l_win->y,max_w,max_h,NULL,title);
    223223
    224224        first->put_image(preview->screen,preview->x1(),preview->y1());
  • abuse/trunk/src/menu.cpp

    r118 r120  
    416416
    417417
    418 void menu_handler(event &ev, input_manager *inm)
     418void menu_handler(event &ev, InputManager *inm)
    419419{
    420420  switch (ev.type)
     
    652652        list=make_default_buttons(xres-33,y,list);
    653653
    654         input_manager *inm=new input_manager(screen,list);
     654        InputManager *inm=new InputManager(screen,list);
    655655        inm->allow_no_selections();
    656656        inm->clear_current();
  • abuse/trunk/src/net/gserver.cpp

    r111 r120  
    5959{
    6060  int last_count=0;
    61   jwindow *stat=NULL;
     61  Jwindow *stat=NULL;
    6262  event ev;
    6363  int abort=0;
  • abuse/trunk/src/netcfg.cpp

    r113 r120  
    5353void net_configuration::cfg_error(char const *msg)
    5454{
    55   jwindow *j=wm->new_window(-1,0,-1,-1,new info_field(0, 0, 0, msg,
     55  Jwindow *j=wm->new_window(-1,0,-1,-1,new info_field(0, 0, 0, msg,
    5656      new button(0, 30,CFG_ERR_OK,symbol_str("ok_button"),NULL)),symbol_str("input_error"));
    5757  event ev;
     
    9494
    9595
    96 int net_configuration::confirm_inputs(input_manager *i, int server)
     96int net_configuration::confirm_inputs(InputManager *i, int server)
    9797{
    9898  if (server)
     
    171171  int x=0,y=0;
    172172 
    173   jwindow *sv=wm->new_window(50,80,-1,-1,new button(0,0,NET_SERVER,symbol_str("server"),
     173  Jwindow *sv=wm->new_window(50,80,-1,-1,new button(0,0,NET_SERVER,symbol_str("server"),
    174174                                     new button(0,wm->font()->height()*2,NET_CLIENT,symbol_str("client"),
    175175                                     new button(0,wm->font()->height()*4,NET_SINGLE,symbol_str("single_play"),
     
    233233
    234234
    235   jwindow *nw=wm->new_window(0,0,-1,-1,ilist,symbol_str("Networking"));
     235  Jwindow *nw=wm->new_window(0,0,-1,-1,ilist,symbol_str("Networking"));
    236236
    237237  done=0;
     
    288288    button *sb=new button(bx,by,NET_SERVER,ok,NULL);
    289289
    290     input_manager inm(screen,sb);
     290    InputManager inm(screen,sb);
    291291    inm.allow_no_selections();
    292292    inm.clear_current();
     
    408408
    409409  {
    410     input_manager inm(screen,list);
     410    InputManager inm(screen,list);
    411411    inm.allow_no_selections();
    412412    inm.clear_current();
     
    463463      sb=new button(x+40,y+ns_h-9-fnt->height(),NET_SINGLE,symbol_str("single_play"),sb);
    464464
    465     input_manager inm(screen,sb);
     465    InputManager inm(screen,sb);
    466466
    467467    inm.allow_no_selections();
  • abuse/trunk/src/netcfg.hpp

    r57 r120  
    1010#ifndef __NETCFG_HPP_
    1111#define __NETCFG_HPP_
     12
    1213#include "jwindow.hpp"
    13 
    1414
    1515class net_configuration
     
    3434  int input();   // pulls up dialog box and input fileds
    3535  void cfg_error(char const *msg);
    36   int confirm_inputs(jwindow *j, int server);
     36  int confirm_inputs(Jwindow *j, int server);
    3737  void error(char const *message);
    38   int confirm_inputs(input_manager *i, int server);
     38  int confirm_inputs(InputManager *i, int server);
    3939  ifield *center_ifield(ifield *i,int x1, int x2, ifield *place_below);
    4040  int get_options(int server);
  • abuse/trunk/src/objects.hpp

    r66 r120  
    6363  int type() { return otype; }
    6464  ifield *make_fields(int ystart, ifield *Next) { return NULL ; }
    65   void gather_input(input_manager *inm) { ; }
     65  void gather_input(InputManager *inm) { ; }
    6666  int hurt_all() { return figures[otype]->get_cflag(CFLAG_HURT_ALL); }
    6767  int stoppable() { return figures[otype]->get_cflag(CFLAG_STOPPABLE); }
  • abuse/trunk/src/profile.cpp

    r111 r120  
    1919
    2020
    21 jwindow *prof_win=NULL;
     21Jwindow *prof_win=NULL;
    2222int prof_height=10;
    2323
  • abuse/trunk/src/ui/volumewindow.cpp

    r119 r120  
    1414#include "gui.hpp"          // ico_button
    1515
    16 VolumeWindow::VolumeWindow() : jwindow("Volume")
     16VolumeWindow::VolumeWindow() : Jwindow("Volume")
    1717{
    1818    char const *ff = "art/frame.spe";
  • abuse/trunk/src/ui/volumewindow.hpp

    r118 r120  
    1212#include "dev.hpp"
    1313
    14 class VolumeWindow : public jwindow
     14class VolumeWindow : public Jwindow
    1515{
    1616private:
  • abuse/trunk/src/unixnfc.cpp

    r113 r120  
    487487
    488488
    489       jwindow *j=wm->new_window(0,yres/2,-1,-1,new info_field(0, 0, 0, "Clients are re-syncing, please wait...",NULL));
     489      Jwindow *j=wm->new_window(0,yres/2,-1,-1,new info_field(0, 0, 0, "Clients are re-syncing, please wait...",NULL));
    490490      wm->flush_screen();
    491491      if (!reload_start()) return ;
     
    538538
    539539    int total_retry=0;
    540     jwindow *abort=NULL;
     540    Jwindow *abort=NULL;
    541541    linked_list input;
    542542    while (base->input_state!=INPUT_PROCESSING)
Note: See TracChangeset for help on using the changeset viewer.