all repos — fluxbox @ 346dacc633a68e14315cdd13f79c31b6e86f124f

custom fork of the fluxbox windowmanager

added copy for X Pixmap
fluxgen fluxgen
commit

346dacc633a68e14315cdd13f79c31b6e86f124f

parent

ac033939cbed373b7ce1465f112e359161216c86

2 files changed, 34 insertions(+), 2 deletions(-)

jump to
M src/FbTk/FbPixmap.ccsrc/FbTk/FbPixmap.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbPixmap.cc,v 1.5 2003/07/10 11:55:01 fluxgen Exp $ +// $Id: FbPixmap.cc,v 1.6 2003/08/11 14:58:49 fluxgen Exp $ #include "FbPixmap.hh" #include "App.hh"

@@ -130,6 +130,37 @@

} } +} + +void FbPixmap::copy(Pixmap pm) { + free(); + if (pm == 0) + return; + + // get width, height and depth for the pixmap + Window root; + int x, y; + unsigned int border_width, bpp; + unsigned int new_width, new_height; + + XGetGeometry(FbTk::App::instance()->display(), + pm, + &root, + &x, &y, + &new_width, &new_height, + &border_width, + &bpp); + // create new pixmap and copy area + create(root, new_width, new_height, bpp); + // determine screen gc + Display *disp = FbTk::App::instance()->display(); + XWindowAttributes attr; + XGetWindowAttributes(disp, root, &attr); + GC gc = DefaultGCOfScreen(attr.screen); + XCopyArea(disp, pm, drawable(), gc, + 0, 0, + width(), height(), + 0, 0); } void FbPixmap::rotate() {
M src/FbTk/FbPixmap.hhsrc/FbTk/FbPixmap.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbPixmap.hh,v 1.5 2003/07/10 11:55:01 fluxgen Exp $ +// $Id: FbPixmap.hh,v 1.6 2003/08/11 14:59:07 fluxgen Exp $ #ifndef FBTK_FBPIXMAP_HH #define FBTK_FBPIXMAP_HH

@@ -45,6 +45,7 @@

~FbPixmap(); void copy(const FbPixmap &the_copy); + void copy(Pixmap pixmap); /// rotates the pixmap 90 deg, not implemented! void rotate(); /// scales the pixmap to specified size