Changeset 120
- Timestamp:
- Mar 17, 2008, 3:25:09 AM (14 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/automap.hpp
r57 r120 16 16 class automap 17 17 { 18 jwindow *automap_window;18 Jwindow *automap_window; 19 19 level *cur_lev; 20 20 int tick,w,h; // used to draw your position as a blinking spot -
abuse/trunk/src/console.hpp
r106 r120 18 18 JCFont *fnt; 19 19 char *screen; 20 jwindow *con_win;20 Jwindow *con_win; 21 21 char *name; 22 22 public : -
abuse/trunk/src/dev.cpp
r115 r120 84 84 85 85 pmenu *dev_menu=NULL; 86 jwindow *mess_win=NULL,*warn_win=NULL;86 Jwindow *mess_win=NULL,*warn_win=NULL; 87 87 88 88 game_object *edit_object; … … 155 155 int confirm_quit() 156 156 { 157 jwindow *quitw;157 Jwindow *quitw; 158 158 image *ok_image, *cancel_image; 159 159 … … 3269 3269 } 3270 3270 3271 int dev_controll::is_pal_win( jwindow *win)3271 int dev_controll::is_pal_win(Jwindow *win) 3272 3272 { 3273 3273 int i; -
abuse/trunk/src/dev.hpp
r106 r120 36 36 37 37 public : 38 jwindow *me;38 Jwindow *me; 39 39 void close_window(); 40 40 void open_window(); … … 77 77 time_marker last_area_click; 78 78 public : 79 jwindow *backw,*forew,*commandw,*modew,*omenu,*oedit,*ledit,79 Jwindow *backw,*forew,*commandw,*modew,*omenu,*oedit,*ledit, 80 80 *music_window,*pmenu,*show_menu,*lightw,*aiw,*ambw,*tbw,*area_win, 81 81 *search_window,*memprof; … … 103 103 void handle_event(event &ev); 104 104 void do_command(char const *st, event &ev); 105 int is_pal_win( jwindow *win);105 int is_pal_win(Jwindow *win); 106 106 void dev_draw(view *v); 107 107 void load_stuff(); -
abuse/trunk/src/devsel.cpp
r106 r120 142 142 143 143 144 void tile_picker::handle_inside_event(event &ev, image *screen, input_manager *inm)144 void tile_picker::handle_inside_event(event &ev, image *screen, InputManager *inm) 145 145 { 146 146 if (ev.type==EV_MOUSE_BUTTON) -
abuse/trunk/src/devsel.hpp
r106 r120 18 18 tile_picker(int X, int Y, int ID, int spec_type, 19 19 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); 21 21 virtual void scroll_event(int newx, image *screen); 22 22 virtual char *read() { return (char *)this; } -
abuse/trunk/src/game.cpp
r115 r120 60 60 extern crc_manager *net_crcs; 61 61 game *the_game; 62 window_manager *wm = NULL;62 WindowManager *wm = NULL; 63 63 int dev, shift_down = SHIFT_DOWN_DEFAULT, shift_right = SHIFT_RIGHT_DEFAULT; 64 64 double sum_diffs = 1, total_diffs = 12; … … 110 110 no_space_msg, NULL); 111 111 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"); 113 113 114 114 event ev; … … 1483 1483 console_font = new JCFont(cash.img(console_font_pict)); 1484 1484 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); 1489 1487 1490 1488 delete stat_man; // move to a graphical status manager -
abuse/trunk/src/game.hpp
r106 r120 46 46 47 47 /* Cleaned-up externs */ 48 extern window_manager *wm;48 extern WindowManager *wm; 49 49 50 50 … … 77 77 78 78 79 jwindow *top_menu,*joy_win,*last_input;79 Jwindow *top_menu,*joy_win,*last_input; 80 80 JCFont *game_font; 81 81 uint8_t keymap[512/8]; -
abuse/trunk/src/gamma.cpp
r111 r120 137 137 gp->set_pos(dg / 4); 138 138 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); 140 140 141 141 event ev; -
abuse/trunk/src/go.cpp
r106 r120 38 38 } 39 39 40 void elevator::gather_input( input_manager *inm)40 void elevator::gather_input(InputManager *inm) 41 41 { 42 42 dir=atoi(inm->get(ELEVATOR_DIR)->read()); … … 54 54 } 55 55 56 void elcontrol::gather_input( input_manager *inm)56 void elcontrol::gather_input(InputManager *inm) 57 57 { 58 58 allow_dir=atoi(inm->get(ELCONTROL_ALLOW_DIR)->read()); … … 354 354 355 355 356 void sensor::gather_input( input_manager *inm)356 void sensor::gather_input(InputManager *inm) 357 357 { 358 358 xrange=atoi(inm->get(SENSOR_XRANGE)->read()); -
abuse/trunk/src/go.hpp
r57 r120 21 21 virtual game_objects type() { return O_elcontrol; } 22 22 virtual ifield *make_fields(int ystart, ifield *Next); 23 virtual void gather_input( input_manager *inm);23 virtual void gather_input(InputManager *inm); 24 24 virtual void save(FILE *fp) { game_object::save(fp); write_short(fp,allow_dir); } 25 25 virtual int decide() { return 1; } // not dead … … 41 41 virtual game_objects type() { return O_elevator; } 42 42 virtual ifield *make_fields(int ystart, ifield *Next); 43 virtual void gather_input( input_manager *inm);43 virtual void gather_input(InputManager *inm); 44 44 virtual void save(FILE *fp); 45 45 virtual int can_block(game_object *who); … … 57 57 virtual game_objects type() { return O_sensor; } 58 58 virtual ifield *make_fields(int ystart, ifield *Next); 59 virtual void gather_input( input_manager *inm);59 virtual void gather_input(InputManager *inm); 60 60 virtual void save(FILE *fp); 61 61 -
abuse/trunk/src/gui.cpp
r106 r120 68 68 } 69 69 70 void ico_switch_button::handle_event(event &ev, image *screen, input_manager *im)70 void ico_switch_button::handle_event(event &ev, image *screen, InputManager *im) 71 71 { 72 72 if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON && … … 116 116 extern int sfx_volume; 117 117 118 void ico_button::handle_event(event &ev, image *screen, input_manager *im)118 void ico_button::handle_event(event &ev, image *screen, InputManager *im) 119 119 { 120 120 if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON && -
abuse/trunk/src/gui.hpp
r106 r120 24 24 virtual void draw_first(image *screen) { draw(0,screen); } 25 25 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); 27 27 28 28 virtual char *read() { return (char *)&up; } … … 43 43 virtual void draw_first(image *screen) { cur_but->draw_first(screen); } 44 44 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); 46 46 virtual ifield *unlink(int id); 47 47 virtual char *read() { return cur_but->read(); } -
abuse/trunk/src/imlib/event.hpp
r57 r120 29 29 #include "mouse.hpp" 30 30 31 class jwindow;31 class Jwindow; 32 32 33 33 class event : public linked_node … … 41 41 struct { int x1,y1,x2,y2; 42 42 void *start; } redraw; 43 jwindow *window; // NULL is root43 Jwindow *window; // NULL is root 44 44 struct { int x,y; } window_position; 45 45 struct { int id; char *data; } message; -
abuse/trunk/src/imlib/filesel.cpp
r111 r120 26 26 virtual int item_height() { return wm->font()->height()+1; } 27 27 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); 29 29 void free_up(); 30 30 ~file_picker() { free_up(); } … … 42 42 } 43 43 44 void file_picker::note_selection(image *screen, input_manager *inm, int x)44 void file_picker::note_selection(image *screen, InputManager *inm, int x) 45 45 { 46 46 if (x<td) … … 116 116 } 117 117 118 jwindow *file_dialog(char const *prompt, char const *def,118 Jwindow *file_dialog(char const *prompt, char const *def, 119 119 int ok_id, char const *ok_name, int cancel_id, 120 120 char const *cancel_name, char const *FILENAME_str, … … 123 123 int wh2 = 5 + wm->font()->height() + 5; 124 124 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, 126 126 new info_field(5, 5, 0, prompt, 127 127 new text_field(0, wh2, filename_id, -
abuse/trunk/src/imlib/filesel.hpp
r106 r120 13 13 #include "jwindow.hpp" 14 14 15 jwindow *file_dialog(char const *prompt, char const *def,15 Jwindow *file_dialog(char const *prompt, char const *def, 16 16 int ok_id, char const *ok_name, int cancel_id, 17 17 char const *cancel_name, char const *FILENAME_str, -
abuse/trunk/src/imlib/guistat.cpp
r111 r120 21 21 gui_status_node *next; 22 22 visual_object *show; 23 jwindow *stat_win;23 Jwindow *stat_win; 24 24 int last_update; 25 25 time_marker last_time; -
abuse/trunk/src/imlib/input.cpp
r112 r120 108 108 } 109 109 110 void button_box::handle_event(event &ev, image *screen, input_manager *im)110 void button_box::handle_event(event &ev, image *screen, InputManager *im) 111 111 { 112 112 switch (ev.type) … … 263 263 } 264 264 265 void text_field::handle_event(event &ev, image *screen, input_manager *im)265 void text_field::handle_event(event &ev, image *screen, InputManager *im) 266 266 { 267 267 int xx; … … 361 361 { up=!up; } 362 362 363 void button::handle_event(event &ev, image *screen, input_manager *im)363 void button::handle_event(event &ev, image *screen, InputManager *im) 364 364 { 365 365 if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON && -
abuse/trunk/src/imlib/input.hpp
r109 r120 13 13 #include "filter.hpp" 14 14 15 extern window_manager *wm; /* FIXME: get rid of this if possible */15 extern WindowManager *wm; /* FIXME: get rid of this if possible */ 16 16 17 17 class button : public ifield … … 29 29 virtual void draw_first(image *screen); 30 30 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); 32 32 void change_visual(image *new_visual); 33 33 virtual void remap(filter *f); … … 52 52 virtual void draw_first(image *screen); 53 53 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); 55 55 virtual ~button_box(); 56 56 virtual char *read(); // return pointer to first button which is depressed … … 83 83 virtual void draw_first(image *screen); 84 84 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); 86 86 87 87 virtual ~text_field() { jfree(prompt); jfree(format); jfree(data); } … … 103 103 virtual void draw_first(image *screen); 104 104 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) { ; } 106 106 virtual char *read() { return text; } 107 107 virtual int selectable() { return 0; } -
abuse/trunk/src/imlib/jwindow.cpp
r119 r120 39 39 40 40 // 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)41 int WindowManager::window_in_area(int x1, int y1, int x2, int y2) 42 { 43 for (Jwindow *f=first;f;f=f->next) 44 44 if (f->x<=x2 && f->y<=y2 && f->x+f->l-1>=x1 && f->y+f->h-1>=y1) 45 45 return 1; … … 47 47 } 48 48 49 void window_manager::grab_focus(jwindow *j)49 void WindowManager::grab_focus(Jwindow *j) 50 50 { grab=j; } 51 51 52 void window_manager::release_focus()52 void WindowManager::release_focus() 53 53 { grab=NULL; } 54 54 55 55 56 void window_manager::close_window(jwindow *j)56 void WindowManager::close_window(Jwindow *j) 57 57 { 58 58 delete j; 59 59 } 60 60 61 void window_manager::hide_windows()62 { 63 jwindow *p;61 void WindowManager::hide_windows() 62 { 63 Jwindow *p; 64 64 for (p=first;p;p=p->next) 65 65 { … … 72 72 } 73 73 74 void window_manager::show_windows()75 { 76 jwindow *p;74 void WindowManager::show_windows() 75 { 76 Jwindow *p; 77 77 for (p=first;p;p=p->next) 78 78 if (p->is_hidden()) … … 80 80 } 81 81 82 void window_manager::hide_window(jwindow *j)83 { 84 jwindow *k;82 void WindowManager::hide_window(Jwindow *j) 83 { 84 Jwindow *k; 85 85 if (j==first) 86 86 first=first->next; … … 98 98 } 99 99 100 void window_manager::show_window(jwindow *j)100 void WindowManager::show_window(Jwindow *j) 101 101 { 102 102 if (j->is_hidden()) … … 107 107 } 108 108 109 void window_manager::get_event(event &ev)110 { 111 jwindow *j;109 void WindowManager::get_event(event &ev) 110 { 111 Jwindow *j; 112 112 eh->get_event(ev); 113 113 if (ev.type==EV_KEY) … … 156 156 else 157 157 { 158 jwindow *last=first;158 Jwindow *last=first; 159 159 for (;last->next!=ev.window;last=last->next); 160 160 if (ev.window->next) … … 166 166 else 167 167 { 168 jwindow *last=first;168 Jwindow *last=first; 169 169 for (;last->next;last=last->next); 170 170 last->next=ev.window; … … 173 173 if (red) 174 174 { 175 jwindow *j=ev.window;175 Jwindow *j=ev.window; 176 176 /* screen->add_dirty(j->x,j->y,j->x+j->l-1,j->y+j->h-1); 177 177 for (p=first;p!=j;p=p->next) … … 216 216 } 217 217 218 void jwindow::resize(int L, int H)218 void Jwindow::resize(int L, int H) 219 219 { 220 220 screen->change_size(L,H); … … 222 222 } 223 223 224 void window_manager::resize_window(jwindow *j, int l, int h)225 { 226 jwindow *p;224 void WindowManager::resize_window(Jwindow *j, int l, int h) 225 { 226 Jwindow *p; 227 227 screen->add_dirty(j->x,j->y,j->x+j->l-1,j->y+j->h-1); 228 228 for (p=first;p!=j;p=p->next) … … 233 233 } 234 234 235 void window_manager::move_window(jwindow *j, int x, int y)235 void WindowManager::move_window(Jwindow *j, int x, int y) 236 236 { 237 237 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) 239 239 p->screen->add_dirty(j->x - p->x, j->y - p->y, j->x + j->l - 1 - p->x, 240 240 j->y + j->h - 1 - p->y); … … 244 244 } 245 245 246 window_manager::window_manager(image *Screen, palette *Pal, int Hi,247 246 WindowManager::WindowManager(image *Screen, palette *Pal, int Hi, 247 int Med, int Low, JCFont *Font) 248 248 { 249 249 wm = this; … … 257 257 } 258 258 259 window_manager::~window_manager()259 WindowManager::~WindowManager() 260 260 { 261 261 delete eh; … … 265 265 } 266 266 267 void window_manager::add_window(jwindow *win)267 void WindowManager::add_window(Jwindow *win) 268 268 { 269 269 if(!first) … … 271 271 else 272 272 { 273 jwindow *tmp = first;273 Jwindow *tmp = first; 274 274 while(tmp->next) 275 275 tmp = tmp->next; … … 279 279 } 280 280 281 void window_manager::remove_window(jwindow *win)281 void WindowManager::remove_window(Jwindow *win) 282 282 { 283 283 if(grab == win) … … 292 292 else 293 293 { 294 jwindow * search;294 Jwindow * search; 295 295 for(search = first; search->next != win; search = search->next) 296 296 search->screen->add_dirty(win->x - search->x, … … 308 308 } 309 309 310 jwindow * window_manager::new_window(int x, int y, int l, int h,310 Jwindow * WindowManager::new_window(int x, int y, int l, int h, 311 311 ifield * fields, char const *name) 312 312 { … … 316 316 y = screen->height () - 10; 317 317 318 jwindow * j = new jwindow (x, y, l, h, fields, name);318 Jwindow * j = new Jwindow (x, y, l, h, fields, name); 319 319 j->show(); 320 320 … … 322 322 } 323 323 324 void window_manager::flush_screen()325 { 326 jwindow *p,*q;324 void WindowManager::flush_screen() 325 { 326 Jwindow *p,*q; 327 327 328 328 int mx=0,my=0; … … 377 377 } 378 378 379 jwindow::jwindow(char const *name)379 Jwindow::Jwindow(char const *name) 380 380 { 381 381 _x1 = left_border(); … … 387 387 // property.flags = JWINDOW_NOAUTOHIDE_FLAG; 388 388 389 inm = new input_manager(this, NULL);389 inm = new InputManager(this, NULL); 390 390 reconfigure(); 391 391 … … 396 396 if(name) 397 397 _name = strcpy((char *)jmalloc(strlen(name) + 1, 398 " jwindow::window name"), name);398 "Jwindow::window name"), name); 399 399 wm->add_window(this); 400 400 } 401 401 402 jwindow::jwindow(int X, int Y, int L, int H, ifield *f, char const *name)402 Jwindow::Jwindow(int X, int Y, int L, int H, ifield *f, char const *name) 403 403 { 404 404 l = 0; … … 411 411 412 412 screen = NULL; 413 inm = new input_manager(screen, f);413 inm = new InputManager(screen, f); 414 414 reconfigure(); /* FIXME: TODO */ 415 415 … … 443 443 if(name) 444 444 _name = strcpy((char *)jmalloc(strlen(name) + 1, 445 " jwindow::window name"), name);445 "Jwindow::window name"), name); 446 446 447 447 wm->add_window(this); … … 450 450 } 451 451 452 jwindow::~jwindow()452 Jwindow::~Jwindow() 453 453 { 454 454 wm->remove_window(this); … … 461 461 } 462 462 463 void jwindow::reconfigure()463 void Jwindow::reconfigure() 464 464 { 465 465 int x1, y1, x2, y2; … … 478 478 } 479 479 480 void jwindow::local_close()480 void Jwindow::local_close() 481 481 { 482 482 ; 483 483 } 484 484 485 void jwindow::redraw()485 void Jwindow::redraw() 486 486 { 487 487 int hi = wm->bright_color (); … … 537 537 } 538 538 539 int jwindow::left_border()539 int Jwindow::left_border() 540 540 { 541 541 return frame_left(); 542 542 } 543 543 544 int jwindow::right_border()544 int Jwindow::right_border() 545 545 { 546 546 return frame_right(); 547 547 } 548 548 549 int jwindow::top_border()549 int Jwindow::top_border() 550 550 { 551 551 return wm->font()->height() + frame_top(); 552 552 } 553 553 554 int jwindow::bottom_border()554 int Jwindow::bottom_border() 555 555 { 556 556 return frame_bottom(); … … 558 558 559 559 560 ifield * input_manager::unlink(int id) // unlinks ID from fields list and return the pointer to it560 ifield *InputManager::unlink(int id) // unlinks ID from fields list and return the pointer to it 561 561 { 562 562 for (ifield *i=first,*last=NULL;i;i=i->next) … … 579 579 } 580 580 581 input_manager::~input_manager()581 InputManager::~InputManager() 582 582 { ifield *i; 583 583 while (first) … … 588 588 } 589 589 590 void input_manager::clear_current()590 void InputManager::clear_current() 591 591 { 592 592 if(owner) … … 597 597 } 598 598 599 void input_manager::handle_event(event &ev, jwindow *j)599 void InputManager::handle_event(event &ev, Jwindow *j) 600 600 { 601 601 ifield *i,*in_area=NULL; … … 670 670 } 671 671 672 void input_manager::allow_no_selections()672 void InputManager::allow_no_selections() 673 673 { 674 674 no_selections_allowed=1; 675 675 } 676 676 677 void input_manager::redraw()677 void InputManager::redraw() 678 678 { 679 679 ifield *i; … … 686 686 } 687 687 688 input_manager::input_manager(image *Screen, ifield *First)688 InputManager::InputManager(image *Screen, ifield *First) 689 689 { 690 690 no_selections_allowed = 0; … … 700 700 } 701 701 702 input_manager::input_manager(jwindow *Owner, ifield *First)702 InputManager::InputManager(Jwindow *Owner, ifield *First) 703 703 { 704 704 no_selections_allowed = 0; … … 712 712 } 713 713 714 void input_manager::grab_focus(ifield *i)714 void InputManager::grab_focus(ifield *i) 715 715 { grab=i; 716 716 if (cur) … … 718 718 } 719 719 720 void input_manager::release_focus()720 void InputManager::release_focus() 721 721 { grab=NULL; 722 722 if (cur) … … 724 724 } 725 725 726 void input_manager::remap(filter *f)726 void InputManager::remap(filter *f) 727 727 { 728 728 for (ifield *i=first;i;i=i->next) … … 731 731 } 732 732 733 void input_manager::add(ifield *i)733 void InputManager::add(ifield *i) 734 734 { ifield *f=first; 735 735 if (i->selectable()) … … 745 745 } 746 746 747 ifield * input_manager::get(int id)747 ifield *InputManager::get(int id) 748 748 { 749 749 ifield *f; … … 771 771 772 772 /* re-position the control with respect to the "client" area of the window */ 773 void ifield::set_owner( jwindow * newowner)773 void ifield::set_owner(Jwindow * newowner) 774 774 { 775 775 if(owner) -
abuse/trunk/src/imlib/jwindow.hpp
r119 r120 18 18 19 19 class ifield; 20 class window_manager;21 class jwindow;20 class WindowManager; 21 class Jwindow; 22 22 23 23 extern int frame_top(); … … 28 28 void set_frame_size(int x); 29 29 30 class input_manager30 class InputManager 31 31 { 32 friend class jwindow;32 friend class Jwindow; 33 33 34 34 private: 35 35 image *screen; 36 36 ifield *first, *active, *grab; 37 jwindow *cur, *owner;37 Jwindow *cur, *owner; 38 38 int no_selections_allowed; 39 39 40 40 public: 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); 44 44 ifield *get(int id); 45 45 void redraw(); … … 52 52 void release_focus(); 53 53 void allow_no_selections(); 54 ~ input_manager();54 ~InputManager(); 55 55 } ; 56 56 57 57 class ifield 58 58 { 59 friend class jwindow;60 friend class input_manager;59 friend class Jwindow; 60 friend class InputManager; 61 61 62 62 protected: 63 jwindow *owner;63 Jwindow *owner; 64 64 65 65 public : … … 69 69 int id; 70 70 ifield *next; 71 virtual void set_owner( jwindow *owner);71 virtual void set_owner(Jwindow *owner); 72 72 virtual void move(int newx, int newy) { x = newx; y = newy; } 73 73 virtual void area(int &x1, int &y1, int &x2, int &y2) = 0; 74 74 virtual void draw_first(image *screen) = 0; 75 75 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; 77 77 virtual int selectable() { return 1; } 78 78 virtual void remap(filter *f) { ; } … … 83 83 } ; 84 84 85 class jwindow85 class Jwindow 86 86 { 87 friend class input_manager;87 friend class InputManager; 88 88 89 89 private: … … 95 95 96 96 protected: 97 jwindow *owner;97 Jwindow *owner; 98 98 int _x1, _y1, _x2, _y2; 99 99 100 100 public: 101 jwindow *next;101 Jwindow *next; 102 102 int x, y, l, h, backg; 103 103 image *screen; 104 input_manager *inm;104 InputManager *inm; 105 105 void *local_info; // pointer to info block for local system (may support windows) 106 106 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(); 110 110 111 111 virtual void redraw(); … … 133 133 }; 134 134 135 class window_manager135 class WindowManager 136 136 { 137 friend class jwindow;137 friend class Jwindow; 138 138 139 139 protected: 140 void add_window( jwindow *);141 void remove_window( jwindow *);140 void add_window(Jwindow *); 141 void remove_window(Jwindow *); 142 142 143 143 public: 144 144 event_handler *eh; 145 jwindow *first, *grab;145 Jwindow *first, *grab; 146 146 image *screen, *mouse_pic, *mouse_save; 147 147 palette *pal; … … 150 150 enum { inputing, dragging } state; 151 151 int drag_mousex, drag_mousey, frame_suppress; 152 jwindow *drag_window;152 Jwindow *drag_window; 153 153 JCFont *fnt, *wframe_fnt; 154 154 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(); 157 157 158 jwindow *new_window(int x, int y, int l, int h,158 Jwindow *new_window(int x, int y, int l, int h, 159 159 ifield *fields = NULL, char const *Name = NULL); 160 160 161 161 void set_frame_font(JCFont *fnt) { wframe_fnt = fnt; } 162 162 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); 166 166 void get_event(event &ev); 167 167 void push_event(event *ev) { eh->push_event(ev); } … … 185 185 void hide_windows(); 186 186 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); 189 189 void set_frame_suppress(int x) { frame_suppress=x; } 190 void grab_focus( jwindow *j);190 void grab_focus(Jwindow *j); 191 191 void release_focus(); 192 192 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 25 25 screen->get_clip(cx1,cy1,cx2,cy2); 26 26 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(); 29 29 30 30 bar=wm->new_window(X, Y, w, 0, NULL); … … 136 136 137 137 138 void psub_menu::hide( jwindow *parent, int x, int y)138 void psub_menu::hide(Jwindow *parent, int x, int y) 139 139 { 140 140 int w,h; … … 176 176 } 177 177 178 void psub_menu::draw( jwindow *parent, int x, int y)178 void psub_menu::draw(Jwindow *parent, int x, int y) 179 179 { 180 180 if (win) wm->close_window(win); … … 193 193 194 194 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(), 197 197 NULL); 198 198 win->freeze(); … … 210 210 } 211 211 212 void pmenu_item::draw_self( jwindow *parent, int x, int y, int w, int top, int active)212 void pmenu_item::draw_self(Jwindow *parent, int x, int y, int w, int top, int active) 213 213 { 214 214 int bx=x; … … 245 245 } 246 246 247 void pmenu_item::draw( jwindow *parent, int x, int y, int w, int top,247 void pmenu_item::draw(Jwindow *parent, int x, int y, int w, int top, 248 248 int active) 249 249 { … … 301 301 302 302 303 int psub_menu::handle_event( jwindow *parent, int x, int y, event &ev)303 int psub_menu::handle_event(Jwindow *parent, int x, int y, event &ev) 304 304 { 305 305 int w,h; … … 342 342 } 343 343 344 int pmenu_item::handle_event( jwindow *parent, int x, int y, int w, int top,344 int pmenu_item::handle_event(Jwindow *parent, int x, int y, int w, int top, 345 345 event &ev) 346 346 { -
abuse/trunk/src/imlib/pmenu.hpp
r106 r120 31 31 pmenu_item *find_id(int search_id); 32 32 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); 36 36 int own_event(event &ev); 37 37 ~pmenu_item(); … … 44 44 psub_menu *next; 45 45 int active; 46 jwindow *win;46 Jwindow *win; 47 47 pmenu_item *item_num(int x) { pmenu_item *p=first; while (x-- && p) p=p->next; return p; } 48 48 public : … … 52 52 psub_menu(pmenu_item *First, psub_menu *Next) 53 53 { 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); 57 57 int own_event(event &ev); 58 58 ~psub_menu(); … … 61 61 class pmenu 62 62 { 63 jwindow *bar;63 Jwindow *bar; 64 64 pmenu_item *top,*active; 65 65 int itemw(pmenu_item *p) -
abuse/trunk/src/imlib/scroller.cpp
r115 r120 175 175 176 176 177 void scroller::handle_event(event &ev, image *screen, input_manager *inm)177 void scroller::handle_event(event &ev, image *screen, InputManager *inm) 178 178 { 179 179 int mx=ev.mouse_move.x,my=ev.mouse_move.y; … … 279 279 280 280 281 void scroller::handle_right(image *screen, input_manager *inm)281 void scroller::handle_right(image *screen, InputManager *inm) 282 282 { 283 283 if (!vert && sx<t-1) … … 290 290 } 291 291 292 void scroller::handle_left(image *screen, input_manager *inm)292 void scroller::handle_left(image *screen, InputManager *inm) 293 293 { 294 294 if (!vert && sx>1) … … 301 301 } 302 302 303 void scroller::handle_up(image *screen, input_manager *inm)303 void scroller::handle_up(image *screen, InputManager *inm) 304 304 { 305 305 if (vert && sx>1) … … 312 312 } 313 313 314 void scroller::handle_down(image *screen, input_manager *inm)314 void scroller::handle_down(image *screen, InputManager *inm) 315 315 { 316 316 if (vert && sx<t-1) … … 409 409 } 410 410 411 void pick_list::handle_inside_event(event &ev, image *screen, input_manager *inm)411 void pick_list::handle_inside_event(event &ev, image *screen, InputManager *inm) 412 412 { 413 413 if (ev.type==EV_MOUSE_MOVE && activate_on_mouse_move()) … … 455 455 } 456 456 457 void pick_list::handle_up(image *screen, input_manager *inm)457 void pick_list::handle_up(image *screen, InputManager *inm) 458 458 { 459 459 if (cur_sel>0) … … 469 469 } 470 470 471 void pick_list::handle_down(image *screen, input_manager *inm)471 void pick_list::handle_down(image *screen, InputManager *inm) 472 472 { 473 473 if (cur_sel<t-1) … … 623 623 624 624 625 void spicker::handle_inside_event(event &ev, image *screen, input_manager *inm)625 void spicker::handle_inside_event(event &ev, image *screen, InputManager *inm) 626 626 { 627 627 switch (ev.type) … … 686 686 687 687 688 void spicker::handle_up(image *screen, input_manager *inm)688 void spicker::handle_up(image *screen, InputManager *inm) 689 689 { 690 690 if (vert && cur_sel>0) … … 703 703 } 704 704 705 void spicker::handle_down(image *screen, input_manager *inm)705 void spicker::handle_down(image *screen, InputManager *inm) 706 706 { 707 707 if (vert && cur_sel<t-1) … … 718 718 } 719 719 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 720 void spicker::handle_left(image *screen, InputManager *inm) 721 { 722 } 723 724 void spicker::handle_right(image *screen, InputManager *inm) 725 { 726 } 727 728 729 730 -
abuse/trunk/src/imlib/scroller.hpp
r112 r120 41 41 virtual void draw_first(image *screen); 42 42 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); 44 44 virtual char *read() { return (char *)&sx; } 45 45 46 46 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) {;} 48 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);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); 53 53 virtual void area_config() { ; } 54 54 void set_size(int width, int height) { l=width; h=height; } … … 69 69 int first_selected(); 70 70 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); 72 72 73 73 // you should define \/ … … 77 77 virtual int item_width() = 0; 78 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) { ; }79 virtual void note_selection(image *screen, InputManager *inm, int x) { ; } 80 virtual void note_new_current(image *screen, InputManager *inm, int x) { ; } 81 81 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); 86 86 virtual void set_x(int x, image *screen); 87 87 void reconfigure(); // should be called by constructor after class is ready to take virtual calls … … 104 104 pick_list(int X, int Y, int ID, int height, 105 105 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); 107 107 virtual void scroll_event(int newx, image *screen); 108 108 virtual char *read() { return (char *)this; } 109 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);110 virtual void handle_up(image *screen, InputManager *inm); 111 virtual void handle_down(image *screen, InputManager *inm); 112 112 int get_selection() { return lis[cur_sel].number; } 113 113 ~pick_list() { jfree(lis); } -
abuse/trunk/src/imlib/tools.hpp
r106 r120 37 37 virtual int item_width() { return iw; } 38 38 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) 40 40 { wm->push_event(new event(ids[x],NULL)); } 41 41 -
abuse/trunk/src/innet.cpp
r111 r120 542 542 543 543 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"), 545 545 new button(0, wm->font()->height() + 5, ID_NET_DISCONNECT, 546 546 symbol_str("slack"),NULL)),symbol_str("hold!")) … … 623 623 624 624 int total_retry=0; 625 jwindow *abort=NULL;625 Jwindow *abort=NULL; 626 626 627 627 while (base->input_state!=INPUT_PROCESSING) -
abuse/trunk/src/loadgame.cpp
r113 r120 55 55 } 56 56 57 jwindow *create_num_window(int mx, int total_saved, image **thumb_nails)57 Jwindow *create_num_window(int mx, int total_saved, image **thumb_nails) 58 58 { 59 59 ico_button *buts[MAX_SAVE_GAMES]; … … 73 73 buts[i]->next=buts[i+1]; 74 74 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]); 76 76 } 77 77 … … 97 97 if( mx < 0) mx = 0; 98 98 99 jwindow *l_win=create_num_window(mx,MAX_SAVE_GAMES,NULL);99 Jwindow *l_win=create_num_window(mx,MAX_SAVE_GAMES,NULL); 100 100 event ev; 101 101 int got_level=0; … … 219 219 220 220 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); 223 223 224 224 first->put_image(preview->screen,preview->x1(),preview->y1()); -
abuse/trunk/src/menu.cpp
r118 r120 416 416 417 417 418 void menu_handler(event &ev, input_manager *inm)418 void menu_handler(event &ev, InputManager *inm) 419 419 { 420 420 switch (ev.type) … … 652 652 list=make_default_buttons(xres-33,y,list); 653 653 654 input_manager *inm=new input_manager(screen,list);654 InputManager *inm=new InputManager(screen,list); 655 655 inm->allow_no_selections(); 656 656 inm->clear_current(); -
abuse/trunk/src/net/gserver.cpp
r111 r120 59 59 { 60 60 int last_count=0; 61 jwindow *stat=NULL;61 Jwindow *stat=NULL; 62 62 event ev; 63 63 int abort=0; -
abuse/trunk/src/netcfg.cpp
r113 r120 53 53 void net_configuration::cfg_error(char const *msg) 54 54 { 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, 56 56 new button(0, 30,CFG_ERR_OK,symbol_str("ok_button"),NULL)),symbol_str("input_error")); 57 57 event ev; … … 94 94 95 95 96 int net_configuration::confirm_inputs( input_manager *i, int server)96 int net_configuration::confirm_inputs(InputManager *i, int server) 97 97 { 98 98 if (server) … … 171 171 int x=0,y=0; 172 172 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"), 174 174 new button(0,wm->font()->height()*2,NET_CLIENT,symbol_str("client"), 175 175 new button(0,wm->font()->height()*4,NET_SINGLE,symbol_str("single_play"), … … 233 233 234 234 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")); 236 236 237 237 done=0; … … 288 288 button *sb=new button(bx,by,NET_SERVER,ok,NULL); 289 289 290 input_manager inm(screen,sb);290 InputManager inm(screen,sb); 291 291 inm.allow_no_selections(); 292 292 inm.clear_current(); … … 408 408 409 409 { 410 input_manager inm(screen,list);410 InputManager inm(screen,list); 411 411 inm.allow_no_selections(); 412 412 inm.clear_current(); … … 463 463 sb=new button(x+40,y+ns_h-9-fnt->height(),NET_SINGLE,symbol_str("single_play"),sb); 464 464 465 input_manager inm(screen,sb);465 InputManager inm(screen,sb); 466 466 467 467 inm.allow_no_selections(); -
abuse/trunk/src/netcfg.hpp
r57 r120 10 10 #ifndef __NETCFG_HPP_ 11 11 #define __NETCFG_HPP_ 12 12 13 #include "jwindow.hpp" 13 14 14 15 15 class net_configuration … … 34 34 int input(); // pulls up dialog box and input fileds 35 35 void cfg_error(char const *msg); 36 int confirm_inputs( jwindow *j, int server);36 int confirm_inputs(Jwindow *j, int server); 37 37 void error(char const *message); 38 int confirm_inputs( input_manager *i, int server);38 int confirm_inputs(InputManager *i, int server); 39 39 ifield *center_ifield(ifield *i,int x1, int x2, ifield *place_below); 40 40 int get_options(int server); -
abuse/trunk/src/objects.hpp
r66 r120 63 63 int type() { return otype; } 64 64 ifield *make_fields(int ystart, ifield *Next) { return NULL ; } 65 void gather_input( input_manager *inm) { ; }65 void gather_input(InputManager *inm) { ; } 66 66 int hurt_all() { return figures[otype]->get_cflag(CFLAG_HURT_ALL); } 67 67 int stoppable() { return figures[otype]->get_cflag(CFLAG_STOPPABLE); } -
abuse/trunk/src/profile.cpp
r111 r120 19 19 20 20 21 jwindow *prof_win=NULL;21 Jwindow *prof_win=NULL; 22 22 int prof_height=10; 23 23 -
abuse/trunk/src/ui/volumewindow.cpp
r119 r120 14 14 #include "gui.hpp" // ico_button 15 15 16 VolumeWindow::VolumeWindow() : jwindow("Volume")16 VolumeWindow::VolumeWindow() : Jwindow("Volume") 17 17 { 18 18 char const *ff = "art/frame.spe"; -
abuse/trunk/src/ui/volumewindow.hpp
r118 r120 12 12 #include "dev.hpp" 13 13 14 class VolumeWindow : public jwindow14 class VolumeWindow : public Jwindow 15 15 { 16 16 private: -
abuse/trunk/src/unixnfc.cpp
r113 r120 487 487 488 488 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)); 490 490 wm->flush_screen(); 491 491 if (!reload_start()) return ; … … 538 538 539 539 int total_retry=0; 540 jwindow *abort=NULL;540 Jwindow *abort=NULL; 541 541 linked_list input; 542 542 while (base->input_state!=INPUT_PROCESSING)
Note: See TracChangeset
for help on using the changeset viewer.