diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2006-10-10 06:28:08 +0000 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2006-10-10 06:28:08 +0000 |
commit | f5db9e1a2ef12949848756aed348b00d3c569d4f (patch) | |
tree | 3fd787969d1eeff2903eca0e7fe3290733e482b0 | |
parent | b3a40a855fd6527a0e1f1b67072ccba5b3a5a248 (diff) |
+ added dock background
o fixed error with dock repainting when apps are un-minimized
o adapted createpackage script to new tag names
TAG: MPWM_1_0_RC1
NOTE: Release Candidate for MPWM 1.0.
Feature set should be fixed now, only expanding for CSCW demo needs.
Tag names switch from MPGWMPP <version> to MPWM <version>
-rw-r--r-- | Changelog | 12 | ||||
-rw-r--r-- | createpackage.sh | 4 | ||||
-rw-r--r-- | images/dock_left.png | bin | 0 -> 2856 bytes | |||
-rw-r--r-- | images/dock_right.png | bin | 0 -> 2859 bytes | |||
-rw-r--r-- | images/dock_top.png | bin | 0 -> 2817 bytes | |||
-rw-r--r-- | src/Config.cpp | 7 | ||||
-rw-r--r-- | src/Config.h | 6 | ||||
-rw-r--r-- | src/Dock.cpp | 55 | ||||
-rw-r--r-- | src/Dock.h | 10 | ||||
-rw-r--r-- | src/DockApp.cpp | 4 | ||||
-rw-r--r-- | src/DockItem.cpp | 6 | ||||
-rw-r--r-- | src/WMWindow.cpp | 13 | ||||
-rw-r--r-- | src/WMWindow.h | 3 |
13 files changed, 98 insertions, 22 deletions
@@ -1,7 +1,16 @@ 10.10.2006 + added ICCCM WM_DELETE_WINDOW to let a client destroy a window. ++ added dock background +o fixed error with dock repainting when apps are un-minimized +o adapted createpackage script to new tag names + TAG: MPGWMPP_0_11 +TAG: MPWM_1_0_RC1 + +NOTE: Release Candidate for MPWM 1.0. +Feature set should be fixed now, only expanding for CSCW demo needs. +Tag names switch from MPGWMPP <version> to MPWM <version> 09.10.2006 + Support for minimizing windows. @@ -23,11 +32,10 @@ white window is overlaid. Increases scaling speed. + added IMAGEPATH define to config. + added make dist target to Makefile (changes imagepath to /opt/MPX/images) -TAG: MPGWMPP_0_10_1 - + added make dist call to createpackage.sh o changed mpwm-control file to remove libmagick++9 dependency. +TAG: MPGWMPP_0_10_1 TAG: MPGWMPP_0_10_2 04.10.2006 diff --git a/createpackage.sh b/createpackage.sh index 0f18a88..acb3ae2 100644 --- a/createpackage.sh +++ b/createpackage.sh @@ -1,11 +1,11 @@ -# $Id: createpackage.sh,v 1.7 2006/10/05 05:17:18 whot Exp $ +# $Id: createpackage.sh,v 1.8 2006/10/10 06:28:08 whot Exp $ # # This script creates a debian package for the MPWM. # # APPNAME=mpwm -VERSION=`cvs log Changelog | grep TAG | head -n 1 | sed -e "s/TAG: MPGWMPP_//" | sed -e "s/_/./g"` +VERSION=`cvs log Changelog | grep TAG | head -n 1 | sed -e "s/TAG: MPWM_//" | sed -e "s/_/./g"` if [ "$1" != "--skip-deb" ] then diff --git a/images/dock_left.png b/images/dock_left.png Binary files differnew file mode 100644 index 0000000..3ba0274 --- /dev/null +++ b/images/dock_left.png diff --git a/images/dock_right.png b/images/dock_right.png Binary files differnew file mode 100644 index 0000000..3a8bfd2 --- /dev/null +++ b/images/dock_right.png diff --git a/images/dock_top.png b/images/dock_top.png Binary files differnew file mode 100644 index 0000000..c7710b3 --- /dev/null +++ b/images/dock_top.png diff --git a/src/Config.cpp b/src/Config.cpp index 588f674..b44fac3 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -1,4 +1,4 @@ -/* $Id: Config.cpp,v 1.12 2006/10/09 06:29:34 whot Exp $ */ +/* $Id: Config.cpp,v 1.13 2006/10/10 06:28:09 whot Exp $ */ /*-- --*/ @@ -106,6 +106,11 @@ Config::Config(XConn* x11) imgBtOverlay = IMAGEPATH "buttonoverlay.png"; imgBtMinimize = IMAGEPATH "buttonminimize.png"; + + imgDockTop = IMAGEPATH "dock_top.png"; + imgDockLeft = IMAGEPATH "dock_left.png"; + imgDockRight = IMAGEPATH "dock_right.png"; + // pencil sizes for overlay drawLineWidth = 4; eraseLineWidth = 25; diff --git a/src/Config.h b/src/Config.h index 4a1f102..dbafdc3 100644 --- a/src/Config.h +++ b/src/Config.h @@ -1,4 +1,4 @@ -/* $Id: Config.h,v 1.11 2006/10/09 06:29:34 whot Exp $ */ +/* $Id: Config.h,v 1.12 2006/10/10 06:28:09 whot Exp $ */ /*-- --*/ @@ -78,6 +78,10 @@ class Config char* imgBtMinimize; + char* imgDockTop; + char* imgDockLeft; + char* imgDockRight; + int drawLineWidth; int eraseLineWidth; diff --git a/src/Dock.cpp b/src/Dock.cpp index c6daff4..525692f 100644 --- a/src/Dock.cpp +++ b/src/Dock.cpp @@ -1,6 +1,8 @@ -/* $Id: Dock.cpp,v 1.2 2006/10/09 06:29:34 whot Exp $ */ +/* $Id: Dock.cpp,v 1.3 2006/10/10 06:28:09 whot Exp $ */ #include "Dock.h" +#include "Magick++.h" +#include "Util.h" Dock::Dock(XConn* x11) @@ -27,6 +29,33 @@ Dock::Dock(XConn* x11) dock = XCreateSimpleWindow(x11->dpy, x11->root, x, y, width, height, 0, 0, color.pixel); + XSelectInput(x11->dpy, dock, ExposureMask); + + XGCValues vals; + gc_dock = XCreateGC(x11->dpy, dock, 0, &vals); + + /* load images for dock */ + Magick::Image* img = Util::ImageFromFile(Config::getInstance()->imgDockTop); + if (img) + { + dock_top = Util::ImageToXImage(x11->dpy, x11->screen, img); + delete img; + } + + img = Util::ImageFromFile(Config::getInstance()->imgDockLeft); + if (img) + { + dock_left = Util::ImageToXImage(x11->dpy, x11->screen, img); + delete img; + } + + img = Util::ImageFromFile(Config::getInstance()->imgDockRight); + if (img) + { + dock_right = Util::ImageToXImage(x11->dpy, x11->screen, img); + delete img; + } + /* add apps to dock */ vector<DockApp*>::const_iterator it = apps.begin(); @@ -44,6 +73,13 @@ Dock::Dock(XConn* x11) XMapRaised(x11->dpy, dock); } +Dock::~Dock() +{ + XDestroyImage(dock_top); + XDestroyImage(dock_left); + XDestroyImage(dock_right); +} + bool Dock::hasWindow(Window win) { if (win == dock) @@ -74,7 +110,17 @@ void Dock::handleExpose(XExposeEvent* ev) { if (ev->window == dock) + { + XPutImage(x11->dpy, dock, gc_dock, dock_left, 0, 0, 0, 0, dock_left->width, dock_left->height); + + XPutImage(x11->dpy, dock, gc_dock, dock_right, 0, 0, width - dock_right->width, 0, dock_right->width, dock_right->height); + for (int i = dock_left->width; i < (width - dock_right->width); i++) + { + XPutImage(x11->dpy, dock, gc_dock, dock_top, 0, 0, i, 0, + dock_top->width, dock_top->height); + } return; + } vector<DockApp*>::const_iterator it = apps.begin(); @@ -99,6 +145,8 @@ void Dock::handleExpose(XExposeEvent* ev) } it2++; } + + return; } @@ -151,6 +199,8 @@ void Dock::appendProcess(WMWindow* win) DockProcess* dp = new DockProcess(x11, win, win->getIcon()); dp->initGUI(dock, dp_x, dp_y, DOCK_BUTTON_WIDTH, DOCK_BUTTON_HEIGHT); processes.push_back(dp); + + TRACE("append dock with %d, dpx %d\n", width, dp_x); } /* @@ -161,7 +211,6 @@ void Dock::removeProcess(DockProcess* dp) x += DOCK_BUTTON_WIDTH/2; width -= DOCK_BUTTON_WIDTH; XMoveResizeWindow(x11->dpy, dock, x, y, width, height); - XClearWindow(x11->dpy, dock); int dp_x, dp_y; dp_x = apps.size() * DOCK_BUTTON_WIDTH + DOCK_WIDTH_EXTENDED/2; @@ -174,5 +223,7 @@ void Dock::removeProcess(DockProcess* dp) dp_x += DOCK_BUTTON_WIDTH; it++; } + + TRACE("dock with %d, dpx %d\n", width, dp_x); } @@ -1,4 +1,4 @@ -/* $Id: Dock.h,v 1.2 2006/10/09 06:29:34 whot Exp $ */ +/* $Id: Dock.h,v 1.3 2006/10/10 06:28:09 whot Exp $ */ #ifndef __DOCK_H__ #define __DOCK_H__ @@ -20,7 +20,7 @@ const int DOCK_BUTTON_HEIGHT = 32; and right of the buttons. Height will be above the buttons. */ const int DOCK_WIDTH_EXTENDED = 10; -const int DOCK_HEIGHT_EXTENDED = 3; +const int DOCK_HEIGHT_EXTENDED = 5; class DockProcess; class DockApp; @@ -30,8 +30,13 @@ class Dock private: XConn* x11; Window dock; + GC gc_dock; vector<DockApp*> apps; /* apps to start app */ vector<DockProcess*> processes; /* minimized processes */ + + XImage* dock_top; + XImage* dock_left; + XImage* dock_right; int x; int y; @@ -40,6 +45,7 @@ class Dock public: Dock(XConn* x11); + ~Dock(); bool hasWindow(Window win); void handleExpose(XExposeEvent* ev); void handleButtonEvent(XButtonEvent *ev); diff --git a/src/DockApp.cpp b/src/DockApp.cpp index 34ae20e..a768349 100644 --- a/src/DockApp.cpp +++ b/src/DockApp.cpp @@ -1,4 +1,4 @@ -/* $Id: DockApp.cpp,v 1.2 2006/10/09 06:29:34 whot Exp $ */ +/* $Id: DockApp.cpp,v 1.3 2006/10/10 06:28:09 whot Exp $ */ #include "DockApp.h" #include <Magick++.h> @@ -17,6 +17,8 @@ DockApp::DockApp(XConn* x11, const char* app, char* imgfile) { ERR("Cannot create XImage.\n"); } + + delete img; } diff --git a/src/DockItem.cpp b/src/DockItem.cpp index 802b253..0e3fa93 100644 --- a/src/DockItem.cpp +++ b/src/DockItem.cpp @@ -1,7 +1,8 @@ -/* $Id: DockItem.cpp,v 1.1 2006/10/09 06:29:34 whot Exp $ */ +/* $Id: DockItem.cpp,v 1.2 2006/10/10 06:28:09 whot Exp $ */ #include "DockItem.h" #include "logger.h" +#include <X11/Xutil.h> void DockItem::handleExpose(XExposeEvent* ev) { @@ -33,6 +34,9 @@ bool DockItem::hasWindow(Window win) } DockItem::~DockItem() { + XFreeGC(x11->dpy, button_gc); + XDestroyWindow(x11->dpy, button); + XDestroyImage(icon); } diff --git a/src/WMWindow.cpp b/src/WMWindow.cpp index 6934cf1..7cbddca 100644 --- a/src/WMWindow.cpp +++ b/src/WMWindow.cpp @@ -1,4 +1,4 @@ -/* $Id: WMWindow.cpp,v 1.21 2006/10/10 03:43:44 whot Exp $ */ +/* $Id: WMWindow.cpp,v 1.22 2006/10/10 06:28:09 whot Exp $ */ /*-- --*/ @@ -62,11 +62,8 @@ WMWindow::WMWindow(Manager* manager, Window w, XConn* x11) x = (x < 0) ? 0 : x; y = (y < 0) ? 0 : y; - int dpywidth = x11->width; - int dpyheight = x11->height; - - x = (x > (dpywidth - width)) ? dpywidth - width : x; - y = (y > (dpyheight - height)) ? dpyheight - height : y; + x = (x > (x11->width - width)) ? x11->width - width : x; + y = (y > (x11->height - height)) ? x11->height - height : y; state = attr.map_state; override_redirect = attr.override_redirect; @@ -217,8 +214,6 @@ void WMWindow::decorate() } } - - TRACE(" - windowBar %x\n", (unsigned int)windowBar); btClose = XCreateSimpleWindow(x11->dpy, windowBar, width - @@ -987,7 +982,7 @@ void WMWindow::setMinimize(bool minimize) } else { XMapWindow(x11->dpy, container); - XDestroyImage(icon); + // the icon image is freed when the dock item is destroyed icon = NULL; } } diff --git a/src/WMWindow.h b/src/WMWindow.h index fd6eca5..b0c62e6 100644 --- a/src/WMWindow.h +++ b/src/WMWindow.h @@ -1,4 +1,4 @@ -/* $Id: WMWindow.h,v 1.15 2006/10/10 03:43:44 whot Exp $ */ +/* $Id: WMWindow.h,v 1.16 2006/10/10 06:28:09 whot Exp $ */ /*-- --*/ @@ -45,6 +45,7 @@ class WMWindow Window client; // the actual client's window Window windowBar; // window manager top bar Window resizeBar; // the bottom bar. Holds resizeSE and resizeSW. + Window resizeBtNE; // resize button north-east Window resizeBtSE; // resize button south-east Window resizeBtNW; // resize button north-west |