• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.0 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • windowmanagement
kwindowsystem_win.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the KDE libraries
3  Copyright (C) 2007 Laurent Montel (montel@kde.org)
4  Copyright (C) 2007 Christian Ehrlicher (ch.ehrlicher@gmx.de)
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #include "kwindowsystem.h"
23 
24 #include <QtGui/QDesktopWidget>
25 #include <QtGui/QIcon>
26 #include <QtGui/QBitmap>
27 #include <QtGui/QPixmap>
28 #include <QtCore/QLibrary>
29 
30 #include "kglobal.h"
31 #include "kdebug.h"
32 #include "klocalizedstring.h"
33 
34 #include <windows.h>
35 #include <windowsx.h>
36 
37 #ifdef __WIN64
38 #define GCL_HICON GCLP_HICON
39 #define GCL_HICONSM GCLP_HICONSM
40 #endif
41 
42 //function to register us as taskmanager
43 #define RSH_UNREGISTER 0
44 #define RSH_REGISTER 1
45 #define RSH_TASKMGR 3
46 typedef bool (WINAPI *PtrRegisterShellHook)(HWND hWnd, DWORD method);
47 
48 static PtrRegisterShellHook pRegisterShellHook = 0;
49 static int WM_SHELLHOOK = -1;
50 
51 class KWindowSystemStaticContainer {
52 public:
53  KWindowSystemStaticContainer() : d(0) {}
54  KWindowSystem kwm;
55  KWindowSystemPrivate* d;
56 };
57 
58 K_GLOBAL_STATIC(KWindowSystemStaticContainer, g_kwmInstanceContainer)
59 
60 K_GLOBAL_STATIC(QDesktopWidget, s_deskWidget)
61 
62 
63 struct InternalWindowInfo
64 {
65  InternalWindowInfo(){}
66  QPixmap bigIcon;
67  QPixmap smallIcon;
68  QString windowName;
69 };
70 
71 class KWindowSystemPrivate : public QWidget
72 {
73  friend class KWindowSystem;
74  public:
75  KWindowSystemPrivate ( int what );
76  ~KWindowSystemPrivate();
77 
78  static bool CALLBACK EnumWindProc (WId hwnd, LPARAM lparam);
79  static void readWindowInfo (WId wid , InternalWindowInfo *winfo);
80 
81  void windowAdded (WId wid);
82  void windowRemoved (WId wid);
83  void windowActivated (WId wid);
84  void windowRedraw (WId wid);
85  void windowFlash (WId wid);
86  void windowStateChanged (WId wid);
87  void reloadStackList ( );
88  void activate ( );
89 
90 
91  protected:
92  bool winEvent ( MSG * message, long * result );
93 
94  private:
95  bool activated;
96  int what;
97  WId fakeHwnd;
98  QList<WId> stackingOrder;
99  QMap<WId,InternalWindowInfo> winInfos;
100 };
101 
102 static HBITMAP QPixmapMask2HBitmap(const QPixmap &pix)
103 {
104  QBitmap bm = pix.mask();
105  if( bm.isNull() ) {
106  bm = QBitmap( pix.size() );
107  bm.fill( Qt::color1 );
108  }
109  QImage im = bm.toImage().convertToFormat( QImage::Format_Mono );
110  im.invertPixels(); // funny blank'n'white games on windows
111  int w = im.width();
112  int h = im.height();
113  int bpl = (( w + 15 ) / 16 ) * 2; // bpl, 16 bit alignment
114  QByteArray bits( bpl * h, '\0' );
115  for (int y=0; y < h; y++)
116  memcpy( bits.data() + y * bpl, im.scanLine( y ), bpl );
117  return CreateBitmap( w, h, 1, 1, bits );
118 }
119 
120 KWindowSystemPrivate::KWindowSystemPrivate(int what) : QWidget(0),activated(false)
121 {
122  //i think there is no difference in windows we always load everything
123  what = KWindowSystem::INFO_WINDOWS;
124  setVisible(false);
125 }
126 
127 void KWindowSystemPrivate::activate ( )
128 {
129  //prevent us from doing the same over and over again
130  if(activated)
131  return;
132  activated = true;
133 
134  //resolve winapi stuff
135  if(!pRegisterShellHook) pRegisterShellHook = (PtrRegisterShellHook)QLibrary::resolve("shell32",(LPCSTR)0xb5);
136 
137  //get the id for the shellhook message
138  if(WM_SHELLHOOK==-1) {
139  WM_SHELLHOOK = RegisterWindowMessage(TEXT("SHELLHOOK"));
140  //kDebug() << "WM_SHELLHOOK:" << WM_SHELLHOOK << winId();
141  }
142 
143  bool shellHookRegistered = false;
144  if(pRegisterShellHook)
145  shellHookRegistered = pRegisterShellHook(winId(),RSH_TASKMGR);
146 
147  if(!shellHookRegistered)
148  //use a timer and poll the windows ?
149  kDebug() << "Could not create shellhook to receive WindowManager Events";
150 
151  //fetch window infos
152  reloadStackList();
153 }
154 
155 KWindowSystemPrivate::~KWindowSystemPrivate()
156 {
157  if(pRegisterShellHook)
158  pRegisterShellHook(winId(),RSH_UNREGISTER);
159 }
160 
164 bool KWindowSystemPrivate::winEvent ( MSG * message, long * result )
165 {
166  /*
167  check winuser.h for the following codes
168  HSHELL_WINDOWCREATED 1
169  HSHELL_WINDOWDESTROYED 2
170  HSHELL_ACTIVATESHELLWINDOW 3
171  HSHELL_WINDOWACTIVATED 4
172  HSHELL_GETMINRECT 5
173  HSHELL_RUDEAPPACTIVATED 32768 + 4 = 32772
174  HSHELL_REDRAW 6
175  HSHELL_FLASH 32768 + 6 = 32774
176  HSHELL_TASKMAN 7
177  HSHELL_LANGUAGE 8
178  HSHELL_SYSMENU 9
179  HSHELL_ENDTASK 10
180  HSHELL_ACCESSIBILITYSTATE 11
181  HSHELL_APPCOMMAND 12
182  HSHELL_WINDOWREPLACED 13
183  HSHELL_WINDOWREPLACING 14
184  */
185  if (message->message == WM_SHELLHOOK) {
186 // kDebug() << "what has happened?:" << message->wParam << message->message;
187 
188  switch(message->wParam) {
189  case HSHELL_WINDOWCREATED:
190  KWindowSystem::s_d_func()->windowAdded(reinterpret_cast<WId>(message->lParam));
191  break;
192  case HSHELL_WINDOWDESTROYED:
193  KWindowSystem::s_d_func()->windowRemoved(reinterpret_cast<WId>(message->lParam));
194  break;
195  case HSHELL_WINDOWACTIVATED:
196 #ifndef _WIN32_WCE
197  case HSHELL_RUDEAPPACTIVATED:
198 #endif
199  KWindowSystem::s_d_func()->windowActivated(reinterpret_cast<WId>(message->lParam));
200  break;
201 #ifndef _WIN32_WCE
202  case HSHELL_GETMINRECT:
203  KWindowSystem::s_d_func()->windowStateChanged(reinterpret_cast<WId>(message->lParam));
204  break;
205  case HSHELL_REDRAW: //the caption has changed
206  KWindowSystem::s_d_func()->windowRedraw(reinterpret_cast<WId>(message->lParam));
207  break;
208  case HSHELL_FLASH:
209  KWindowSystem::s_d_func()->windowFlash(reinterpret_cast<WId>(message->lParam));
210  break;
211 #endif
212  }
213  }
214  return QWidget::winEvent(message,result);
215 }
216 
217 bool CALLBACK KWindowSystemPrivate::EnumWindProc(WId hWnd, LPARAM lparam)
218 {
219  QByteArray windowText = QByteArray ( (GetWindowTextLength(hWnd)+1) * sizeof(wchar_t), 0 ) ;
220  GetWindowTextW(hWnd, (LPWSTR)windowText.data(), windowText.size());
221  DWORD ex_style = GetWindowExStyle(hWnd);
222  KWindowSystemPrivate *p = KWindowSystem::s_d_func();
223 
224  QString add;
225  if( !QString::fromWCharArray((wchar_t*)windowText.data()).trimmed().isEmpty() && IsWindowVisible( hWnd ) && !(ex_style&WS_EX_TOOLWINDOW)
226  && !GetParent(hWnd) && !GetWindow(hWnd,GW_OWNER) && !p->winInfos.contains(hWnd) ) {
227 
228 // kDebug()<<"Adding window to windowList " << add + QString(windowText).trimmed();
229 
230  InternalWindowInfo winfo;
231  KWindowSystemPrivate::readWindowInfo(hWnd,&winfo);
232 
233  p->stackingOrder.append(hWnd);
234  p->winInfos.insert(hWnd,winfo);
235  }
236  return true;
237 }
238 
239 void KWindowSystemPrivate::readWindowInfo ( WId hWnd , InternalWindowInfo *winfo)
240 {
241  QByteArray windowText = QByteArray ( (GetWindowTextLength(hWnd)+1) * sizeof(wchar_t), 0 ) ;
242  GetWindowTextW(hWnd, (LPWSTR)windowText.data(), windowText.size());
243  //maybe use SendMessageTimout here?
244  QPixmap smallIcon;
245  HICON hSmallIcon = (HICON)SendMessage(hWnd, WM_GETICON, ICON_SMALL, 0);
246  //if(!hSmallIcon) hSmallIcon = (HICON)SendMessage(hWnd, WM_GETICON, ICON_SMALL2, 0);
247  if(!hSmallIcon) hSmallIcon = (HICON)SendMessage(hWnd, WM_GETICON, ICON_BIG, 0);
248 #ifndef _WIN32_WCE
249  if(!hSmallIcon) hSmallIcon = (HICON)GetClassLong(hWnd, GCL_HICONSM);
250  if(!hSmallIcon) hSmallIcon = (HICON)GetClassLong(hWnd, GCL_HICON);
251 #endif
252  if(!hSmallIcon) hSmallIcon = (HICON)SendMessage(hWnd, WM_QUERYDRAGICON, 0, 0);
253  if(hSmallIcon) smallIcon = QPixmap::fromWinHICON(hSmallIcon);
254 
255  QPixmap bigIcon;
256  HICON hBigIcon = (HICON)SendMessage(hWnd, WM_GETICON, ICON_BIG, 0);
257  //if(!hBigIcon) hBigIcon = (HICON)SendMessage(hWnd, WM_GETICON, ICON_SMALL2, 0);
258  if(!hBigIcon) hBigIcon = (HICON)SendMessage(hWnd, WM_GETICON, ICON_SMALL, 0);
259 #ifndef _WIN32_WCE
260  if(!hBigIcon) hBigIcon = (HICON)GetClassLong(hWnd, GCL_HICON);
261  if(!hBigIcon) hBigIcon = (HICON)GetClassLong(hWnd, GCL_HICONSM);
262 #endif
263  if(!hBigIcon) hBigIcon = (HICON)SendMessage(hWnd, WM_QUERYDRAGICON, 0, 0);
264  if(hBigIcon) bigIcon = QPixmap::fromWinHICON(hBigIcon);
265 
266  winfo->bigIcon = bigIcon;
267  winfo->smallIcon = smallIcon;
268  winfo->windowName = QString::fromWCharArray((wchar_t*)windowText.data()).trimmed();
269 }
270 
271 
272 void KWindowSystemPrivate::windowAdded (WId wid)
273 {
274 // kDebug() << "window added!";
275  KWindowSystem::s_d_func()->reloadStackList();
276  emit KWindowSystem::self()->windowAdded(wid);
277  emit KWindowSystem::self()->activeWindowChanged(wid);
278  emit KWindowSystem::self()->stackingOrderChanged();
279 }
280 
281 void KWindowSystemPrivate::windowRemoved (WId wid)
282 {
283 // kDebug() << "window removed!";
284  KWindowSystem::s_d_func()->reloadStackList();
285  emit KWindowSystem::self()->windowRemoved(wid);
286  emit KWindowSystem::self()->stackingOrderChanged();
287 }
288 
289 void KWindowSystemPrivate::windowActivated (WId wid)
290 {
291 // kDebug() << "window activated!";
292  if (!wid) {
293  return;
294  }
295 
296  KWindowSystem::s_d_func()->reloadStackList();
297  emit KWindowSystem::self()->activeWindowChanged(wid);
298  emit KWindowSystem::self()->stackingOrderChanged();
299 }
300 
301 void KWindowSystemPrivate::windowRedraw (WId wid)
302 {
303  KWindowSystem::s_d_func()->reloadStackList();
304 }
305 
306 void KWindowSystemPrivate::windowFlash (WId wid)
307 {
308  //emit KWindowSystem::self()->demandAttention( wid );
309 }
310 
311 void KWindowSystemPrivate::windowStateChanged (WId wid)
312 {
313  emit KWindowSystem::self()->windowChanged( wid );
314 }
315 
316 void KWindowSystemPrivate::reloadStackList ()
317 {
318  KWindowSystem::s_d_func()->stackingOrder.clear();
319  KWindowSystem::s_d_func()->winInfos.clear();
320  EnumWindows((WNDENUMPROC)EnumWindProc, 0 );
321 }
322 
323 
324 
325 KWindowSystem* KWindowSystem::self()
326 {
327  return &(g_kwmInstanceContainer->kwm);
328 }
329 
330 KWindowSystemPrivate* KWindowSystem::s_d_func()
331 {
332  return g_kwmInstanceContainer->d;
333 }
334 
335 void KWindowSystem::init(int what)
336 {
337  KWindowSystemPrivate* const s_d = s_d_func();
338 
339  if (what >= INFO_WINDOWS)
340  what = INFO_WINDOWS;
341  else
342  what = INFO_BASIC;
343 
344  if ( !s_d )
345  {
346  g_kwmInstanceContainer->d = new KWindowSystemPrivate(what); // invalidates s_d
347  g_kwmInstanceContainer->d->activate();
348  }
349  else if (s_d->what < what)
350  {
351  delete s_d;
352  g_kwmInstanceContainer->d = new KWindowSystemPrivate(what); // invalidates s_d
353  g_kwmInstanceContainer->d->activate();
354  }
355 
356 }
357 
358 bool KWindowSystem::allowedActionsSupported()
359 {
360  return false;
361 }
362 
363 int KWindowSystem::currentDesktop()
364 {
365  return 1;
366 }
367 
368 int KWindowSystem::numberOfDesktops()
369 {
370  return 1;
371 }
372 
373 void KWindowSystem::setMainWindow( QWidget* subwindow, WId mainwindow )
374 {
375  SetForegroundWindow(subwindow->winId());
376 }
377 
378 void KWindowSystem::setCurrentDesktop( int desktop )
379 {
380  kDebug() << "KWindowSystem::setCurrentDesktop( int desktop ) isn't yet implemented!";
381  //TODO
382 }
383 
384 void KWindowSystem::setOnAllDesktops( WId win, bool b )
385 {
386  kDebug() << "KWindowSystem::setOnAllDesktops( WId win, bool b ) isn't yet implemented!";
387  //TODO
388 }
389 
390 void KWindowSystem::setOnDesktop( WId win, int desktop )
391 {
392  //TODO
393  kDebug() << "KWindowSystem::setOnDesktop( WId win, int desktop ) isn't yet implemented!";
394 }
395 
396 WId KWindowSystem::activeWindow()
397 {
398  return GetActiveWindow();
399 }
400 
401 void KWindowSystem::activateWindow( WId win, long )
402 {
403  SetActiveWindow( win );
404 }
405 
406 void KWindowSystem::forceActiveWindow( WId win, long time )
407 {
408  // FIXME restoring a hidden window doesn't work: the window contents just appear white.
409  // But the mouse cursor still acts as if the widgets were there (e.g. button clicking works),
410  // which indicates the issue is at the window/backingstore level.
411  // This is probably a side effect of bypassing Qt's internal window state handling.
412 #ifndef _WIN32_WCE
413  if ( IsIconic( win ) /*|| !IsWindowVisible( win ) */) {
414  // Do not activate the window as we restore it,
415  // otherwise the window appears see-through (contents not updated).
416  ShowWindow( win, SW_SHOWNOACTIVATE );
417  }
418 #endif
419  // Puts the window in front and activates it.
420  //to bring a window to the front while the user is active in a different apllication we
421  //have to atach our self to the current active window
422  HWND hwndActiveWin = GetForegroundWindow();
423  int idActive = GetWindowThreadProcessId(hwndActiveWin, NULL);
424  if ( AttachThreadInput(GetCurrentThreadId(), idActive, TRUE) )
425  {
426  SetForegroundWindow( win );
427  SetFocus( win );
428  AttachThreadInput(GetCurrentThreadId(), idActive, FALSE);
429  }
430 
431 }
432 
433 void KWindowSystem::demandAttention( WId win, bool set )
434 {
435 // One can not flash a windows in wince
436 #ifndef _WIN32_WCE
437  FLASHWINFO fi;
438  fi.cbSize = sizeof( FLASHWINFO );
439  fi.hwnd = win;
440  fi.dwFlags = set ? FLASHW_ALL : FLASHW_STOP;
441  fi.uCount = 5;
442  fi.dwTimeout = 0;
443 
444  FlashWindowEx( &fi );
445 #endif
446 }
447 
448 
449 QPixmap KWindowSystem::icon( WId win, int width, int height, bool scale )
450 {
451  KWindowSystem::init(INFO_WINDOWS);
452 
453  QPixmap pm;
454  if(KWindowSystem::s_d_func()->winInfos.contains(win)){
455  if( width < 24 || height < 24 )
456  pm = KWindowSystem::s_d_func()->winInfos[win].smallIcon;
457  else
458  pm = KWindowSystem::s_d_func()->winInfos[win].bigIcon;
459  }
460  else{
461  kDebug()<<"KWindowSystem::icon winid not in winInfos";
462  UINT size = ICON_BIG;
463  if( width < 24 || height < 24 )
464  size = ICON_SMALL;
465  HICON hIcon = (HICON)SendMessage( win, WM_GETICON, size, 0);
466  if(hIcon != NULL)
467  pm = QPixmap::fromWinHICON( hIcon );
468  }
469  if( scale )
470  pm = pm.scaled( width, height );
471  return pm;
472 }
473 
474 QPixmap KWindowSystem::icon( WId win, int width, int height, bool scale, int )
475 {
476  return icon( win, width, height, scale );
477 }
478 
479 void KWindowSystem::setIcons( WId win, const QPixmap& icon, const QPixmap& miniIcon )
480 {
481  KWindowSystem::init(INFO_WINDOWS);
482  KWindowSystemPrivate* s_d = s_d_func();
483 
484  if(s_d->winInfos.contains(win)){
485  // is this safe enough or do i have to refresh() the window infos
486  s_d->winInfos[win].smallIcon = miniIcon;
487  s_d->winInfos[win].bigIcon = icon;
488  }
489 
490  HICON hIconBig = icon.toWinHICON();
491  HICON hIconSmall = miniIcon.toWinHICON();
492 
493  hIconBig = (HICON)SendMessage( win, WM_SETICON, ICON_BIG, (LPARAM)hIconBig );
494  hIconSmall = (HICON)SendMessage( win, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall );
495 
496 }
497 
498 void KWindowSystem::setState( WId win, unsigned long state )
499 {
500  bool got = false;
501 #ifndef _WIN32_WCE
502  if (state & NET::SkipTaskbar) {
503  got = true;
504  LONG_PTR lp = GetWindowLongPtr(win, GWL_EXSTYLE);
505  SetWindowLongPtr(win, GWL_EXSTYLE, lp | WS_EX_TOOLWINDOW);
506  }
507 #endif
508  if (state & NET::KeepAbove) {
509  got = true;
510  SetWindowPos(win, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
511  }
512  if(state & NET::KeepBelow){
513  got = true;
514  SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
515  }
516  if(state & NET::Max){
517  got = true;
518  ShowWindow( win, SW_MAXIMIZE );
519  }
520  if (!got)
521  kDebug() << "KWindowSystem::setState( WId win, unsigned long state ) isn't yet implemented for the state you requested!";
522 }
523 
524 void KWindowSystem::clearState( WId win, unsigned long state )
525 {
526  bool got = false;
527 
528 #ifndef _WIN32_WCE
529  if (state & NET::SkipTaskbar) {
530  got = true;
531  LONG_PTR lp = GetWindowLongPtr(win, GWL_EXSTYLE);
532  SetWindowLongPtr(win, GWL_EXSTYLE, lp & ~WS_EX_TOOLWINDOW);
533  }
534 #endif
535  if (state & NET::KeepAbove) {
536  got = true;
537  //lets hope this remove the topmost
538  SetWindowPos(win, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
539  }
540  if(state & NET::Max){
541  got = true;
542  ShowWindow( win, SW_RESTORE );
543  }
544  if (!got)
545  kDebug() << "KWindowSystem::clearState( WId win, unsigned long state ) isn't yet implemented!";
546 }
547 
548 void KWindowSystem::minimizeWindow( WId win, bool animation)
549 {
550  Q_UNUSED( animation );
551  ShowWindow( win, SW_MINIMIZE );
552 }
553 
554 void KWindowSystem::unminimizeWindow( WId win, bool animation )
555 {
556  Q_UNUSED( animation );
557  ShowWindow( win, SW_RESTORE );
558 }
559 
560 void KWindowSystem::raiseWindow( WId win )
561 {
562 
563  //to bring a window to the front while the user is active in a different apllication we
564  //have to atach our self to the current active window
565  HWND hwndActiveWin = GetForegroundWindow();
566  int idActive = GetWindowThreadProcessId(hwndActiveWin, NULL);
567  if ( AttachThreadInput(GetCurrentThreadId(), idActive, TRUE) )
568  {
569  SetForegroundWindow( win );
570  AttachThreadInput(GetCurrentThreadId(), idActive, FALSE);
571  }
572 }
573 
574 void KWindowSystem::lowerWindow( WId win )
575 {
576  SetWindowPos( win, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE ); // mhhh?
577 }
578 
579 bool KWindowSystem::compositingActive()
580 {
581  return true;
582 }
583 
584 QRect KWindowSystem::workArea( int desktop )
585 {
586  return s_deskWidget->availableGeometry( desktop );
587 }
588 
589 QRect KWindowSystem::workArea( const QList<WId>& exclude, int desktop )
590 {
591  //TODO
592  kDebug() << "QRect KWindowSystem::workArea( const QList<WId>& exclude, int desktop ) isn't yet implemented!";
593  return QRect();
594 }
595 
596 QString KWindowSystem::desktopName( int desktop )
597 {
598  return i18n("Desktop %1", desktop );
599 }
600 
601 void KWindowSystem::setDesktopName( int desktop, const QString& name )
602 {
603  kDebug() << "KWindowSystem::setDesktopName( int desktop, const QString& name ) isn't yet implemented!";
604  //TODO
605 }
606 
607 bool KWindowSystem::showingDesktop()
608 {
609  return false;
610 }
611 
612 void KWindowSystem::setUserTime( WId win, long time )
613 {
614  kDebug() << "KWindowSystem::setUserTime( WId win, long time ) isn't yet implemented!";
615  //TODO
616 }
617 
618 bool KWindowSystem::icccmCompliantMappingState()
619 {
620  return false;
621 }
622 
623 // optimalization - create KWindowSystemPrivate only when needed and only for what is needed
624 void KWindowSystem::connectNotify( const char* signal )
625 {
626  int what = INFO_BASIC;
627  if( QLatin1String( signal ) == SIGNAL(workAreaChanged()))
628  what = INFO_WINDOWS;
629  else if( QLatin1String( signal ) == SIGNAL(strutChanged()))
630  what = INFO_WINDOWS;
631  else if( QLatin1String( signal ) == QMetaObject::normalizedSignature(SIGNAL(windowChanged(WId,const ulong*))).constData())
632  what = INFO_WINDOWS;
633  else if( QLatin1String( signal ) == QMetaObject::normalizedSignature(SIGNAL(windowChanged(WId,uint))).constData())
634  what = INFO_WINDOWS;
635  else if( QLatin1String( signal ) == QMetaObject::normalizedSignature(SIGNAL(windowChanged(WId))).constData())
636  what = INFO_WINDOWS;
637 
638  init( what );
639  QObject::connectNotify( signal );
640 }
641 
642 void KWindowSystem::setExtendedStrut( WId win, int left_width, int left_start, int left_end,
643  int right_width, int right_start, int right_end, int top_width, int top_start, int top_end,
644  int bottom_width, int bottom_start, int bottom_end )
645 {
646  kDebug() << "KWindowSystem::setExtendedStrut isn't yet implemented!";
647  //TODO
648 }
649 void KWindowSystem::setStrut( WId win, int left, int right, int top, int bottom )
650 {
651  kDebug() << "KWindowSystem::setStrut isn't yet implemented!";
652  //TODO
653 }
654 
655 QString KWindowSystem::readNameProperty( WId window, unsigned long atom )
656 {
657  //TODO
658  kDebug() << "QString KWindowSystem::readNameProperty( WId window, unsigned long atom ) isn't yet implemented!";
659  return QString();
660 }
661 
662 void KWindowSystem::doNotManage( const QString& title )
663 {
664  //TODO
665  kDebug() << "KWindowSystem::doNotManage( const QString& title ) isn't yet implemented!";
666 }
667 
668 QList<WId> KWindowSystem::stackingOrder()
669 {
670  KWindowSystem::init(INFO_WINDOWS);
671  return KWindowSystem::s_d_func()->stackingOrder;
672 }
673 
674 const QList<WId>& KWindowSystem::windows()
675 {
676  KWindowSystem::init(INFO_WINDOWS);
677  return KWindowSystem::s_d_func()->stackingOrder;
678 }
679 
680 void KWindowSystem::setType( WId win, NET::WindowType windowType )
681 {
682  //TODO
683  kDebug() << "setType( WId win, NET::WindowType windowType ) isn't yet implemented!";
684 }
685 
686 KWindowInfo KWindowSystem::windowInfo( WId win, unsigned long properties, unsigned long properties2 )
687 {
688  KWindowSystem::init(INFO_WINDOWS);
689  return KWindowInfo( win, properties, properties2 );
690 }
691 
692 bool KWindowSystem::hasWId(WId w)
693 {
694  KWindowSystem::init(INFO_WINDOWS);
695  return KWindowSystem::s_d_func()->winInfos.contains(w);
696 }
697 
698 void KWindowSystem::allowExternalProcessWindowActivation( int pid )
699 {
700 #ifndef _WIN32_WCE
701  AllowSetForegroundWindow( pid == -1 ? ASFW_ANY : pid );
702 #endif
703 }
704 
705 void KWindowSystem::setBlockingCompositing( WId window, bool active )
706 {
707  //TODO
708  kDebug() << "setBlockingCompositing( WId window, bool active ) isn't yet implemented!";
709 }
710 
711 #include "kwindowsystem.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Feb 9 2013 12:06:10 by doxygen 1.8.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.10.0 API Reference

Skip menu "kdelibs-4.10.0 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal