- Timestamp:
- Mar 15, 2008, 12:55:44 AM (15 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/ant.cpp
r60 r106 443 443 { 444 444 fade_out(8); 445 eh->set_mouse_position(0,0);445 wm->set_mouse_position(0,0); 446 446 screen->clear(); 447 447 image *im=cash.img(cash.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1)); … … 468 468 } else sprintf(msg,"%s : %s",symbol_str("lev_complete"),current_level->original_name()); 469 469 470 int w= eh->font()->width()*strlen(msg),h=eh->font()->height();470 int w=wm->font()->width()*strlen(msg),h=wm->font()->height(); 471 471 int x=(x1+x2)/2-w/2,y=(y1+y2)/2-h/2; 472 screen->bar(x-10,y-10,x+w+10,y+h+10, eh->bright_color());473 screen->bar(x-9,y-9,x+w+9,y+h+9, eh->medium_color());474 475 eh->font()->put_string(screen,x+1,y+1,msg,eh->dark_color());476 eh->font()->put_string(screen,x,y,msg,eh->bright_color());477 eh->flush_screen();472 screen->bar(x-10,y-10,x+w+10,y+h+10,wm->bright_color()); 473 screen->bar(x-9,y-9,x+w+9,y+h+9,wm->medium_color()); 474 475 wm->font()->put_string(screen,x+1,y+1,msg,wm->dark_color()); 476 wm->font()->put_string(screen,x,y,msg,wm->bright_color()); 477 wm->flush_screen(); 478 478 milli_wait(500); 479 479 } -
abuse/trunk/src/automap.cpp
r56 r106 153 153 if (automap_window) 154 154 { 155 eh->close_window(automap_window);155 wm->close_window(automap_window); 156 156 automap_window=NULL; 157 157 } … … 161 161 old_dy=-1000; 162 162 163 automap_window= eh->new_window(0,0,w*AUTOTILE_WIDTH,h*AUTOTILE_HEIGHT);164 automap_window->screen->bar(17,1,17+8*6+3,6, eh->medium_color());165 eh->font()->put_string(automap_window->screen,20,2,"AUTOMAP");163 automap_window=wm->new_window(0,0,w*AUTOTILE_WIDTH,h*AUTOTILE_HEIGHT); 164 automap_window->screen->bar(17,1,17+8*6+3,6,wm->medium_color()); 165 wm->font()->put_string(automap_window->screen,20,2,"AUTOMAP"); 166 166 draw(); 167 167 } … … 198 198 break; 199 199 case EV_CLOSE_WINDOW : 200 eh->close_window(automap_window);200 wm->close_window(automap_window); 201 201 automap_window=NULL; 202 202 break; -
abuse/trunk/src/chat.cpp
r56 r106 13 13 #include "dev.hpp" 14 14 15 chat_console::chat_console( window_manager *WM,JCFont *font, int width, int height) :16 console( WM,font,width,height<4 ? 4 : height,symbol_str("CHAT"))15 chat_console::chat_console(JCFont *font, int width, int height) : 16 console(font,width,height<4 ? 4 : height,symbol_str("CHAT")) 17 17 { 18 18 clear(); -
abuse/trunk/src/chat.hpp
r57 r106 21 21 void put_all(char *st); 22 22 void clear(); 23 chat_console( window_manager *WM,JCFont *font, int width, int height);23 chat_console(JCFont *font, int width, int height); 24 24 25 25 } ; -
abuse/trunk/src/clisp.cpp
r92 r106 927 927 return ret; 928 928 } break; 929 case 51 : return new_lisp_pointer( eh->font()); break;929 case 51 : return new_lisp_pointer(wm->font()); break; 930 930 case 52 : 931 931 { … … 1297 1297 return 1; 1298 1298 } break; 1299 case 93 : return eh->dark_color(); break;1300 case 94 : return eh->medium_color(); break;1301 case 95 : return eh->bright_color(); break;1299 case 93 : return wm->dark_color(); break; 1300 case 94 : return wm->medium_color(); break; 1301 case 95 : return wm->bright_color(); break; 1302 1302 1303 1303 case 99 : current_object->remove_object((game_object *)lpointer_value(CAR(args))); return 1; break; … … 2184 2184 c_target=id; 2185 2185 if (screen) 2186 eh->set_mouse_shape(cash.img(c_target)->copy(),x,y);2186 wm->set_mouse_shape(cash.img(c_target)->copy(),x,y); 2187 2187 } break; 2188 2188 case 276 : -
abuse/trunk/src/config.cpp
r93 r106 161 161 b4 = 0; 162 162 } 163 else if( ! eh)163 else if( !wm ) 164 164 { 165 165 x = y = b1 = b2 = b3 = b4 = 0; -
abuse/trunk/src/console.cpp
r88 r106 75 75 } 76 76 77 console::console(window_manager *WM, JCFont *font, int width, int height, char const *Name) 78 { 79 wm=WM; 77 console::console(JCFont *font, int width, int height, char const *Name) 78 { 80 79 con_win=NULL; 81 80 w=width; … … 122 121 memset(screen+w*(h-1),' ',w); 123 122 redraw(); 124 eh->flush_screen();123 wm->flush_screen(); 125 124 } 126 125 } else draw_cursor(); … … 173 172 174 173 175 shell_term::shell_term( window_manager *WM,JCFont *font, int width, int height, char const *Name) :176 console( WM,font,width,height,Name)174 shell_term::shell_term(JCFont *font, int width, int height, char const *Name) : 175 console(font,width,height,Name) 177 176 { 178 177 shcmd[0]=0; … … 191 190 } 192 191 193 int shell_term::handle_event(event &ev , window_manager *wm)192 int shell_term::handle_event(event &ev) 194 193 { 195 194 if (ev.window==con_win && con_win) -
abuse/trunk/src/console.hpp
r57 r106 19 19 char *screen; 20 20 jwindow *con_win; 21 window_manager *wm;22 21 char *name; 23 22 public : 24 23 25 console( window_manager *WM,JCFont *font, int width, int height, char const *Name);24 console(JCFont *font, int width, int height, char const *Name); 26 25 int showing() { return con_win!=NULL; } 27 26 void show(); … … 46 45 char shcmd[300]; 47 46 public : 48 shell_term( window_manager *WM,JCFont *font, int width, int height, char const *Name);47 shell_term(JCFont *font, int width, int height, char const *Name); 49 48 virtual ~shell_term() {}; 50 int handle_event(event &ev , window_manager *wm);49 int handle_event(event &ev); 51 50 virtual void prompt(); 52 51 virtual void execute(char const *st); -
abuse/trunk/src/cop.cpp
r61 r106 1008 1008 } 1009 1009 1010 JCFont *fnt= eh->font();1010 JCFont *fnt=wm->font(); 1011 1011 if (local) 1012 1012 { … … 1039 1039 { 1040 1040 fade_out(8); 1041 eh->set_mouse_position(0,0);1041 wm->set_mouse_position(0,0); 1042 1042 screen->clear(); 1043 1043 image *im=cash.img(cash.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1)); 1044 1044 im->put_image(screen,0,0); 1045 1045 int x1=im->width()+1,y1=0,y2=screen->height(); 1046 JCFont *fnt= eh->font();1046 JCFont *fnt=wm->font(); 1047 1047 1048 1048 view *v=player_list; int tp=0,i; … … 1051 1051 int y=(y1+y2)/2-(tp+2)*fnt->height()/2,x=x1+10; 1052 1052 char const *header_str = symbol_str("score_header"); 1053 fnt->put_string(screen,x,y,header_str, eh->bright_color());1053 fnt->put_string(screen,x,y,header_str,wm->bright_color()); 1054 1054 y+=fnt->height(); 1055 1055 1056 1056 screen->wiget_bar(x,y+2,x+strlen(header_str)*fnt->width(),y+fnt->height()-3, 1057 eh->bright_color(),eh->medium_color(),eh->dark_color());1057 wm->bright_color(),wm->medium_color(),wm->dark_color()); 1058 1058 y+=fnt->height(); 1059 1059 v=player_list; … … 1075 1075 } 1076 1076 1077 eh->flush_screen();1077 wm->flush_screen(); 1078 1078 milli_wait(4000); // wait 4 seconds 1079 1079 -
abuse/trunk/src/demo.cpp
r88 r106 35 35 extern void fade_out(int steps); 36 36 37 void get_event(event &ev , window_manager *wm)37 void get_event(event &ev) 38 38 { wm->get_event(ev); 39 39 switch (ev.type) … … 57 57 } 58 58 59 int event_waiting( window_manager *wm)59 int event_waiting() 60 60 { return wm->event_waiting(); } 61 61 … … 120 120 int32_t mx,my; 121 121 the_game->game_to_mouse(player_list->pointer_x,player_list->pointer_y,player_list,mx,my); 122 eh->set_mouse_position(small_render ? mx*2 : mx, small_render ? my*2 : my);122 wm->set_mouse_position(small_render ? mx*2 : mx, small_render ? my*2 : my); 123 123 } 124 124 else … … 210 210 l_difficulty=initial_difficulty; 211 211 the_game->set_state(MENU_STATE); 212 eh->push_event(new event(ID_NULL,NULL));212 wm->push_event(new event(ID_NULL,NULL)); 213 213 214 214 view *v=player_list; -
abuse/trunk/src/demo.hpp
r57 r106 38 38 extern demo_manager demo_man; 39 39 40 extern void get_event(event &ev , window_manager *wm);41 extern int event_waiting( window_manager *wm);40 extern void get_event(event &ev); 41 extern int event_waiting(); 42 42 43 43 -
abuse/trunk/src/dev.cpp
r105 r106 100 100 public : 101 101 cached_image(int Id) { id=Id; } 102 virtual void draw(image *screen, int x, int y, 103 window_manager *wm, filter *f) 102 virtual void draw(image *screen, int x, int y, filter *f) 104 103 { 105 104 if (f) … … 108 107 cash.img(id)->put_image(screen,x,y); 109 108 } 110 virtual int width( window_manager *wm) { return cash.img(id)->width(); }111 virtual int height( window_manager *wm) { return cash.img(id)->height(); }109 virtual int width() { return cash.img(id)->width(); } 110 virtual int height() { return cash.img(id)->height(); } 112 111 } ; 113 112 … … 139 138 { 140 139 public : 141 amb_cont(int X, int Y, ifield *Next) : scroller(X,Y,ID_NULL,100, eh->font()->height()+2,0,64,Next)140 amb_cont(int X, int Y, ifield *Next) : scroller(X,Y,ID_NULL,100,wm->font()->height()+2,0,64,Next) 142 141 { if (player_list) sx=player_list->ambient; } 143 virtual void scroll_event(int newx, image *screen , window_manager *wm)142 virtual void scroll_event(int newx, image *screen) 144 143 { 145 144 screen->bar(x,y,x+l-1,y+h-1,wm->dark_color()); 146 145 char st[100]; 147 146 sprintf(st,"%d",newx); 148 wm->font()->put_string(screen,x+30,y+1,st, eh->bright_color());147 wm->font()->put_string(screen,x+30,y+1,st,wm->bright_color()); 149 148 if (player_list) 150 149 player_list->ambient=newx; … … 160 159 161 160 162 jwindow *quitw= eh->new_window(xres/2+40,yres/2,80,-1,161 jwindow *quitw=wm->new_window(xres/2+40,yres/2,80,-1, 163 162 new button(WINDOW_FRAME_LEFT+10,WINDOW_FRAME_TOP+20,ID_QUIT_OK,ok_image, 164 163 new button(WINDOW_FRAME_LEFT+38,WINDOW_FRAME_TOP+20,ID_CANCEL,cancel_image, 165 164 new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,ID_NULL,symbol_str("sure?"),NULL))), 166 165 symbol_str("quit_title")); 167 eh->grab_focus(quitw);166 wm->grab_focus(quitw); 168 167 int fin=0,quit=0; 169 168 do 170 169 { 171 eh->flush_screen();170 wm->flush_screen(); 172 171 173 172 event ev; 174 eh->get_event(ev);173 wm->get_event(ev); 175 174 if (ev.type==EV_MESSAGE && ev.message.id==ID_QUIT_OK) 176 175 fin=quit=1; … … 189 188 the_game->reset_keymap(); 190 189 191 eh->close_window(quitw);192 eh->flush_screen();190 wm->close_window(quitw); 191 wm->flush_screen(); 193 192 return quit; 194 193 } … … 292 291 int32_t dev_controll::snap_x(int32_t x) 293 292 { 294 if ( eh->key_pressed(JK_CTRL_L) || eh->key_pressed(JK_CTRL_R))293 if (wm->key_pressed(JK_CTRL_L) || wm->key_pressed(JK_CTRL_R)) 295 294 return x-(x%the_game->ftile_width()); 296 else if ( eh->key_pressed(JK_ALT_L) || eh->key_pressed(JK_ALT_R))295 else if (wm->key_pressed(JK_ALT_L) || wm->key_pressed(JK_ALT_R)) 297 296 return x-(x%the_game->ftile_width())+the_game->ftile_width()/2; 298 297 else return x; … … 301 300 int32_t dev_controll::snap_y(int32_t y) 302 301 { 303 if ( eh->key_pressed(JK_CTRL_L) || eh->key_pressed(JK_CTRL_R))302 if (wm->key_pressed(JK_CTRL_L) || wm->key_pressed(JK_CTRL_R)) 304 303 return y-(y%the_game->ftile_height())-1; 305 else if ( eh->key_pressed(JK_ALT_L) || eh->key_pressed(JK_ALT_R))304 else if (wm->key_pressed(JK_ALT_L) || wm->key_pressed(JK_ALT_R)) 306 305 return y-(y%the_game->ftile_height())+the_game->ftile_height()/2-1; 307 306 else return y; … … 311 310 { 312 311 if (!ambw) 313 ambw= eh->new_window(prop->getd("ambient x",-1),312 ambw=wm->new_window(prop->getd("ambient x",-1), 314 313 prop->getd("ambient y",-1),-1,-1, 315 314 new amb_cont(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,NULL),"ambient"); … … 466 465 im->put_image(screen,f->x-vx+v->cx1-im->width()/2,f->y-vy+v->cy1-im->height()/2,1); 467 466 screen->rectangle(f->x1-vx+v->cx1,f->y1-vy+v->cy1,f->x2-vx+v->cx1,f->y2-vy+v->cy1, 468 eh->medium_color());467 wm->medium_color()); 469 468 } 470 469 } … … 484 483 int32_t rx1,ry1; 485 484 the_game->game_to_mouse(selected_light->x,selected_light->y,v,rx1,ry1); 486 screen->rectangle(rx1-l,ry1-h,rx1+l,ry1+h, eh->bright_color());485 screen->rectangle(rx1-l,ry1-h,rx1+l,ry1+h,wm->bright_color()); 487 486 } 488 487 … … 508 507 game_object *other=o->get_object(i); 509 508 the_game->game_to_mouse(other->x,other->y,current_view,x2,y2); 510 screen->line(x1,y1,x2,y2, eh->bright_color());509 screen->line(x1,y1,x2,y2,wm->bright_color()); 511 510 } 512 511 … … 527 526 the_game->game_to_mouse(x1,y1,v,rx1,ry1); 528 527 the_game->game_to_mouse(x2,y2,v,rx2,ry2); 529 screen->rectangle(rx1,ry1,rx2,ry2, eh->bright_color());528 screen->rectangle(rx1,ry1,rx2,ry2,wm->bright_color()); 530 529 531 530 the_game->game_to_mouse(selected_object->x,selected_object->y,current_view,x1,y1); … … 574 573 { 575 574 int h=st[i]*100/3000; x++; 576 memprof->screen->bar(x,y,x,y+h, eh->bright_color());575 memprof->screen->bar(x,y,x,y+h,wm->bright_color()); 577 576 h=ch[i]*100/3000; 578 memprof->screen->bar(x,y,x,y+h, eh->medium_color());577 memprof->screen->bar(x,y,x,y+h,wm->medium_color()); 579 578 x++; 580 579 } … … 583 582 char buf[100]; 584 583 sprintf(buf,"%8ld %8ld",(long int)j_allocated(),(long int)j_available()); 585 eh->font()->put_string(memprof->screen,memprof->x1(),memprof->y2()-eh->font()->height(),buf);584 wm->font()->put_string(memprof->screen,memprof->x1(),memprof->y2()-wm->font()->height(),buf); 586 585 587 586 } … … 595 594 prop->setd("memprof x",memprof->x); 596 595 prop->setd("memprof y",memprof->y); 597 eh->close_window(memprof);596 wm->close_window(memprof); 598 597 memprof=NULL; 599 598 } else … … 603 602 jfree(st); 604 603 jfree(ch); 605 memprof= eh->new_window(0,0,total*2+20,100,NULL);604 memprof=wm->new_window(0,0,total*2+20,100,NULL); 606 605 update_memprof(); 607 606 } … … 615 614 prop->setd("toolbar x",tbw->x); 616 615 prop->setd("toolbar y",tbw->y); 617 eh->close_window(tbw);616 wm->close_window(tbw); 618 617 tbw=NULL; 619 618 } else … … 631 630 ID_NULL, 632 631 5,(visual_object **)dev_mode_pict,dev_mode_ids,DEV_MODES, 633 pal,pal, eh,NULL);634 tbw= eh->new_window(prop->getd("toolbar x",-1),632 pal,pal,NULL); 633 tbw=wm->new_window(prop->getd("toolbar x",-1), 635 634 prop->getd("toolbar y",-1),-1,-1,tp); 636 tp->set_x(setx,tbw->screen ,eh);635 tp->set_x(setx,tbw->screen); 637 636 } 638 637 } … … 645 644 prop->setd("layer x",show_menu->x); 646 645 prop->setd("layer y",show_menu->y); 647 eh->close_window(show_menu);646 wm->close_window(show_menu); 648 647 show_menu=NULL; 649 648 } else … … 659 658 button *fb=new button(sx,sy+ 0, SHOW_FOREGROUND, symbol_str("l_fore"),bdb); if (dev&DRAW_FG_LAYER) fb->push(); 660 659 661 show_menu= eh->new_window(prop->getd("layer x",-1),660 show_menu=wm->new_window(prop->getd("layer x",-1), 662 661 prop->getd("layer y",-1), 663 662 -1,-1,fb,symbol_str(symbol_str("SHOW?"))); … … 676 675 prop->setd("objects x",omenu->x); 677 676 prop->setd("objects y",omenu->y); 678 eh->close_window(omenu);677 wm->close_window(omenu); 679 678 omenu=NULL; 680 679 jfree(listable_objs); … … 698 697 } 699 698 700 omenu= eh->new_window(prop->getd("objects x",0),699 omenu=wm->new_window(prop->getd("objects x",0), 701 700 prop->getd("objects y",0),-1,-1, 702 701 new pick_list(WINDOW_FRAME_LEFT, 703 WINDOW_FRAME_TOP,DEV_CREATE,yres/ eh->font()->height()/2,702 WINDOW_FRAME_TOP,DEV_CREATE,yres/wm->font()->height()/2, 704 703 listable_objs,total_listable,0,NULL,cash.img(window_texture))); 705 704 } … … 721 720 prop->setd("pal x",pmenu->x); 722 721 prop->setd("pal y",pmenu->y); 723 eh->close_window(pmenu);722 wm->close_window(pmenu); 724 723 pmenu=NULL; 725 724 jfree(pwin_list); … … 733 732 pwin_list[i]=pal_wins[i]->name; 734 733 735 pmenu= eh->new_window(prop->getd("pal x",0),734 pmenu=wm->new_window(prop->getd("pal x",0), 736 735 prop->getd("pal y",-1), 737 736 -1,-1, 738 737 new pick_list(WINDOW_FRAME_LEFT, 739 WINDOW_FRAME_TOP,DEV_PALETTE,yres/ eh->font()->height()/2,738 WINDOW_FRAME_TOP,DEV_PALETTE,yres/wm->font()->height()/2, 740 739 pwin_list,total_pals,0,NULL,cash.img(window_texture))); 741 740 } else the_game->show_help(symbol_str("no_pals")); … … 751 750 752 751 tile_picker *f_tp=new tile_picker(WINDOW_FRAME_LEFT+1,WINDOW_FRAME_TOP+1, 753 DEV_FG_PICKER,SPEC_FORETILE, eh,fg_scale,maxh,fg_w,NULL);752 DEV_FG_PICKER,SPEC_FORETILE,fg_scale,maxh,fg_w,NULL); 754 753 f_tp->reverse(); 755 754 756 forew= eh->new_window(prop->getd("fore x",-30),755 forew=wm->new_window(prop->getd("fore x",-30), 757 756 prop->getd("fore y",0), 758 757 -1,-1, … … 763 762 prop->setd("fore x",forew->x); 764 763 prop->setd("fore y",forew->y); 765 eh->close_window(forew);764 wm->close_window(forew); 766 765 forew=NULL; 767 766 } … … 772 771 /* if (!music_window) 773 772 { 774 music_window= eh->new_window(-1,30,0,0,773 music_window=wm->new_window(-1,30,0,0, 775 774 new pick_list(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP, 776 775 DEV_MUSIC_PICKLIST,10,song_list,total_songs,0,NULL)); 777 eh->fnt->put_string(music_window->screen,WINDOW_FRAME_LEFT,1,"songs");776 wm->fnt->put_string(music_window->screen,WINDOW_FRAME_LEFT,1,"songs"); 778 777 } else 779 778 { 780 eh->close_window(music_window);779 wm->close_window(music_window); 781 780 music_window=NULL; 782 781 }*/ … … 790 789 int maxh=(yres-25)/(the_game->btile_height()/bg_scale); 791 790 792 backw= eh->new_window(prop->getd("back x",-30),791 backw=wm->new_window(prop->getd("back x",-30), 793 792 prop->getd("back y",0), 794 793 -1,-1, 795 794 new tile_picker(WINDOW_FRAME_LEFT+1,WINDOW_FRAME_TOP+1, 796 DEV_BG_PICKER,SPEC_BACKTILE, eh,bg_scale,maxh,bg_w,NULL),symbol_str("l_bg"));795 DEV_BG_PICKER,SPEC_BACKTILE,bg_scale,maxh,bg_w,NULL),symbol_str("l_bg")); 797 796 } else 798 797 { … … 800 799 prop->setd("back x",backw->x); 801 800 prop->setd("back y",backw->y); 802 eh->close_window(backw);801 wm->close_window(backw); 803 802 backw=NULL; 804 803 } … … 812 811 wh=WINDOW_FRAME_TOP+1; 813 812 int bw=cash.img(dev_forward)->width(); 814 search_window= eh->new_window(prop->getd("searchw x",-30),813 search_window=wm->new_window(prop->getd("searchw x",-30), 815 814 prop->getd("searchw y",0), 816 815 -1,-1, … … 818 817 "***************************", 819 818 prop->get("search name",""), 820 new button(wl+bw*1,wh+ eh->font()->height()+5,ID_SEARCH_BACKWARD,819 new button(wl+bw*1,wh+wm->font()->height()+5,ID_SEARCH_BACKWARD, 821 820 cash.img(dev_backward), 822 new button(wl+bw*3,wh+ eh->font()->height()+5,ID_SEARCH_FOREWARD,821 new button(wl+bw*3,wh+wm->font()->height()+5,ID_SEARCH_FOREWARD, 823 822 cash.img(dev_forward),NULL))),"SEARCH"); 824 823 searchw_on=0; … … 829 828 prop->setd("searchw y",search_window->y); 830 829 prop->set("search name",search_window->read(ID_SEARCH_TEXT)); 831 eh->close_window(search_window);830 wm->close_window(search_window); 832 831 search_window=NULL; 833 832 search_object=NULL; … … 961 960 dev_console=new dev_term(50,18,this); 962 961 if (start_edit) 963 dev_menu=make_menu(0,yres- eh->font()->height()-5);962 dev_menu=make_menu(0,yres-wm->font()->height()-5); 964 963 965 964 if (get_option("-nolight")) … … 1243 1242 cur_fg=current_level->get_fg(x,y); 1244 1243 if (forew) 1245 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew->screen ,eh);1244 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew->screen); 1246 1245 the_game->need_refresh(); 1247 1246 } … … 1267 1266 1268 1267 if (forew) 1269 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew->screen ,eh);1268 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew->screen); 1270 1269 } 1271 1270 } … … 1349 1348 if (!lightw) 1350 1349 { 1351 int wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP,bh=16+6,bw=20+6,th= eh->font()->height()+4;1352 lightw= eh->new_window(prop->getd("light create x",0),1350 int wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP,bh=16+6,bw=20+6,th=wm->font()->height()+4; 1351 lightw=wm->new_window(prop->getd("light create x",0), 1353 1352 prop->getd("light create y",0), 1354 1353 -1,-1,new button_box(wl,wh,DEV_LIGHT_BUTTON_BOX,1, … … 1388 1387 prop->setd("light create r1",atoi(lightw->read(DEV_LIGHTR1))); 1389 1388 prop->setd("light create r2",atoi(lightw->read(DEV_LIGHTR2))); 1390 eh->close_window(lightw);1389 wm->close_window(lightw); 1391 1390 lightw=NULL; 1392 1391 } … … 1396 1395 { 1397 1396 ai_object=o; 1398 int th= eh->font()->height()+4,wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP+20;1397 int th=wm->font()->height()+4,wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP+20; 1399 1398 if (figures[o->otype]->total_fields) 1400 1399 { … … 1424 1423 wh+=th; 1425 1424 } 1426 aiw= eh->new_window(prop->getd("ai x",0),1425 aiw=wm->new_window(prop->getd("ai x",0), 1427 1426 prop->getd("ai y",0), 1428 1427 -1,-1, … … 1432 1431 else 1433 1432 { 1434 aiw= eh->new_window(prop->getd("ai x",0),1433 aiw=wm->new_window(prop->getd("ai x",0), 1435 1434 prop->getd("ai y",0), 1436 1435 -1,-1, … … 1450 1449 } 1451 1450 1452 eh->grab_focus(aiw);1451 wm->grab_focus(aiw); 1453 1452 } 1454 1453 … … 1461 1460 prop->setd("ledit x",ledit->x); 1462 1461 prop->setd("ledit y",ledit->y); 1463 eh->close_window(ledit); ledit=NULL;1462 wm->close_window(ledit); ledit=NULL; 1464 1463 } 1465 1464 edit_light=NULL; … … 1536 1535 prop->setd("ai x",aiw->x); 1537 1536 prop->setd("ai y",aiw->y); 1538 eh->close_window(aiw);1537 wm->close_window(aiw); 1539 1538 aiw=NULL; 1540 1539 ai_object=NULL; … … 1577 1576 current_area->view_yoff_speed=atoi(area_win->read(DEV_AREA_VIEW_YOFF_SPEED)); 1578 1577 } 1579 eh->close_window(area_win);1578 wm->close_window(area_win); 1580 1579 area_win=NULL; 1581 1580 } … … 1609 1608 if (area_win) close_area_win(0); 1610 1609 int wl=WINDOW_FRAME_LEFT; 1611 int wh=WINDOW_FRAME_TOP,th= eh->font()->height()+12,bw=cash.img(dev_ok)->width()+10;1612 area_win= eh->new_window(prop->getd("area_box x",0),1610 int wh=WINDOW_FRAME_TOP,th=wm->font()->height()+12,bw=cash.img(dev_ok)->width()+10; 1611 area_win=wm->new_window(prop->getd("area_box x",0), 1613 1612 prop->getd("area_box y",0), 1614 1613 -1,-1, … … 1647 1646 prop->setd("oedit x",oedit->x); 1648 1647 prop->setd("oedit y",oedit->y); 1649 eh->close_window(oedit);1648 wm->close_window(oedit); 1650 1649 oedit=NULL; 1651 1650 edit_object=NULL; … … 1666 1665 } 1667 1666 1668 if (dev_menu && dev_menu->handle_event(ev,screen ,eh)) return ;1667 if (dev_menu && dev_menu->handle_event(ev,screen)) return ; 1669 1668 1670 1669 if (!current_level) return ; … … 1677 1676 dlasty=last_demo_my; 1678 1677 } 1679 if (dev_console && dev_console->handle_event(ev ,eh))1678 if (dev_console && dev_console->handle_event(ev)) 1680 1679 return; 1681 1680 … … 1941 1940 int bw=20+6,bh=16+6,wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP; 1942 1941 1943 oedit= eh->new_window(prop->getd("oedit x",0),1942 oedit=wm->new_window(prop->getd("oedit x",0), 1944 1943 prop->getd("oedit y",0), 1945 1944 -1,-1,new button_box(wl,wh,ID_NULL,1, … … 1969 1968 prop->setd("ledit x",ledit->x); 1970 1969 prop->setd("ledit x",ledit->y); 1971 eh->close_window(ledit);1970 wm->close_window(ledit); 1972 1971 } 1973 int bw=20+6,bh=16+6,wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP,th= eh->font()->height()+4;1972 int bw=20+6,bh=16+6,wl=WINDOW_FRAME_LEFT,wh=WINDOW_FRAME_TOP,th=wm->font()->height()+4; 1974 1973 edit_light=selected_light; 1975 1974 if (edit_object) … … 1978 1977 edit_light->known=1; 1979 1978 } 1980 ledit= eh->new_window(prop->getd("ledit x",0),1979 ledit=wm->new_window(prop->getd("ledit x",0), 1981 1980 prop->getd("ledit y",0), 1982 1981 -1,-1, … … 2059 2058 if (mess_win) 2060 2059 { 2061 eh->close_window(mess_win);2060 wm->close_window(mess_win); 2062 2061 mess_win=NULL; 2063 2062 } break; … … 2067 2066 if (!mess_win) 2068 2067 { 2069 mess_win=file_dialog( eh,symbol_str("level_name"),current_level ? current_level->name() : "",2068 mess_win=file_dialog(symbol_str("level_name"),current_level ? current_level->name() : "", 2070 2069 ID_LEVEL_LOAD_OK,symbol_str("ok_button"),ID_CANCEL,symbol_str("cancel_button"), 2071 2070 symbol_str("FILENAME"),ID_MESS_STR1); 2072 eh->grab_focus(mess_win);2071 wm->grab_focus(mess_win); 2073 2072 } 2074 2073 } break; … … 2078 2077 sprintf(cmd,"load %s",mess_win->read(ID_MESS_STR1)); 2079 2078 dev_cont->do_command(cmd,ev); 2080 eh->push_event(new event(ID_CANCEL,NULL)); // close window2079 wm->push_event(new event(ID_CANCEL,NULL)); // close window 2081 2080 } break; 2082 2081 case ID_GAME_SAVE : … … 2103 2102 if (!mess_win) 2104 2103 { 2105 mess_win=file_dialog( eh,symbol_str("saveas_name"),current_level ? current_level->name() : "untitled.spe",2104 mess_win=file_dialog(symbol_str("saveas_name"),current_level ? current_level->name() : "untitled.spe", 2106 2105 ID_LEVEL_SAVEAS_OK,symbol_str("ok_button"), 2107 2106 ID_CANCEL,symbol_str("cancel_button"), 2108 2107 symbol_str("FILENAME"),ID_MESS_STR1); 2109 eh->grab_focus(mess_win);2108 wm->grab_focus(mess_win); 2110 2109 } 2111 2110 } break; … … 2115 2114 { 2116 2115 current_level->set_name(mess_win->read(ID_MESS_STR1)); 2117 eh->push_event(new event(ID_CANCEL,NULL)); // close window after save2118 eh->push_event(new event(ID_LEVEL_SAVE,NULL));2116 wm->push_event(new event(ID_CANCEL,NULL)); // close window after save 2117 wm->push_event(new event(ID_LEVEL_SAVE,NULL)); 2119 2118 } 2120 2119 } break; … … 2147 2146 if (!mess_win) 2148 2147 { 2149 mess_win= eh->new_window(xres/2,yres/2,-1,-1,2148 mess_win=wm->new_window(xres/2,yres/2,-1,-1, 2150 2149 new button(WINDOW_FRAME_LEFT+10,WINDOW_FRAME_TOP+20,ID_LEVEL_NEW_OK,symbol_str("YES"), 2151 2150 new button(WINDOW_FRAME_LEFT+40,WINDOW_FRAME_TOP+20,ID_CANCEL,symbol_str("NO"), 2152 2151 new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,ID_NULL,symbol_str("sure?"),NULL))),symbol_str("New?")); 2153 eh->grab_focus(mess_win);2152 wm->grab_focus(mess_win); 2154 2153 } 2155 2154 } break; 2156 2155 case ID_LEVEL_NEW_OK : 2157 2156 { 2158 eh->push_event(new event(ID_CANCEL,NULL)); // close_window2157 wm->push_event(new event(ID_CANCEL,NULL)); // close_window 2159 2158 if (current_level) 2160 2159 delete current_level; … … 2165 2164 if (!mess_win) 2166 2165 { 2167 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h= eh->font()->height()+8;2168 mess_win= eh->new_window(xres/2,yres/2,-1,-1,2166 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h=wm->font()->height()+8; 2167 mess_win=wm->new_window(xres/2,yres/2,-1,-1, 2169 2168 new text_field(wl,wt+h*0,ID_MESS_STR1,symbol_str("width_"),"****", 2170 2169 current_level ? current_level->foreground_width() : 100, … … 2182 2181 atoi(mess_win->read(ID_MESS_STR2))); 2183 2182 } else the_game->show_help("Create a level first!"); 2184 eh->push_event(new event(ID_CANCEL,NULL)); // close_window2183 wm->push_event(new event(ID_CANCEL,NULL)); // close_window 2185 2184 } break; 2186 2185 … … 2217 2216 if (!mess_win) 2218 2217 { 2219 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h= eh->font()->height()+8;2220 mess_win= eh->new_window(xres/2,yres/2,-1,-1,2218 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h=wm->font()->height()+8; 2219 mess_win=wm->new_window(xres/2,yres/2,-1,-1, 2221 2220 new text_field(wl,wt+h*0,ID_RECORD_DEMO_FILENAME, 2222 2221 "demo filename","*******************", … … 2230 2229 { 2231 2230 demo_man.set_state(demo_manager::RECORDING,mess_win->read(ID_RECORD_DEMO_FILENAME)); 2232 eh->push_event(new event(ID_CANCEL,NULL)); // close window2231 wm->push_event(new event(ID_CANCEL,NULL)); // close window 2233 2232 } break; 2234 2233 … … 2237 2236 if (!mess_win) 2238 2237 { 2239 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h= eh->font()->height()+8;2240 mess_win= eh->new_window(xres/2,yres/2,-1,-1,2238 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h=wm->font()->height()+8; 2239 mess_win=wm->new_window(xres/2,yres/2,-1,-1, 2241 2240 new text_field(wl,wt+h*0,ID_PLAY_DEMO_FILENAME, 2242 2241 "demo filename","*******************", … … 2250 2249 { 2251 2250 demo_man.set_state(demo_manager::PLAYING,mess_win->read(ID_PLAY_DEMO_FILENAME)); 2252 eh->close_window(mess_win);2251 wm->close_window(mess_win); 2253 2252 mess_win=NULL; 2254 2253 } break; … … 2258 2257 if (!mess_win) 2259 2258 { 2260 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h= eh->font()->height()+8;2261 mess_win= eh->new_window(xres/2,yres/2,-1,-1,2259 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h=wm->font()->height()+8; 2260 mess_win=wm->new_window(xres/2,yres/2,-1,-1, 2262 2261 new text_field(wl,wt+h*0,ID_MESS_STR1,symbol_str("x_mul"),"****",bg_xmul, 2263 2262 new text_field(wl,wt+h*1,ID_MESS_STR2,symbol_str("x_div"),"****",bg_xdiv, … … 2278 2277 (((float)tbg_ymul/(float)tbg_ydiv) < ((float)bg_ymul/(float)bg_ydiv))) 2279 2278 { 2280 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h= eh->font()->height()+8;2281 2282 warn_win= eh->new_window(xres/2-40,yres/2-40,-1,-1,2279 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h=wm->font()->height()+8; 2280 2281 warn_win=wm->new_window(xres/2-40,yres/2-40,-1,-1, 2283 2282 new info_field(wl,wt,ID_NULL, 2284 2283 symbol_str("back_loss"), … … 2286 2285 new button(wt+40,wt+h*4,ID_WARN_CANCEL,symbol_str("cancel_button"),NULL))), 2287 2286 symbol_str("WARNING")); 2288 eh->grab_focus(warn_win);2289 } else eh->push_event(new event(ID_SET_SCROLL_OK,NULL));2287 wm->grab_focus(warn_win); 2288 } else wm->push_event(new event(ID_SET_SCROLL_OK,NULL)); 2290 2289 } break; 2291 2290 case ID_WARN_CANCEL : 2292 2291 { 2293 eh->close_window(warn_win); warn_win=NULL;2294 eh->push_event(new event(ID_CANCEL,NULL));2292 wm->close_window(warn_win); warn_win=NULL; 2293 wm->push_event(new event(ID_CANCEL,NULL)); 2295 2294 } break; 2296 2295 case ID_SET_SCROLL_OK : 2297 2296 { 2298 if (warn_win) { eh->close_window(warn_win); warn_win=NULL; }2297 if (warn_win) { wm->close_window(warn_win); warn_win=NULL; } 2299 2298 bg_xmul=atoi(mess_win->read(ID_MESS_STR1)); 2300 2299 bg_xdiv=atoi(mess_win->read(ID_MESS_STR2)); 2301 2300 bg_ymul=atoi(mess_win->read(ID_MESS_STR3)); 2302 2301 bg_ydiv=atoi(mess_win->read(ID_MESS_STR4)); 2303 eh->push_event(new event(ID_CANCEL,NULL)); // close window2302 wm->push_event(new event(ID_CANCEL,NULL)); // close window 2304 2303 } break; 2305 2304 … … 2323 2322 if (!mess_win) 2324 2323 { 2325 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h= eh->font()->height()+8;2326 mess_win= eh->new_window(xres/2,yres/2,-1,-1,2324 int wl=WINDOW_FRAME_LEFT,wt=WINDOW_FRAME_TOP,h=wm->font()->height()+8; 2325 mess_win=wm->new_window(xres/2,yres/2,-1,-1, 2327 2326 new text_field(wl,wt+h*0,ID_MESS_STR1,symbol_str("ap_width"),"****",2, 2328 2327 new text_field(wl,wt+h*1,ID_MESS_STR2,symbol_str("ap_height"),"****",2, … … 2340 2339 char const *s=name; 2341 2340 eval(compile(s)); 2342 eh->push_event(new event(ID_CANCEL,NULL)); // close window2341 wm->push_event(new event(ID_CANCEL,NULL)); // close window 2343 2342 } break; 2344 2343 case ID_TOGGLE_DELAY : … … 2471 2470 prop->setd("ledit x",ledit->x); 2472 2471 prop->setd("ledit y",ledit->y); 2473 eh->close_window(ledit); ledit=NULL;2472 wm->close_window(ledit); ledit=NULL; 2474 2473 if (current_level) 2475 2474 current_level->remove_light(edit_light); … … 2499 2498 prop->setd("ledit x",ledit->x); 2500 2499 prop->setd("ledit y",ledit->y); 2501 eh->close_window(ledit); ledit=NULL;2500 wm->close_window(ledit); ledit=NULL; 2502 2501 the_game->need_refresh(); 2503 2502 } break; … … 2506 2505 prop->setd("ledit x",ledit->x); 2507 2506 prop->setd("ledit y",ledit->y); 2508 eh->close_window(ledit); ledit=NULL;2507 wm->close_window(ledit); ledit=NULL; 2509 2508 state=DEV_MOVE_LIGHT; 2510 2509 } break; … … 2514 2513 prop->setd("ledit x",ledit->x); 2515 2514 prop->setd("ledit y",ledit->y); 2516 eh->close_window(ledit); ledit=NULL;2515 wm->close_window(ledit); ledit=NULL; 2517 2516 state=DEV_MOVE_LIGHT; 2518 2517 } break; … … 2597 2596 prop->setd("commandw x",commandw->x); 2598 2597 prop->setd("commandw y",commandw->y); 2599 eh->close_window(commandw);2598 wm->close_window(commandw); 2600 2599 commandw=NULL; 2601 2600 do_command(cmd,ev); … … 2700 2699 prop->setd("commandw x",commandw->x); 2701 2700 prop->setd("commandw y",commandw->y); 2702 eh->close_window(commandw);2701 wm->close_window(commandw); 2703 2702 commandw=NULL; 2704 2703 } else if (ev.window==oedit) 2705 2704 close_oedit_window(); 2706 2705 else if (ev.window==ambw) 2707 { eh->close_window(ambw); ambw=NULL; }2706 { wm->close_window(ambw); ambw=NULL; } 2708 2707 else if (ev.window==backw) toggle_bgw(); 2709 2708 else if (ev.window==forew) toggle_fgw(); … … 2791 2790 case 'A' : { if (selected_object) 2792 2791 { 2793 if (oedit) eh->push_event(new event(DEV_OEDIT_OK,NULL));2792 if (oedit) wm->push_event(new event(DEV_OEDIT_OK,NULL)); 2794 2793 make_ai_window(selected_object); 2795 2794 } … … 2856 2855 if (selected_object && selected_object->controller()==NULL) 2857 2856 { copy_object=selected_object; 2858 eh->push_event(new event(DEV_OEDIT_COPY,NULL)); } break;2857 wm->push_event(new event(DEV_OEDIT_COPY,NULL)); } break; 2859 2858 2860 2859 case 'D' : the_game->toggle_delay(); break; … … 2920 2919 if (ledit) 2921 2920 { 2922 eh->close_window(ledit);2921 wm->close_window(ledit); 2923 2922 ledit=NULL; 2924 2923 } … … 3012 3011 { 3013 3012 if (me) close_window(); 3014 me= eh->new_window(x,y,w*f_wid/scale,h*f_hi/scale,NULL,name);3013 me=wm->new_window(x,y,w*f_wid/scale,h*f_hi/scale,NULL,name); 3015 3014 draw(); 3016 3015 } … … 3023 3022 // it will be in the same spot 3024 3023 y=me->y; 3025 eh->close_window(me);3024 wm->close_window(me); 3026 3025 me=NULL; 3027 3026 … … 3054 3053 me->y1()+(i/w)*th, 3055 3054 me->x1()+(i%w)*tw+tw-1, 3056 me->y1()+(i/w)*th+th-1, eh->bright_color());3055 me->y1()+(i/w)*th+th-1,wm->bright_color()); 3057 3056 } 3058 3057 } … … 3097 3096 if (dev_cont->forew) 3098 3097 ((tile_picker *)dev_cont->forew-> 3099 read(DEV_FG_PICKER))->recenter(dev_cont->forew->screen ,eh);3098 read(DEV_FG_PICKER))->recenter(dev_cont->forew->screen); 3100 3099 } 3101 3100 } else if (ev.mouse_button==2) … … 3613 3612 new pmenu_item(symbol_str("file_top"),new psub_menu(i_recurse(filemenu),NULL), 3614 3613 new pmenu_item(symbol_str("edit_top"),new psub_menu(i_recurse(editmenu),NULL), 3615 new pmenu_item(symbol_str("window_top"),new psub_menu(i_recurse(winmenu),NULL),NULL))),screen ,eh);3614 new pmenu_item(symbol_str("window_top"),new psub_menu(i_recurse(winmenu),NULL),NULL))),screen); 3616 3615 } 3617 3616 … … 3623 3622 if (dev&EDIT_MODE) 3624 3623 { 3625 eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);3624 wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1); 3626 3625 pal->load(); 3627 3626 } … … 3629 3628 { 3630 3629 if (dev&MAP_MODE) dev-=MAP_MODE; // no map mode while playing! 3631 eh->set_mouse_shape(cash.img(c_target)->copy(),8,8);3630 wm->set_mouse_shape(cash.img(c_target)->copy(),8,8); 3632 3631 } 3633 3632 if ((dev&EDIT_MODE) && !dev_menu) 3634 3633 { 3635 dev_menu=make_menu(0,yres- eh->font()->height()-5);3634 dev_menu=make_menu(0,yres-wm->font()->height()-5); 3636 3635 } 3637 3636 else if (!(dev&EDIT_MODE) && dev_menu) -
abuse/trunk/src/dev.hpp
r88 r106 129 129 dev_controll *dv; 130 130 public : 131 dev_term(int width, int height, dev_controll *dev) : shell_term( eh,console_font,width,height,"dev")131 dev_term(int width, int height, dev_controll *dev) : shell_term(console_font, width, height, "dev") 132 132 { 133 dv =dev;133 dv = dev; 134 134 } 135 135 virtual ~dev_term() {}; -
abuse/trunk/src/devsel.cpp
r56 r106 19 19 int cur_bg=0,cur_fg=0,cur_char=0; 20 20 21 void tile_picker::recenter(image *screen , window_manager *wm)21 void tile_picker::recenter(image *screen) 22 22 { 23 set_x(get_current(), screen,wm);23 set_x(get_current(), screen); 24 24 } 25 25 … … 72 72 } 73 73 74 tile_picker::tile_picker(int X, int Y, int ID, int spec_type, window_manager *wm,74 tile_picker::tile_picker(int X, int Y, int ID, int spec_type, 75 75 int Scale, int scroll_h, int Wid, ifield *Next) 76 76 : scroller(X,Y,ID,2,2,1,0,Next) … … 86 86 87 87 88 void tile_picker::scroll_event(int newx, image *screen , window_manager *wm)88 void tile_picker::scroll_event(int newx, image *screen) 89 89 { 90 90 int yo=y,ya=pich(),xw=picw(),c=get_current(),xo; … … 92 92 last_sel=newx; 93 93 94 screen->bar(x,y,x+l-1,y+h-1, eh->black());94 screen->bar(x,y,x+l-1,y+h-1,wm->black()); 95 95 for (int i=newx;i<newx+th*wid;i++) 96 96 { … … 142 142 143 143 144 void tile_picker::handle_inside_event(event &ev, image *screen, window_manager *wm,input_manager *inm)144 void tile_picker::handle_inside_event(event &ev, image *screen, input_manager *inm) 145 145 { 146 146 if (ev.type==EV_MOUSE_BUTTON) … … 150 150 { 151 151 set_current(sel); 152 scroll_event(last_sel, screen,wm);152 scroll_event(last_sel, screen); 153 153 } 154 154 } -
abuse/trunk/src/devsel.hpp
r57 r106 16 16 int th,last_sel,type,scale,wid,rev; 17 17 public : 18 tile_picker(int X, int Y, int ID, int spec_type, window_manager *wm,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, window_manager *wm,input_manager *inm);21 virtual void scroll_event(int newx, image *screen , window_manager *wm);20 virtual void handle_inside_event(event &ev, image *screen, input_manager *inm); 21 virtual void scroll_event(int newx, image *screen); 22 22 virtual char *read() { return (char *)this; } 23 23 int picw(); … … 26 26 int get_current(); 27 27 void set_current(int x); 28 void recenter(image *screen , window_manager *wm);28 void recenter(image *screen); 29 29 void reverse() { rev=!rev; } 30 30 } ; -
abuse/trunk/src/director.cpp
r56 r106 125 125 *text_symbol=make_find_symbol("text"); 126 126 127 JCFont *font= eh->font();127 JCFont *font=wm->font(); 128 128 129 129 do … … 156 156 the_game->first_view->cy2-tbottom,text,font, 157 157 white_light+32*256, 158 eh->bright_color()158 wm->bright_color() 159 159 160 160 )) … … 174 174 } else if (arg==text_symbol) done=1; 175 175 176 eh->flush_screen();177 while ( eh->event_waiting())176 wm->flush_screen(); 177 while (wm->event_waiting()) 178 178 { 179 179 event ev; 180 eh->get_event(ev);180 wm->get_event(ev); 181 181 if (ev.type==EV_KEY) 182 182 { -
abuse/trunk/src/endgame.cpp
r60 r106 179 179 180 180 image blank(2,2); blank.clear(); 181 eh->set_mouse_shape(blank.copy(),0,0); // don't show mouse181 wm->set_mouse_shape(blank.copy(),0,0); // don't show mouse 182 182 183 183 … … 263 263 eoff+=2; if (eoff>=320) eoff-=320; 264 264 coff+=1; if (coff>=320) coff-=320; 265 eh->flush_screen();265 wm->flush_screen(); 266 266 i++; 267 267 } … … 326 326 } 327 327 328 eh->flush_screen();328 wm->flush_screen(); 329 329 330 330 } … … 356 356 eoff+=2; if (eoff>=320) eoff-=320; 357 357 coff+=1; if (coff>=320) coff-=320; 358 eh->flush_screen();358 wm->flush_screen(); 359 359 i++; 360 360 } 361 361 362 if ( eh->event_waiting())363 eh->get_event(ev);362 if (wm->event_waiting()) 363 wm->get_event(ev); 364 364 365 365 } while (ev.type!=EV_KEY && ev.type!=EV_MOUSE_BUTTON); … … 387 387 256,paddr, 388 388 p,cash.img(mask)->height(),eoff,coff); 389 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot), eh->font(),cmap,eh->bright_color());390 eh->flush_screen();389 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color()); 390 wm->flush_screen(); 391 391 time_marker now; while (now.diff_time(&start)<0.18) now.get_time(); start.get_time(); 392 392 393 while ( eh->event_waiting() && ev.type!=EV_KEY) eh->get_event(ev);393 while (wm->event_waiting() && ev.type!=EV_KEY) wm->get_event(ev); 394 394 } 395 395 … … 412 412 413 413 414 eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);414 wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1); 415 415 the_game->set_state(MENU_STATE); 416 416 } … … 422 422 fade_out(16); 423 423 image blank(2,2); blank.clear(); 424 eh->set_mouse_shape(blank.copy(),0,0); // don't show mouse424 wm->set_mouse_shape(blank.copy(),0,0); // don't show mouse 425 425 screen->clear(); 426 426 … … 453 453 lstring_value(to_be)); 454 454 455 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(mid_plot), eh->font(),cmap,eh->bright_color());456 eh->flush_screen();455 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(mid_plot),wm->font(),cmap,wm->bright_color()); 456 wm->flush_screen(); 457 457 time_marker now; while (now.diff_time(&start)<0.18) now.get_time(); start.get_time(); 458 while ( eh->event_waiting() && ev.type!=EV_KEY) eh->get_event(ev);458 while (wm->event_waiting() && ev.type!=EV_KEY) wm->get_event(ev); 459 459 } 460 460 … … 463 463 do 464 464 { 465 eh->flush_screen();466 eh->get_event(ev);465 wm->flush_screen(); 466 wm->get_event(ev); 467 467 } while (ev.type!=EV_KEY && ev.type!=EV_MOUSE_BUTTON); 468 468 } 469 469 470 470 fade_out(16); 471 eh->set_mouse_shape(blank.copy(),0,0); // don't show mouse471 wm->set_mouse_shape(blank.copy(),0,0); // don't show mouse 472 472 show_sell(1); 473 eh->push_event(new event(ID_SHOW_SELL,NULL));473 wm->push_event(new event(ID_SHOW_SELL,NULL)); 474 474 } 475 475 … … 479 479 fade_out(16); 480 480 image blank(2,2); blank.clear(); 481 eh->set_mouse_shape(blank.copy(),0,0); // don't show mouse481 wm->set_mouse_shape(blank.copy(),0,0); // don't show mouse 482 482 screen->clear(); 483 483 … … 503 503 im->put_image(screen,dx,dy); 504 504 505 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot), eh->font(),cmap,eh->bright_color());506 eh->flush_screen();505 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color()); 506 wm->flush_screen(); 507 507 time_marker now; while (now.diff_time(&start)<0.18) now.get_time(); start.get_time(); 508 while ( eh->event_waiting() && ev.type!=EV_KEY) eh->get_event(ev);508 while (wm->event_waiting() && ev.type!=EV_KEY) wm->get_event(ev); 509 509 } 510 510 … … 513 513 do 514 514 { 515 eh->flush_screen();516 eh->get_event(ev);515 wm->flush_screen(); 516 wm->get_event(ev); 517 517 } while (ev.type!=EV_KEY && ev.type!=EV_MOUSE_BUTTON); 518 518 } … … 526 526 show_sell(1); 527 527 528 eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);528 wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1); 529 529 the_game->set_state(MENU_STATE); 530 530 } -
abuse/trunk/src/game.cpp
r95 r106 60 60 extern crc_manager *net_crcs; 61 61 game *the_game; 62 window_manager * eh= NULL;62 window_manager *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; … … 101 101 "and try again.\n"; 102 102 103 if(! eh)103 if(!wm) 104 104 { 105 105 fprintf(stderr, "%s\n", no_space_msg); … … 108 108 109 109 info_field *inf = new info_field(WINDOW_FRAME_LEFT, WINDOW_FRAME_TOP + 110 eh->font()->height() * 2, ID_NULL,110 wm->font()->height() * 2, ID_NULL, 111 111 no_space_msg, NULL); 112 112 button *b = new button(WINDOW_FRAME_LEFT, WINDOW_FRAME_TOP, 113 113 ID_QUIT_OK, "Quit", inf); 114 jwindow *no_space = eh->new_window(0, 0, -1, -1, b, "ERROR");114 jwindow *no_space = wm->new_window(0, 0, -1, -1, b, "ERROR"); 115 115 116 116 event ev; 117 117 do 118 118 { 119 eh->flush_screen();120 eh->get_event(ev);119 wm->flush_screen(); 120 wm->get_event(ev); 121 121 } while(ev.type != EV_MESSAGE || ev.message.id != ID_QUIT_OK); 122 eh->close_window(no_space);122 wm->close_window(no_space); 123 123 124 124 close_graphics(); … … 430 430 // so we need to redraw. 431 431 if(window_state(new_state) && !window_state(state)) 432 eh->show_windows();432 wm->show_windows(); 433 433 else if(!window_state(new_state) && window_state(state)) 434 eh->hide_windows();434 wm->hide_windows(); 435 435 436 436 int old_state = state; … … 440 440 441 441 if(playing_state(state) && !(dev & EDIT_MODE)) 442 eh->set_mouse_shape(cash.img(c_target)->copy(), 8, 8);442 wm->set_mouse_shape(cash.img(c_target)->copy(), 8, 8); 443 443 else 444 eh->set_mouse_shape(cash.img(c_normal)->copy(), 1, 1);444 wm->set_mouse_shape(cash.img(c_normal)->copy(), 1, 1); 445 445 446 446 if(old_state == SCENE_STATE && new_state != SCENE_STATE) … … 473 473 int dx = WINDOW_FRAME_LEFT + 20, dy = WINDOW_FRAME_TOP + 5; 474 474 image *jim = cash.img(joy_picts[but * 9+(y + 1)*3 + x + 1]); 475 joy_win->screen->bar(dx, dy, dx + jim->width()+6, dy + jim->height()+6, eh->black());475 joy_win->screen->bar(dx, dy, dx + jim->width()+6, dy + jim->height()+6, wm->black()); 476 476 jim->put_image(joy_win->screen, dx + 3, dy + 3); 477 477 … … 481 481 else if(ev.type == EV_MESSAGE && ev.message.id == JOY_OK) 482 482 { 483 eh->close_window(joy_win);483 wm->close_window(joy_win); 484 484 joy_win = NULL; 485 485 set_state(MENU_STATE); … … 493 493 { 494 494 #if 0 495 eh->push_event(new event(men_mess[((pick_list *)ev.message.data)->get_selection()], NULL));496 eh->close_window(top_menu);495 wm->push_event(new event(men_mess[((pick_list *)ev.message.data)->get_selection()], NULL)); 496 wm->close_window(top_menu); 497 497 top_menu = NULL; 498 498 #endif … … 511 511 int val, int max) 512 512 { 513 screen->bar(x, y, x + w - 1, y + h, eh->dark_color());514 screen->bar(x, y + 1, x + w * val / max, y + h - 1, eh->bright_color());513 screen->bar(x, y, x + w - 1, y + h, wm->dark_color()); 514 screen->bar(x, y + 1, x + w * val / max, y + h - 1, wm->bright_color()); 515 515 } 516 516 … … 630 630 if(mousex < xmargin && dev_cont->ok_to_scroll()) xs = -18; 631 631 else if(mousex>(screen->width()-xmargin) && dev_cont->ok_to_scroll()) xs = 18; 632 else if( eh->key_pressed(JK_LEFT) && !last_input && !dev_cont->need_arrows())632 else if(wm->key_pressed(JK_LEFT) && !last_input && !dev_cont->need_arrows()) 633 633 xs = -18; 634 else if( eh->key_pressed(JK_RIGHT) && !last_input && !dev_cont->need_arrows())634 else if(wm->key_pressed(JK_RIGHT) && !last_input && !dev_cont->need_arrows()) 635 635 xs = 18; 636 636 else xs = 0; … … 639 639 if(mousey < ymargin && dev_cont->ok_to_scroll()) ys = -18; 640 640 else if(mousey>(screen->height()-ymargin) && dev_cont->ok_to_scroll()) ys = 18; 641 else if( eh->key_pressed(JK_UP) && !last_input)641 else if(wm->key_pressed(JK_UP) && !last_input) 642 642 ys = -18; 643 else if( eh->key_pressed(JK_DOWN) && !last_input)643 else if(wm->key_pressed(JK_DOWN) && !last_input) 644 644 ys = 18; 645 645 else ys = 0; … … 717 717 if(state == SCENE_STATE) 718 718 screen->set_clip(cx1, cy1, cx2, cy2); 719 eh->flush_screen();719 wm->flush_screen(); 720 720 } 721 721 return; … … 896 896 { 897 897 if(dev & EDIT_MODE) 898 screen->clear( eh->bright_color());898 screen->clear(wm->bright_color()); 899 899 else 900 screen->clear( eh->black());900 screen->clear(wm->black()); 901 901 for(y = y1, draw_y = yo; y <= y2; y++, draw_y += yinc) 902 902 { … … 1009 1009 else 1010 1010 { 1011 screen->line(draw_x, draw_y, draw_x + xinc, draw_y + yinc, eh->bright_color());1012 screen->line(draw_x + xinc, draw_y, draw_x, draw_y + yinc, eh->bright_color());1011 screen->line(draw_x, draw_y, draw_x + xinc, draw_y + yinc, wm->bright_color()); 1012 screen->line(draw_x + xinc, draw_y, draw_x, draw_y + yinc, wm->bright_color()); 1013 1013 } 1014 1014 } … … 1021 1021 if(dev & DRAW_FG_BOUND_LAYER) 1022 1022 { 1023 int b = eh->bright_color();1023 int b = wm->bright_color(); 1024 1024 int fg_h = current_level->foreground_height(), fg_w = current_level->foreground_width(); 1025 1025 … … 1068 1068 color = 2+(help_text_frames - 10); 1069 1069 1070 int x1 = v->cx1, y1 = v->cy1, x2 = v->cx2, y2 = v->cy1 + eh->font()->height()+10;1070 int x1 = v->cx1, y1 = v->cy1, x2 = v->cx2, y2 = v->cy1 + wm->font()->height()+10; 1071 1071 1072 1072 remap_area(screen, x1, y1, x2, y2, white_light + 40 * 256); … … 1074 1074 screen->bar(x1, y2, x2, y2, color); 1075 1075 1076 eh->font()->put_string(screen, x1 + 5, y1 + 5,1076 wm->font()->put_string(screen, x1 + 5, y1 + 5, 1077 1077 help_text, color); 1078 1078 if(color > 30) … … 1198 1198 } 1199 1199 pal->load(); 1200 eh->flush_screen();1200 wm->flush_screen(); 1201 1201 milli_wait(25); 1202 1202 } … … 1222 1222 } 1223 1223 pal->load(); 1224 eh->flush_screen();1224 wm->flush_screen(); 1225 1225 milli_wait(25); 1226 1226 } 1227 1227 screen->clear(); 1228 eh->flush_screen();1228 wm->flush_screen(); 1229 1229 delete pal; 1230 1230 pal = old_pal; … … 1261 1261 image *blank = new image(2, 2); 1262 1262 blank->clear(); 1263 eh->set_mouse_shape(blank->copy(), 0, 0); // hide mouse1263 wm->set_mouse_shape(blank->copy(), 0, 0); // hide mouse 1264 1264 delete blank; 1265 1265 fade_in(cash.img(cdc_logo), 32); … … 1313 1313 gray->put_image(screen, dx, dy); 1314 1314 smoke[i % 5]->put_image(screen, dx + 24, dy + 5); 1315 text_draw(205 - i, dx + 15, dy, dx + 320 - 15, dy + 199, str, eh->font(), cmap, eh->bright_color());1316 eh->flush_screen();1315 text_draw(205 - i, dx + 15, dy, dx + 320 - 15, dy + 199, str, wm->font(), cmap, wm->bright_color()); 1316 wm->flush_screen(); 1317 1317 time_marker now; 1318 1318 … … 1325 1325 start.get_time(); 1326 1326 1327 while( eh->event_waiting() && ev.type != EV_KEY)1327 while(wm->event_waiting() && ev.type != EV_KEY) 1328 1328 { 1329 eh->get_event(ev);1329 wm->get_event(ev); 1330 1330 } 1331 1331 if((i % 5) == 0 && DEFINEDP(space_snd) && (sound_avail & SFX_INITIALIZED)) … … 1354 1354 fade_in(cash.img(title_screen), 32); 1355 1355 1356 eh->set_mouse_shape(cash.img(c_normal)->copy(), 1, 1);1356 wm->set_mouse_shape(cash.img(c_normal)->copy(), 1, 1); 1357 1357 } 1358 1358 } … … 1483 1483 console_font = new JCFont(cash.img(console_font_pict)); 1484 1484 1485 eh= new window_manager(screen, pal, bright_color,1485 wm = new window_manager(screen, pal, bright_color, 1486 1486 med_color, 1487 1487 dark_color, … … 1489 1489 1490 1490 delete stat_man; // move to a graphical status manager 1491 gui_status_manager *gstat = new gui_status_manager( eh);1491 gui_status_manager *gstat = new gui_status_manager(); 1492 1492 gstat->set_window_title("status"); 1493 1493 stat_man = gstat; 1494 1494 1495 1495 1496 chat = new chat_console( eh,console_font, 50, 6);1497 1498 if(! eh->has_mouse())1496 chat = new chat_console( console_font, 50, 6); 1497 1498 if(!wm->has_mouse()) 1499 1499 { 1500 1500 close_graphics(); … … 1601 1601 { 1602 1602 draw_map(f, 1); 1603 eh->flush_screen();1603 wm->flush_screen(); 1604 1604 } 1605 1605 draw_map(f, 0); … … 1622 1622 cash.prof_poll_end(); 1623 1623 1624 eh->flush_screen();1624 wm->flush_screen(); 1625 1625 1626 1626 } … … 1699 1699 event ev; 1700 1700 idle_ticks++; 1701 while(event_waiting( eh))1702 { 1703 get_event(ev , eh);1701 while(event_waiting()) 1702 { 1703 get_event(ev); 1704 1704 1705 1705 if(ev.type == EV_MOUSE_MOVE) … … 1781 1781 int wx = WINDOW_FRAME_LEFT, wy = WINDOW_FRAME_TOP; 1782 1782 1783 joy_win = eh->new_window(80, 50, -1, -1,1783 joy_win = wm->new_window(80, 50, -1, -1, 1784 1784 new button(wx + 70, wy + 9, JOY_OK, "OK", 1785 1785 new info_field(wx, wy + 30, DEV_NULL, … … 1802 1802 else if(ev.type == EV_CLOSE_WINDOW && ev.window == top_menu) 1803 1803 { 1804 eh->close_window(top_menu);1804 wm->close_window(top_menu); 1805 1805 top_menu = NULL; 1806 1806 } … … 1854 1854 case 'v': 1855 1855 { 1856 eh->push_event(new event(DO_VOLUME, NULL));1856 wm->push_event(new event(DO_VOLUME, NULL)); 1857 1857 } break; 1858 1858 case 'p': … … 1869 1869 if(start_edit) 1870 1870 { 1871 eh->push_event(new event(ID_LEVEL_SAVE, NULL));1871 wm->push_event(new event(ID_LEVEL_SAVE, NULL)); 1872 1872 } 1873 1873 } break; … … 1893 1893 if(!dev_cont->need_plus_minus()) 1894 1894 { 1895 if( eh->key_pressed(JK_CTRL_L))1895 if(wm->key_pressed(JK_CTRL_L)) 1896 1896 grow_views(20); 1897 1897 else … … 1909 1909 if(!dev_cont->need_plus_minus()) 1910 1910 { 1911 if( eh->key_pressed(JK_CTRL_L))1911 if(wm->key_pressed(JK_CTRL_L)) 1912 1912 grow_views(-20); 1913 1913 else … … 2186 2186 config_cleanup(); 2187 2187 delete color_table; 2188 delete eh;2188 delete wm; 2189 2189 delete game_font; 2190 2190 delete big_font; … … 2212 2212 { 2213 2213 char const *helpstr = "ARROW KEYS CHANGE TEXT SPEED"; 2214 eh->font()->put_string(screen, screen->width()/2-(eh->font()->width()*strlen(helpstr))/2 + 1,2215 screen->height()- eh->font()->height()-5 + 1, helpstr, eh->dark_color());2216 eh->font()->put_string(screen, screen->width()/2-(eh->font()->width()*strlen(helpstr))/2,2217 screen->height()- eh->font()->height()-5, helpstr, eh->bright_color());2214 wm->font()->put_string(screen, screen->width()/2-(wm->font()->width()*strlen(helpstr))/2 + 1, 2215 screen->height()-wm->font()->height()-5 + 1, helpstr, wm->dark_color()); 2216 wm->font()->put_string(screen, screen->width()/2-(wm->font()->width()*strlen(helpstr))/2, 2217 screen->height()-wm->font()->height()-5, helpstr, wm->bright_color()); 2218 2218 } 2219 2219 /* else 2220 2220 { 2221 2221 char *helpstr="PRESS h FOR HELP"; 2222 eh->font()->put_string(screen, screen->width()-eh->font()->width()*strlen(helpstr)-5,2223 screen->height()- eh->font()->height()-5, helpstr);2222 wm->font()->put_string(screen, screen->width()-wm->font()->width()*strlen(helpstr)-5, 2223 screen->height()-wm->font()->height()-5, helpstr); 2224 2224 }*/ 2225 2225 /* int dc = cash.img(window_colors)->pixel(0, 2); … … 2284 2284 do 2285 2285 { 2286 get_event(ev , eh);2286 get_event(ev); 2287 2287 if(ev.type == EV_KEY) 2288 2288 { … … 2307 2307 } 2308 2308 } 2309 eh->flush_screen();2309 wm->flush_screen(); 2310 2310 } while(ev.type != EV_KEY || ev.key != JK_ENTER); 2311 2311 dprintf("\n"); -
abuse/trunk/src/game.hpp
r88 r106 46 46 47 47 /* Cleaned-up externs */ 48 extern window_manager * eh;48 extern window_manager *wm; 49 49 50 50 -
abuse/trunk/src/gamma.cpp
r88 r106 30 30 public: 31 31 int sc; 32 virtual void draw_item( window_manager *wm,image *screen, int x, int y, int num, int active)33 { 34 long x2 = x + item_width( wm) - 1;35 long y2 = y + item_height( wm) - 1;32 virtual void draw_item(image *screen, int x, int y, int num, int active) 33 { 34 long x2 = x + item_width() - 1; 35 long y2 = y + item_height() - 1; 36 36 screen->bar( x, y, x2, y2, 0 ); 37 37 screen->bar( x, y, x2 - 3, y2, sc + num ); … … 43 43 void set_pos( int x ) { cur_sel = x; } 44 44 virtual int total() { return 32; } 45 virtual int item_width( window_manager *wm) { return 12; }46 virtual int item_height( window_manager *wm) { return 20; }45 virtual int item_width() { return 12; } 46 virtual int item_height() { return 20; } 47 47 virtual int activate_on_mouse_move() { return 0; } 48 48 … … 94 94 gray_pal->load(); 95 95 96 int wm_bc = eh->bright_color(), wm_mc = eh->medium_color(), wm_dc = eh->dark_color();96 int wm_bc = wm->bright_color(), wm_mc = wm->medium_color(), wm_dc = wm->dark_color(); 97 97 98 98 int br_r = pal->red( wm_bc ) + 20; … … 144 144 } 145 145 146 eh->set_colors( gray_pal->find_closest( br_r, br_g, br_b ),146 wm->set_colors( gray_pal->find_closest( br_r, br_g, br_b ), 147 147 gray_pal->find_closest( md_r, md_g, md_b ), 148 148 gray_pal->find_closest( dr_r, dr_g, dr_b ) ); 149 149 150 150 int wl = WINDOW_FRAME_LEFT, wh = WINDOW_FRAME_TOP; 151 int sh = eh->font()->height() + 35;151 int sh = wm->font()->height() + 35; 152 152 button *but = new button( wl + 5, wh + 5 + sh * 3, ID_GAMMA_OK, cash.img( ok_button ), 153 153 new info_field( wl + 35, wh + 10 + sh * 3, ID_NULL, lang_string( "gamma_msg" ), 0 ) ); … … 156 156 gp->set_pos( dg / 4 ); 157 157 158 jwindow *gw = eh->new_window( xres / 2 - 190, yres / 2 - 90, -1, -1, gp);158 jwindow *gw = wm->new_window( xres / 2 - 190, yres / 2 - 90, -1, -1, gp); 159 159 160 160 event ev; 161 eh->flush_screen();161 wm->flush_screen(); 162 162 do 163 163 { 164 164 do 165 165 { 166 eh->get_event(ev);167 } while( ev.type == EV_MOUSE_MOVE && eh->event_waiting() );168 eh->flush_screen();166 wm->get_event(ev); 167 } while( ev.type == EV_MOUSE_MOVE && wm->event_waiting() ); 168 wm->flush_screen(); 169 169 if( ev.type == EV_CLOSE_WINDOW) 170 170 { … … 179 179 dg = ( (spicker *)gw->inm->get( ID_GREEN_PICKER ) )->first_selected() * 4; 180 180 181 eh->close_window( gw );182 eh->flush_screen();183 184 eh->set_colors( wm_bc, wm_mc, wm_dc);181 wm->close_window( gw ); 182 wm->flush_screen(); 183 184 wm->set_colors( wm_bc, wm_mc, wm_dc); 185 185 delete gray_pal; 186 186 -
abuse/trunk/src/go.cpp
r56 r106 338 338 game_object::draw(); 339 339 int sx=the_game->screenx(x),sy=the_game->screeny(y); 340 screen->rectangle(sx-xrange,sy-yrange,sx+xrange,sy+yrange, eh->bright_color());340 screen->rectangle(sx-xrange,sy-yrange,sx+xrange,sy+yrange,wm->bright_color()); 341 341 } 342 342 } -
abuse/trunk/src/gui.cpp
r67 r106 31 31 } 32 32 33 void ico_switch_button::area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm)33 void ico_switch_button::area(int &x1, int &y1, int &x2, int &y2) 34 34 { 35 35 x1=10000; … … 40 40 for (ifield *b=blist;b;b=b->next) 41 41 { 42 b->area(X1,Y1,X2,Y2 ,wm);42 b->area(X1,Y1,X2,Y2); 43 43 if (X1<x1) x1=X1; 44 44 if (Y1<y1) y1=Y1; … … 68 68 } 69 69 70 void ico_switch_button::handle_event(event &ev, image *screen, window_manager *wm,input_manager *im)70 void ico_switch_button::handle_event(event &ev, image *screen, input_manager *im) 71 71 { 72 72 if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON && … … 75 75 cur_but=cur_but->next; 76 76 if (!cur_but) cur_but=blist; 77 cur_but->draw(act,screen ,wm);78 cur_but->handle_event(ev,screen, wm,im);77 cur_but->draw(act,screen); 78 cur_but->handle_event(ev,screen,im); 79 79 } 80 80 81 81 } 82 82 83 void ico_button::draw(int active, image *screen , window_manager *wm)83 void ico_button::draw(int active, image *screen) 84 84 { 85 85 int x1,y1,x2,y2; 86 area(x1,y1,x2,y2 ,wm);86 area(x1,y1,x2,y2); 87 87 88 88 if (active!=act && activate_id!=-1 && active) … … 116 116 extern int sfx_volume; 117 117 118 void ico_button::handle_event(event &ev, image *screen, window_manager *wm,input_manager *im)118 void ico_button::handle_event(event &ev, image *screen, input_manager *im) 119 119 { 120 120 if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON && … … 122 122 { 123 123 int x1,y1,x2,y2; 124 area(x1,y1,x2,y2 ,wm);124 area(x1,y1,x2,y2); 125 125 up=!up; 126 draw(act,screen ,wm);126 draw(act,screen); 127 127 wm->push_event(new event(id,(char *)this)); 128 128 if (S_BUTTON_PRESS_SND) … … 131 131 } 132 132 133 void ico_button::area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm)133 void ico_button::area(int &x1, int &y1, int &x2, int &y2) 134 134 { 135 135 x1=x; y1=y; -
abuse/trunk/src/gui.hpp
r57 r106 21 21 ico_button(int X, int Y, int ID, int Up, int down, int upa, int downa, ifield *Next, int act_id=-1, char const *help_key=NULL); 22 22 23 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm);24 virtual void draw_first(image *screen , window_manager *wm) { draw(0,screen,wm); }25 virtual void draw(int active, image *screen , window_manager *wm);26 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im);23 virtual void area(int &x1, int &y1, int &x2, int &y2); 24 virtual void draw_first(image *screen) { draw(0,screen); } 25 virtual void draw(int active, image *screen); 26 virtual void handle_event(event &ev, image *screen, input_manager *im); 27 27 28 28 virtual char *read() { return (char *)&up; } … … 40 40 public : 41 41 ico_switch_button(int X, int Y, int ID, int start_on, ifield *butts, ifield *Next); 42 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm);43 virtual void draw_first(image *screen , window_manager *wm) { cur_but->draw_first(screen,wm); }44 virtual void draw(int active, image *screen , window_manager *wm) { cur_but->draw(active,screen,wm); act=active; }45 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im);42 virtual void area(int &x1, int &y1, int &x2, int &y2); 43 virtual void draw_first(image *screen) { cur_but->draw_first(screen); } 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); 46 46 virtual ifield *unlink(int id); 47 47 virtual char *read() { return cur_but->read(); } -
abuse/trunk/src/imlib/filesel.cpp
r90 r106 23 23 file_picker(int X, int Y, int ID, int Rows, ifield *Next); 24 24 virtual int total() { return tf+td; } 25 virtual int item_width( window_manager *wm) { return wm->font()->width()*wid; }26 virtual int item_height( window_manager *wm) { return wm->font()->height()+1; }27 virtual void draw_item( window_manager *wm,image *screen, int x, int y, int num, int active);28 virtual void note_selection( window_manager *wm,image *screen, input_manager *inm, int x);25 virtual int item_width() { return wm->font()->width()*wid; } 26 virtual int item_height() { return wm->font()->height()+1; } 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); 29 29 void free_up(); 30 30 ~file_picker() { free_up(); } … … 42 42 } 43 43 44 void file_picker::note_selection( window_manager *wm,image *screen, input_manager *inm, int x)44 void file_picker::note_selection(image *screen, input_manager *inm, int x) 45 45 { 46 46 if (x<td) … … 49 49 { 50 50 int x1,y1,x2,y2; 51 area(x1,y1,x2,y2 ,wm);51 area(x1,y1,x2,y2); 52 52 screen->bar(x1,y1,x2,y2,wm->medium_color()); 53 53 … … 72 72 73 73 reconfigure(); 74 draw_first(screen ,wm);74 draw_first(screen); 75 75 } 76 76 } else … … 79 79 sprintf(nm,"%s/%s",cd,f[x-td]); 80 80 text_field *link=(text_field *)inm->get(sid); 81 link->change_data(nm,strlen(nm),1,screen ,wm);81 link->change_data(nm,strlen(nm),1,screen); 82 82 } 83 83 84 84 } 85 85 86 void file_picker::draw_item( window_manager *wm,image *screen, int x, int y, int num, int active)86 void file_picker::draw_item(image *screen, int x, int y, int num, int active) 87 87 { 88 88 if (active) 89 screen->bar(x,y,x+item_width( wm)-1,y+item_height(wm)-1,wm->black());89 screen->bar(x,y,x+item_width()-1,y+item_height()-1,wm->black()); 90 90 91 91 if (num<td) … … 116 116 } 117 117 118 jwindow *file_dialog( window_manager *wm,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, -
abuse/trunk/src/imlib/filesel.hpp
r57 r106 13 13 #include "jwindow.hpp" 14 14 15 jwindow *file_dialog( window_manager *wm,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
r56 r106 10 10 #include "config.h" 11 11 12 #include "input.hpp" 12 13 #include "status.hpp" 13 14 #include "timing.hpp" … … 21 22 visual_object *show; 22 23 jwindow *stat_win; 23 window_manager *wm;24 24 int last_update; 25 25 time_marker last_time; 26 gui_status_node(char const *Name, visual_object *Show, window_manager *WM,gui_status_node *Next)26 gui_status_node(char const *Name, visual_object *Show, gui_status_node *Next) 27 27 { name=strcpy((char *)jmalloc(strlen(Name)+1,"status name"),Name); 28 28 show=Show; … … 30 30 last_update=0; 31 31 stat_win=NULL; 32 wm=WM;33 32 } 34 33 ~gui_status_node(); … … 73 72 void gui_status_manager::push(char const *name, visual_object *show) 74 73 { 75 first=new gui_status_node(name,show, wm,first);74 first=new gui_status_node(name,show,first); 76 75 } 77 76 78 gui_status_manager::gui_status_manager( window_manager *WM)77 gui_status_manager::gui_status_manager() 79 78 { 80 wm=WM;81 79 first=NULL; 82 80 strcpy(title,"STATUS"); … … 95 93 { 96 94 long wx=xres/2,wy=10,len1=strlen(first->name)*wm->font()->width()+10,len2=0,len3, 97 h1=wm->font()->height()+5,h2=first->show ? first->show->height( wm) : 0;95 h1=wm->font()->height()+5,h2=first->show ? first->show->height() : 0; 98 96 99 if (first->show) len2=first->show->width( wm)/2;97 if (first->show) len2=first->show->width()/2; 100 98 if (len2>len1) len3=len2; else len3=len1; 101 99 wx-=len3/2; … … 112 110 if (first->show) 113 111 first->show->draw(first->stat_win->screen,(first->stat_win->x2()-first->stat_win->x1())/2- 114 first->show->width( wm)/2,my+h1,wm,NULL);112 first->show->width()/2,my+h1,NULL); 115 113 116 114 draw_bar(first,percentage); -
abuse/trunk/src/imlib/guistat.hpp
r57 r106 17 17 class gui_status_manager : public status_manager 18 18 { 19 window_manager *wm;20 19 char title[40]; 21 20 int last_perc; 22 21 public : 23 22 gui_status_node *first; 24 gui_status_manager( window_manager *WM);23 gui_status_manager(); 25 24 virtual void push(char const *name, visual_object *show); 26 25 virtual void update(int percentage); -
abuse/trunk/src/imlib/input.cpp
r56 r106 60 60 } 61 61 62 void button_box::area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm)62 void button_box::area(int &x1, int &y1, int &x2, int &y2) 63 63 { 64 64 button *b=buttons; … … 66 66 else 67 67 { 68 b->area(x1,y1,x2,y2 ,wm);68 b->area(x1,y1,x2,y2); 69 69 int xp1,yp1,xp2,yp2; 70 70 for (b=(button *)b->next;b;b=(button *)b->next) 71 71 { 72 b->area(xp1,yp1,xp2,yp2 ,wm);72 b->area(xp1,yp1,xp2,yp2); 73 73 if (xp1<x1) x1=xp1; 74 74 if (xp2>x2) x2=xp2; … … 79 79 } 80 80 81 void button_box::draw_first(image *screen , window_manager *wm)81 void button_box::draw_first(image *screen) 82 82 { 83 83 for (button *b=buttons;b;b=(button *)b->next) 84 b->draw_first(screen ,wm);85 } 86 87 void button_box::draw(int active, image *screen , window_manager *wm)84 b->draw_first(screen); 85 } 86 87 void button_box::draw(int active, image *screen) 88 88 { 89 89 return ; … … 100 100 } 101 101 102 void button_box::handle_event(event &ev, image *screen, window_manager *wm,input_manager *im)102 void button_box::handle_event(event &ev, image *screen, input_manager *im) 103 103 { 104 104 switch (ev.type) … … 110 110 for (button *b=buttons;!found && b;b=(button *)b->next) // see if the user clicked on a button 111 111 { 112 b->area(x1,y1,x2,y2 ,wm);112 b->area(x1,y1,x2,y2); 113 113 if (ev.mouse_move.x>=x1 && ev.mouse_move.x<=x2 && 114 114 ev.mouse_move.y>=y1 && ev.mouse_move.y<=y2) 115 115 { 116 b->handle_event(ev,screen, wm,im);116 b->handle_event(ev,screen,im); 117 117 118 118 int total=0; … … 131 131 total--; 132 132 b2->push(); 133 b2->draw_first(screen ,wm);133 b2->draw_first(screen); 134 134 } 135 135 } 136 b->draw_first(screen ,wm);136 b->draw_first(screen); 137 137 } else if (total==0 && maxdown) 138 138 b->push(); // don't let the user de-press a button if non others are selected. … … 154 154 155 155 156 void button_box::arrange_left_right( window_manager *wm)156 void button_box::arrange_left_right() 157 157 { 158 158 button *b=buttons; … … 160 160 for (;b;b=(button *)b->next) 161 161 { 162 b->area(x1,y1,x2,y2 ,wm);162 b->area(x1,y1,x2,y2); 163 163 b->x=x_on; 164 164 b->y=y; … … 167 167 } 168 168 169 void button_box::arrange_up_down( window_manager *wm)169 void button_box::arrange_up_down() 170 170 { 171 171 button *b=buttons; … … 173 173 for (;b;b=(button *)b->next) 174 174 { 175 b->area(x1,y1,x2,y2 ,wm);175 b->area(x1,y1,x2,y2); 176 176 b->y=y_on; 177 177 b->x=x; … … 186 186 } 187 187 188 void button::area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm)188 void button::area(int &x1, int &y1, int &x2, int &y2) 189 189 { 190 190 x1=x; y1=y; … … 237 237 238 238 void text_field::change_data(char const *new_data, int new_cursor, // cursor==-1, does not change it. 239 int active, image *screen , window_manager *wm)239 int active, image *screen) 240 240 { 241 241 if (strlen(format)<strlen(new_data)) … … 245 245 if (new_cursor!=-1) 246 246 cur=new_cursor; 247 draw_first(screen ,wm);248 draw(active,screen ,wm);247 draw_first(screen); 248 draw(active,screen); 249 249 } 250 250 … … 259 259 #endif 260 260 261 void text_field::handle_event(event &ev, image *screen, window_manager *wm,input_manager *im)261 void text_field::handle_event(event &ev, image *screen, input_manager *im) 262 262 { 263 263 int xx; … … 266 266 switch (ev.key) 267 267 { 268 case JK_LEFT : if (cur) { draw_cur(wm->dark_color(),screen ,wm); cur--;269 draw_cur(wm->bright_color(),screen ,wm); } break;270 case JK_RIGHT : if (cur<(int)strlen(format)-1) { draw_cur(wm->dark_color(),screen ,wm); cur++;271 draw_cur(wm->bright_color(),screen ,wm); } break;268 case JK_LEFT : if (cur) { draw_cur(wm->dark_color(),screen); cur--; 269 draw_cur(wm->bright_color(),screen); } break; 270 case JK_RIGHT : if (cur<(int)strlen(format)-1) { draw_cur(wm->dark_color(),screen); cur++; 271 draw_cur(wm->bright_color(),screen); } break; 272 272 case JK_END : if (cur!=last_spot()) 273 { draw_cur(wm->dark_color(),screen ,wm); cur=last_spot();273 { draw_cur(wm->dark_color(),screen); cur=last_spot(); 274 274 if (cur==(int)strlen(format)-1) cur--; 275 draw_cur(wm->bright_color(),screen ,wm); } break;275 draw_cur(wm->bright_color(),screen); } break; 276 276 case JK_HOME : if (cur) 277 { draw_cur(wm->dark_color(),screen ,wm); cur=0;278 draw_cur(wm->bright_color(),screen ,wm); } break;277 { draw_cur(wm->dark_color(),screen); cur=0; 278 draw_cur(wm->bright_color(),screen); } break; 279 279 case JK_BACKSPACE : if (cur) 280 { draw_cur(wm->dark_color(),screen ,wm); cur--;280 { draw_cur(wm->dark_color(),screen); cur--; 281 281 for (xx=cur;xx<(int)strlen(format)-1;xx++) 282 282 data[xx]=data[xx+1]; 283 283 data[strlen(format)-1]=' '; 284 draw_text(screen ,wm);285 draw_cur(wm->bright_color(),screen ,wm);284 draw_text(screen); 285 draw_cur(wm->bright_color(),screen); 286 286 wm->push_event(new event(id,(char *)this)); 287 287 } break; 288 288 default : if (ev.key>=' ' && ev.key<='~') 289 289 { 290 draw_cur(wm->dark_color(),screen ,wm);290 draw_cur(wm->dark_color(),screen); 291 291 for (xx=strlen(format)-1;xx>cur && xx>0;xx--) 292 292 data[xx]=data[xx-1]; … … 295 295 cur++; 296 296 data[strlen(format)]=0; 297 draw_text(screen ,wm);298 draw_cur(wm->bright_color(),screen ,wm);297 draw_text(screen); 298 draw_cur(wm->bright_color(),screen); 299 299 wm->push_event(new event(id,(char *)this)); 300 300 } break; … … 307 307 #endif 308 308 309 void text_field::draw(int active, image *screen , window_manager *wm)309 void text_field::draw(int active, image *screen) 310 310 { 311 311 if (active) 312 312 { 313 screen->rectangle(xstart( wm),y,xend(wm),yend(wm),wm->bright_color());314 draw_cur(wm->bright_color(),screen ,wm);313 screen->rectangle(xstart(),y,xend(),yend(),wm->bright_color()); 314 draw_cur(wm->bright_color(),screen); 315 315 } 316 316 else 317 317 { 318 screen->rectangle(xstart( wm),y,xend(wm),yend(wm),wm->dark_color());319 draw_cur(wm->dark_color(),screen ,wm);320 } 321 } 322 323 void text_field::area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm)318 screen->rectangle(xstart(),y,xend(),yend(),wm->dark_color()); 319 draw_cur(wm->dark_color(),screen); 320 } 321 } 322 323 void text_field::area(int &x1, int &y1, int &x2, int &y2) 324 324 { 325 325 x1=x; y1=y; 326 x2=xend( wm);327 y2=yend( wm);326 x2=xend(); 327 y2=yend(); 328 328 } 329 329 … … 361 361 { up=!up; } 362 362 363 void button::handle_event(event &ev, image *screen, window_manager *wm,input_manager *im)363 void button::handle_event(event &ev, image *screen, input_manager *im) 364 364 { 365 365 if ((ev.type==EV_KEY && ev.key==13) || (ev.type==EV_MOUSE_BUTTON && … … 367 367 { 368 368 int x1,y1,x2,y2; 369 area(x1,y1,x2,y2 ,wm);369 area(x1,y1,x2,y2); 370 370 up=!up; 371 draw_first(screen ,wm);372 draw(act,screen ,wm);371 draw_first(screen); 372 draw(act,screen); 373 373 wm->push_event(new event(id,(char *)this)); 374 374 } 375 375 } 376 376 377 void button::draw(int active, image *screen , window_manager *wm)377 void button::draw(int active, image *screen) 378 378 { 379 379 int x1,y1,x2,y2,color=(active ? wm->bright_color() : wm->medium_color()); 380 area(x1,y1,x2,y2 ,wm);380 area(x1,y1,x2,y2); 381 381 if (active!=act && act_id!=-1 && active) 382 382 wm->push_event(new event(act_id,NULL)); … … 399 399 } 400 400 401 void button::draw_first(image *screen , window_manager *wm)401 void button::draw_first(image *screen) 402 402 { 403 403 if (pressed) 404 draw(0,screen ,wm);404 draw(0,screen); 405 405 else 406 406 { 407 407 408 408 int x1,y1,x2,y2; 409 area(x1,y1,x2,y2 ,wm);409 area(x1,y1,x2,y2); 410 410 411 411 … … 439 439 } 440 440 441 void text_field::draw_first(image *screen , window_manager *wm)441 void text_field::draw_first(image *screen) 442 442 { 443 443 wm->font()->put_string(screen,x,y+3,prompt); 444 screen->bar(xstart( wm),y,xend(wm),yend(wm),wm->dark_color());445 wm->font()->put_string(screen,xstart( wm)+1,y+3,data);446 } 447 448 449 void text_field::draw_cur(int color, image *screen , window_manager *wm)450 { 451 screen->bar(xstart( wm)+cur*wm->font()->width()+1,452 yend( wm)-2,453 xstart( wm)+(cur+1)*wm->font()->width(),454 yend( wm)-1,color);444 screen->bar(xstart(),y,xend(),yend(),wm->dark_color()); 445 wm->font()->put_string(screen,xstart()+1,y+3,data); 446 } 447 448 449 void text_field::draw_cur(int color, image *screen) 450 { 451 screen->bar(xstart()+cur*wm->font()->width()+1, 452 yend()-2, 453 xstart()+(cur+1)*wm->font()->width(), 454 yend()-1,color); 455 455 } 456 456 … … 465 465 466 466 467 void info_field::area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm)467 void info_field::area(int &x1, int &y1, int &x2, int &y2) 468 468 { 469 469 if (w==-1) // if we haven't calculated this yet … … 509 509 } 510 510 511 void info_field::draw_first(image *screen , window_manager *wm)511 void info_field::draw_first(image *screen) 512 512 { 513 513 put_para(screen,text,x+1,y+1,wm->font()->width(),wm->font()->height(),wm->font(),wm->black()); -
abuse/trunk/src/imlib/input.hpp
r57 r106 13 13 #include "filter.hpp" 14 14 15 extern window_manager *wm; /* FIXME: get rid of this if possible */ 15 16 16 17 class button : public ifield … … 25 26 button(int X, int Y, int ID, image *Depressed, image *Pressed, image *active, ifield *Next); 26 27 27 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm);28 virtual void draw_first(image *screen , window_manager *wm);29 virtual void draw(int active, image *screen , window_manager *wm);30 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im);28 virtual void area(int &x1, int &y1, int &x2, int &y2); 29 virtual void draw_first(image *screen); 30 virtual void draw(int active, image *screen); 31 virtual void handle_event(event &ev, image *screen, input_manager *im); 31 32 void change_visual(image *new_visual); 32 33 virtual void remap(filter *f); … … 47 48 void press_button(int id); // if button box doesn't contain id, nothing happens 48 49 virtual void remap(filter *f); 49 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm);50 virtual void draw_first(image *screen , window_manager *wm);51 virtual void draw(int active, image *screen , window_manager *wm);52 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im);50 virtual void area(int &x1, int &y1, int &x2, int &y2); 51 virtual void draw_first(image *screen); 52 virtual void draw(int active, image *screen); 53 virtual void handle_event(event &ev, image *screen, input_manager *im); 53 54 virtual ~button_box(); 54 55 virtual char *read(); // return pointer to first button which is depressed 55 56 virtual ifield *find(int search_id); // should return pointer to item you control with this id 56 void arrange_left_right( window_manager *wm);57 void arrange_up_down( window_manager *wm);57 void arrange_left_right(); 58 void arrange_up_down(); 58 59 } ; 59 60 … … 62 63 int cur; 63 64 char *prompt,*data,*format; 64 int xstart( window_manager *wm) { return x+wm->font()->width()*(strlen(prompt)+1)+3; }65 int xend( window_manager *wm) { return x+wm->font()->width()*(strlen(prompt)+1+strlen(format))+7; }66 int yend( window_manager *wm) { return y+wm->font()->height()+5; }67 void draw_cur(int color, image *screen , window_manager *wm);65 int xstart() { return x+wm->font()->width()*(strlen(prompt)+1)+3; } 66 int xend() { return x+wm->font()->width()*(strlen(prompt)+1+strlen(format))+7; } 67 int yend() { return y+wm->font()->height()+5; } 68 void draw_cur(int color, image *screen); 68 69 int last_spot() { int x=strlen(data); while (x && data[x-1]==' ') x--; return x; } 69 void draw_text(image *screen , window_manager *wm)70 void draw_text(image *screen) 70 71 { 71 screen->bar(xstart( wm)+1,y+1,xend(wm)-1,yend(wm)-1,wm->dark_color());72 wm->font()->put_string(screen,xstart( wm)+1,y+3,data);72 screen->bar(xstart()+1,y+1,xend()-1,yend()-1,wm->dark_color()); 73 wm->font()->put_string(screen,xstart()+1,y+3,data); 73 74 } 74 75 public : … … 78 79 double Data, ifield *Next); 79 80 80 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm);81 virtual void draw_first(image *screen , window_manager *wm);82 virtual void draw(int active, image *screen , window_manager *wm);83 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im);81 virtual void area(int &x1, int &y1, int &x2, int &y2); 82 virtual void draw_first(image *screen); 83 virtual void draw(int active, image *screen); 84 virtual void handle_event(event &ev, image *screen, input_manager *im); 84 85 85 86 virtual ~text_field() { jfree(prompt); jfree(format); jfree(data); } 86 87 virtual char *read(); 87 88 void change_data(char const *new_data, int new_cursor, // cursor==-1, does not change it. 88 int active, image *screen , window_manager *wm);89 int active, image *screen); 89 90 } ; 90 91 … … 98 99 public : 99 100 info_field(int X, int Y, int ID, char const *info, ifield *Next); 100 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm);101 virtual void draw_first(image *screen , window_manager *wm);102 virtual void draw(int active, image *screen , window_manager *wm) { ; }103 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im) { ; }101 virtual void area(int &x1, int &y1, int &x2, int &y2); 102 virtual void draw_first(image *screen); 103 virtual void draw(int active, image *screen) { ; } 104 virtual void handle_event(event &ev, image *screen, input_manager *im) { ; } 104 105 virtual char *read() { return text; } 105 106 virtual int selectable() { return 0; } -
abuse/trunk/src/imlib/jwindow.cpp
r56 r106 12 12 #include "video.hpp" 13 13 #include "image.hpp" 14 #include "input.hpp" 14 15 #include "event.hpp" 15 16 #include "filter.hpp" … … 201 202 ev.type=EV_SPURIOUS; 202 203 } else if (ev.window) 203 ev.window->inm->handle_event(ev,ev.window ,this);204 ev.window->inm->handle_event(ev,ev.window); 204 205 } 205 206 } else if (state==dragging) … … 274 275 if (y>screen->height()-4) y=screen->height()-10; 275 276 276 jwindow *j=new jwindow(x,y,l,h, this,fields,Name),*k;277 jwindow *j=new jwindow(x,y,l,h,fields,Name),*k; 277 278 j->property.hidden=0; 278 279 if (!first) … … 350 351 } 351 352 352 jwindow::jwindow(int X, int Y, int L, int H, window_manager *wm,ifield *fields, char const *Name)353 jwindow::jwindow(int X, int Y, int L, int H, ifield *fields, char const *Name) 353 354 { 354 355 ifield *i; … … 359 360 for (i=fields;i;i=i->next) 360 361 { 361 i->area(x1,y1,x2,y2 ,wm);362 i->area(x1,y1,x2,y2); 362 363 if ((int)y2>(int)h) 363 364 h=y2+1; … … 384 385 screen->clear(backg); 385 386 next=NULL; 386 inm=new input_manager(screen, wm,fields);387 inm=new input_manager(screen,fields); 387 388 if (Name==NULL) 388 389 name=strcpy((char *)jmalloc(strlen(" ")+1,"jwindow::window name")," "); … … 469 470 { 470 471 if (active) 471 active->draw(0,screen ,wm);472 active->draw(0,screen); 472 473 473 474 active=NULL; 474 475 } 475 476 476 void input_manager::handle_event(event &ev, jwindow *j , window_manager *wm)477 void input_manager::handle_event(event &ev, jwindow *j) 477 478 { 478 479 ifield *i,*in_area=NULL; … … 491 492 for (i=first;i;i=i->next) 492 493 { 493 i->area(x1,y1,x2,y2 ,wm);494 i->area(x1,y1,x2,y2); 494 495 if (ev.mouse_move.x>=x1 && ev.mouse_move.y>=y1 && 495 496 ev.mouse_move.x<=x2 && ev.mouse_move.y<=y2) … … 499 500 { 500 501 if (active) 501 active->draw(0,screen ,wm);502 active->draw(0,screen); 502 503 503 504 active=in_area; 504 505 505 506 if (active) 506 active->draw(1,screen ,wm);507 active->draw(1,screen); 507 508 } 508 509 } 509 510 if (ev.type==EV_KEY && ev.key==JK_TAB && active) 510 511 { 511 active->draw(0,screen ,wm);512 active->draw(0,screen); 512 513 do 513 514 { … … 515 516 if (!active) active=first; 516 517 } while (active && !active->selectable()); 517 active->draw(1,screen ,wm);518 active->draw(1,screen); 518 519 } 519 520 } else active=grab; … … 522 523 { 523 524 if (ev.type!=EV_MOUSE_MOVE && ev.type!=EV_MOUSE_BUTTON) 524 active->handle_event(ev,screen, wm,this);525 active->handle_event(ev,screen,this); 525 526 else 526 527 { 527 active->area(x1,y1,x2,y2 ,wm);528 active->area(x1,y1,x2,y2); 528 529 if (grab || (ev.mouse_move.x>=x1 && ev.mouse_move.y>=y1 && 529 530 ev.mouse_move.x<=x2 && ev.mouse_move.y<=y2)) 530 531 { 531 532 if (j) 532 active->handle_event(ev,screen, wm,j->inm);533 else active->handle_event(ev,screen, wm,this);533 active->handle_event(ev,screen,j->inm); 534 else active->handle_event(ev,screen,this); 534 535 } 535 536 } … … 552 553 ifield *i; 553 554 for (i=first;i;i=i->next) 554 i->draw_first(screen ,wm);555 i->draw_first(screen); 555 556 if (active) 556 active->draw(1,screen ,wm);557 } 558 559 input_manager::input_manager(image *Screen, window_manager *WM,ifield *First)557 active->draw(1,screen); 558 } 559 560 input_manager::input_manager(image *Screen, ifield *First) 560 561 { 561 562 no_selections_allowed=0; … … 563 564 grab=NULL; 564 565 screen=Screen; 565 wm=WM;566 566 active=first=First; 567 567 while (active && !active->selectable()) active=active->next; -
abuse/trunk/src/imlib/jwindow.hpp
r57 r106 38 38 image *screen; 39 39 ifield *first,*active,*grab; 40 window_manager *wm;41 40 jwindow *cur; 42 41 int no_selections_allowed; 43 42 public : 44 input_manager(image *Screen, window_manager *WM,ifield *First);45 void handle_event(event &ev, jwindow *j , window_manager *wm);43 input_manager(image *Screen, ifield *First); 44 void handle_event(event &ev, jwindow *j); 46 45 ifield *get(int id); 47 46 void redraw(); … … 64 63 int id; 65 64 ifield *next; 66 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm) = 0;67 virtual void draw_first(image *screen , window_manager *wm) = 0;68 virtual void draw(int active, image *screen , window_manager *wm) = 0;69 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im) = 0;65 virtual void area(int &x1, int &y1, int &x2, int &y2) = 0; 66 virtual void draw_first(image *screen) = 0; 67 virtual void draw(int active, image *screen) = 0; 68 virtual void handle_event(event &ev, image *screen, input_manager *im) = 0; 70 69 virtual int selectable() { return 1; } 71 70 virtual void remap(filter *f) { ; } … … 93 92 input_manager *inm; 94 93 void *local_info; // pointer to info block for local system (may support windows) 95 jwindow(int X, int Y, int L, int H, window_manager *wm,ifield *fields, char const *Name=NULL);94 jwindow(int X, int Y, int L, int H, ifield *fields, char const *Name=NULL); 96 95 void redraw(int hi, int med, int low, JCFont *fnt); 97 96 void resize(int L, int H); -
abuse/trunk/src/imlib/pmenu.cpp
r56 r106 17 17 } 18 18 19 pmenu::pmenu(int X, int Y, pmenu_item *first, image *screen , window_manager *wmanager)19 pmenu::pmenu(int X, int Y, pmenu_item *first, image *screen) 20 20 { 21 21 top=first; 22 22 active=NULL; 23 wm=wmanager;24 23 25 24 short cx1,cy1,cx2,cy2; … … 46 45 47 46 for (p=top;p;p=p->next,tx+=tw) 48 p->draw_self(bar,itemx(p ,wm),1,itemw(p,wm),1,wm,p==active);47 p->draw_self(bar,itemx(p),1,itemw(p),1,p==active); 49 48 /* } 50 49 else 51 50 { 52 51 for (p=top;p;p=p->next,tx+=tw) 53 p->draw(bar,itemx(p ,wm),1,itemw(p,wm),1,wm,p==active);52 p->draw(bar,itemx(p),1,itemw(p),1,p==active); 54 53 }*/ 55 54 … … 139 138 140 139 141 void psub_menu::hide(jwindow *parent, int x, int y , window_manager* wm)140 void psub_menu::hide(jwindow *parent, int x, int y) 142 141 { 143 142 int w,h; 144 calc_size(w,h ,wm);143 calc_size(w,h); 145 144 short cx1,cy1,cx2,cy2; 146 145 screen->get_clip(cx1,cy1,cx2,cy2); … … 154 153 { 155 154 int w,h; 156 calc_size(w,h ,wm);157 item_num(active)->draw(win,x+3,y+3+active*(wm->font()->height()+1),w-6,0, wm,0);155 calc_size(w,h); 156 item_num(active)->draw(win,x+3,y+3+active*(wm->font()->height()+1),w-6,0,0); 158 157 } 159 158 wm->close_window(win); … … 162 161 } 163 162 164 void psub_menu::calc_size(int &w, int &h , window_manager *wm)163 void psub_menu::calc_size(int &w, int &h) 165 164 { 166 165 int tw=wm->font()->width(),th=wm->font()->height(); … … 179 178 } 180 179 181 void psub_menu::draw(jwindow *parent, int x, int y , window_manager *wmanager)180 void psub_menu::draw(jwindow *parent, int x, int y) 182 181 { 183 182 if (win) wm->close_window(win); 184 wm=wmanager;185 186 183 187 184 int w,h,i=0; 188 calc_size(w,h ,wm);185 calc_size(w,h); 189 186 short cx1,cy1,cx2,cy2; 190 187 screen->get_clip(cx1,cy1,cx2,cy2); … … 210 207 211 208 for (p=first;p;p=p->next,i++,y+=wm->font()->height()+1) 212 p->draw(win,x,y,w-6,0, wm,i==active);213 214 } 215 216 void pmenu_item::draw_self(jwindow *parent, int x, int y, int w, int top, window_manager *wm,int active)209 p->draw(win,x,y,w-6,0,i==active); 210 211 } 212 213 void pmenu_item::draw_self(jwindow *parent, int x, int y, int w, int top, int active) 217 214 { 218 215 int bx=x; … … 250 247 251 248 void pmenu_item::draw(jwindow *parent, int x, int y, int w, int top, 252 window_manager *wm,int active)249 int active) 253 250 { 254 251 if (n) … … 256 253 if (active) 257 254 { 258 draw_self(parent,x,y,w,top, wm,active);255 draw_self(parent,x,y,w,top,active); 259 256 if (sub) 260 257 { 261 258 if (top) 262 sub->draw(parent,x,y+wm->font()->height()+2 ,wm);259 sub->draw(parent,x,y+wm->font()->height()+2); 263 260 else 264 sub->draw(parent,x+w,y ,wm);261 sub->draw(parent,x+w,y); 265 262 } 266 263 } … … 270 267 { 271 268 if (top) 272 sub->hide(parent,x,y+wm->font()->height()+2 ,wm);269 sub->hide(parent,x,y+wm->font()->height()+2); 273 270 else 274 sub->hide(parent,x+w,y ,wm);275 } 276 draw_self(parent,x,y,w,top, wm,active);277 278 } 279 280 } else draw_self(parent,x,y,w,top, wm,active);281 } 282 283 int pmenu::itemx(pmenu_item *p , window_manager *wm)271 sub->hide(parent,x+w,y); 272 } 273 draw_self(parent,x,y,w,top,active); 274 275 } 276 277 } else draw_self(parent,x,y,w,top,active); 278 } 279 280 int pmenu::itemx(pmenu_item *p) 284 281 { 285 282 if (p->xp!=-1) return p->xp; … … 299 296 300 297 301 void pmenu::draw(image *screen, window_manager *wm,int top_only)302 { 303 304 } 305 306 307 int psub_menu::handle_event(jwindow *parent, int x, int y, window_manager *wm,event &ev)298 void pmenu::draw(image *screen, int top_only) 299 { 300 301 } 302 303 304 int psub_menu::handle_event(jwindow *parent, int x, int y, event &ev) 308 305 { 309 306 int w,h; 310 calc_size(w,h ,wm);307 calc_size(w,h); 311 308 short cx1,cy1,cx2,cy2; 312 309 screen->get_clip(cx1,cy1,cx2,cy2); … … 328 325 { 329 326 if (active!=-1) 330 item_num(active)->draw(win,dx,3+active*(th+1),w-6,0, wm,0);327 item_num(active)->draw(win,dx,3+active*(th+1),w-6,0,0); 331 328 active=new_active; 332 329 if (active!=-1) 333 item_num(active)->draw(win,dx,3+active*(th+1),w-6,0, wm,1);330 item_num(active)->draw(win,dx,3+active*(th+1),w-6,0,1); 334 331 } 335 332 if (ev.type==EV_MOUSE_BUTTON) 336 333 { 337 334 if (active!=-1) 338 return item_num(active)->handle_event(win,dx,3+active*(th+1),w-6,0, wm,ev);335 return item_num(active)->handle_event(win,dx,3+active*(th+1),w-6,0,ev); 339 336 else return 0; 340 337 } else return 1; 341 338 } else if (active!=-1) 342 return item_num(active)->handle_event(win,win->x+dx,win->y+3+active*(th+1),w-6,0, wm,ev);339 return item_num(active)->handle_event(win,win->x+dx,win->y+3+active*(th+1),w-6,0,ev); 343 340 else return 0; 344 341 … … 347 344 348 345 int pmenu_item::handle_event(jwindow *parent, int x, int y, int w, int top, 349 window_manager *wm,event &ev)346 event &ev) 350 347 { 351 348 x+=parent->x; … … 364 361 { 365 362 if (top) 366 return sub->handle_event(parent,x,y+wm->font()->height()+2, wm,ev);367 else return sub->handle_event(parent,x+w,y, wm,ev);363 return sub->handle_event(parent,x,y+wm->font()->height()+2,ev); 364 else return sub->handle_event(parent,x+w,y,ev); 368 365 } else return 0; 369 366 } 370 367 371 pmenu_item *pmenu::inarea(int mx, int my, image *screen , window_manager *wm)368 pmenu_item *pmenu::inarea(int mx, int my, image *screen) 372 369 { 373 370 short cx1,cy1,cx2,cy2; … … 381 378 { 382 379 if (!p->next) return p; 383 else if (itemx(p->next ,wm)>mx) return p;380 else if (itemx(p->next)>mx) return p; 384 381 } 385 382 return NULL; … … 407 404 } 408 405 409 int pmenu::handle_event(event &ev, image *screen , window_manager *wm)406 int pmenu::handle_event(event &ev, image *screen) 410 407 { 411 408 if (!active && ev.window!=bar) return 0; … … 438 435 case EV_MOUSE_MOVE : 439 436 { 440 pmenu_item *new_selection=inarea(ev.mouse_move.x,ev.mouse_move.y,screen ,wm);437 pmenu_item *new_selection=inarea(ev.mouse_move.x,ev.mouse_move.y,screen); 441 438 if (!new_selection && active && 442 active->handle_event(bar,itemx(active ,wm),1,itemw(active,wm),1,wm,ev))439 active->handle_event(bar,itemx(active),1,itemw(active),1,ev)) 443 440 return 1; 444 441 else if (active!=new_selection) 445 442 { 446 443 if (active) 447 active->draw(bar,itemx(active ,wm),1,itemw(active,wm),1,wm,0);444 active->draw(bar,itemx(active),1,itemw(active),1,0); 448 445 active=new_selection; 449 446 if (active) 450 active->draw(bar,itemx(active ,wm),1,itemw(active,wm),1,wm,1);447 active->draw(bar,itemx(active),1,itemw(active),1,1); 451 448 } 452 449 if (active) return 1; … … 457 454 if (active) 458 455 { 459 if (active->handle_event(bar,itemx(active ,wm),1,itemw(active,wm),1,wm,ev))456 if (active->handle_event(bar,itemx(active),1,itemw(active),1,ev)) 460 457 { 461 active->draw(bar,itemx(active ,wm),1,itemw(active,wm),1,wm,0);458 active->draw(bar,itemx(active),1,itemw(active),1,0); 462 459 active=NULL; 463 460 return 1; -
abuse/trunk/src/imlib/pmenu.hpp
r57 r106 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, window_manager *wm,int active);34 void draw_self (jwindow *parent, int x, int y, int w, int top, window_manager *wm,int active);35 int handle_event(jwindow *parent, int x, int y, int w, int top, window_manager *wm,event &ev);33 void draw (jwindow *parent, int x, int y, int w, int top, int active); 34 void draw_self (jwindow *parent, int x, int y, int w, int top, int active); 35 int handle_event(jwindow *parent, int x, int y, int w, int top, event &ev); 36 36 int own_event(event &ev); 37 37 ~pmenu_item(); … … 44 44 psub_menu *next; 45 45 int active; 46 window_manager *wm;47 46 jwindow *win; 48 47 pmenu_item *item_num(int x) { pmenu_item *p=first; while (x-- && p) p=p->next; return p; } 49 48 public : 50 void calc_size(int &w, int &h , window_manager *wm);49 void calc_size(int &w, int &h); 51 50 pmenu_item *find_id(int search_id); 52 51 pmenu_item *find_key(int key); 53 52 psub_menu(pmenu_item *First, psub_menu *Next) 54 53 { first=First; Next=Next; win=0; active=0; } 55 int handle_event(jwindow *parent, int x, int y, window_manager *wm,event &ev);56 void draw(jwindow *parent, int x, int y , window_manager *wm);57 void hide(jwindow *parent, int x, int y , window_manager *wm);54 int handle_event(jwindow *parent, int x, int y, event &ev); 55 void draw(jwindow *parent, int x, int y); 56 void hide(jwindow *parent, int x, int y); 58 57 int own_event(event &ev); 59 58 ~psub_menu(); … … 62 61 class pmenu 63 62 { 64 window_manager *wm;65 63 jwindow *bar; 66 64 pmenu_item *top,*active; 67 int itemw(pmenu_item *p , window_manager *wm)65 int itemw(pmenu_item *p) 68 66 { return strlen(p->name())*wm->font()->width()+2; } 69 int itemx(pmenu_item *p , window_manager *wm);70 pmenu_item *inarea(int mx, int my, image *screen , window_manager *wm);67 int itemx(pmenu_item *p); 68 pmenu_item *inarea(int mx, int my, image *screen); 71 69 public : 72 70 ~pmenu(); 73 pmenu(int X, int Y, pmenu_item *first, image *screen , window_manager *wm);71 pmenu(int X, int Y, pmenu_item *first, image *screen); 74 72 void move(int new_x, int new_y); 75 void draw(image *screen, window_manager *wm,int top_only=0);76 int handle_event(event &ev, image *screen , window_manager *wm);73 void draw(image *screen, int top_only=0); 74 int handle_event(event &ev, image *screen); 77 75 78 76 } ; -
abuse/trunk/src/imlib/scroller.cpp
r56 r106 50 50 0, 0, 0, 0, 0}; 51 51 52 void show_icon(image *screen, window_manager *wm,int x, int y, int icw, int ich, uint8_t *buf)52 void show_icon(image *screen, int x, int y, int icw, int ich, uint8_t *buf) 53 53 { 54 54 short cx1,cy1,cx2,cy2; … … 79 79 80 80 81 void scroller::area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm)81 void scroller::area(int &x1, int &y1, int &x2, int &y2) 82 82 { 83 area_config( wm);83 area_config(); 84 84 x1=x-1; y1=y-1; 85 85 if (vert) … … 112 112 113 113 114 void scroller::draw_first(image *screen , window_manager *wm)114 void scroller::draw_first(image *screen) 115 115 { 116 116 if (sx>=t) sx=t-1; 117 draw(0,screen ,wm);117 draw(0,screen); 118 118 screen->wiget_bar(b1x(),b1y(),b1x()+bw()-1,b1y()+bh()-1, 119 119 wm->bright_color(),wm->medium_color(),wm->dark_color()); 120 120 screen->wiget_bar(b2x(),b2y(),b2x()+bw()-1,b2y()+bh()-1, 121 121 wm->bright_color(),wm->medium_color(),wm->dark_color()); 122 show_icon(screen, wm,b1x()+2,b1y()+2,bw()-4,bh()-4,b1());123 show_icon(screen, wm,b2x()+2,b2y()+2,bw()-4,bh()-4,b2());122 show_icon(screen,b1x()+2,b1y()+2,bw()-4,bh()-4,b1()); 123 show_icon(screen,b2x()+2,b2y()+2,bw()-4,bh()-4,b2()); 124 124 125 125 int x1,y1,x2,y2; … … 127 127 screen->bar(x1,y1,x2,y2,wm->black()); 128 128 screen->bar(x1+1,y1+1,x2-1,y2-1,wm->medium_color()); 129 draw_wiget(screen, wm,0);130 scroll_event(sx,screen ,wm);129 draw_wiget(screen,0); 130 scroll_event(sx,screen); 131 131 } 132 132 … … 154 154 155 155 156 void scroller::draw_wiget(image *screen, window_manager *wm,int erase)156 void scroller::draw_wiget(image *screen, int erase) 157 157 { 158 158 int x1,y1,x2,y2; … … 165 165 } 166 166 167 void scroller::draw(int active, image *screen , window_manager *wm)167 void scroller::draw(int active, image *screen) 168 168 { 169 169 int x1,y1,x2,y2; 170 area(x1,y1,x2,y2 ,wm);170 area(x1,y1,x2,y2); 171 171 screen->rectangle(x1,y1,x2,y2,active ? wm->bright_color() : wm->dark_color()); 172 172 } 173 173 174 174 175 void scroller::handle_event(event &ev, image *screen, window_manager *wm,input_manager *inm)175 void scroller::handle_event(event &ev, image *screen, input_manager *inm) 176 176 { 177 177 int mx=ev.mouse_move.x,my=ev.mouse_move.y; … … 186 186 if (sx>0) 187 187 { 188 draw_wiget(screen, wm,1);188 draw_wiget(screen,1); 189 189 sx--; 190 draw_wiget(screen, wm,0);191 scroll_event(sx,screen ,wm);190 draw_wiget(screen,0); 191 scroll_event(sx,screen); 192 192 } 193 193 } else if (mx>=b2x() && mx<b2x()+bw() && my>=b2y() && my<=b2y()+bh()) … … 195 195 if (sx<t-1) 196 196 { 197 draw_wiget(screen, wm,1);197 draw_wiget(screen,1); 198 198 sx++; 199 draw_wiget(screen, wm,0);200 scroll_event(sx,screen ,wm);199 draw_wiget(screen,0); 200 scroll_event(sx,screen); 201 201 } 202 202 } … … 219 219 if (nx!=sx && nx>=0 && nx<t) 220 220 { 221 draw_wiget(screen, wm,1);221 draw_wiget(screen,1); 222 222 sx=nx; 223 draw_wiget(screen, wm,0);224 scroll_event(sx,screen ,wm);223 draw_wiget(screen,0); 224 scroll_event(sx,screen); 225 225 } 226 226 } 227 } else handle_inside_event(ev,screen, wm,inm);227 } else handle_inside_event(ev,screen,inm); 228 228 } 229 229 } else if (!ev.mouse_button && drag!=-1) … … 242 242 if (nx!=sx) 243 243 { 244 draw_wiget(screen, wm,1);244 draw_wiget(screen,1); 245 245 sx=nx; 246 draw_wiget(screen, wm,0);247 scroll_event(sx,screen ,wm);246 draw_wiget(screen,0); 247 scroll_event(sx,screen); 248 248 } 249 249 } else if ( activate_on_mouse_move()) … … 252 252 wig_area(x1,y1,x2,y2); 253 253 if (mx>=x && mx<=x+l-1 && my>=y && my<=y+h-1) 254 handle_inside_event(ev,screen, wm,inm);254 handle_inside_event(ev,screen,inm); 255 255 } 256 256 … … 261 261 { 262 262 case JK_LEFT : 263 { handle_left(screen, wm,inm); } break;263 { handle_left(screen,inm); } break; 264 264 case JK_RIGHT : 265 { handle_right(screen, wm,inm); } break;265 { handle_right(screen,inm); } break; 266 266 case JK_UP : 267 { handle_up(screen, wm,inm); } break;267 { handle_up(screen,inm); } break; 268 268 case JK_DOWN : 269 { handle_down(screen, wm,inm); } break;269 { handle_down(screen,inm); } break; 270 270 271 271 default : 272 handle_inside_event(ev,screen, wm,inm);272 handle_inside_event(ev,screen,inm); 273 273 } 274 274 } break; … … 277 277 278 278 279 void scroller::handle_right(image *screen, window_manager *wm,input_manager *inm)279 void scroller::handle_right(image *screen, input_manager *inm) 280 280 { 281 281 if (!vert && sx<t-1) 282 282 { 283 draw_wiget(screen, wm,1);283 draw_wiget(screen,1); 284 284 sx++; 285 draw_wiget(screen, wm,0);286 scroll_event(sx,screen ,wm);287 } 288 } 289 290 void scroller::handle_left(image *screen, window_manager *wm,input_manager *inm)285 draw_wiget(screen,0); 286 scroll_event(sx,screen); 287 } 288 } 289 290 void scroller::handle_left(image *screen, input_manager *inm) 291 291 { 292 292 if (!vert && sx>1) 293 293 { 294 draw_wiget(screen, wm,1);294 draw_wiget(screen,1); 295 295 sx--; 296 draw_wiget(screen, wm,0);297 scroll_event(sx,screen ,wm);298 } 299 } 300 301 void scroller::handle_up(image *screen, window_manager *wm,input_manager *inm)296 draw_wiget(screen,0); 297 scroll_event(sx,screen); 298 } 299 } 300 301 void scroller::handle_up(image *screen, input_manager *inm) 302 302 { 303 303 if (vert && sx>1) 304 304 { 305 draw_wiget(screen, wm,1);305 draw_wiget(screen,1); 306 306 sx--; 307 draw_wiget(screen, wm,0);308 scroll_event(sx,screen ,wm);309 } 310 } 311 312 void scroller::handle_down(image *screen, window_manager *wm,input_manager *inm)307 draw_wiget(screen,0); 308 scroll_event(sx,screen); 309 } 310 } 311 312 void scroller::handle_down(image *screen, input_manager *inm) 313 313 { 314 314 if (vert && sx<t-1) 315 315 { 316 draw_wiget(screen, wm,1);316 draw_wiget(screen,1); 317 317 sx++; 318 draw_wiget(screen, wm,0);319 scroll_event(sx,screen ,wm);320 } 321 } 322 323 void scroller::set_x (int x, image *screen , window_manager *wm)318 draw_wiget(screen,0); 319 scroll_event(sx,screen); 320 } 321 } 322 323 void scroller::set_x (int x, image *screen) 324 324 { 325 325 if (x<0) x=0; … … 327 327 if (x!=sx) 328 328 { 329 draw_wiget(screen, wm,1);329 draw_wiget(screen,1); 330 330 sx=x; 331 draw_wiget(screen, wm,0);332 scroll_event(sx,screen ,wm);331 draw_wiget(screen,0); 332 scroll_event(sx,screen); 333 333 } 334 334 } … … 356 356 357 357 358 void scroller::scroll_event(int newx, image *screen , window_manager *wm)358 void scroller::scroll_event(int newx, image *screen) 359 359 { 360 360 screen->bar(x,y,x+l-1,y+h-1,wm->black()); … … 370 370 } 371 371 372 void pick_list::area_config( window_manager *wm)372 void pick_list::area_config() 373 373 { 374 374 l=wid*wm->font()->width(); … … 407 407 } 408 408 409 void pick_list::handle_inside_event(event &ev, image *screen, window_manager *wm,input_manager *inm)409 void pick_list::handle_inside_event(event &ev, image *screen, input_manager *inm) 410 410 { 411 411 if (ev.type==EV_MOUSE_MOVE && activate_on_mouse_move()) … … 415 415 { 416 416 cur_sel=sel; 417 scroll_event(last_sel,screen ,wm);417 scroll_event(last_sel,screen); 418 418 } 419 419 } … … 428 428 { 429 429 cur_sel=sel; 430 scroll_event(last_sel,screen ,wm);430 scroll_event(last_sel,screen); 431 431 } 432 432 } … … 448 448 sx=found; 449 449 cur_sel=found; 450 scroll_event(sx,screen ,wm);450 scroll_event(sx,screen); 451 451 } else key_hist_total=0; 452 452 } 453 453 } 454 454 455 void pick_list::handle_up(image *screen, window_manager *wm,input_manager *inm)455 void pick_list::handle_up(image *screen, input_manager *inm) 456 456 { 457 457 if (cur_sel>0) … … 460 460 if (cur_sel<sx) 461 461 { 462 draw_wiget(screen, wm,1);462 draw_wiget(screen,1); 463 463 sx=cur_sel; 464 draw_wiget(screen, wm,0);465 } 466 scroll_event(sx,screen ,wm);467 } 468 469 void pick_list::handle_down(image *screen, window_manager *wm,input_manager *inm)464 draw_wiget(screen,0); 465 } 466 scroll_event(sx,screen); 467 } 468 469 void pick_list::handle_down(image *screen, input_manager *inm) 470 470 { 471 471 if (cur_sel<t-1) … … 474 474 if (cur_sel>sx+th-1) 475 475 { 476 draw_wiget(screen, wm,1);476 draw_wiget(screen,1); 477 477 sx=cur_sel-th+1; 478 draw_wiget(screen, wm,0);479 } 480 scroll_event(sx,screen ,wm);481 } 482 483 void pick_list::scroll_event(int newx, image *screen , window_manager *wm)478 draw_wiget(screen,0); 479 } 480 scroll_event(sx,screen); 481 } 482 483 void pick_list::scroll_event(int newx, image *screen) 484 484 { 485 485 last_sel=newx; … … 569 569 } 570 570 571 void spicker::draw_background( window_manager *wm,image *screen)571 void spicker::draw_background(image *screen) 572 572 { 573 573 screen->bar(x,y,x+l-1,y+h-1,wm->dark_color()); … … 575 575 576 576 577 void spicker::area_config( window_manager *wm)577 void spicker::area_config() 578 578 { 579 579 if (vert) 580 l=item_width( wm)+4;580 l=item_width()+4; 581 581 else 582 l=item_width( wm)*c+4;582 l=item_width()*c+4; 583 583 584 584 if (vert) 585 h=item_height( wm)*r+4;585 h=item_height()*r+4; 586 586 else 587 h=item_height( wm)+4;588 589 } 590 591 void spicker::set_x(int x, image *screen , window_manager *wm)587 h=item_height()+4; 588 589 } 590 591 void spicker::set_x(int x, image *screen) 592 592 { 593 593 cur_sel=x; 594 594 sx=x; 595 scroll_event(x,screen ,wm);596 } 597 598 599 void spicker::scroll_event(int newx, image *screen , window_manager *wm)595 scroll_event(x,screen); 596 } 597 598 599 void spicker::scroll_event(int newx, image *screen) 600 600 { 601 601 last_sel=newx; … … 603 603 xo=x+2; 604 604 yo=y+2; 605 if (vert) { xa=0; ya=item_height( wm); }606 else { xa=item_width( wm); ya=0; }607 draw_background( wm,screen);605 if (vert) { xa=0; ya=item_height(); } 606 else { xa=item_width(); ya=0; } 607 draw_background(screen); 608 608 609 609 for (int i=newx;i<newx+vis();i++) … … 612 612 { 613 613 if (m) 614 draw_item( wm,screen,xo,yo,i,get_select(i));614 draw_item(screen,xo,yo,i,get_select(i)); 615 615 else 616 draw_item( wm,screen,xo,yo,i,i==cur_sel);616 draw_item(screen,xo,yo,i,i==cur_sel); 617 617 } 618 618 xo+=xa; yo+=ya; … … 621 621 622 622 623 void spicker::handle_inside_event(event &ev, image *screen, window_manager *wm,input_manager *inm)623 void spicker::handle_inside_event(event &ev, image *screen, input_manager *inm) 624 624 { 625 625 switch (ev.type) … … 631 631 int me; 632 632 if (vert) 633 me=last_sel+(ev.mouse_move.y-y)/item_height( wm);633 me=last_sel+(ev.mouse_move.y-y)/item_height(); 634 634 else 635 me=last_sel+(ev.mouse_move.x-x)/item_width( wm);635 me=last_sel+(ev.mouse_move.x-x)/item_width(); 636 636 if (me<t && me>=0) 637 637 { … … 639 639 { 640 640 cur_sel=me; 641 scroll_event(last_sel,screen ,wm);642 note_new_current( wm,screen,inm,me);641 scroll_event(last_sel,screen); 642 note_new_current(screen,inm,me); 643 643 } 644 644 } … … 649 649 int me; 650 650 if (vert) 651 me=last_sel+(ev.mouse_move.y-y)/item_height( wm);651 me=last_sel+(ev.mouse_move.y-y)/item_height(); 652 652 else 653 me=last_sel+(ev.mouse_move.x-x)/item_width( wm);653 me=last_sel+(ev.mouse_move.x-x)/item_width(); 654 654 if (me<t && me>=0) 655 655 { … … 661 661 { 662 662 set_select(me,!get_select(me)); 663 scroll_event(last_sel,screen ,wm);663 scroll_event(last_sel,screen); 664 664 inm->grab_focus(this); 665 665 } … … 669 669 { 670 670 if (cur_sel==me) 671 note_selection( wm,screen,inm,me);671 note_selection(screen,inm,me); 672 672 else 673 673 { 674 674 cur_sel=me; 675 scroll_event(last_sel,screen ,wm);676 note_new_current( wm,screen,inm,me);675 scroll_event(last_sel,screen); 676 note_new_current(screen,inm,me); 677 677 } 678 678 } … … 684 684 685 685 686 void spicker::handle_up(image *screen, window_manager *wm,input_manager *inm)686 void spicker::handle_up(image *screen, input_manager *inm) 687 687 { 688 688 if (vert && cur_sel>0) … … 692 692 if (cur_sel<sx) 693 693 { 694 draw_wiget(screen, wm,1);694 draw_wiget(screen,1); 695 695 last_sel=sx=cur_sel; 696 draw_wiget(screen, wm,0);696 draw_wiget(screen,0); 697 697 } 698 scroll_event(last_sel,screen ,wm);699 note_new_current( wm,screen,inm,cur_sel);700 } 701 } 702 703 void spicker::handle_down(image *screen, window_manager *wm,input_manager *inm)698 scroll_event(last_sel,screen); 699 note_new_current(screen,inm,cur_sel); 700 } 701 } 702 703 void spicker::handle_down(image *screen, input_manager *inm) 704 704 { 705 705 if (vert && cur_sel<t-1) … … 708 708 if (cur_sel>sx+r-1) 709 709 { 710 draw_wiget(screen, wm,1);710 draw_wiget(screen,1); 711 711 last_sel=sx=cur_sel-r+1; 712 draw_wiget(screen, wm,0);713 } 714 scroll_event(sx,screen ,wm);715 note_new_current( wm,screen,inm,cur_sel);716 } 717 718 void spicker::handle_left(image *screen, window_manager *wm,input_manager *inm)719 { 720 } 721 722 void spicker::handle_right(image *screen, window_manager *wm,input_manager *inm)723 { 724 } 725 726 727 728 712 draw_wiget(screen,0); 713 } 714 scroll_event(sx,screen); 715 note_new_current(screen,inm,cur_sel); 716 } 717 718 void spicker::handle_left(image *screen, input_manager *inm) 719 { 720 } 721 722 void spicker::handle_right(image *screen, input_manager *inm) 723 { 724 } 725 726 727 728 -
abuse/trunk/src/imlib/scroller.hpp
r57 r106 33 33 int wig_x(); 34 34 int darea() { return (l-bw()-2)-bw()-bw(); } 35 void draw_wiget(image *screen, window_manager *wm,int erase);35 void draw_wiget(image *screen, int erase); 36 36 int mouse_to_drag(int mx,int my); 37 37 public : 38 38 int t,sx; 39 39 scroller(int X, int Y, int ID, int L, int H, int Vert, int Total_items, ifield *Next); 40 virtual void area(int &x1, int &y1, int &x2, int &y2 , window_manager *wm);41 virtual void draw_first(image *screen , window_manager *wm);42 virtual void draw(int active, image *screen , window_manager *wm);43 virtual void handle_event(event &ev, image *screen, window_manager *wm,input_manager *im);40 virtual void area(int &x1, int &y1, int &x2, int &y2); 41 virtual void draw_first(image *screen); 42 virtual void draw(int active, image *screen); 43 virtual void handle_event(event &ev, image *screen, input_manager *im); 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, window_manager *wm,input_manager *inm) {;}48 virtual void scroll_event(int newx, image *screen , window_manager *wm);49 virtual void handle_up(image *screen, window_manager *wm,input_manager *inm);50 virtual void handle_down(image *screen, window_manager *wm,input_manager *inm);51 virtual void handle_left(image *screen, window_manager *wm,input_manager *inm);52 virtual void handle_right(image *screen, window_manager *wm,input_manager *inm);53 virtual void area_config( window_manager *wm) { ; }47 virtual void handle_inside_event(event &ev, image *screen, input_manager *inm) {;} 48 virtual void scroll_event(int newx, image *screen); 49 virtual void handle_up(image *screen, input_manager *inm); 50 virtual void handle_down(image *screen, input_manager *inm); 51 virtual void handle_left(image *screen, input_manager *inm); 52 virtual void handle_right(image *screen, input_manager *inm); 53 virtual void area_config() { ; } 54 54 void set_size(int width, int height) { l=width; h=height; } 55 virtual void set_x(int x, image *screen , window_manager *wm);55 virtual void set_x(int x, image *screen); 56 56 } ; 57 57 … … 64 64 spicker(int X, int Y, int ID, int Rows, int Cols, int Vert, int MultiSelect, ifield *Next); 65 65 int vis() { if (vert) return r; else return c; } 66 virtual void area_config( window_manager *wm);66 virtual void area_config(); 67 67 void set_select(int x, int on); 68 68 int get_select(int x); 69 69 int first_selected(); 70 virtual void scroll_event(int newx, image *screen , window_manager *wm);71 virtual void handle_inside_event(event &ev, image *screen, window_manager *wm,input_manager *inm);70 virtual void scroll_event(int newx, image *screen); 71 virtual void handle_inside_event(event &ev, image *screen, input_manager *inm); 72 72 73 73 // you should define \/ 74 virtual void draw_background( window_manager *wm,image *screen);75 virtual void draw_item( window_manager *wm,image *screen, int x, int y, int num, int active) = 0;74 virtual void draw_background(image *screen); 75 virtual void draw_item(image *screen, int x, int y, int num, int active) = 0; 76 76 virtual int total() = 0; 77 virtual int item_width( window_manager *wm) = 0;78 virtual int item_height( window_manager *wm) = 0;79 virtual void note_selection( window_manager *wm,image *screen, input_manager *inm, int x) { ; }80 virtual void note_new_current( window_manager *wm,image *screen, input_manager *inm, int x) { ; }77 virtual int item_width() = 0; 78 virtual int item_height() = 0; 79 virtual void note_selection(image *screen, input_manager *inm, int x) { ; } 80 virtual void note_new_current(image *screen, input_manager *inm, int x) { ; } 81 81 virtual int ok_to_select(int num) { return 1; } 82 virtual void handle_up(image *screen, window_manager *wm,input_manager *inm);83 virtual void handle_down(image *screen, window_manager *wm,input_manager *inm);84 virtual void handle_left(image *screen, window_manager *wm,input_manager *inm);85 virtual void handle_right(image *screen, window_manager *wm,input_manager *inm);86 virtual void set_x(int x, image *screen , window_manager *wm);82 virtual void handle_up(image *screen, input_manager *inm); 83 virtual void handle_down(image *screen, input_manager *inm); 84 virtual void handle_left(image *screen, input_manager *inm); 85 virtual void handle_right(image *screen, input_manager *inm); 86 virtual void set_x(int x, image *screen); 87 87 void reconfigure(); // should be called by constructor after class is ready to take virtual calls 88 88 ~spicker() { if (select) jfree(select); } … … 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, window_manager *wm,input_manager *inm);107 virtual void scroll_event(int newx, image *screen , window_manager *wm);106 virtual void handle_inside_event(event &ev, image *screen, input_manager *inm); 107 virtual void scroll_event(int newx, image *screen); 108 108 virtual char *read() { return (char *)this; } 109 virtual void area_config( window_manager *wm);110 virtual void handle_up(image *screen, window_manager *wm,input_manager *inm);111 virtual void handle_down(image *screen, window_manager *wm,input_manager *inm);109 virtual void area_config(); 110 virtual void handle_up(image *screen, input_manager *inm); 111 virtual void handle_down(image *screen, input_manager *inm); 112 112 int get_selection() { return lis[cur_sel].number; } 113 113 ~pick_list() { jfree(lis); } -
abuse/trunk/src/imlib/tools.cpp
r56 r106 21 21 } 22 22 23 void tool_picker::remap(palette *pal, window_manager *wm,image *screen)23 void tool_picker::remap(palette *pal, image *screen) 24 24 { 25 25 delete map; 26 26 map=new filter(old_pal,pal); 27 draw_first(screen ,wm);27 draw_first(screen); 28 28 } 29 29 30 30 tool_picker::tool_picker(int X, int Y, int ID, 31 31 int show_h, visual_object **Icons, int *Ids, int total_ic, 32 palette *icon_palette, palette *pal, window_manager *wm,ifield *Next) :32 palette *icon_palette, palette *pal, ifield *Next) : 33 33 spicker(X,Y,ID,show_h,1,1,0,Next) 34 34 { … … 39 39 for (int i=0;i<total_ic;i++) 40 40 { 41 if (icons[i]->width( wm)>iw) iw=icons[i]->width(wm);42 if (icons[i]->height( wm)>ih) ih=icons[i]->height(wm);41 if (icons[i]->width()>iw) iw=icons[i]->width(); 42 if (icons[i]->height()>ih) ih=icons[i]->height(); 43 43 } 44 44 map=new filter(icon_palette,pal); … … 47 47 } 48 48 49 void tool_picker::draw_item( window_manager *wm,image *screen, int x, int y, int num, int active)49 void tool_picker::draw_item(image *screen, int x, int y, int num, int active) 50 50 { 51 51 if (!active) … … 53 53 else 54 54 screen->bar(x,y,x+iw-1,y+ih-1,wm->bright_color()); 55 icons[num]->draw(screen,x,y, wm,map);55 icons[num]->draw(screen,x,y,map); 56 56 } 57 57 -
abuse/trunk/src/imlib/tools.hpp
r57 r106 31 31 tool_picker(int X, int Y, int ID, 32 32 int show_h, visual_object **Icons, int *Ids, int total_ic, 33 palette *icon_palette, palette *pal, window_manager *wm,ifield *Next);33 palette *icon_palette, palette *pal, ifield *Next); 34 34 35 virtual void draw_item( window_manager *wm,image *screen, int x, int y, int num, int active);35 virtual void draw_item(image *screen, int x, int y, int num, int active); 36 36 virtual int total() { return total_icons; } 37 virtual int item_width( window_manager *wm) { return iw; }38 virtual int item_height( window_manager *wm) { return ih; }39 virtual void note_new_current( window_manager *wm,image *screen, input_manager *inm, int x)37 virtual int item_width() { return iw; } 38 virtual int item_height() { return ih; } 39 virtual void note_new_current(image *screen, input_manager *inm, int x) 40 40 { wm->push_event(new event(ids[x],NULL)); } 41 41 42 void remap(palette *pal, window_manager *wm,image *screen);42 void remap(palette *pal, image *screen); 43 43 ~tool_picker(); 44 44 } ; -
abuse/trunk/src/imlib/visobj.cpp
r56 r106 10 10 #include "config.h" 11 11 12 #include "input.hpp" 12 13 #include "visobj.hpp" 13 14 14 15 void image_visual::draw(image *screen, int x, int y, 15 window_manager *wm,filter *f)16 filter *f) 16 17 { 17 18 if (f) … … 30 31 31 32 32 int string_visual::width( window_manager *wm)33 int string_visual::width() 33 34 { 34 35 if (w==-1) // not calculated yet … … 51 52 } 52 53 53 int string_visual::height( window_manager *wm)54 int string_visual::height() 54 55 { 55 if (w==-1) width( wm);56 if (w==-1) width(); 56 57 return h; 57 58 } … … 78 79 } 79 80 80 void string_visual::draw(image *screen, int x, int y, 81 window_manager *wm, filter *f) 81 void string_visual::draw(image *screen, int x, int y, filter *f) 82 82 83 83 { -
abuse/trunk/src/imlib/visobj.hpp
r57 r106 17 17 { 18 18 public : 19 virtual void draw(image *screen, int x, int y, window_manager *wm,filter *f) = 0;20 virtual int width( window_manager *wm) = 0;21 virtual int height( window_manager *wm) = 0;19 virtual void draw(image *screen, int x, int y, filter *f) = 0; 20 virtual int width() = 0; 21 virtual int height() = 0; 22 22 virtual ~visual_object() {} 23 23 } ; … … 31 31 32 32 image_visual(image *img) { im=img; } 33 virtual void draw(image *screen, int x, int y, 34 window_manager *wm, filter *f); 35 virtual int width(window_manager *wm) { return im->width(); } 36 virtual int height(window_manager *wm) { return im->height(); } 33 virtual void draw(image *screen, int x, int y, filter *f); 34 virtual int width() { return im->width(); } 35 virtual int height() { return im->height(); } 37 36 } ; 38 37 … … 45 44 public : 46 45 string_visual(char *string, int Color); 47 virtual void draw(image *screen, int x, int y, 48 window_manager *wm, filter *f); 49 virtual int width(window_manager *wm); 50 virtual int height(window_manager *wm); 46 virtual void draw(image *screen, int x, int y, filter *f); 47 virtual int width(); 48 virtual int height(); 51 49 } ; 52 50 -
abuse/trunk/src/innet.cpp
r90 r106 542 542 543 543 544 jwindow *j= eh->new_window(0,yres/2,-1,-1,new info_field(WINDOW_FRAME_LEFT,544 jwindow *j=wm->new_window(0,yres/2,-1,-1,new info_field(WINDOW_FRAME_LEFT, 545 545 WINDOW_FRAME_TOP, 546 546 0,symbol_str("resync"), 547 547 new button(WINDOW_FRAME_LEFT, 548 WINDOW_FRAME_TOP+ eh->font()->height()+5,ID_NET_DISCONNECT,548 WINDOW_FRAME_TOP+wm->font()->height()+5,ID_NET_DISCONNECT, 549 549 symbol_str("slack"),NULL)),symbol_str("hold!")) 550 550 ; … … 552 552 553 553 554 eh->flush_screen();554 wm->flush_screen(); 555 555 if (!reload_start()) return ; 556 556 … … 561 561 { 562 562 service_net_request(); 563 if ( eh->event_waiting())563 if (wm->event_waiting()) 564 564 { 565 565 event ev; 566 566 do 567 567 { 568 eh->get_event(ev);568 wm->get_event(ev); 569 569 if (ev.type==EV_MESSAGE && ev.message.id==ID_NET_DISCONNECT) 570 570 { … … 573 573 } 574 574 575 } while ( eh->event_waiting());575 } while (wm->event_waiting()); 576 576 577 eh->flush_screen();577 wm->flush_screen(); 578 578 } 579 579 580 580 } while (!reload_end()); 581 eh->close_window(j);581 wm->close_window(j); 582 582 unlink(NET_STARTFILE); 583 583 … … 651 651 if (total_retry==12000) // 2 minutes and nothing 652 652 { 653 abort= eh->new_window(0,yres/2,-1,eh->font()->height()*4,653 abort=wm->new_window(0,yres/2,-1,wm->font()->height()*4, 654 654 new info_field(WINDOW_FRAME_LEFT, 655 655 WINDOW_FRAME_TOP, 656 656 0,symbol_str("waiting"), 657 657 new button(WINDOW_FRAME_LEFT, 658 WINDOW_FRAME_TOP+ eh->font()->height()+5,ID_NET_DISCONNECT,658 WINDOW_FRAME_TOP+wm->font()->height()+5,ID_NET_DISCONNECT, 659 659 symbol_str("slack"),NULL)),symbol_str("Error")); 660 eh->flush_screen();660 wm->flush_screen(); 661 661 } 662 662 } 663 663 if (abort) 664 664 { 665 if ( eh->event_waiting())665 if (wm->event_waiting()) 666 666 { 667 667 event ev; 668 668 do 669 669 { 670 eh->get_event(ev);670 wm->get_event(ev); 671 671 if (ev.type==EV_MESSAGE && ev.message.id==ID_NET_DISCONNECT) 672 672 { … … 674 674 base->input_state=INPUT_PROCESSING; 675 675 } 676 } while ( eh->event_waiting());677 678 eh->flush_screen();676 } while (wm->event_waiting()); 677 678 wm->flush_screen(); 679 679 } 680 680 } … … 683 683 if (abort) 684 684 { 685 eh->close_window(abort);685 wm->close_window(abort); 686 686 the_game->reset_keymap(); 687 687 -
abuse/trunk/src/level.cpp
r56 r106 787 787 { 788 788 c1=morph_sel_frame_color; 789 c2= eh->bright_color();789 c2=wm->bright_color(); 790 790 } else 791 791 { 792 792 c2=morph_sel_frame_color; 793 c1= eh->bright_color();793 c1=wm->bright_color(); 794 794 } 795 795 … … 1630 1630 sd.add_by_hand(new spec_entry(SPEC_DATA_ARRAY,"player_names",NULL,name_len,0)); 1631 1631 1632 sd.add_by_hand(new spec_entry(SPEC_IMAGE,"thumb nail",NULL,4+160*(100+ eh->font()->height()*2),0));1632 sd.add_by_hand(new spec_entry(SPEC_IMAGE,"thumb nail",NULL,4+160*(100+wm->font()->height()*2),0)); 1633 1633 } 1634 1634 … … 1642 1642 void level::write_thumb_nail(bFILE *fp, image *im) 1643 1643 { 1644 image *i=new image(160,100+ eh->font()->height()*2);1644 image *i=new image(160,100+wm->font()->height()*2); 1645 1645 i->clear(); 1646 1646 scale_put(im,i,0,0,160,100); 1647 1647 if (first_name) 1648 eh->font()->put_string(i,80-strlen(first_name)*eh->font()->width()/2,100,first_name);1648 wm->font()->put_string(i,80-strlen(first_name)*wm->font()->width()/2,100,first_name); 1649 1649 1650 1650 time_t t; … … 1653 1653 1654 1654 strftime(buf,80,"%T %A %B %d",localtime(&t)); 1655 eh->font()->put_string(i,80-strlen(buf)*eh->font()->width()/2,100+eh->font()->height(),buf);1655 wm->font()->put_string(i,80-strlen(buf)*wm->font()->width()/2,100+wm->font()->height(),buf); 1656 1656 1657 1657 fp->write_uint16(i->width()); -
abuse/trunk/src/loadgame.cpp
r88 r106 73 73 buts[i]->next=buts[i+1]; 74 74 75 return eh->new_window(mx,yres/2-(WINDOW_FRAME_TOP+ih*5)/2,-1,-1,buts[0]);75 return wm->new_window(mx,yres/2-(WINDOW_FRAME_TOP+ih*5)/2,-1,-1,buts[0]); 76 76 } 77 77 … … 103 103 do 104 104 { 105 eh->flush_screen();106 eh->get_event(ev);105 wm->flush_screen(); 106 wm->get_event(ev); 107 107 if (ev.type==EV_MESSAGE && ev.message.id>=ID_LOAD_GAME_NUMBER && ev.message.id<ID_LOAD_GAME_PREVIEW) 108 108 got_level=ev.message.id-ID_LOAD_GAME_NUMBER+1; … … 113 113 } while (!got_level && !quit); 114 114 115 eh->close_window(l_win);115 wm->close_window(l_win); 116 116 the_game->reset_keymap(); 117 117 return got_level; … … 220 220 221 221 jwindow *l_win=create_num_window(0,total_saved,thumb_nails); 222 jwindow *preview= eh->new_window(l_win->x+l_win->l+5,l_win->y,max_w,max_h,NULL,title);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()); … … 229 229 do 230 230 { 231 eh->flush_screen();232 eh->get_event(ev);231 wm->flush_screen(); 232 wm->get_event(ev); 233 233 if (ev.type==EV_MESSAGE && ev.message.id>=ID_LOAD_GAME_NUMBER && ev.message.id<ID_LOAD_GAME_PREVIEW) 234 234 got_level=ev.message.id-ID_LOAD_GAME_NUMBER+1; … … 245 245 } while (!got_level && !quit); 246 246 247 eh->close_window(l_win);248 eh->close_window(preview);247 wm->close_window(l_win); 248 wm->close_window(preview); 249 249 250 250 for (i=0;i<total_saved;i++) -
abuse/trunk/src/menu.cpp
r88 r106 148 148 int tl=strlen(title)*font->width(); 149 149 int tx=screen->width()/2-tl/2; 150 dark_wiget(tx-2,my-font->height()-4,tx+tl+2,my-2, eh->medium_color(),eh->dark_color(),180);151 font->put_string(screen,tx+1,my-font->height()-2,title, eh->bright_color());150 dark_wiget(tx-2,my-font->height()-4,tx+tl+2,my-2,wm->medium_color(),wm->dark_color(),180); 151 font->put_string(screen,tx+1,my-font->height()-2,title,wm->bright_color()); 152 152 } 153 153 154 dark_wiget(mx,my,mx+mw-1,my+mh-1, eh->medium_color(),eh->dark_color(),200);154 dark_wiget(mx,my,mx+mw-1,my+mh-1,wm->medium_color(),wm->dark_color(),200); 155 155 156 156 … … 159 159 { 160 160 char *ms=men_str(CAR(c)); 161 font->put_string(screen,mx+10+1,y+1,ms, eh->black());162 font->put_string(screen,mx+10,y,ms, eh->bright_color());161 font->put_string(screen,mx+10+1,y+1,ms,wm->black()); 162 font->put_string(screen,mx+10,y,ms,wm->bright_color()); 163 163 y+=font->height()+1; 164 164 } 165 165 166 eh->flush_screen();166 wm->flush_screen(); 167 167 event ev; 168 168 int choice=0,done=0; … … 176 176 do 177 177 { 178 eh->flush_screen();179 if ( eh->event_waiting())180 { 181 eh->get_event(ev);178 wm->flush_screen(); 179 if (wm->event_waiting()) 180 { 181 wm->get_event(ev); 182 182 if (ev.type==EV_KEY) 183 183 { … … 228 228 229 229 char *cur=men_str(nth(choice,args)); 230 font->put_string(screen,mx+10+1,by1+3,cur, eh->black());231 font->put_string(screen,mx+10,by1+2,cur, eh->bright_color());232 screen->rectangle(mx+1,by1,mx+mw-2,by2, eh->bright_color());230 font->put_string(screen,mx+10+1,by1+3,cur,wm->black()); 231 font->put_string(screen,mx+10,by1+2,cur,wm->bright_color()); 232 screen->rectangle(mx+1,by1,mx+mw-2,by2,wm->bright_color()); 233 233 234 234 color+=cdir; … … 239 239 color+=cdir; 240 240 } 241 eh->flush_screen();241 wm->flush_screen(); 242 242 save->put_image(screen,mx+1,by1); 243 243 } else milli_wait(10); … … 287 287 static void create_volume_window() 288 288 { 289 /* int vx=WINDOW_FRAME_LEFT,vy=WINDOW_FRAME_TOP+ eh->font()->height()*2,scroller_height=130,bh=eh->font()->height()+5;290 291 volume_window= eh->new_window(prop->getd("volume_x",xres/2-20),289 /* int vx=WINDOW_FRAME_LEFT,vy=WINDOW_FRAME_TOP+wm->font()->height()*2,scroller_height=130,bh=wm->font()->height()+5; 290 291 volume_window=wm->new_window(prop->getd("volume_x",xres/2-20), 292 292 prop->getd("volume_y",yres/2-50), 293 293 -1, … … 299 299 do 300 300 { 301 eh->flush_screen();302 eh->get_event(ev);301 wm->flush_screen(); 302 wm->get_event(ev); 303 303 if (ev.type==EV_CLOSE_WINDOW && ev.window==volume_window) done=1; 304 304 } while (!done); 305 eh->close_window(volume_window);305 wm->close_window(volume_window); 306 306 volume_window=NULL; */ 307 307 … … 320 320 slider=cash.reg(ff,"volume_slide",t,1); 321 321 322 volume_window= eh->new_window(prop->getd("volume_x",xres/2-20),322 volume_window=wm->new_window(prop->getd("volume_x",xres/2-20), 323 323 prop->getd("volume_y",yres/2-50), 324 324 41-WINDOW_FRAME_LEFT-WINDOW_FRAME_RIGHT-2, … … 337 337 draw_sfx_vol(slider); 338 338 volume_window->inm->redraw(); 339 eh->grab_focus(volume_window);340 eh->flush_screen();339 wm->grab_focus(volume_window); 340 wm->flush_screen(); 341 341 342 342 volume_window->inm->allow_no_selections(); … … 346 346 do 347 347 { 348 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());349 eh->flush_screen();348 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 349 wm->flush_screen(); 350 350 if (ev.type==EV_MESSAGE) 351 351 { … … 396 396 } else if (ev.type==EV_CLOSE_WINDOW || (ev.type==EV_KEY && ev.key==JK_ESC)) 397 397 { 398 eh->close_window(volume_window);398 wm->close_window(volume_window); 399 399 volume_window=NULL; 400 400 } … … 448 448 { 449 449 image blank(2,2); blank.clear(); 450 eh->set_mouse_shape(blank.copy(),0,0); // don't show mouse450 wm->set_mouse_shape(blank.copy(),0,0); // don't show mouse 451 451 452 452 ss=symbol_value(ss); … … 459 459 event ev; 460 460 do 461 { eh->flush_screen();462 eh->get_event(ev);461 { wm->flush_screen(); 462 wm->get_event(ev); 463 463 } while (ev.type!=EV_KEY); 464 464 if (ev.key==JK_ESC && abortable) … … 467 467 ss=CDR(ss); 468 468 } 469 eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);469 wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1); 470 470 } 471 471 } … … 572 572 inm->redraw(); 573 573 fade_in(NULL,8); 574 eh->flush_screen();574 wm->flush_screen(); 575 575 576 576 } break; … … 580 580 { 581 581 if (ev.window==volume_window) 582 { eh->close_window(volume_window); volume_window=NULL; }582 { wm->close_window(volume_window); volume_window=NULL; } 583 583 } break; 584 584 } … … 708 708 list=make_default_buttons(xres-33,y,list); 709 709 710 input_manager *inm=new input_manager(screen, eh,list);710 input_manager *inm=new input_manager(screen,list); 711 711 inm->allow_no_selections(); 712 712 inm->clear_current(); … … 718 718 int stop_menu=0; 719 719 time_marker start; 720 eh->flush_screen();720 wm->flush_screen(); 721 721 do 722 722 { 723 723 time_marker new_time; 724 724 725 if ( eh->event_waiting())725 if (wm->event_waiting()) 726 726 { 727 727 do 728 728 { 729 eh->get_event(ev);730 } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());731 inm->handle_event(ev,NULL ,eh);729 wm->get_event(ev); 730 } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 731 inm->handle_event(ev,NULL); 732 732 if (ev.type==EV_KEY && ev.key==JK_ESC) 733 eh->push_event(new event(ID_QUIT,NULL));733 wm->push_event(new event(ID_QUIT,NULL)); 734 734 735 735 menu_handler(ev,inm); 736 736 start.get_time(); 737 737 738 eh->flush_screen();738 wm->flush_screen(); 739 739 } 740 740 else -
abuse/trunk/src/net/gserver.cpp
r61 r106 29 29 #include "input.hpp" 30 30 #include "dev.hpp" 31 #include "game.hpp" 31 32 32 33 extern base_memory_struct *base; … … 35 36 extern net_protocol *prot; 36 37 extern join_struct *join_array; 37 extern window_manager *eh;38 38 extern void service_net_request(); 39 39 … … 66 66 if (last_count!=total_players()) 67 67 { 68 if (stat) eh->close_window(stat);68 if (stat) wm->close_window(stat); 69 69 char msg[100]; 70 70 sprintf(msg,symbol_str("min_wait"),main_net_cfg->min_players-total_players()); 71 stat= eh->new_window(100,50,-1,-1,new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,ID_NULL,msg,72 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+ eh->font()->height()*2,71 stat=wm->new_window(100,50,-1,-1,new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,ID_NULL,msg, 72 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+wm->font()->height()*2, 73 73 ID_CANCEL,symbol_str("cancel_button"),NULL) )); 74 eh->flush_screen();74 wm->flush_screen(); 75 75 last_count=total_players(); 76 76 } 77 77 78 if ( eh->event_waiting())79 { 80 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());81 eh->flush_screen();78 if (wm->event_waiting()) 79 { 80 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 81 wm->flush_screen(); 82 82 if (ev.type==EV_MESSAGE && ev.message.id==ID_CANCEL) 83 83 abort=1; … … 88 88 if (stat) 89 89 { 90 eh->close_window(stat);91 eh->flush_screen();90 wm->close_window(stat); 91 wm->flush_screen(); 92 92 } 93 93 } -
abuse/trunk/src/netcfg.cpp
r88 r106 53 53 void net_configuration::cfg_error(char const *msg) 54 54 { 55 jwindow *j= eh->new_window(-1,0,-1,-1,new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,0,msg,55 jwindow *j=wm->new_window(-1,0,-1,-1,new info_field(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,0,msg, 56 56 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+30,CFG_ERR_OK,symbol_str("ok_button"),NULL)),symbol_str("input_error")); 57 57 event ev; 58 58 do 59 59 { 60 eh->flush_screen();61 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());60 wm->flush_screen(); 61 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 62 62 } while (ev.type!=EV_MESSAGE || ev.message.id!=CFG_ERR_OK || ev.type==EV_CLOSE_WINDOW || (ev.type==EV_KEY && ev.key==JK_ESC)); 63 eh->close_window(j);64 eh->flush_screen();63 wm->close_window(j); 64 wm->flush_screen(); 65 65 } 66 66 … … 171 171 int x=WINDOW_FRAME_LEFT,y=WINDOW_FRAME_TOP; 172 172 173 jwindow *sv= eh->new_window(50,80,-1,-1,new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,NET_SERVER,symbol_str("server"),174 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+ eh->font()->height()*2,NET_CLIENT,symbol_str("client"),175 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+ eh->font()->height()*4,NET_SINGLE,symbol_str("single_play"),176 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+ eh->font()->height()*6,NET_CANCEL,symbol_str("cancel_net"),173 jwindow *sv=wm->new_window(50,80,-1,-1,new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP,NET_SERVER,symbol_str("server"), 174 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+wm->font()->height()*2,NET_CLIENT,symbol_str("client"), 175 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+wm->font()->height()*4,NET_SINGLE,symbol_str("single_play"), 176 new button(WINDOW_FRAME_LEFT,WINDOW_FRAME_TOP+wm->font()->height()*6,NET_CANCEL,symbol_str("cancel_net"), 177 177 NULL)))),symbol_str("Networking")); 178 178 … … 181 181 do 182 182 { 183 eh->flush_screen();184 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());183 wm->flush_screen(); 184 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 185 185 if (ev.type==EV_MESSAGE) 186 186 { … … 193 193 } while (!done); 194 194 195 eh->close_window(sv);196 eh->flush_screen();195 wm->close_window(sv); 196 wm->flush_screen(); 197 197 198 198 if (state==RESTART_SINGLE) … … 228 228 i->y=y; 229 229 int x1,y1,x2,y2; 230 i->area(x1,y1,x2,y2 ,eh);230 i->area(x1,y1,x2,y2); 231 231 y=y2+2; 232 232 } 233 233 234 234 235 jwindow *nw= eh->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; 238 238 do 239 239 { 240 eh->flush_screen();241 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());240 wm->flush_screen(); 241 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 242 242 if (ev.type==EV_MESSAGE && ev.message.id==NET_OK && confirm_inputs(nw,state==RESTART_SERVER)) 243 243 done=1; … … 248 248 249 249 } while (!done); 250 eh->close_window(nw);251 eh->flush_screen();250 wm->close_window(nw); 251 wm->flush_screen(); 252 252 253 253 return ev.message.id==NET_OK; … … 265 265 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 266 266 ns->put_image(screen,x,y); 267 JCFont *fnt= eh->font();267 JCFont *fnt=wm->font(); 268 268 269 269 uint8_t *remap=white_light+30*256; … … 276 276 fy=y+ns_h/2-fnt->height(); 277 277 278 fnt->put_string(screen,fx+1,fy+1,message, eh->black());279 fnt->put_string(screen,fx,fy,message, eh->bright_color());278 fnt->put_string(screen,fx+1,fy+1,message,wm->black()); 279 fnt->put_string(screen,fx,fy,message,wm->bright_color()); 280 280 281 281 … … 288 288 button *sb=new button(bx,by,NET_SERVER,ok,NULL); 289 289 290 input_manager inm(screen, eh,sb);290 input_manager inm(screen,sb); 291 291 inm.allow_no_selections(); 292 292 inm.clear_current(); … … 296 296 do 297 297 { 298 eh->flush_screen();299 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());300 inm.handle_event(ev,NULL ,eh);298 wm->flush_screen(); 299 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 300 inm.handle_event(ev,NULL); 301 301 if ((ev.type==EV_KEY && (ev.key==JK_ESC || ev.key==JK_ENTER)) || 302 302 ev.type==EV_MESSAGE) done=1; … … 305 305 306 306 screen_backup->put_image(screen,0,0); 307 eh->flush_screen();307 wm->flush_screen(); 308 308 delete screen_backup; 309 309 } … … 313 313 { 314 314 int X1,Y1,X2,Y2; 315 i->area(X1,Y1,X2,Y2 ,eh);315 i->area(X1,Y1,X2,Y2); 316 316 i->x=(x1+x2)/2-(X2-X1)/2; 317 317 318 318 if (place_below) 319 319 { 320 place_below->area(X1,Y1,X2,Y2 ,eh);320 place_below->area(X1,Y1,X2,Y2); 321 321 i->y=Y2+2; 322 322 } … … 330 330 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 331 331 ns->put_image(screen,x,y); 332 JCFont *fnt= eh->font();332 JCFont *fnt=wm->font(); 333 333 image *ok_image=cash.img(cash.reg("art/frame.spe","dev_ok",SPEC_IMAGE,1))->copy(), 334 334 *cancel_image=cash.img(cash.reg("art/frame.spe","cancel",SPEC_IMAGE,1))->copy(); … … 356 356 357 357 358 b->arrange_left_right( eh);358 b->arrange_left_right(); 359 359 center_ifield(b,x,x+ns_w,list); 360 b->arrange_left_right( eh);360 b->arrange_left_right(); 361 361 list=b; 362 362 … … 372 372 b->add_button(new button(0,0,MAX_3,"3",NULL)); 373 373 b->add_button(new button(0,0,MAX_2,"2",NULL)); 374 b->arrange_left_right( eh);374 b->arrange_left_right(); 375 375 center_ifield(b,x,x+ns_w,list); 376 b->arrange_left_right( eh);376 b->arrange_left_right(); 377 377 list=b; 378 378 … … 386 386 b->add_button(q); 387 387 388 b->arrange_left_right( eh);388 b->arrange_left_right(); 389 389 center_ifield(b,x,x+ns_w,list); 390 b->arrange_left_right( eh);390 b->arrange_left_right(); 391 391 list=b; 392 392 … … 408 408 409 409 { 410 input_manager inm(screen, eh,list);410 input_manager inm(screen,list); 411 411 inm.allow_no_selections(); 412 412 inm.clear_current(); … … 416 416 do 417 417 { 418 eh->flush_screen();419 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());420 inm.handle_event(ev,NULL ,eh);418 wm->flush_screen(); 419 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 420 inm.handle_event(ev,NULL); 421 421 if (ev.type==EV_MESSAGE) 422 422 { … … 450 450 ns->put_image(screen,x,y); 451 451 char const *nw_s = symbol_str("Networking"); 452 JCFont *fnt= eh->font();453 454 455 eh->font()->put_string(screen,x+ns_w/2-strlen(nw_s)*fnt->width()/2,y+21/2-fnt->height()/2,456 nw_s, eh->medium_color());452 JCFont *fnt=wm->font(); 453 454 455 wm->font()->put_string(screen,x+ns_w/2-strlen(nw_s)*fnt->width()/2,y+21/2-fnt->height()/2, 456 nw_s,wm->medium_color()); 457 457 { 458 458 … … 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, eh,sb);465 input_manager inm(screen,sb); 466 466 467 467 inm.allow_no_selections(); … … 479 479 do 480 480 { 481 if ( eh->event_waiting())481 if (wm->event_waiting()) 482 482 { 483 do { eh->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && eh->event_waiting());484 inm.handle_event(ev,NULL ,eh);483 do { wm->get_event(ev); } while (ev.type==EV_MOUSE_MOVE && wm->event_waiting()); 484 inm.handle_event(ev,NULL); 485 485 if (ev.type==EV_MESSAGE) 486 486 { … … 509 509 } 510 510 511 eh->flush_screen();511 wm->flush_screen(); 512 512 char name[256]; 513 513 -
abuse/trunk/src/oldhelp.cpp
r56 r106 55 55 void make_help_page(int page, image *s) 56 56 { 57 int x=0,y=0,fw= eh->font()->width(),fh=eh->font()->height(),ya;57 int x=0,y=0,fw=wm->font()->width(),fh=wm->font()->height(),ya; 58 58 char *h,*ho,imname[30],*inp; 59 59 h=ho=get_page(page); … … 64 64 if (fp->open_failure()) 65 65 { 66 eh->font()->put_string(s,10,10,"Help file missing!");66 wm->font()->put_string(s,10,10,"Help file missing!"); 67 67 return ; 68 68 … … 82 82 if (*h=='@') 83 83 { 84 eh->font()->put_char(s,x,y,*h);84 wm->font()->put_char(s,x,y,*h); 85 85 x+=fw; 86 86 h++; … … 122 122 if (!sd.find(imname)) 123 123 { 124 eh->font()->put_string(s,0,yres-10,"Missing image!");124 wm->font()->put_string(s,0,yres-10,"Missing image!"); 125 125 delete fp; 126 126 jfree(ho); … … 160 160 else 161 161 { 162 eh->font()->put_char(s,x,y,*h);162 wm->font()->put_char(s,x,y,*h); 163 163 x+=fw; 164 164 h++; … … 198 198 screen->scroll(0,0,xres,yres,0,scroll_step); 199 199 h->put_part(screen,0,helpy,0,0,xres,-helpy+scroll_step); 200 eh->flush_screen();200 wm->flush_screen(); 201 201 } 202 202 delete h; -
abuse/trunk/src/profile.cpp
r88 r106 56 56 57 57 58 prof_win= eh->new_window(prop->getd("profile x",-1),58 prof_win=wm->new_window(prop->getd("profile x",-1), 59 59 prop->getd("profile y",-1), 60 60 20*console_font->width(), … … 81 81 if (prof_list) jfree(prof_list); 82 82 prof_list=NULL; 83 if (prof_win) { eh->close_window(prof_win); prof_win=NULL; }83 if (prof_win) { wm->close_window(prof_win); prof_win=NULL; } 84 84 } 85 85 … … 125 125 prof_win->screen->bar(spliter-1-(int)(prof_list[i].total_time*time_scaler),dy+1, 126 126 spliter-1, 127 dy+console_font->height()-1, eh->bright_color());127 dy+console_font->height()-1,wm->bright_color()); 128 128 dy+=console_font->height()+1; 129 129 } -
abuse/trunk/src/scene.cpp
r56 r106 650 650 if (!text_loaded) done=1; 651 651 652 eh->flush_screen();653 while ( eh->event_waiting())652 wm->flush_screen(); 653 while (wm->event_waiting()) 654 654 { 655 655 event ev; 656 eh->get_event(ev);656 wm->get_event(ev); 657 657 if (ev.type==EV_KEY) 658 658 { -
abuse/trunk/src/statbar.cpp
r56 r106 246 246 { 247 247 if ((current_level->tick_counter()&4)==0) 248 eh->set_mouse_shape(cash.img(c_mouse1)->copy(),4,4);249 else eh->set_mouse_shape(cash.img(c_mouse2)->copy(),4,4);248 wm->set_mouse_shape(cash.img(c_mouse1)->copy(),4,4); 249 else wm->set_mouse_shape(cash.img(c_mouse2)->copy(),4,4); 250 250 changed_cursor=1; 251 251 } else if (changed_cursor) 252 252 { 253 253 if (!(dev&EDIT_MODE)) 254 eh->set_mouse_shape(cash.img(c_target)->copy(),8,8);254 wm->set_mouse_shape(cash.img(c_target)->copy(),8,8); 255 255 else 256 eh->set_mouse_shape(cash.img(c_normal)->copy(),1,1);256 wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1); 257 257 changed_cursor=0; 258 258 } -
abuse/trunk/src/unixnfc.cpp
r61 r106 487 487 488 488 489 jwindow *j= eh->new_window(0,yres/2,-1,-1,new info_field(WINDOW_FRAME_LEFT,489 jwindow *j=wm->new_window(0,yres/2,-1,-1,new info_field(WINDOW_FRAME_LEFT, 490 490 WINDOW_FRAME_TOP, 491 491 0,"Clients are re-syncing, please wait...",NULL)); 492 eh->flush_screen();492 wm->flush_screen(); 493 493 if (!reload_start()) return ; 494 494 … … 498 498 next_process(); 499 499 } while (!reload_end()); 500 eh->close_window(j);500 wm->close_window(j); 501 501 502 502 } … … 564 564 if (total_retry==10) // 2 seconds and nothing 565 565 { 566 abort= eh->new_window(0,yres/2,-1,eh->font()->height()*4,566 abort=wm->new_window(0,yres/2,-1,wm->font()->height()*4, 567 567 new info_field(WINDOW_FRAME_LEFT, 568 568 WINDOW_FRAME_TOP, 569 569 0,"Waiting for data...", 570 570 new button(WINDOW_FRAME_LEFT, 571 WINDOW_FRAME_TOP+ eh->font()->height()+5,ID_NET_DISCONNECT,571 WINDOW_FRAME_TOP+wm->font()->height()+5,ID_NET_DISCONNECT, 572 572 "Disconnect slackers",NULL)),"Error"); 573 eh->flush_screen();573 wm->flush_screen(); 574 574 } 575 575 } 576 576 if (abort) 577 577 { 578 if ( eh->event_waiting())578 if (wm->event_waiting()) 579 579 { 580 580 event ev; 581 581 do 582 582 { 583 eh->get_event(ev);583 wm->get_event(ev); 584 584 if (ev.type==EV_MESSAGE && ev.message.id==ID_NET_DISCONNECT) 585 585 kill_slackers(); … … 590 590 input.add_front(e); 591 591 } 592 } while ( eh->event_waiting());593 594 eh->flush_screen();592 } while (wm->event_waiting()); 593 594 wm->flush_screen(); 595 595 } 596 596 } … … 599 599 if (abort) 600 600 { 601 eh->close_window(abort);601 wm->close_window(abort); 602 602 while (input.first()) // push all the key events 603 603 { 604 604 event *ev=(event *)input.first(); 605 605 input.unlink((linked_node *)ev); 606 eh->push_event(ev);606 wm->push_event(ev); 607 607 } 608 608 }
Note: See TracChangeset
for help on using the changeset viewer.