git-svn-id: https://svn.code.sf.net/p/kooldock/code@60 9f32970d-5c29-0410-a1d8-a3be4640426c
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
pull/5/head
Blase Stanek 16 years ago committed by Alexander Golubev
parent 7cb7bef2c9
commit 42c5515635

@ -73,8 +73,7 @@ KoolDock::KoolDock(TQWidget* parent, const char* name) :
menuPath = progPath + TQString("/menu/"); menuPath = progPath + TQString("/menu/");
confFile = locateLocal("config", "kooldockrc"); confFile = locateLocal("config", "kooldockrc");
noSet = false; lockSetTab= false; // disables changing opened tab in preferences window
firstInit = true;
setupdlg = new SetupDialogPrg(); // create the setup dialog object. setupdlg = new SetupDialogPrg(); // create the setup dialog object.
connect(setupdlg, SIGNAL(apply()), SLOT(chkRestart())); connect(setupdlg, SIGNAL(apply()), SLOT(chkRestart()));
@ -100,24 +99,7 @@ KoolDock::KoolDock(TQWidget* parent, const char* name) :
connect(tasklist, SIGNAL(activated(int)), this, SLOT(goToWindow(int))); connect(tasklist, SIGNAL(activated(int)), this, SLOT(goToWindow(int)));
connect(deskpopup, SIGNAL(activated(int)), this, SLOT(sendToDesktop(int))); connect(deskpopup, SIGNAL(activated(int)), this, SLOT(sendToDesktop(int)));
menuCount = 0; menuCount = 0;
init(); //initialization
init1();
if (fFirstRun)
{
// Show welcome dialog.
const char* welcomeMsg =
I18N_NOOP("<center><B>Welcome</B></center>It appears to be the first time you run KoolDock.<br>"
"By default the dock is hidden at the botton of the screen, move your mouse"
" to the bottom edge of the screen and the dock will appear.<br>"
"Right click on the dock for a menu that allows you to configure it<br>"
"or run with <I>-o</I> parameter to have preferences window at start.<br>"
"We hope this software is usefull for you<br>-- The KoolDock Team");
KMessageBox::information(0L, i18n(welcomeMsg));
saveConf(); // create initial configuration.
}
init2();
firstInit = false;
} }
KoolDock::~KoolDock() KoolDock::~KoolDock()
@ -136,13 +118,13 @@ KoolDock::~KoolDock()
if (_filterData) delete(_filterData); if (_filterData) delete(_filterData);
} }
void KoolDock::mTimerEnd() void KoolDock::mTimerEnd() // mouse emulation timer
{ {
if (menuCount > 0) { if (menuCount > 0) {
return; return; // a popup is still opened - disable scrolling
} }
TQPoint pointer = TQCursor::pos(); TQPoint pointer = TQCursor::pos();
lastXPos = pointer.x() - rx; lastXPos = pointer.x() - rx; // remember current mouse position (relative to window position)
lastYPos = pointer.y() - ry; lastYPos = pointer.y() - ry;
int px, py, pw, ph; int px, py, pw, ph;
int mpx = pointer.x(); int mpx = pointer.x();
@ -250,7 +232,6 @@ void KoolDock::trackTimer2End()
getTopBG(); getTopBG();
} }
debug(TQString("tracktimer: grabWindow(%1, %2, %3, %4)").arg(x1).arg(dh - h1).arg(w1).arg(h1)); debug(TQString("tracktimer: grabWindow(%1, %2, %3, %4)").arg(x1).arg(dh - h1).arg(w1).arg(h1));
move2(x, dh - h);
resize2(w, h); resize2(w, h);
Ybase = iwBig2; Ybase = iwBig2;
enterEvent(NULL); enterEvent(NULL);
@ -303,7 +284,7 @@ void KoolDock::paintEvent(TQPaintEvent *)
int p1 = 0; int p1 = 0;
int p2 = 0; int p2 = 0;
KPixmapIO pixio; KPixmapIO pixio;
if (!fLeftImg.isEmpty()) { if (!fLeftImg.isEmpty()) {
TempBG = pixio.convertToImage(LeftImg); TempBG = pixio.convertToImage(LeftImg);
if ((fOrientation & 1) == 1) { if ((fOrientation & 1) == 1) {
@ -625,7 +606,7 @@ void KoolDock::paintEvent(TQPaintEvent *)
KPixmapEffect::fade(*currentIcon, ((float) 60) * 0.01, TQColor("#FFFFFF")); KPixmapEffect::fade(*currentIcon, ((float) 60) * 0.01, TQColor("#FFFFFF"));
} }
// End drawing icon effects // End drawing icon effects
Xpos += x; Xpos += x;
if ((fOrientation & 1) == 1) { if ((fOrientation & 1) == 1) {
std::swap(Xpos, Ypos); std::swap(Xpos, Ypos);
@ -637,7 +618,7 @@ void KoolDock::paintEvent(TQPaintEvent *)
} }
} // End drawing icons } // End drawing icons
// Draw the seperator between launcher and taskbar // Draw the seperators between launcher and taskbar, and between tasbar and systray
if (fShowTaskbar && ((numLaunchers > 0 && ((int) items.count() > numLaunchers)) || ((fShowKMenu == 1) && (items.count() > 1)))) { if (fShowTaskbar && ((numLaunchers > 0 && ((int) items.count() > numLaunchers)) || ((fShowKMenu == 1) && (items.count() > 1)))) {
i = numLaunchers - 1; i = numLaunchers - 1;
if ((i >= 0) && (i < (int) items.count() - 1)) { if ((i >= 0) && (i < (int) items.count() - 1)) {
@ -1406,7 +1387,7 @@ void KoolDock::enterEvent (TQEvent *)
iwBig = iwSmall; iwBig = iwSmall;
} }
resize2(w, h); resize2(w, h);
move2(x, dh - h); move2(x, rdh);
funcH = iwBig - iwSmall; funcH = iwBig - iwSmall;
iy = (iDist - iwSmall) / 2; iy = (iDist - iwSmall) / 2;
@ -1414,12 +1395,14 @@ void KoolDock::enterEvent (TQEvent *)
fExpanded = true; fExpanded = true;
oldfirstX = x; oldfirstX = x;
oldtmpw = w; oldtmpw = w;
paintEvent(NULL);
debug("enterEvent"); debug("enterEvent");
zoomTicksB = 0; zoomTicksB = 0;
zoomTicksS = 0; zoomTicksS = 0;
perf->start(); perf->start();
mkbigTimer->start(zoomStep, false); mkbigTimer->start(zoomStep, false);
mkbigTimerDo();
paintEvent(NULL);
move2(x,dh-h);
} }
void KoolDock::onleaveEvent(TQEvent *) void KoolDock::onleaveEvent(TQEvent *)
@ -2013,7 +1996,7 @@ void KoolDock::rmwTask(int iFound)
Item* item; Item* item;
int i; int i;
int ind = witems.at(iFound)->getIndex(); int ind = witems.at(iFound)->getIndex();
for (i = 0, item = witems.at(0); item; i++, item = witems.next()) { for (i = 0, item = witems.at(0); item; i++, item = witems.next()) {
if (item->getIndex() > ind) { if (item->getIndex() > ind) {
item->setIndex(item->getIndex() - 1); item->setIndex(item->getIndex() - 1);
@ -2458,10 +2441,8 @@ void KoolDock::editPref()
} }
loadIgnore(); // Load Ignore List loadIgnore(); // Load Ignore List
if (!setupdlg->isVisible()) { if (!setupdlg->isVisible() && !lockSetTab) {
if (!noSet) { setupdlg->tabWidget->setCurrentPage(0);
setupdlg->tabWidget->setCurrentPage(0);
}
} }
setupdlg->toReloadIcons->setChecked(false); setupdlg->toReloadIcons->setChecked(false);
@ -3084,16 +3065,15 @@ void KoolDock::reload()
items.clear(); items.clear();
witems.clear(); witems.clear();
} }
init1(); init();
init2();
if (setupdlg->isVisible()) { if (setupdlg->isVisible()) {
noSet = true; lockSetTab=true;
editPref(); editPref();
if (reloadIcons) { if (reloadIcons) {
setupdlg->appClear(); setupdlg->appClear();
setupdlg->appFill(); setupdlg->appFill();
} }
noSet = false; lockSetTab=false;
} }
} }
@ -3313,10 +3293,10 @@ void KoolDock::menuX(int num)
} }
} }
void KoolDock::init1() void KoolDock::init()
{ {
initialization = true; initialization = true;
nDesks=-1; nDesks=-2;
ptPart = 5; ptPart = 5;
// Load the configuration // Load the configuration
loadConf(); loadConf();
@ -3374,7 +3354,7 @@ void KoolDock::init1()
} }
} }
// Load the menu entries //Lets load the menu entries
if (reloadIcons) { if (reloadIcons) {
loadMenu(); loadMenu();
} }
@ -3491,6 +3471,7 @@ void KoolDock::init1()
ii_last = items.count() - 1; ii_last = items.count() - 1;
iOnClick = -1; iOnClick = -1;
onChangeTimer = NULL; onChangeTimer = NULL;
Ybase = 0; Ybase = 0;
soffset = 0; soffset = 0;
eoffset = 0; eoffset = 0;
@ -3552,10 +3533,21 @@ void KoolDock::init1()
iSpace * 2) / 2 - 4 * iwSmall - (int) ((3 * iDist + 1 - funcW) * (func(0) + func (iDist) - 2 * iwSmall) / (2 * iDist)) + 1; iSpace * 2) / 2 - 4 * iwSmall - (int) ((3 * iDist + 1 - funcW) * (func(0) + func (iDist) - 2 * iwSmall) / (2 * iDist)) + 1;
eoffset= (int) ((iwBig2 - iwSmall) * fAmount / 100); eoffset= (int) ((iwBig2 - iwSmall) * fAmount / 100);
doUpdateGeometry(); doUpdateGeometry();
} if (fFirstRun)
{
fFirstRun=false;
// Show welcome dialog.
const char* welcomeMsg =
I18N_NOOP("<center><B>Welcome</B></center>It appears to be the first time you run KoolDock.<br>"
"By default the dock is hidden at the botton of the screen, move your mouse"
" to the bottom edge of the screen and the dock will appear.<br>"
"Right click on the dock for a menu that allows you to configure it<br>"
"or run with <I>-o</I> parameter to have preferences window at start.<br>"
"We hope this software is usefull for you<br>-- The KoolDock Team");
KMessageBox::information(0L, i18n(welcomeMsg));
saveConf(); // create initial configuration.
}
void KoolDock::init2()
{
clipw = new clip(); clipw = new clip();
if (fHidden == 1) { if (fHidden == 1) {
@ -3631,6 +3623,7 @@ void KoolDock::init2()
} }
else { else {
pTest(); pTest();
} }
} }
@ -3705,6 +3698,7 @@ void KoolDock::dropEvent(TQDropEvent* event)
useList = false; useList = false;
} }
//Funtion used in window grouping
void KoolDock::movetoback(WId id) void KoolDock::movetoback(WId id)
{ {
int i; int i;
@ -3740,6 +3734,7 @@ void KoolDock::movetoback(WId id)
} }
} }
//Gets index of an incon by position
int KoolDock::itemFromPoint(int x) int KoolDock::itemFromPoint(int x)
{ {
int i, Xpos = -1; int i, Xpos = -1;
@ -3749,10 +3744,10 @@ int KoolDock::itemFromPoint(int x)
break; break;
} }
} }
currXPos = Xpos;
return i; return i;
} }
//Gets position of an icon by its index
int KoolDock::xFromIndex(int i) int KoolDock::xFromIndex(int i)
{ {
int Xpos; int Xpos;
@ -3825,7 +3820,7 @@ void KoolDock::updTaskList()
desks.setAutoDelete(true); desks.setAutoDelete(true);
//tasklist; menu to access every window throught navigation menu //tasklist; menu to access every window throught navigation menu
int j, index, incr, nDesks; int j, index, incr;
KWin::WindowInfo tmpinfo; KWin::WindowInfo tmpinfo;
nDesks = KWin::numberOfDesktops(); nDesks = KWin::numberOfDesktops();

@ -26,7 +26,7 @@
#include <tdeaboutdialog.h> #include <tdeaboutdialog.h>
#include <krootpixmap.h> #include <krootpixmap.h>
#include <kpixmap.h> #include <kpixmap.h>
#include <kurifilter.h> #include <kurifilter.h>
#include <tqwidget.h> #include <tqwidget.h>
#include <tqptrlist.h> #include <tqptrlist.h>
@ -48,7 +48,7 @@ const int UPDATE_DIST = 1; // update when x - last_x <= UPDATE_DIST
const int DEF_SMALL_SIZE = 32; // default small icon size const int DEF_SMALL_SIZE = 32; // default small icon size
const int DEF_BIG_SIZE = 90; // default big icon size const int DEF_BIG_SIZE = 90; // default big icon size
const int DEF_DOCK_OPACITY = 50; // default dock opacity const int DEF_DOCK_OPACITY = 50; // default dock opacity
const int DEF_PRIORITY = 5; const int DEF_PRIORITY = 5; // default priority
const int DEF_HIDDEN = 1; // default hidden priority const int DEF_HIDDEN = 1; // default hidden priority
const int ANIM_TOTAL_STEP = 6; // not in use yet const int ANIM_TOTAL_STEP = 6; // not in use yet
@ -66,44 +66,43 @@ class KoolDock : public TQWidget
KoolDock(TQWidget* parent = 0, const char* name = 0); KoolDock(TQWidget* parent = 0, const char* name = 0);
/** destructor */ /** destructor */
~KoolDock(); ~KoolDock();
void setMainPath(const TQString& path); void setMainPath(const TQString& path); // send run paramenters to the widget
void setArgs(const TQString& param); void setArgs(const TQString& param);
clip *clipw; clip *clipw; // clipping window - makes kooldock's edge sticky
private: private:
TQTime* perf; TQTime* perf; // variable used to control animation speed
// configuration variables // configuration variables
int fShowTaskbar; // show-taskbar flag int fShowTaskbar; // show-taskbar flag
int fMinimizedOnly; // show only minimized icons flag int fMinimizedOnly; // show only minimized icons flag
int fShowNotification; // show-notification flag int fShowNotification; // show-notification flag
int fShowBorders; // show-borders flag int fShowBorders; // show-borders flag
int fShowKMenu; // show the K menu int fShowKMenu; // show the K menu
int fUseKBFX; int fUseKBFX; // makes kooldock use KBFX insted of K menu
int fPriority; // "nice" priority int fPriority; // "nice" priority
int fMouseTimer; // Mouse timer interval int fMouseTimer; // Mouse timer interval
int fClipping; //window area clippig int fClipping; // window area clippig
int fClipIcons; //icon area clipping int fClipIcons; // icon area clipping
long int fzoomSpeed, zoomStep, zoomStepB, zoomStepS, zoomVal; //speed of show/hide animation long int fzoomSpeed, zoomStep, zoomStepB, zoomStepS, zoomVal; //speed of show/hide animation
int zoomTicksB, zoomTicksS; //counts timer ticks int zoomTicksB, zoomTicksS; //counts timer ticks
int neededTicksB,neededTicksS; //sets how many ticks is necessary to calculate new speed int neededTicksB,neededTicksS; //sets how many ticks is necessary to calculate new speed
bool fSpeed; bool fSpeed; // enables speed control
TQColor borderColor; TQColor borderColor;
int fHidden; // hidden dockbar int fHidden; // determines dock's autohide
int fStayBelow; int fStayBelow; // makes dock stay below other windows while not focused
int fOrientation; //bottom/left/top/right int fOrientation; //bottom/left/top/right
int fHideOnClick; int fHideOnClick; // determines if kooldock should hide after clicking an icon
int fSteppy; int fSteppy; // enables autocenter on icon
int fShowFrames; // frames to show the dock "growing from bottom" int fShowFrames; // frames to show the dock "growing from bottom"
int fGrowFrames; // frames to grow the icon when the mouse is over it. int fGrowFrames; // frames to grow the icon when the mouse is over it.
int fHighLightTime; int fHighLightTime;
bool fFirstRun; bool fFirstRun; // shows information box one time
bool fShowShot; bool fShowShot; // makes kooldock do screenshot of minimized window
bool fGrouping; bool fGrouping; // enables window grouping
int fRepaintInterval;
int xinerama; //whether we want xinerama int xinerama; //whether we want xinerama
int hideTimer; //user define time to show dock int hideTimer; //user define time to show dock
int Solid; //whether using backgroung Image or not (for preference controls) int Solid; //whether using background Image or not (for preference controls)
int fShowNav; //whether we want the navigation menu (clock + desktop chooser) in kooldocks main menu int fShowNav; //whether we want the navigation menu (clock + desktop chooser) in kooldocks main menu
int numSystray; //for systray control int numSystray; //for systray control
int fSystray; //whether we want the systray or not int fSystray; //whether we want the systray or not
@ -112,43 +111,38 @@ class KoolDock : public TQWidget
bool firstTime; //to control certain things bool firstTime; //to control certain things
TQString curTheme; //for the background theme (to preserve changes) TQString curTheme; //for the background theme (to preserve changes)
int leftRes; //Left monitor resolution int leftRes; //Left monitor resolution
int XinDesiredHeight; int XinDesiredHeight; // size of screen on which kooldock is visible in Xinerama
int XinPreviousWidth; int XinPreviousWidth;
int fpercentPos; int fpercentPos; // sets position of dock on screen
bool noSet; bool lockSetTab; // disables changing opened tab in preferences window
bool firstInit; bool reloadIcons; // sets the need of reloading icons after changes in setting
bool reloadIcons; bool initialization; // blocks dock during loading settings
bool initialization; int ptPart; // variable used in speed control as state data
int ptPart;
bool mouseOnLauncher; bool mouseOnLauncher; // determines if mouse is on laucher icon or on window icon
TQStringList lstDrop; TQStringList lstDrop; // list of dropped elements
bool useList; bool useList; // determines if dropped elements should be sent to selected application
Atom net_system_tray_selection; Atom net_system_tray_selection;
Atom net_system_tray_opcode; Atom net_system_tray_opcode;
TQString fLeftImg; TQString fLeftImg; //paths to background images
TQString fRightImg; TQString fRightImg;
TQString fCenterImg; TQString fCenterImg;
bool fNWideBg; bool fNWideBg; // determines if background should not be wider than screen
bool scaleMax; bool scaleMax; // sets scaling mode of background corners
TQPixmap LeftImg; TQPixmap LeftImg;
TQPixmap RightImg; TQPixmap RightImg;
TQPixmap CenterImg; TQPixmap CenterImg;
TQPixmap TempScaledCenter; TQPixmap TempScaledCenter;
TQPixmap TestPix;
TQImage TestIm;
unsigned int oLeft, oRight;
int iwSmall; int iwSmall; // sizes of small and big icon
int iwBig; int iwBig; // size of current big icon - during animation its value is between iwSmall and iwBig2
int iwBig2; int iwBig2; // size of base size of big icon
int firstX, tmpw; int firstX, tmpw; // variables used in background positioning
int oldfirstX, oldtmpw; int oldfirstX, oldtmpw;
int lastX; int lastX;
@ -157,7 +151,7 @@ class KoolDock : public TQWidget
TQColor sepColor; // separator bar's color TQColor sepColor; // separator bar's color
int Ybase; int Ybase; // sets position of dock, and how big part of dock is out of screen
// normal variables // normal variables
TQString progPath; TQString progPath;
@ -169,23 +163,22 @@ class KoolDock : public TQWidget
TQStringList ignoreList; TQStringList ignoreList;
NETWinInfo* info; NETWinInfo* info; // window informations
KWinModule* wm; KWinModule* wm;
SetupDialog* setupdlg; SetupDialog* setupdlg;
int Offset; int Offset; // scrolls dock if all icons are wider than screen
int numLaunchers; // number of quick launcher items int numLaunchers; // number of quick launcher items
int x, y, w, h, h0, h1, w0, x0, w1, x1; int x, y, w, h, h0, h1, w0, x0, w1, x1; // positions *0 - small *1 big
int rx, ry, rw, rh, uw; //current position int rx, ry, rw, rh, uw; //current position
int ix, iy, iDist, iSpace; int ix, iy, iDist, iSpace; // sizes of dock's elements - icons, distance between small icon centres, space between them
int dw, dh, rdh; int dw, dh, rdh; // real current position
int funcW, funcH; int funcW, funcH; // variables used to calculate zoomed icons sizes
int ii_first, ii_last; int ii_first, ii_last; // idexes of first and last zoomed icons
int soffset, eoffset; //used in icon positioning int soffset, eoffset; //used in icon positioning
int sx, sw; int adjust; // offset of first zoomed icon
int adjust; int fAmount; // amount of big icons
int fAmount; int last_mx; // mouse position
int last_mx;
int last_ncx; int last_ncx;
TQPtrList<Item> items;//currently visible items TQPtrList<Item> items;//currently visible items
@ -197,7 +190,7 @@ class KoolDock : public TQWidget
KRootPixmap* rootpix; KRootPixmap* rootpix;
KPixmap bottomBg; KPixmap bottomBg;
KPixmap bottomBgf; KPixmap bottomBgf; // faded bottom background
TQPixmap topBg; TQPixmap topBg;
TDEAboutDialog* aboutDlg; TDEAboutDialog* aboutDlg;
@ -210,24 +203,23 @@ class KoolDock : public TQWidget
int animStep; // animation step, not in use yet int animStep; // animation step, not in use yet
int iOnClick; // index of the quick launcher being clicked int iOnClick; // index of the quick launcher being clicked
WId cId; // id of the application (used in the right click menu over the taskbar) WId cId; // id of the application (used in the right click menu over the taskbar)
TQString cClass; WId CurrentFocus; // id of window that is currently active
WId CurrentFocus; TDEPopupMenu *deskpopup; // moving between desktops
int onChangeAnimStep; TDEPopupMenu *appMenu; // list of windows in selected group
TDEPopupMenu* deskpopup; TDEPopupMenu *godesk; // sends window to another desktop
TDEPopupMenu* appMenu; TDEPopupMenu *tasklist; // list of all windows
TDEPopupMenu* godesk; TDEPopupMenu *popup; // main popup
TDEPopupMenu* tasklist; TDEPopupMenu *advMenu; // kicker like advanced menu of window icon
TDEPopupMenu* popup; int menuCount; // counts menus - disable dock hiding when popups are visible, and determines if user want to do some changes to specific window, or to all windows in group
TDEPopupMenu* advMenu; int currMenu; // information to which window user apply changes
int menuCount, currMenu; bool allApps; // sets if dock should apply changes to all windows
bool allApps;
TQPtrList<TDEPopupMenu> popups; TQPtrList<TDEPopupMenu> popups;
bool iGroup; bool iGroup; // menu of icon is connect with single window or with group of windows
int dIndex, nDesks; int dIndex, nDesks; // index of desktop (0 for all), count of desktops
TQPtrList<dInfo> desks; TQPtrList<dInfo> desks;
bool fExpanded; bool fExpanded; // informs if kooldock is zoomed
bool track2active; bool track2active; // checks if second tracking timer is active - to make kooldock open in proper time
/*Xosd Section */ /*Xosd Section */
TQString nom; TQString nom;
TQString aux; TQString aux;
@ -243,62 +235,62 @@ class KoolDock : public TQWidget
int xosdSize; int xosdSize;
KURIFilterData* _filterData; KURIFilterData* _filterData;
xosd* xosdw; xosd* xosdw;
int animValue;
int animValue; // icon highlight
int animState; int animState;
void run(const TQString& cmd); bool doRepaint;
int func(int x); int lastXPos; // postion of mouse - used in autocenter
int lastYPos;
void run(const TQString& cmd); // runs command, including data dropped of launcher
int func(int x); // function used in scaling zoomed icons
int func2(int x); int func2(int x);
void doUpdateGeometry(); void doUpdateGeometry(); // updates kooldock dimentios, and icon positions
bool addTask(WId id, int iFound = -1); bool addTask(WId id, int iFound=-1); // add window to dock
bool rmTask(WId id, int iFound = -1); bool rmTask(WId id, int iFound=-1); // remove window from dock
void rmwTask(int iFound); void rmwTask(int iFound); // remove window from list (hidden, used for performance)
bool addwTask(WId id); bool addwTask(WId id);
void movetoback(WId id); void movetoback(WId id); // send icon in group to end of list - used to determine order of windows in group
void loadConf(); void loadConf();
void loadIgnore(); void loadIgnore();
void saveConf(); void saveConf();
void loadMenu(); void loadMenu();
void addWindows(); void addWindows(); // refreshes list of windows (hidden list, and icons on dock)
int itemFromPoint(int x); int itemFromPoint(int x); // gets icon in specified point
int xFromIndex(int i); int xFromIndex(int i); // gets position of icon from its index
void createMenu(TDEPopupMenu* tmpMenu, KWin::WindowInfo* info); void createMenu(TDEPopupMenu* tmpMenu, KWin::WindowInfo* info);
void updTaskList(); void updTaskList(); // recreate popup menu of all applications
void addToTaskList(WId id); void addToTaskList(WId id); // add window to menu
void rmFromTaskList(WId id); void rmFromTaskList(WId id); // remove from menu
bool doRepaint; void init();
int currXPos;
int lastXPos;
int lastYPos;
void init1();
void init2();
protected: protected:
void paintEvent(TQPaintEvent*); void paintEvent(TQPaintEvent*);
void mousePressEvent(TQMouseEvent*); void mousePressEvent(TQMouseEvent*);
void mMoveEvent(int ex, int ey); void mMoveEvent(int ex, int ey); // mouse move event called by timer (to avoid 'freezes' i.e. when menu are open)
void mPress( int mx, int my, ButtonState srcButton); void mPress(int mx, int my, ButtonState srcButton); // press event, used insted of normal event for simplicity of calling
void wheelEvent(TQWheelEvent*); void wheelEvent(TQWheelEvent*);
void enterEvent(TQEvent*); void enterEvent(TQEvent*);
void onleaveEvent(TQEvent*); void onleaveEvent(TQEvent*); // event called when mouse leves dock
void mksmallTimerstop(); void mksmallTimerstop(); // called when stopping smalling aninamtion
void dragMoveEvent(TQDragMoveEvent* event); void dragMoveEvent(TQDragMoveEvent* event);
void dropEvent(TQDropEvent* event); void dropEvent(TQDropEvent* event);
public slots: public slots:
void edit(); void edit(); // shows launcher editing page
void editPref(); void editPref(); // shows preferences
void about(); void about();
void windowAdded(WId id); void windowAdded(WId id); // events called when window appaers/disappears
void windowRemoved(WId id); void windowRemoved(WId id);
void numberOfDesktopsChanged(int); void numberOfDesktopsChanged(int); // called when number of desktops has changed
void windowChanged(WId id, unsigned int properties); void windowChanged(WId id, unsigned int properties); // when window was modified - moved, resized, minimized, etc.
void activeWindowChanged(WId id); void activeWindowChanged(WId id); // focus changed
void workAreaChanged(); void workAreaChanged();
void currentDesktopChanged(int); void currentDesktopChanged(int);
void onChangeTimerTicked(); void onChangeTimerTicked(); // called when icon is highlighted
void updateBackground(const TQPixmap&); void updateBackground(const TQPixmap&);
void moveApp(); void moveApp(); // functions used to manipulate windows
void resizeApp(); void resizeApp();
void minApp(); void minApp();
void maxApp(); void maxApp();
@ -310,21 +302,23 @@ class KoolDock : public TQWidget
void shadeApp(); void shadeApp();
void activateApp(); void activateApp();
void closeApp(); void closeApp();
void editItem(); void toggleAlwaysOnTop();
void removeItem(); void toggleKeptBelowOthers();
void sendToDesktop(int); void toggleFullScreen();
void goToDesktop(int); void sendToDesktop(int); // sends app to another desktop
void goToWindow(int); void goToWindow(int); // sets focus
void editItem(); // edit launcher
void removeItem(); // remove launcher
void goToDesktop(int); // changes current desktop
/* Systray support */ /* Systray support */
void systemTrayWindowAdded(WId id); void systemTrayWindowAdded(WId id);
void systemTrayWindowRemoved(WId id); void systemTrayWindowRemoved(WId id);
void aboutToShow();
/* menus */
void aboutToShow(); // events associated with all popups
void aboutToHide(); void aboutToHide();
void toggleAlwaysOnTop();
void toggleKeptBelowOthers();
void toggleFullScreen();
static void addFile(const TQString& filename, static void addFile(const TQString& filename,
const TQString& iconname, const TQString& iconname,
const TQString& execname, const TQString& execname,
@ -342,27 +336,27 @@ class KoolDock : public TQWidget
#ifndef _ENABLE_DEBUG #ifndef _ENABLE_DEBUG
static void debug(TQString); static void debug(TQString);
#endif #endif
void mkbigTimerDo(); void mkbigTimerDo(); // tick of animation timers
void mksmallTimerDo(); void mksmallTimerDo();
void endProg(); void endProg();
void mTimerEnd(); void mTimerEnd(); // event called by mTimer - detects mouse position
void trackTimerEnd(); void trackTimerEnd(); // checks if cursor touched screen edge, on which kooldock is autohided
void trackTimer2End(); void trackTimer2End(); // enabled by first trackTimer - provides kooldock's opening in proper time
void restart(); void restart();
void reload(); void reload();
void chkRestart(); void chkRestart(); // sub called by preferences window, after clicking apply or ok
void refreshBackground(); void refreshBackground();
void unhighlight(); void unhighlight();
void move2(int nx, int ny); void move2(int nx, int ny); // moves dock
void resize2(int nw, int nh); void resize2(int nw, int nh); // resizes dock
void getBottomBG(); void getBottomBG(); // gets bottom part of background - covered by small icons
void getTopBG(); void getTopBG(); // gets upper part of background - covered by zoomed icons
void setDesktopIconsArea(int, int, int, int); void setDesktopIconsArea(int, int, int, int); // changes KDE desktop area
void setDockAbove(); void setDockAbove();
void setDockBelow(); void setDockBelow();
void menuX(int num); void menuX(int num); // event called when user highlighted menu of specified window in window group menu
void menuShow(); void menuShow(); // event called when deskpopup is about to show - updates settings on menu for selected window
void pTest(); void pTest(); // performance test
}; };
#endif // KOOLDOCK_H #endif // KOOLDOCK_H

@ -15,15 +15,19 @@
#include <kdebug.h> #include <kdebug.h>
#include <stdlib.h> #include <stdlib.h>
xosd::xosd(TQWidget* parent, const char* name) : xosd::xosd(TQWidget *parent, const char *name) :
TQWidget(parent, name, WStyle_Customize | WRepaintNoErase | WStyle_NoBorder | TQWidget(parent, name, WStyle_Customize | WRepaintNoErase | WStyle_NoBorder |
WDestructiveClose | WResizeNoErase | WMouseNoMask | WStyle_StaysOnTop | WX11BypassWM) WDestructiveClose | WStyle_StaysOnTop | WX11BypassWM)
{ {
info = new NETWinInfo(tqt_xdisplay(), winId(), tqt_xrootwin(), NET::WMState); info = new NETWinInfo(tqt_xdisplay(), winId(), tqt_xrootwin(), NET::WMState);
info->setDesktop(NETWinInfo::OnAllDesktops); info->setDesktop(NETWinInfo::OnAllDesktops);
hide(); hide();
KWin::setState(winId(), NET::SkipTaskbar | NET::SkipPager); KWin::setState(winId(), NET::SkipTaskbar | NET::SkipPager);
setCaption("kooldock xosd window"); setCaption("kooldock xosd window");
w=0;
h=0;
yOffset=0;
fCleaner=0;
} }
xosd::~xosd() xosd::~xosd()
@ -110,7 +114,7 @@ void xosd::paintEvent(TQPaintEvent*)
TQPixmap pm(size()); TQPixmap pm(size());
TQBitmap bm(size()); TQBitmap bm(size());
TQPainter p; TQPainter p;
// Drawing text // Drawing text
p.begin(&pm, this); p.begin(&pm, this);
if (fCleaner == 1) { if (fCleaner == 1) {

Loading…
Cancel
Save