[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src video.cc,1.14,1.15
From: |
Daniel Heck <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src video.cc,1.14,1.15 |
Date: |
Wed, 26 Nov 2003 08:15:51 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv9630/src
Modified Files:
video.cc
Log Message:
- Added MouseCursor::init_bg(), restore_bg().
Index: video.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/video.cc,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** video.cc 19 Nov 2003 16:22:37 -0000 1.14
--- video.cc 26 Nov 2003 08:15:49 -0000 1.15
***************
*** 86,93 ****
--- 86,96 ----
private:
void grab_bg ();
+ void init_bg();
+ void restore_bg();
Screen *screen;
Surface *background; // Copy of screen contents behind cursor
Surface *cursor; // Pixmap of the cursor
+
int x, y;
int oldx, oldy;
***************
*** 194,197 ****
--- 197,204 ----
hotx = hx;
hoty = hy;
+
+ if (visible > 0) {
+ init_bg();
+ }
}
***************
*** 209,219 ****
void MouseCursor::redraw () {
! if (visible > 0 && changedp)
! {
! if (background) {
! GC gc(screen->get_surface());
! blit (gc, oldx-hotx, oldy-hoty, background);
! screen->update_rect (get_oldrect());
! }
draw();
}
--- 216,221 ----
void MouseCursor::redraw () {
! if (visible > 0 && changedp) {
! restore_bg ();
draw();
}
***************
*** 227,232 ****
void MouseCursor::show () {
! if (++visible == 1)
changedp=true;
}
--- 229,236 ----
void MouseCursor::show () {
! if (++visible == 1) {
! init_bg();
changedp=true;
+ }
}
***************
*** 234,241 ****
if (--visible == 0) {
changedp = true;
! if (background) {
! GC gc(screen->get_surface());
! blit (gc, oldx-hotx, oldy-hoty, background);
! }
delete background;
background=0;
--- 238,242 ----
if (--visible == 0) {
changedp = true;
! restore_bg();
delete background;
background=0;
***************
*** 255,267 ****
}
! void MouseCursor::grab_bg () {
! if (background == 0)
! background = Grab(screen->get_surface(), get_rect());
! else {
! GC gc(background);
! blit (gc, 0,0, screen->get_surface(), get_rect());
}
oldx=x;
oldy=y;
}
--- 256,291 ----
}
! void MouseCursor::init_bg() {
! assert (visible > 0);
! assert (cursor != 0);
!
! if (background != 0) {
! delete background;
}
+
+ background = px::MakeSurfaceLike (cursor->width(),
+ cursor->height(),
+ screen->get_surface());
+ grab_bg();
+ }
+
+ void MouseCursor::grab_bg () {
+ assert (background != 0);
+ // if (background == 0)
+ // background = Grab(screen->get_surface(), get_rect());
+ // else {
+ GC gc(background);
+ blit (gc, 0,0, screen->get_surface(), get_rect());
+
oldx=x;
oldy=y;
+ }
+
+ void MouseCursor::restore_bg () {
+ if (background) {
+ GC gc(screen->get_surface());
+ blit (gc, oldx-hotx, oldy-hoty, background);
+ screen->update_rect (get_oldrect());
+ }
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src video.cc,1.14,1.15,
Daniel Heck <address@hidden> <=