[AD] Small GUI extra

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Okay, I know probably no one really cares about the GUI too much, but
this is something I've wanted for awhile, but I didnt want to bug
anybody about it. (Plus, I really need it now for more GUI stuff I'm
writing, so it would be nice to have it in the main Allegro code) What I
did, which is really absolutely simple, is make the GUI write to a
gui_bitmap BITMAP rather than screen. gui_bitmap is set to screen by
set_gfx_mode (I'm guessing the best place to put it, at least for now),
so for most it wouldn't make the gui any different at all. But for
someone like me, it will make it easy to double buffer the GUI, without
redirecting screen. Anyway, here's the patch if anyone wants to try it.
I tested it out on some of my code, and it seems to work perfectly.
Only in allegro: allegro.txt
Only in allegro/docs: allegro.txt
Only in allegro/docs: window.h
Only in allegro: faq.txt
Only in allegro: help.txt
diff -ur aold/include/allegro.h allegro/include/allegro.h
--- aold/include/allegro.h	Mon Jul 19 21:05:28 1999
+++ allegro/include/allegro.h	Sun Aug  1 00:09:02 1999
@@ -1991,6 +1991,7 @@
 
 AL_VAR(DIALOG *, active_dialog);
 AL_VAR(MENU *, active_menu);
+AL_VAR(BITMAP *, gui_bitmap);
 
 AL_VAR(int, gui_mouse_focus);
 
diff -ur aold/src/graphics.c allegro/src/graphics.c
--- aold/src/graphics.c	Mon Jul 19 20:59:42 1999
+++ allegro/src/graphics.c	Sun Aug  1 00:06:10 1999
@@ -516,6 +516,9 @@
    if (system_driver->display_switch_lock)
       system_driver->display_switch_lock(FALSE, FALSE);
 
+   /* I put this here because it looked like a good spot - JH */
+   gui_bitmap = screen;
+
    return 0;
 } 
 
diff -ur aold/src/gui.c allegro/src/gui.c
--- aold/src/gui.c	Mon Jul 19 20:59:44 1999
+++ allegro/src/gui.c	Sun Aug  1 00:00:46 1999
@@ -34,7 +34,7 @@
 /* pointer to the currently active dialog and menu objects */
 DIALOG *active_dialog = NULL;
 MENU *active_menu = NULL;
-
+BITMAP *gui_bitmap = NULL;
 
 
 /* hook function for reading the mouse x position */
@@ -165,7 +165,7 @@
 
 /* centre_dialog:
  *  Moves all the objects in a dialog so that the dialog is centered in
- *  the screen.
+ *  gui_bitmap.
  */
 void centre_dialog(DIALOG *dialog)
 {
@@ -564,7 +564,7 @@
 
 
 /* popup_dialog:
- *  Like do_dialog(), but it stores the data on the screen before drawing
+ *  Like do_dialog(), but it stores the data on gui_bitmap before drawing
  *  the dialog and restores it when the dialog is closed. The screen area
  *  to be stored is calculated from the dimensions of the first object in
  *  the dialog, so all the other objects should lie within this one.
@@ -578,7 +578,7 @@
 
    if (bmp) {
       scare_mouse();
-      blit(screen, bmp, dialog->x, dialog->y, 0, 0, dialog->w+1, dialog->h+1);
+      blit(gui_bitmap, bmp, dialog->x, dialog->y, 0, 0, dialog->w+1, dialog->h+1);
       unscare_mouse();
    }
    else
@@ -588,7 +588,7 @@
 
    if (bmp) {
       scare_mouse();
-      blit(bmp, screen, 0, 0, dialog->x, dialog->y, dialog->w+1, dialog->h+1);
+      blit(bmp, gui_bitmap, 0, 0, dialog->x, dialog->y, dialog->w+1, dialog->h+1);
       unscare_mouse();
       destroy_bitmap(bmp);
    }
@@ -635,7 +635,7 @@
       dclick_install_count++;
 
    /* initialise the dialog */
-   set_clip(screen, 0, 0, SCREEN_W-1, SCREEN_H-1);
+   set_clip(gui_bitmap, 0, 0, SCREEN_W-1, SCREEN_H-1);
    player->res |= dialog_message(dialog, MSG_START, 0, &player->obj);
 
    player->mouse_obj = find_mouse_object(dialog);
@@ -919,7 +919,7 @@
    int bar;                         /* set if it is a top level menu bar */
    int size;                        /* number of items in the menu */
    int sel;                         /* selected item */
-   int x, y, w, h;                  /* screen position of the menu */
+   int x, y, w, h;                  /* gui_bitmap position of the menu */
    int (*proc)();                   /* callback function */
    BITMAP *saved;                   /* saved what was underneath it */
 } MENU_INFO;
@@ -952,7 +952,7 @@
 
 
 /* draw_menu_item:
- *  Draws an item from a popup menu onto the screen.
+ *  Draws an item from a popup menu onto gui_bitmap.
  */
 static void draw_menu_item(MENU_INFO *m, int c)
 {
@@ -983,7 +983,7 @@
 
    get_menu_pos(m, c, &x, &y, &w);
 
-   rectfill(screen, x, y, x+w-1, y+text_height(font)+3, bg);
+   rectfill(gui_bitmap, x, y, x+w-1, y+text_height(font)+3, bg);
    text_mode(bg);
 
    if (ugetc(m->menu[c].text)) {
@@ -997,34 +997,34 @@
 
       usetc(buf+i, 0);
 
-      gui_textout(screen, buf, x+8, y+1, fg, FALSE);
+      gui_textout(gui_bitmap, buf, x+8, y+1, fg, FALSE);
 
       if (j == '\t') {
 	 tok = m->menu[c].text+i + uwidth(m->menu[c].text+i);
-	 gui_textout(screen, tok, x+w-gui_strlen(tok)-8, y+1, fg, FALSE);
+         gui_textout(gui_bitmap, tok, x+w-gui_strlen(tok)-8, y+1, fg, FALSE);
       }
    }
    else
-      hline(screen, x, y+text_height(font)/2+2, x+w, fg);
+      hline(gui_bitmap, x, y+text_height(font)/2+2, x+w, fg);
 
    if (m->menu[c].flags & D_SELECTED) {
-      line(screen, x+1, y+text_height(font)/2+1, x+3, y+text_height(font)+1, fg);
-      line(screen, x+3, y+text_height(font)+1, x+6, y+2, fg);
+      line(gui_bitmap, x+1, y+text_height(font)/2+1, x+3, y+text_height(font)+1, fg);
+      line(gui_bitmap, x+3, y+text_height(font)+1, x+6, y+2, fg);
    }
 }
 
 
 
 /* draw_menu:
- *  Draws a popup menu onto the screen.
+ *  Draws a popup menu onto gui_bitmap.
  */
 static void draw_menu(MENU_INFO *m)
 {
    int c;
 
-   rect(screen, m->x, m->y, m->x+m->w-1, m->y+m->h-1, gui_fg_color);
-   vline(screen, m->x+m->w, m->y+1, m->y+m->h, gui_fg_color);
-   hline(screen, m->x+1, m->y+m->h, m->x+m->w, gui_fg_color);
+   rect(gui_bitmap, m->x, m->y, m->x+m->w-1, m->y+m->h-1, gui_fg_color);
+   vline(gui_bitmap, m->x+m->w, m->y+1, m->y+m->h, gui_fg_color);
+   hline(gui_bitmap, m->x+1, m->y+m->h, m->x+m->w, gui_fg_color);
 
    for (c=0; m->menu[c].text; c++)
       draw_menu_item(m, c);
@@ -1226,11 +1226,11 @@
       m.y = MID(0, m.y, SCREEN_H-m.h-1);
    }
 
-   /* save screen under the menu */
+   /* save gui_bitmap under the menu */
    m.saved = create_bitmap(m.w+1, m.h+1); 
 
    if (m.saved)
-      blit(screen, m.saved, m.x, m.y, 0, 0, m.w+1, m.h+1);
+      blit(gui_bitmap, m.saved, m.x, m.y, 0, 0, m.w+1, m.h+1);
    else
       *allegro_errno = ENOMEM;
 
@@ -1437,10 +1437,10 @@
       }
    }
 
-   /* restore screen */
+   /* restore gui_bitmap */
    if (m.saved) {
       scare_mouse();
-      blit(m.saved, screen, 0, 0, m.x, m.y, m.w+1, m.h+1);
+      blit(m.saved, gui_bitmap, 0, 0, m.x, m.y, m.w+1, m.h+1);
       unscare_mouse();
       destroy_bitmap(m.saved);
    }
@@ -1451,9 +1451,9 @@
 
 
 /* do_menu:
- *  Displays and animates a popup menu at the specified screen position,
+ *  Displays and animates a popup menu at the specified gui_bitmap position,
  *  returning the index of the item that was selected, or -1 if it was
- *  dismissed. If the menu crosses the edge of the screen it will be moved.
+ *  dismissed. If the menu crosses the edge of gui_bitmap it will be moved.
  */
 int do_menu(MENU *menu, int x, int y)
 {
@@ -1470,7 +1470,7 @@
 /* d_menu_proc:
  *  Dialog procedure for adding drop down menus to a GUI dialog. This 
  *  displays the top level menu items as a horizontal bar (eg. across the
- *  top of the screen), and pops up child menus when they are clicked.
+ *  top of gui_bitmap), and pops up child menus when they are clicked.
  *  When it executes one of the menu callback routines, it passes the
  *  return value back to the dialog manager, so these can return D_O_K,
  *  D_CLOSE, D_REDRAW, etc.
diff -ur aold/src/guiproc.c allegro/src/guiproc.c
--- aold/src/guiproc.c	Mon Jul 19 20:59:42 1999
+++ allegro/src/guiproc.c	Sun Aug  1 00:01:24 1999
@@ -33,7 +33,7 @@
 
 
 /* gui_textout:
- *  Wrapper function for drawing text to the screen, which interprets the
+ *  Wrapper function for drawing text to the gui_bitmap, which interprets the
  *  & character as an underbar for displaying keyboard shortcuts. Returns
  *  the width of the output string in pixels.
  */
@@ -109,27 +109,27 @@
    int c;
 
    for (c=x1; c<=x2; c++) {
-      putpixel(screen, c, y1, (((c+y1) & 1) == x) ? fg : bg);
-      putpixel(screen, c, y2, (((c+y2) & 1) == x) ? fg : bg);
+      putpixel(gui_bitmap, c, y1, (((c+y1) & 1) == x) ? fg : bg);
+      putpixel(gui_bitmap, c, y2, (((c+y2) & 1) == x) ? fg : bg);
    }
 
    for (c=y1+1; c<y2; c++) {
-      putpixel(screen, x1, c, (((c+x1) & 1) == x) ? fg : bg);
-      putpixel(screen, x2, c, (((c+x2) & 1) == x) ? fg : bg);
+      putpixel(gui_bitmap, x1, c, (((c+x1) & 1) == x) ? fg : bg);
+      putpixel(gui_bitmap, x2, c, (((c+x2) & 1) == x) ? fg : bg);
    }
 }
 
 
 
 /* d_clear_proc:
- *  Simple dialog procedure which just clears the screen. Useful as the
+ *  Simple dialog procedure which just clears the gui_bitmap. Useful as the
  *  first object in a dialog.
  */
 int d_clear_proc(int msg, DIALOG *d, int c)
 {
    if (msg == MSG_DRAW) {
-      set_clip(screen, 0, 0, SCREEN_W-1, SCREEN_H-1);
-      clear_to_color(screen, d->bg);
+      set_clip(gui_bitmap, 0, 0, SCREEN_W-1, SCREEN_H-1);
+      clear_to_color(gui_bitmap, d->bg);
    }
 
    return D_O_K;
@@ -144,8 +144,8 @@
 {
    if (msg==MSG_DRAW) {
       int fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
-      rectfill(screen, d->x+1, d->y+1, d->x+d->w-1, d->y+d->h-1, d->bg);
-      rect(screen, d->x, d->y, d->x+d->w, d->y+d->h, fg);
+      rectfill(gui_bitmap, d->x+1, d->y+1, d->x+d->w-1, d->y+d->h-1, d->bg);
+      rect(gui_bitmap, d->x, d->y, d->x+d->w, d->y+d->h, fg);
    }
 
    return D_O_K;
@@ -160,10 +160,10 @@
 {
    if (msg==MSG_DRAW) {
       int fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
-      rectfill(screen, d->x+1, d->y+1, d->x+d->w-2, d->y+d->h-2, d->bg);
-      rect(screen, d->x, d->y, d->x+d->w-1, d->y+d->h-1, fg);
-      vline(screen, d->x+d->w, d->y+1, d->y+d->h, fg);
-      hline(screen, d->x+1, d->y+d->h, d->x+d->w, fg);
+      rectfill(gui_bitmap, d->x+1, d->y+1, d->x+d->w-2, d->y+d->h-2, d->bg);
+      rect(gui_bitmap, d->x, d->y, d->x+d->w-1, d->y+d->h-1, fg);
+      vline(gui_bitmap, d->x+d->w, d->y+1, d->y+d->h, fg);
+      hline(gui_bitmap, d->x+1, d->y+d->h, d->x+d->w, fg);
    }
 
    return D_O_K;
@@ -179,7 +179,7 @@
    BITMAP *b = (BITMAP *)d->dp;
 
    if (msg==MSG_DRAW)
-      blit(b, screen, 0, 0, d->x, d->y, d->w, d->h);
+      blit(b, gui_bitmap, 0, 0, d->x, d->y, d->w, d->h);
 
    return D_O_K;
 }
@@ -199,7 +199,7 @@
 	 font = d->dp2;
 
       text_mode(d->bg);
-      gui_textout(screen, d->dp, d->x, d->y, fg, FALSE);
+      gui_textout(gui_bitmap, d->dp, d->x, d->y, fg, FALSE);
 
       font = oldfont;
    }
@@ -223,7 +223,7 @@
 	 font = d->dp2;
 
       text_mode(d->bg);
-      gui_textout(screen, d->dp, d->x, d->y, fg, TRUE);
+      gui_textout(gui_bitmap, d->dp, d->x, d->y, fg, TRUE);
 
       font = oldfont;
    }
@@ -259,18 +259,18 @@
 	    state2 = d->bg;
 	 }
 
-	 rectfill(screen, d->x+1+g, d->y+1+g, d->x+d->w-2+g, d->y+d->h-2+g, state2);
-	 rect(screen, d->x+g, d->y+g, d->x+d->w-1+g, d->y+d->h-1+g, state1);
+         rectfill(gui_bitmap, d->x+1+g, d->y+1+g, d->x+d->w-2+g, d->y+d->h-2+g, state2);
+         rect(gui_bitmap, d->x+g, d->y+g, d->x+d->w-1+g, d->y+d->h-1+g, state1);
 	 text_mode(-1);
-	 gui_textout(screen, d->dp, d->x+d->w/2+g, d->y+d->h/2-text_height(font)/2+g, state1, TRUE);
+         gui_textout(gui_bitmap, d->dp, d->x+d->w/2+g, d->y+d->h/2-text_height(font)/2+g, state1, TRUE);
 
 	 if (d->flags & D_SELECTED) {
-	    vline(screen, d->x, d->y, d->y+d->h-1, d->bg);
-	    hline(screen, d->x, d->y, d->x+d->w-1, d->bg);
+            vline(gui_bitmap, d->x, d->y, d->y+d->h-1, d->bg);
+            hline(gui_bitmap, d->x, d->y, d->x+d->w-1, d->bg);
 	 }
 	 else {
-	    vline(screen, d->x+d->w, d->y+1, d->y+d->h-1, d->fg);
-	    hline(screen, d->x+1, d->y+d->h, d->x+d->w, d->fg);
+            vline(gui_bitmap, d->x+d->w, d->y+1, d->y+d->h-1, d->fg);
+            hline(gui_bitmap, d->x+1, d->y+d->h, d->x+d->w, d->fg);
 	 }
 	 if ((d->flags & D_GOTFOCUS) && 
 	     (!(d->flags & D_SELECTED) || !(d->flags & D_EXIT)))
@@ -346,14 +346,14 @@
    if (msg==MSG_DRAW) {
       fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
       text_mode(d->bg);
-      x = d->x + ((d->d1) ? 0 : gui_textout(screen, d->dp, d->x, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, FALSE) + text_height(font)/2);
-      rectfill(screen, x+1, d->y+1, x+d->h-1, d->y+d->h-1, d->bg);
-      rect(screen, x, d->y, x+d->h, d->y+d->h, fg);
+      x = d->x + ((d->d1) ? 0 : gui_textout(gui_bitmap, d->dp, d->x, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, FALSE) + text_height(font)/2);
+      rectfill(gui_bitmap, x+1, d->y+1, x+d->h-1, d->y+d->h-1, d->bg);
+      rect(gui_bitmap, x, d->y, x+d->h, d->y+d->h, fg);
       if (d->d1)
-	 gui_textout(screen, d->dp, x+d->h+text_height(font)/2, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, FALSE);
+         gui_textout(gui_bitmap, d->dp, x+d->h+text_height(font)/2, d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, FALSE);
       if (d->flags & D_SELECTED) {
-	 line(screen, x, d->y, x+d->h, d->y+d->h, fg);
-	 line(screen, x, d->y+d->h, x+d->h, d->y, fg); 
+         line(gui_bitmap, x, d->y, x+d->h, d->y+d->h, fg);
+         line(gui_bitmap, x, d->y+d->h, x+d->h, d->y, fg); 
       }
       if (d->flags & D_GOTFOCUS)
 	 dotted_rect(x+1, d->y+1, x+d->h-1, d->y+d->h-1, fg, d->bg);
@@ -379,25 +379,25 @@
       case MSG_DRAW:
 	 fg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
 	 text_mode(d->bg);
-	 gui_textout(screen, d->dp, d->x+d->h+text_height(font), d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, FALSE);
+         gui_textout(gui_bitmap, d->dp, d->x+d->h+text_height(font), d->y+(d->h-(text_height(font)-gui_font_baseline))/2, fg, FALSE);
 
 	 x = d->x;
 	 r = d->h/2;
 	 center = x+r;
-	 rectfill(screen, x+1, d->y+1, x+d->h-1, d->y+d->h-1, d->bg);
+         rectfill(gui_bitmap, x+1, d->y+1, x+d->h-1, d->y+d->h-1, d->bg);
 
 	 switch (d->d2) {
 
 	    case 1:
-	       rect(screen, x, d->y, x+d->h, d->y+d->h, fg);
+               rect(gui_bitmap, x, d->y, x+d->h, d->y+d->h, fg);
 	       if (d->flags & D_SELECTED)
-		  rectfill(screen, x+r/2, d->y+r/2, x+d->h-r/2, d->y+d->h-r/2, fg);
+                  rectfill(gui_bitmap, x+r/2, d->y+r/2, x+d->h-r/2, d->y+d->h-r/2, fg);
 	       break;
 
 	    default:
-	       circle(screen, center, d->y+r, r, fg);
+               circle(gui_bitmap, center, d->y+r, r, fg);
 	       if (d->flags & D_SELECTED)
-		  circlefill(screen, center, d->y+r, r/2, fg);
+                  circlefill(gui_bitmap, center, d->y+r, r/2, fg);
 	       break;
 	 }
 
@@ -478,29 +478,29 @@
       if (indent==0)
 	 indent = 2;
 
-      /* put the graphic on screen, scaled as needed */
+      /* put the graphic on gui_bitmap, scaled as needed */
       butx = butimage->w;
       buty = butimage->h;
-      stretch_blit(butimage, screen, 0, 0, butx-depth, buty-depth, 
+      stretch_blit(butimage, gui_bitmap, 0, 0, butx-depth, buty-depth, 
 		   d->x+depth, d->y+depth, d->w-depth, d->h-depth);
 
       if ((d->flags & D_GOTFOCUS) &&
 	  (!(d->flags & D_SELECTED) || !(d->flags & D_EXIT))) {
 	 /* draw focus lines */
 	 for (index=indent; index<d->w-(indent+1); index+=2) {
-	    putpixel(screen, d->x+index+depth, d->y+indent+depth,d->fg);
-	    putpixel(screen, d->x+index+depth, d->y+d->h-(indent+1)+depth, d->fg);
+            putpixel(gui_bitmap, d->x+index+depth, d->y+indent+depth,d->fg);
+            putpixel(gui_bitmap, d->x+index+depth, d->y+d->h-(indent+1)+depth, d->fg);
 	 }
 	 for (index=indent; index<d->h-(indent+1); index+=2) {
-	    putpixel(screen, d->x+indent+depth, d->y+index+depth, d->fg);
-	    putpixel(screen, d->x+d->w-(indent+1)+depth, d->y+index+depth, d->fg);
+            putpixel(gui_bitmap, d->x+indent+depth, d->y+index+depth, d->fg);
+            putpixel(gui_bitmap, d->x+d->w-(indent+1)+depth, d->y+index+depth, d->fg);
 	 }
       }
 
       /* draw shadowing */
       for (index=0; index<depth; index++) {
-	  hline(screen, d->x, d->y+index, d->x+d->w-1, d->bg);
-	  vline(screen, d->x+index, d->y, d->y+d->h-1, d->bg);
+          hline(gui_bitmap, d->x, d->y+index, d->x+d->w-1, d->bg);
+          vline(gui_bitmap, d->x+index, d->y, d->y+d->h-1, d->bg);
       }
 
       return D_O_K;
@@ -617,11 +617,11 @@
 	       break;
 	    f = ((p == d->d2) && (d->flags & D_GOTFOCUS));
 	    text_mode((f) ? fg : d->bg);
-	    textout(screen, font, buf, d->x+x, d->y, (f) ? d->bg : fg);
+            textout(gui_bitmap, font, buf, d->x+x, d->y, (f) ? d->bg : fg);
 	    x += w;
 	 }
 	 if (x < d->w)
-	    rectfill(screen, d->x+x, d->y, d->x+d->w-1, d->y+text_height(font)-1, d->bg);
+            rectfill(gui_bitmap, d->x+x, d->y, d->x+d->w-1, d->y+text_height(font)-1, d->bg);
 	 break;
 
       case MSG_CLICK:
@@ -890,11 +890,11 @@
    int xx, yy;
 
    /* draw frame */
-   rect(screen, d->x, d->y, d->x+d->w, d->y+d->h, fg_color);
+   rect(gui_bitmap, d->x, d->y, d->x+d->w, d->y+d->h, fg_color);
 
    /* possibly draw scrollbar */
    if (listsize > height) {
-      vline(screen, d->x+d->w-12, d->y+1, d->y+d->h-1, fg_color);
+      vline(gui_bitmap, d->x+d->w-12, d->y+1, d->y+d->h-1, fg_color);
 
       /* scrollbar with focus */ 
       if (d->flags & D_GOTFOCUS) {
@@ -902,8 +902,8 @@
 	 dotted_rect(d->x+d->w-11, d->y+1, d->x+d->w-1, d->y+d->h-1, fg_color, bg);
       }
       else {
-	 rect(screen, d->x+1, d->y+1, d->x+d->w-13, d->y+d->h-1, bg);
-	 rect(screen, d->x+d->w-11, d->y+1, d->x+d->w-1, d->y+d->h-1, bg);
+         rect(gui_bitmap, d->x+1, d->y+1, d->x+d->w-13, d->y+d->h-1, bg);
+         rect(gui_bitmap, d->x+d->w-11, d->y+1, d->x+d->w-1, d->y+d->h-1, bg);
       }
 
       /* create and draw the scrollbar */
@@ -919,19 +919,19 @@
 
       if (offset > 0) {
 	 len = (((d->h-4) * offset) + listsize/2) / listsize;
-	 rectfill(screen, xx, yy, xx+8, yy+len-1, bg);
+         rectfill(gui_bitmap, xx, yy, xx+8, yy+len-1, bg);
 	 yy += len;
       }
       if (yy+i < d->y+d->h-2) {
 	 drawing_mode(DRAW_MODE_COPY_PATTERN, pattern, 0, 0);
-	 rectfill(screen, xx, yy, xx+8, yy+i, 0);
+         rectfill(gui_bitmap, xx, yy, xx+8, yy+i, 0);
 	 solid_mode();
 	 yy += i;
-	 rectfill(screen, xx, yy, xx+8, d->y+d->h-2, bg);
+         rectfill(gui_bitmap, xx, yy, xx+8, d->y+d->h-2, bg);
       }
       else {
 	 drawing_mode(DRAW_MODE_COPY_PATTERN, pattern, 0, 0);
-	 rectfill(screen, xx, yy, xx+8, d->y+d->h-2, 0);
+         rectfill(gui_bitmap, xx, yy, xx+8, d->y+d->h-2, 0);
 	 solid_mode();
       }
       destroy_bitmap(pattern);
@@ -941,7 +941,7 @@
       if (d->flags & D_GOTFOCUS)
 	 dotted_rect(d->x+1, d->y+1, d->x+d->w-1, d->y+d->h-1, fg_color, bg);
       else
-	 rect(screen, d->x+1, d->y+1, d->x+d->w-1, d->y+d->h-1, bg);
+         rect(gui_bitmap, d->x+1, d->y+1, d->x+d->w-1, d->y+d->h-1, bg);
    }
 }
 
@@ -983,26 +983,26 @@
 	 x = d->x + 2;
 	 y = d->y + 2 + i*text_height(font);
 	 text_mode(bg);
-	 rectfill(screen, x, y, x+7, y+text_height(font)-1, bg); 
+         rectfill(gui_bitmap, x, y, x+7, y+text_height(font)-1, bg); 
 	 x += 8;
 	 len = ustrlen(s);
 	 while (text_length(font, s) >= d->w - (bar ? 22 : 10)) {
 	    len--;
 	    usetat(s, len, 0);
 	 }
-	 textout(screen, font, s, x, y, fg); 
+         textout(gui_bitmap, font, s, x, y, fg); 
 	 x += text_length(font, s);
 	 if (x <= d->x+w) 
-	    rectfill(screen, x, y, d->x+w, y+text_height(font)-1, bg);
+            rectfill(gui_bitmap, x, y, d->x+w, y+text_height(font)-1, bg);
       }
       else {
-	 rectfill(screen, d->x+2,  d->y+2+i*text_height(font), 
+         rectfill(gui_bitmap, d->x+2,  d->y+2+i*text_height(font), 
 		  d->x+w, d->y+1+(i+1)*text_height(font), d->bg);
       }
    }
 
    if (d->y+2+i*text_height(font) <= d->y+d->h-2)
-      rectfill(screen, d->x+2, d->y+2+i*text_height(font), 
+      rectfill(gui_bitmap, d->x+2, d->y+2+i*text_height(font), 
 				       d->x+w, d->y+d->h-2, d->bg);
 
    /* draw frame, maybe with scrollbar */
@@ -1284,7 +1284,7 @@
    /* do some drawing setup */
    if (draw) {
       /* initial start blanking at the top */
-      rectfill(screen, x+2, y+2, x+w-1, y1-1, deselect);
+      rectfill(gui_bitmap, x+2, y+2, x+w-1, y1-1, deselect);
    }
 
    /* choose the text color */
@@ -1360,7 +1360,7 @@
 	 x1 = x+4;
 
 	 /* the initial blank bit */
-	 rectfill(screen, x+2, y1, x1-1, y1+text_height(font), deselect);
+         rectfill(gui_bitmap, x+2, y1, x1-1, y1+text_height(font), deselect);
 
 	 /* print up to the marked character */
 	 while (printed != scanned) {
@@ -1376,7 +1376,7 @@
 	       case '\t':
 		  for (i=0; i<tabsize; i++) {
 		     usetc(s+usetc(s, ' '), 0);
-		     textout(screen, font, s, x1, y1, fg);
+                     textout(gui_bitmap, font, s, x1, y1, fg);
 		     x1 += text_length(font, s);
 		  }
 		  break;
@@ -1385,7 +1385,7 @@
 	       default:
 		  if (printed != ignore) {
 		     usetc(s+usetc(s, ugetc(printed)), 0);
-		     textout(screen, font, s, x1, y1, fg);
+                     textout(gui_bitmap, font, s, x1, y1, fg);
 		     x1 += text_length(font, s);
 		  }
 	    }
@@ -1395,7 +1395,7 @@
 	 }
 	 /* the last blank bit */
 	 if (x1 < x+w-1) 
-	    rectfill(screen, x1, y1, x+w-1, y1+text_height(font)-1, deselect);
+            rectfill(gui_bitmap, x1, y1, x+w-1, y1+text_height(font)-1, deselect);
 
 	 /* print the line end */
 	 y1 += text_height(font);
@@ -1409,7 +1409,7 @@
       if (!ugetc(printed)) {
 	 /* the under blank bit */
 	 if (draw) 
-	    rectfill(screen, x+1, y1, x+w-1, y+h-1, deselect);
+            rectfill(gui_bitmap, x+1, y1, x+w-1, y+h-1, deselect);
 
 	 /* tell how many lines we found */
 	 *listsize = line;
@@ -1620,14 +1620,14 @@
 	 sfg = (d->flags & D_DISABLED) ? gui_mg_color : d->fg;
 
 	 if (vert) {
-	    rectfill(screen, d->x, d->y, d->x+d->w/2-2, d->y+d->h-1, d->bg);
-	    rectfill(screen, d->x+d->w/2-1, d->y, d->x+d->w/2+1, d->y+d->h-1, sfg);
-	    rectfill(screen, d->x+d->w/2+2, d->y, d->x+d->w-1, d->y+d->h-1, d->bg);
+            rectfill(gui_bitmap, d->x, d->y, d->x+d->w/2-2, d->y+d->h-1, d->bg);
+            rectfill(gui_bitmap, d->x+d->w/2-1, d->y, d->x+d->w/2+1, d->y+d->h-1, sfg);
+            rectfill(gui_bitmap, d->x+d->w/2+2, d->y, d->x+d->w-1, d->y+d->h-1, d->bg);
 	 }
 	 else {
-	    rectfill(screen, d->x, d->y, d->x+d->w-1, d->y+d->h/2-2, d->bg);
-	    rectfill(screen, d->x, d->y+d->h/2-1, d->x+d->w-1, d->y+d->h/2+1, sfg);
-	    rectfill(screen, d->x, d->y+d->h/2+2, d->x+d->w-1, d->y+d->h-1, d->bg);
+            rectfill(gui_bitmap, d->x, d->y, d->x+d->w-1, d->y+d->h/2-2, d->bg);
+            rectfill(gui_bitmap, d->x, d->y+d->h/2-1, d->x+d->w-1, d->y+d->h/2+1, sfg);
+            rectfill(gui_bitmap, d->x, d->y+d->h/2+2, d->x+d->w-1, d->y+d->h-1, d->bg);
 	 }
 
 	 /* okay, background and slot are drawn, now draw the handle */
@@ -1640,7 +1640,7 @@
 	       slx = d->x+slp;
 	       sly = d->y+(d->h/2)-(slhan->h/2);
 	    }
-	    draw_sprite(screen, slhan, slx, sly);
+            draw_sprite(gui_bitmap, slhan, slx, sly);
 	 } 
 	 else {
 	    /* draw default handle */
@@ -1657,14 +1657,14 @@
 	    }
 
 	    /* draw body */
-	    rectfill(screen, slx+2, sly, slx+(slw-2), sly+slh, sfg);
-	    vline(screen, slx+1, sly+1, sly+slh-1, sfg);
-	    vline(screen, slx+slw-1, sly+1, sly+slh-1, sfg);
-	    vline(screen, slx, sly+2, sly+slh-2, sfg);
-	    vline(screen, slx+slw, sly+2, sly+slh-2, sfg);
-	    vline(screen, slx+1, sly+2, sly+slh-2, d->bg);
-	    hline(screen, slx+2, sly+1, slx+slw-2, d->bg);
-	    putpixel(screen, slx+2, sly+2, d->bg);
+            rectfill(gui_bitmap, slx+2, sly, slx+(slw-2), sly+slh, sfg);
+            vline(gui_bitmap, slx+1, sly+1, sly+slh-1, sfg);
+            vline(gui_bitmap, slx+slw-1, sly+1, sly+slh-1, sfg);
+            vline(gui_bitmap, slx, sly+2, sly+slh-2, sfg);
+            vline(gui_bitmap, slx+slw, sly+2, sly+slh-2, sfg);
+            vline(gui_bitmap, slx+1, sly+2, sly+slh-2, d->bg);
+            hline(gui_bitmap, slx+2, sly+1, slx+slw-2, d->bg);
+            putpixel(gui_bitmap, slx+2, sly+2, d->bg);
 	 }
 
 	 if (d->flags & D_GOTFOCUS)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/