Hi.

The three patches below are needed to compile Blackbox with GCC-3.5, and
I suspect GCC-3.4 as well. Without these patches the compile generates
errors due to the scope of the copy constructor for the Pen class. The
fix is to create a Pen instance outside the function call and pass that
instance to the function.

The link below points to the various changes that GCC-3.4 will have, and
in the section regarding C++ changes there are a few words about the
compiler changes that make the patches below necessary.

http://gcc.gnu.org/gcc-3.4/changes.html

Art Haas

Index: src/Screen.cc
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/src/Screen.cc,v
retrieving revision 1.244
diff -u -r1.244 Screen.cc
--- src/Screen.cc       8 Mar 2004 15:34:57 -0000       1.244
+++ src/Screen.cc       12 Apr 2004 13:43:00 -0000
@@ -1327,9 +1327,9 @@
   bt::Rect u(0, 0, geom_w, geom_h);
   bt::drawTexture(screen_info.screenNumber(), texture,
                   geom_window, u, u, geom_pixmap);
+  bt::Pen pen(screen_info.screenNumber(), style->focus.text);
   bt::drawText(style->font,
-               bt::Pen(screen_info.screenNumber(),
-                       style->focus.text),
+              pen,
                geom_window,
                bt::Rect(style->bevel_width,
                         style->bevel_width,
Index: src/Toolbar.cc
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/src/Toolbar.cc,v
retrieving revision 1.106
diff -u -r1.106 Toolbar.cc
--- src/Toolbar.cc      8 Mar 2004 15:34:57 -0000       1.106
+++ src/Toolbar.cc      12 Apr 2004 13:43:02 -0000
@@ -498,9 +498,9 @@
                     pressed ? style->pressed : style->button,
                     frame.psbutton, u, u, p);
   }
-
+  bt::Pen pen(_screen->screenNumber(), style->foreground);
   bt::drawBitmap(bt::Bitmap::leftArrow(_screen->screenNumber()),
-                 bt::Pen(_screen->screenNumber(), style->foreground),
+                pen,
                  frame.psbutton, u);
 }
 
@@ -522,8 +522,9 @@
                     frame.nsbutton, u, u, p);
   }
 
+  bt::Pen pen(_screen->screenNumber(), style->foreground);
   bt::drawBitmap(bt::Bitmap::rightArrow(_screen->screenNumber()),
-                 bt::Pen(_screen->screenNumber(), style->foreground),
+                 pen,
                  frame.nsbutton, u);
 }
 
@@ -545,8 +546,9 @@
                     frame.pwbutton, u, u, p);
   }
 
+  bt::Pen pen(_screen->screenNumber(), style->foreground);
   bt::drawBitmap(bt::Bitmap::leftArrow(_screen->screenNumber()),
-                 bt::Pen(_screen->screenNumber(), style->foreground),
+                pen,
                  frame.pwbutton, u);
 }
 
@@ -568,8 +570,9 @@
                     frame.nwbutton, u, u, p);
   }
 
+  bt::Pen pen(_screen->screenNumber(), style->foreground);
   bt::drawBitmap(bt::Bitmap::rightArrow(_screen->screenNumber()),
-                 bt::Pen(_screen->screenNumber(), style->foreground),
+                pen,
                  frame.nwbutton, u);
 }
 
Index: src/Window.cc
===================================================================
RCS file: /cvsroot/blackboxwm/blackbox/src/Window.cc,v
retrieving revision 1.329
diff -u -r1.329 Window.cc
--- src/Window.cc       9 Mar 2004 09:59:14 -0000       1.329
+++ src/Window.cc       12 Apr 2004 13:43:11 -0000
@@ -2252,11 +2252,11 @@
                     frame.iconify_button, u, u, p);
   }
 
+  bt::Pen pen(screen->screenNumber(), ((client.state.focused)
+                                      ? frame.style->focus.foreground
+                                      : frame.style->unfocus.foreground));
   bt::drawBitmap(frame.style->iconify,
-                 bt::Pen(screen->screenNumber(),
-                         client.state.focused
-                         ? frame.style->focus.foreground
-                         : frame.style->unfocus.foreground),
+                pen,
                  frame.iconify_button, u);
 }
 
@@ -2285,11 +2285,11 @@
                     frame.maximize_button, u, u, p);
   }
 
+  bt::Pen pen(screen->screenNumber(), ((client.state.focused)
+                                      ? frame.style->focus.foreground
+                                      : frame.style->unfocus.foreground));
   bt::drawBitmap(isMaximized() ? frame.style->restore : frame.style->maximize,
-                 bt::Pen(screen->screenNumber(),
-                         client.state.focused
-                         ? frame.style->focus.foreground
-                         : frame.style->unfocus.foreground),
+                pen,
                  frame.maximize_button, u);
 }
 
@@ -2317,11 +2317,11 @@
                     frame.close_button, u, u, p);
   }
 
+  bt::Pen pen(screen->screenNumber(), ((client.state.focused)
+                                      ? frame.style->focus.foreground
+                                      : frame.style->unfocus.foreground));
   bt::drawBitmap(frame.style->close,
-                 bt::Pen(screen->screenNumber(),
-                         client.state.focused
-                         ? frame.style->focus.foreground
-                         : frame.style->unfocus.foreground),
+                pen,
                  frame.close_button, u);
 }
 
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822

-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
List archives:  http://asgardsrealm.net/lurker/splash/index.html
Trouble? Contact [EMAIL PROTECTED]

Reply via email to