• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
twin.h
1/* This file is part of the KDE libraries
2 Copyright (C) 1999 Matthias Ettrich (ettrich@kde.org)
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19#ifndef KWIN_H
20#define KWIN_H
21
22#include <sys/types.h>
23#include <tqwindowdefs.h>
24#include <tqstring.h>
25#include <tqpixmap.h>
26#include "tdelibs_export.h"
27
28#ifdef Q_OS_UNIX
29
30#include <netwm_def.h>
31class NETWinInfo;
32
61class TDECORE_EXPORT KWin
62{
63public:
64
92 static void activateWindow( WId win, long time = 0 );
93
108 static void forceActiveWindow( WId win, long time = 0 );
113 static void setActiveWindow( WId win ) TDE_DEPRECATED;
114
126 static void demandAttention( WId win, bool set = true );
127
138 static void setUserTime( WId win, long time );
139
143 static void invokeContextHelp();
144
145
159 static void setMainWindow( TQWidget* subwindow, WId mainwindow );
160
170 static void setSystemTrayWindowFor( WId trayWin, WId forWin );
171
172 class WindowInfo;
173 class WindowInfoPrivate;
187 static WindowInfo windowInfo( WId win, unsigned long properties = 0, unsigned long properties2 = 0 );
188
196 static WId transientFor( WId window );
197
203 static WId groupLeader( WId window );
204
221 static TQPixmap icon( WId win, int width = -1, int height = -1, bool scale = false );
222
231 enum IconSource { NETWM = 1,
232 WMHints = 2,
233 ClassHint = 4,
234 XApp = 8
235 };
251 static TQPixmap icon( WId win, int width, int height, bool scale, int flags );
252
259 static void setIcons( WId win, const TQPixmap& icon, const TQPixmap& miniIcon );
260
267 static void setType( WId win, NET::WindowType windowType );
268
280 static void setState( WId win, unsigned long state );
281
293 static void clearState( WId win, unsigned long state );
294
305 static void setOpacity( WId win, uint percent );
306
317 static void setShadowSize( WId win, uint percent );
318
327 static void setOnAllDesktops( WId win, bool b );
328
335 static void setOnDesktop( WId win, int desktop);
336
358 static void setExtendedStrut( WId win, int left_width, int left_start, int left_end,
359 int right_width, int right_start, int right_end, int top_width, int top_start, int top_end,
360 int bottom_width, int bottom_start, int bottom_end );
361
372 static void setStrut( WId win, int left, int right, int top, int bottom );
377 static int currentDesktop();
378
384 static int numberOfDesktops();
385
391 static void setCurrentDesktop( int desktop );
392
400 static void setCurrentDesktopViewport( int desktop, TQPoint viewport );
401
410 static void iconifyWindow( WId win, bool animation = true );
411
420 static void deIconifyWindow( WId win, bool animation = true );
421
429 static void raiseWindow( WId win );
430
438 static void lowerWindow( WId win );
439
445 static bool icccmCompliantMappingState();
446
451 static bool allowedActionsSupported();
452
458 static TQString readNameProperty( WId window, unsigned long atom );
459
464 static bool compositingActive();
465
469 struct TDECORE_EXPORT Info
470 {
472 WId win;
474 long unsigned int state;
476 bool isMinimized() const;
477 bool isIconified() const;
478 NET::MappingState mappingState;
480 NETStrut strut;
482 NET::WindowType windowType;
484 TQString visibleName;
486 TQString name;
488 int desktop;
490 bool onAllDesktops;
492 pid_t pid;
494 TQRect geometry;
496 TQRect frameGeometry;
497
498 TQString visibleNameWithState() const;
499 };
500
505 static Info info( WId win ) TDE_DEPRECATED;
506
507#ifdef KDE_NO_COMPAT
508private:
509#endif
514 static void appStarted() TDE_DEPRECATED;
515};
516
517
522class TDECORE_EXPORT KWin::WindowInfo
523{
524public:
528 WindowInfo( WId window, unsigned long properties, unsigned long properties2 );
529 WindowInfo(); // to make TQValueList and others happy
530 ~WindowInfo();
537 bool valid( bool withdrawn_is_valid = false ) const;
541 WId win() const;
546 unsigned long state() const;
552 bool hasState( unsigned long s ) const { return ( state() & s ) == s; }
560 bool isMinimized() const;
567 NET::MappingState mappingState() const;
572 NETExtendedStrut extendedStrut() const;
578 NETStrut strut() const;
584 NET::WindowType windowType( int supported_types ) const;
590 TQString visibleName() const;
600 TQString visibleNameWithState() const;
606 TQString name() const;
613 TQString visibleIconName() const;
624 TQString visibleIconNameWithState() const;
631 TQString iconName() const;
636 bool isOnCurrentDesktop() const;
641 bool isOnDesktop( int desktop ) const;
647 bool onAllDesktops() const;
653 int desktop() const;
658 TQRect geometry() const;
663 TQRect frameGeometry() const;
669 WId transientFor() const;
674 WId groupLeader() const;
675
682 TQCString windowClassClass() const;
683
690 TQCString windowClassName() const;
691
697 TQCString windowRole() const;
698
704 TQCString clientMachine() const;
705
711 bool actionSupported( NET::Action action ) const;
712
713 WindowInfo( const WindowInfo& );
714 WindowInfo& operator=( const WindowInfo& );
715private:
716 WindowInfoPrivate* d;
717};
718
719#endif //Q_OS_UNIX
720
721#endif
KWin::WindowInfo
Information about a window.
Definition: twin.h:523
KWin::WindowInfo::hasState
bool hasState(unsigned long s) const
Returns true if the window has the given state flag set (see the NET::State enum for details).
Definition: twin.h:552
KWin
Convenience access to certain properties and features of the window manager.
Definition: twin.h:62
KWin::IconSource
IconSource
Masks specifying from which sources to read an icon.
Definition: twin.h:231
NET::WindowType
WindowType
Window type.
Definition: netwm_def.h:294
NET::Action
Action
Actions that can be done with a window (_NET_WM_ALLOWED_ACTIONS).
Definition: netwm_def.h:474
NET::MappingState
MappingState
Client window mapping state.
Definition: netwm_def.h:464
KWin::Info
Definition: twin.h:470
KWin::Info::frameGeometry
TQRect frameGeometry
Position and size of the window's frame.
Definition: twin.h:496
KWin::Info::pid
pid_t pid
The process id of the window's owner.
Definition: twin.h:492
KWin::Info::win
WId win
The window's id.
Definition: twin.h:472
KWin::Info::geometry
TQRect geometry
Position and size of the window contents.
Definition: twin.h:494
KWin::Info::state
long unsigned int state
The window's state.
Definition: twin.h:474
KWin::Info::desktop
int desktop
The number of the window's desktop.
Definition: twin.h:488
KWin::Info::windowType
NET::WindowType windowType
The window type.
Definition: twin.h:482
KWin::Info::onAllDesktops
bool onAllDesktops
true if the window is on all desktops.
Definition: twin.h:490
KWin::Info::visibleName
TQString visibleName
The visible name of the window.
Definition: twin.h:484
KWin::Info::strut
NETStrut strut
The strut.
Definition: twin.h:480
KWin::Info::name
TQString name
The name of the window.
Definition: twin.h:486
NETExtendedStrut
Partial strut class for NET classes.
Definition: netwm_def.h:153
NETStrut
Definition: netwm_def.h:195

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.