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