Changeset View
Changeset View
Standalone View
Standalone View
abstract_client.h
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Line(s) | 61 | { | |||
---|---|---|---|---|---|
239 | * @see moveable | 239 | * @see moveable | ||
240 | **/ | 240 | **/ | ||
241 | Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens) | 241 | Q_PROPERTY(bool moveableAcrossScreens READ isMovableAcrossScreens) | ||
242 | /** | 242 | /** | ||
243 | * Whether the Client can be resized. The property is evaluated each time it is invoked. | 243 | * Whether the Client can be resized. The property is evaluated each time it is invoked. | ||
244 | * Because of that there is no notify signal. | 244 | * Because of that there is no notify signal. | ||
245 | **/ | 245 | **/ | ||
246 | Q_PROPERTY(bool resizeable READ isResizable) | 246 | Q_PROPERTY(bool resizeable READ isResizable) | ||
247 | | ||||
248 | /** | ||||
249 | * The desktop file name of the application this AbstractClient belongs to. | ||||
250 | * | ||||
251 | * This is either the base name without full path and without file extension of the | ||||
252 | * desktop file for the window's application (e.g. "org.kde.foo"). | ||||
253 | * | ||||
254 | * The application's desktop file name can also be the full path to the desktop file | ||||
255 | * (e.g. "/opt/kde/share/org.kde.foo.desktop") in case it's not in a standard location. | ||||
256 | **/ | ||||
257 | Q_PROPERTY(QByteArray desktopFileName READ desktopFileName NOTIFY desktopFileNameChanged) | ||||
247 | public: | 258 | public: | ||
248 | virtual ~AbstractClient(); | 259 | virtual ~AbstractClient(); | ||
249 | 260 | | |||
250 | QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const { | 261 | QWeakPointer<TabBox::TabBoxClientImpl> tabBoxClient() const { | ||
251 | return m_tabBoxClient.toWeakRef(); | 262 | return m_tabBoxClient.toWeakRef(); | ||
252 | } | 263 | } | ||
253 | bool isFirstInTabBox() const { | 264 | bool isFirstInTabBox() const { | ||
254 | return m_firstInTabBox; | 265 | return m_firstInTabBox; | ||
▲ Show 20 Lines • Show All 339 Lines • ▼ Show 20 Line(s) | |||||
594 | 605 | | |||
595 | /** | 606 | /** | ||
596 | * Restores the AbstractClient after it had been hidden due to show on screen edge functionality. | 607 | * Restores the AbstractClient after it had been hidden due to show on screen edge functionality. | ||
597 | * The AbstractClient also gets raised (e.g. Panel mode windows can cover) and the AbstractClient | 608 | * The AbstractClient also gets raised (e.g. Panel mode windows can cover) and the AbstractClient | ||
598 | * gets informed in a window specific way that it is shown and raised again. | 609 | * gets informed in a window specific way that it is shown and raised again. | ||
599 | **/ | 610 | **/ | ||
600 | virtual void showOnScreenEdge() = 0; | 611 | virtual void showOnScreenEdge() = 0; | ||
601 | 612 | | |||
613 | QByteArray desktopFileName() const { | ||||
614 | return m_desktopFileName; | ||||
615 | } | ||||
616 | | ||||
602 | // TODO: remove boolean trap | 617 | // TODO: remove boolean trap | ||
603 | static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false); | 618 | static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false); | ||
604 | 619 | | |||
605 | public Q_SLOTS: | 620 | public Q_SLOTS: | ||
606 | virtual void closeWindow() = 0; | 621 | virtual void closeWindow() = 0; | ||
607 | 622 | | |||
608 | Q_SIGNALS: | 623 | Q_SIGNALS: | ||
609 | void fullScreenChanged(); | 624 | void fullScreenChanged(); | ||
Show All 25 Lines | |||||
635 | void moveResizeCursorChanged(Qt::CursorShape); | 650 | void moveResizeCursorChanged(Qt::CursorShape); | ||
636 | void clientStartUserMovedResized(KWin::AbstractClient*); | 651 | void clientStartUserMovedResized(KWin::AbstractClient*); | ||
637 | void clientStepUserMovedResized(KWin::AbstractClient *, const QRect&); | 652 | void clientStepUserMovedResized(KWin::AbstractClient *, const QRect&); | ||
638 | void clientFinishUserMovedResized(KWin::AbstractClient*); | 653 | void clientFinishUserMovedResized(KWin::AbstractClient*); | ||
639 | void closeableChanged(bool); | 654 | void closeableChanged(bool); | ||
640 | void minimizeableChanged(bool); | 655 | void minimizeableChanged(bool); | ||
641 | void shadeableChanged(bool); | 656 | void shadeableChanged(bool); | ||
642 | void maximizeableChanged(bool); | 657 | void maximizeableChanged(bool); | ||
658 | void desktopFileNameChanged(); | ||||
643 | 659 | | |||
644 | protected: | 660 | protected: | ||
645 | AbstractClient(); | 661 | AbstractClient(); | ||
646 | void setFirstInTabBox(bool enable) { | 662 | void setFirstInTabBox(bool enable) { | ||
647 | m_firstInTabBox = enable; | 663 | m_firstInTabBox = enable; | ||
648 | } | 664 | } | ||
649 | void setIcon(const QIcon &icon); | 665 | void setIcon(const QIcon &icon); | ||
650 | void startAutoRaise(); | 666 | void startAutoRaise(); | ||
▲ Show 20 Lines • Show All 262 Lines • ▼ Show 20 Line(s) | |||||
913 | 929 | | |||
914 | void setDecoration(KDecoration2::Decoration *decoration) { | 930 | void setDecoration(KDecoration2::Decoration *decoration) { | ||
915 | m_decoration.decoration = decoration; | 931 | m_decoration.decoration = decoration; | ||
916 | } | 932 | } | ||
917 | virtual void destroyDecoration(); | 933 | virtual void destroyDecoration(); | ||
918 | void startDecorationDoubleClickTimer(); | 934 | void startDecorationDoubleClickTimer(); | ||
919 | void invalidateDecorationDoubleClickTimer(); | 935 | void invalidateDecorationDoubleClickTimer(); | ||
920 | 936 | | |||
937 | void setDesktopFileName(const QByteArray &name); | ||||
938 | QString iconFromDesktopFile() const; | ||||
939 | | ||||
921 | private: | 940 | private: | ||
922 | void handlePaletteChange(); | 941 | void handlePaletteChange(); | ||
923 | QSharedPointer<TabBox::TabBoxClientImpl> m_tabBoxClient; | 942 | QSharedPointer<TabBox::TabBoxClientImpl> m_tabBoxClient; | ||
924 | bool m_firstInTabBox = false; | 943 | bool m_firstInTabBox = false; | ||
925 | bool m_skipTaskbar = false; | 944 | bool m_skipTaskbar = false; | ||
926 | /** | 945 | /** | ||
927 | * Unaffected by KWin | 946 | * Unaffected by KWin | ||
928 | **/ | 947 | **/ | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | |||||
980 | } m_moveResize; | 999 | } m_moveResize; | ||
981 | 1000 | | |||
982 | struct { | 1001 | struct { | ||
983 | KDecoration2::Decoration *decoration = nullptr; | 1002 | KDecoration2::Decoration *decoration = nullptr; | ||
984 | QPointer<Decoration::DecoratedClientImpl> client; | 1003 | QPointer<Decoration::DecoratedClientImpl> client; | ||
985 | QElapsedTimer doubleClickTimer; | 1004 | QElapsedTimer doubleClickTimer; | ||
986 | } m_decoration; | 1005 | } m_decoration; | ||
987 | 1006 | | |||
1007 | QByteArray m_desktopFileName; | ||||
1008 | | ||||
988 | 1009 | | |||
989 | static bool s_haveResizeEffect; | 1010 | static bool s_haveResizeEffect; | ||
990 | }; | 1011 | }; | ||
991 | 1012 | | |||
992 | /** | 1013 | /** | ||
993 | * Helper for AbstractClient::blockGeometryUpdates() being called in pairs (true/false) | 1014 | * Helper for AbstractClient::blockGeometryUpdates() being called in pairs (true/false) | ||
994 | */ | 1015 | */ | ||
995 | class GeometryUpdatesBlocker | 1016 | class GeometryUpdatesBlocker | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |