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

superkaramba

  • superkaramba
  • src
taskmanager.cpp
1 /*****************************************************************
2 
3 Copyright (c) 2000 Matthias Elter <elter@kde.org>
4 
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
11 
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 
22 ******************************************************************/
23 
24 #include <tdeglobal.h>
25 #include <tdelocale.h>
26 #include <kdebug.h>
27 #include <tdeconfig.h>
28 #include <kiconloader.h>
29 #include <twinmodule.h>
30 #include <netwm.h>
31 #include <tqtimer.h>
32 #include <tqimage.h>
33 
34 #include <X11/X.h>
35 #include <X11/Xlib.h>
36 #include <X11/Xutil.h>
37 
38 #include "taskmanager.h"
39 #include "taskmanager.moc"
40 
41 template class TQPtrList<Task>;
42 
43 // Hack: create a global TWinModule without a parent. We
44 // can't make it a child of TaskManager because more than one
45 // TaskManager might be created. We can't make it a class
46 // variable without changing Task, which also uses it.
47 // So, we'll leak a little memory, but it's better than crashing.
48 // The real problem is that TWinModule should be a singleton.
49 TWinModule* twin_module = 0;
50 
51 TaskManager::TaskManager(TQObject *parent, const char *name)
52  : TQObject(parent, name), _active(0), _startup_info( NULL )
53 {
54 
55  twin_module = new TWinModule();
56 
57 // TDEGlobal::locale()->insertCatalogue("libtaskmanager");
58  connect(twin_module, TQ_SIGNAL(windowAdded(WId)), TQ_SLOT(windowAdded(WId)));
59  connect(twin_module, TQ_SIGNAL(windowRemoved(WId)), TQ_SLOT(windowRemoved(WId)));
60  connect(twin_module, TQ_SIGNAL(activeWindowChanged(WId)), TQ_SLOT(activeWindowChanged(WId)));
61  connect(twin_module, TQ_SIGNAL(currentDesktopChanged(int)), TQ_SLOT(currentDesktopChanged(int)));
62  connect(twin_module, TQ_SIGNAL(windowChanged(WId,unsigned int)), TQ_SLOT(windowChanged(WId,unsigned int)));
63 
64  // register existing windows
65  const TQValueList<WId> windows = twin_module->windows();
66  TQValueList<WId>::ConstIterator end( windows.end() );
67  for (TQValueList<WId>::ConstIterator it = windows.begin(); it != end; ++it )
68  windowAdded(*it);
69 
70  // set active window
71  WId win = twin_module->activeWindow();
72  activeWindowChanged(win);
73 
74  configure_startup();
75 }
76 
77 TaskManager::~TaskManager()
78 {
79 }
80 
81 void TaskManager::configure_startup()
82 {
83  TDEConfig c("tdelaunchrc", true);
84  c.setGroup("FeedbackStyle");
85  if (!c.readBoolEntry("TaskbarButton", true))
86  return;
87  _startup_info = new TDEStartupInfo( true, this );
88  connect( _startup_info,
89  TQ_SIGNAL( gotNewStartup( const TDEStartupInfoId&, const TDEStartupInfoData& )),
90  TQ_SLOT( gotNewStartup( const TDEStartupInfoId&, const TDEStartupInfoData& )));
91  connect( _startup_info,
92  TQ_SIGNAL( gotStartupChange( const TDEStartupInfoId&, const TDEStartupInfoData& )),
93  TQ_SLOT( gotStartupChange( const TDEStartupInfoId&, const TDEStartupInfoData& )));
94  connect( _startup_info,
95  TQ_SIGNAL( gotRemoveStartup( const TDEStartupInfoId&, const TDEStartupInfoData& )),
96  TQ_SLOT( gotRemoveStartup( const TDEStartupInfoId& )));
97  c.setGroup( "TaskbarButtonSettings" );
98  _startup_info->setTimeout( c.readUnsignedNumEntry( "Timeout", 30 ));
99 }
100 
101 Task* TaskManager::findTask(WId w)
102 {
103  for (Task* t = _tasks.first(); t != 0; t = _tasks.next())
104  if (t->window() == w || t->hasTransient(w))
105  return t;
106  return 0;
107 }
108 
109 void TaskManager::windowAdded(WId w )
110 {
111  NETWinInfo info(tqt_xdisplay(), w, tqt_xrootwin(),
112  NET::WMWindowType | NET::WMPid | NET::WMState );
113  NET::WindowType windowType = info.windowType(NET::AllTypesMask);
114  // ignore NET::Tool and other special window types
115  if (windowType != NET::Normal && windowType != NET::Override
116  && windowType != NET::Unknown && windowType != NET::Dialog)
117  return;
118  // ignore windows that want to be ignored by the taskbar
119  if ((info.state() & NET::SkipTaskbar) != 0)
120  {
121  _skiptaskbar_windows.push_front( w ); // remember them though
122  return;
123  }
124 
125  Window transient_for_tmp;
126  if (XGetTransientForHint(tqt_xdisplay(), (Window) w, &transient_for_tmp))
127  {
128  WId transient_for = (WId) transient_for_tmp;
129 
130  // check if it's transient for a skiptaskbar window
131  if (_skiptaskbar_windows.contains(transient_for))
132  return;
133 
134  // lets see if this is a transient for an existing task
135  if (transient_for != tqt_xrootwin() && transient_for != 0 )
136  {
137  Task* t = findTask(transient_for);
138  if (t)
139  {
140  if (t->window() != w)
141  {
142  t->addTransient(w);
143  // kdDebug() << "TM: Transient " << w << " added for Task: " << t->window() << endl;
144  }
145  return;
146  }
147  }
148  }
149  Task* t = new Task(w, this);
150  _tasks.append(t);
151 
152  // kdDebug() << "TM: Task added for WId: " << w << endl;
153  emit taskAdded(t);
154 }
155 
156 void TaskManager::windowRemoved(WId w )
157 {
158  _skiptaskbar_windows.remove( w );
159  // find task
160  Task* t = findTask(w);
161  if (!t) return;
162 
163  if (t->window() == w) {
164  _tasks.removeRef(t);
165 
166  emit taskRemoved(t);
167 
168  if(t == _active) _active = 0;
169  delete t;
170  //kdDebug() << "TM: Task for WId " << w << " removed." << endl;
171  }
172  else {
173  t->removeTransient( w );
174  //kdDebug() << "TM: Transient " << w << " for Task " << t->window() << " removed." << endl;
175  }
176 }
177 
178 void TaskManager::windowChanged(WId w, unsigned int dirty)
179 {
180  if( dirty & NET::WMState ) {
181  NETWinInfo info ( tqt_xdisplay(), w, tqt_xrootwin(), NET::WMState );
182  if ( (info.state() & NET::SkipTaskbar) != 0 ) {
183  windowRemoved( w );
184  _skiptaskbar_windows.push_front( w );
185  return;
186  }
187  else {
188  _skiptaskbar_windows.remove( w );
189  if( !findTask( w ))
190  windowAdded( w ); // skipTaskBar state was removed, so add this window
191  }
192  }
193 
194  // check if any state we are interested in is marked dirty
195  if(!(dirty & (NET::WMVisibleName|NET::WMName|NET::WMState|NET::WMIcon|NET::XAWMState|NET::WMDesktop)) )
196  return;
197 
198  // find task
199  Task* t = findTask( w );
200  if (!t) return;
201 
202  //kdDebug() << "TaskManager::windowChanged " << w << " " << dirty << endl;
203 
204 
205  // refresh icon pixmap if necessary
206  if (dirty & NET::WMIcon)
207  t->refresh(true);
208  else
209  t->refresh();
210 
211  if(dirty & (NET::WMDesktop|NET::WMState|NET::XAWMState))
212  emit windowChanged(w); // moved to different desktop or is on all or change in iconification/withdrawnnes
213 }
214 
215 void TaskManager::activeWindowChanged(WId w )
216 {
217  //kdDebug() << "TaskManager::activeWindowChanged" << endl;
218 
219  Task* t = findTask( w );
220  if (!t) {
221  if (_active) {
222  _active->setActive(false);
223  _active = 0;
224 
225  // there is no active window at the moment
226  emit activeTaskChanged(0);
227  }
228  }
229  else {
230  if (_active)
231  _active->setActive(false);
232 
233  _active = t;
234  _active->setActive(true);
235 
236  emit activeTaskChanged(_active);
237  }
238 }
239 
240 void TaskManager::currentDesktopChanged(int desktop)
241 {
242  emit desktopChanged(desktop);
243 }
244 
245 void TaskManager::gotNewStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data )
246 {
247  Startup* s = new Startup( id, data, this );
248  _startups.append(s);
249 
250  emit startupAdded(s);
251 }
252 
253 void TaskManager::gotStartupChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data )
254 {
255  for( Startup* s = _startups.first(); s != 0; s = _startups.next()) {
256  if ( s->id() == id ) {
257  s->update( data );
258  return;
259  }
260  }
261 }
262 
263 void TaskManager::gotRemoveStartup( const TDEStartupInfoId& id )
264 {
265  killStartup( id );
266 }
267 
268 void TaskManager::killStartup( const TDEStartupInfoId& id )
269 {
270  Startup* s = 0;
271  for(s = _startups.first(); s != 0; s = _startups.next()) {
272  if (s->id() == id)
273  break;
274  }
275  if (s == 0) return;
276 
277  _startups.removeRef(s);
278  emit startupRemoved(s);
279  delete s;
280 }
281 
282 void TaskManager::killStartup(Startup* s)
283 {
284  if (s == 0) return;
285 
286  _startups.removeRef(s);
287  emit startupRemoved(s);
288  delete s;
289 }
290 
291 TQString TaskManager::desktopName(int desk) const
292 {
293  return twin_module->desktopName(desk);
294 }
295 
296 int TaskManager::numberOfDesktops() const
297 {
298  return twin_module->numberOfDesktops();
299 }
300 
301 bool TaskManager::isOnTop(const Task* task)
302 {
303  if(!task) return false;
304 
305  for (TQValueList<WId>::ConstIterator it = twin_module->stackingOrder().fromLast();
306  it != twin_module->stackingOrder().end(); --it ) {
307  for (Task* t = _tasks.first(); t != 0; t = _tasks.next() ) {
308  if ( (*it) == t->window() ) {
309  if ( t == task )
310  return true;
311  if ( !t->isIconified() && (t->isAlwaysOnTop() == task->isAlwaysOnTop()) )
312  return false;
313  break;
314  }
315  }
316  }
317  return false;
318 }
319 
320 
321 Task::Task(WId win, TaskManager * parent, const char *name) :
322  TQObject(parent, name),
323  _active(false), _win(win),
324  _lastWidth(0), _lastHeight(0), _lastResize(false), _lastIcon(),
325  _thumbSize(0.2), _thumb(), _grab()
326 {
327  _info = KWin::windowInfo(_win, 0, 0);
328  // try to load icon via net_wm
329  _pixmap = KWin::icon(_win, 16, 16, true);
330 
331  // try to guess the icon from the classhint
332  if(_pixmap.isNull())
333  TDEGlobal::instance()->iconLoader()->loadIcon(className().lower(),
334  TDEIcon::Small,TDEIcon::Small,
335  TDEIcon::DefaultState, 0, true);
336 
337  // load xapp icon
338  if (_pixmap.isNull())
339  _pixmap = SmallIcon("kcmx");
340 }
341 
342 Task::~Task()
343 {
344 }
345 
346 void Task::refresh(bool icon)
347 {
348  _info = KWin::windowInfo(_win, 0, 0);
349  if (icon)
350  {
351  // try to load icon via net_wm
352  _pixmap = KWin::icon(_win, 16, 16, true);
353 
354  // try to guess the icon from the classhint
355  if(_pixmap.isNull())
356  {
357  TDEGlobal::instance()->iconLoader()->loadIcon(className().lower(),
358  TDEIcon::Small, TDEIcon::Small, TDEIcon::DefaultState, 0, true);
359  }
360 
361  // load xapp icon
362  if (_pixmap.isNull())
363  _pixmap = SmallIcon("kcmx");
364 
365  _lastIcon.resize(0,0);
366  emit iconChanged();
367  }
368  emit changed();
369 }
370 
371 void Task::setActive(bool a)
372 {
373  _active = a;
374  emit changed();
375  if ( a )
376  emit activated();
377  else
378  emit deactivated();
379 }
380 
381 bool Task::isMaximized() const
382 {
383  return(_info.state() & NET::Max);
384 }
385 
386 bool Task::isIconified() const
387 {
388  return (_info.mappingState() == NET::Iconic);
389 }
390 
391 bool Task::isAlwaysOnTop() const
392 {
393  return (_info.state() & NET::StaysOnTop);
394 }
395 
396 bool Task::isShaded() const
397 {
398  return (_info.state() & NET::Shaded);
399 }
400 
401 bool Task::isOnCurrentDesktop() const
402 {
403  return (_info.onAllDesktops() || _info.desktop() == twin_module->currentDesktop());
404 }
405 
406 bool Task::isOnAllDesktops() const
407 {
408  return _info.onAllDesktops();
409 }
410 
411 bool Task::isActive() const
412 {
413  return _active;
414 }
415 
416 bool Task::isOnTop() const
417 {
418  return taskManager()->isOnTop( this );
419 }
420 
421 bool Task::isModified() const
422 {
423  static TQString modStr = TQString::fromUtf8("[") + i18n("modified") + TQString::fromUtf8("]");
424  int modStrPos = _info.visibleName().find(modStr);
425 
426  return ( modStrPos != -1 );
427 }
428 
429 TQString Task::iconName() const
430 {
431  NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMIconName);
432  return TQString::fromUtf8(ni.iconName());
433 }
434 TQString Task::visibleIconName() const
435 {
436  NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMVisibleIconName);
437  return TQString::fromUtf8(ni.visibleIconName());
438 }
439 
440 TQString Task::className()
441 {
442  XClassHint hint;
443  if(XGetClassHint(tqt_xdisplay(), _win, &hint)) {
444  TQString nh( hint.res_name );
445  XFree( hint.res_name );
446  XFree( hint.res_class );
447  return nh;
448  }
449  return TQString();
450 }
451 
452 TQString Task::classClass()
453 {
454  XClassHint hint;
455  if(XGetClassHint(tqt_xdisplay(), _win, &hint)) {
456  TQString ch( hint.res_class );
457  XFree( hint.res_name );
458  XFree( hint.res_class );
459  return ch;
460  }
461  return TQString();
462 }
463 
464 TQPixmap Task::icon( int width, int height, bool allowResize )
465 {
466  if ( (width == _lastWidth)
467  && (height == _lastHeight)
468  && (allowResize == _lastResize )
469  && (!_lastIcon.isNull()) )
470  return _lastIcon;
471 
472  TQPixmap newIcon = KWin::icon( _win, width, height, allowResize );
473  if ( !newIcon.isNull() ) {
474  _lastIcon = newIcon;
475  _lastWidth = width;
476  _lastHeight = height;
477  _lastResize = allowResize;
478  }
479 
480  return newIcon;
481 }
482 
483 TQPixmap Task::bestIcon( int size, bool &isStaticIcon )
484 {
485  TQPixmap pixmap;
486  isStaticIcon = false;
487 
488  switch( size ) {
489  case TDEIcon::SizeSmall:
490  {
491  pixmap = icon( 16, 16, true );
492 
493  // Icon of last resort
494  if( pixmap.isNull() ) {
495  pixmap = TDEGlobal::iconLoader()->loadIcon( "go",
496  TDEIcon::NoGroup,
497  TDEIcon::SizeSmall );
498  isStaticIcon = true;
499  }
500  }
501  break;
502  case TDEIcon::SizeMedium:
503  {
504  //
505  // Try 34x34 first for KDE 2.1 icons with shadows, if we don't
506  // get one then try 32x32.
507  //
508  pixmap = icon( 34, 34, false );
509 
510  if ( ( pixmap.width() != 34 ) || ( pixmap.height() != 34 ) ) {
511  if ( ( pixmap.width() != 32 ) || ( pixmap.height() != 32 ) ) {
512  pixmap = icon( 32, 32, true );
513  }
514  }
515 
516  // Icon of last resort
517  if( pixmap.isNull() ) {
518  pixmap = TDEGlobal::iconLoader()->loadIcon( "go",
519  TDEIcon::NoGroup,
520  TDEIcon::SizeMedium );
521  isStaticIcon = true;
522  }
523  }
524  break;
525  case TDEIcon::SizeLarge:
526  {
527  // If there's a 48x48 icon in the hints then use it
528  pixmap = icon( size, size, false );
529 
530  // If not, try to get one from the classname
531  if ( pixmap.isNull() || pixmap.width() != size || pixmap.height() != size ) {
532  pixmap = TDEGlobal::iconLoader()->loadIcon( className(),
533  TDEIcon::NoGroup,
534  size,
535  TDEIcon::DefaultState,
536  0L,
537  true );
538  isStaticIcon = true;
539  }
540 
541  // If we still don't have an icon then scale the one in the hints
542  if ( pixmap.isNull() || ( pixmap.width() != size ) || ( pixmap.height() != size ) ) {
543  pixmap = icon( size, size, true );
544  isStaticIcon = false;
545  }
546 
547  // Icon of last resort
548  if( pixmap.isNull() ) {
549  pixmap = TDEGlobal::iconLoader()->loadIcon( "go",
550  TDEIcon::NoGroup,
551  size );
552  isStaticIcon = true;
553  }
554  }
555  }
556 
557  return pixmap;
558 }
559 
560 bool Task::idMatch( const TQString& id1, const TQString& id2 )
561 {
562  if ( id1.isEmpty() || id2.isEmpty() )
563  return false;
564 
565  if ( id1.contains( id2 ) > 0 )
566  return true;
567 
568  if ( id2.contains( id1 ) > 0 )
569  return true;
570 
571  return false;
572 }
573 
574 
575 void Task::maximize()
576 {
577  NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
578  ni.setState( NET::Max, NET::Max );
579 
580  if (_info.mappingState() == NET::Iconic)
581  activate();
582 }
583 
584 void Task::restore()
585 {
586  NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
587  ni.setState( 0, NET::Max );
588  if (_info.mappingState() == NET::Iconic)
589  activate();
590 }
591 
592 void Task::iconify()
593 {
594  XIconifyWindow( tqt_xdisplay(), _win, tqt_xscreen() );
595 }
596 
597 void Task::close()
598 {
599  NETRootInfo ri( tqt_xdisplay(), NET::CloseWindow );
600  ri.closeWindowRequest( _win );
601 }
602 
603 void Task::raise()
604 {
605 // kdDebug(1210) << "Task::raise(): " << name() << endl;
606  XRaiseWindow( tqt_xdisplay(), _win );
607 }
608 
609 void Task::lower()
610 {
611 // kdDebug(1210) << "Task::lower(): " << name() << endl;
612  XLowerWindow( tqt_xdisplay(), _win );
613 }
614 
615 void Task::activate()
616 {
617 // kdDebug(1210) << "Task::activate():" << name() << endl;
618  NETRootInfo ri( tqt_xdisplay(), 0 );
619  ri.setActiveWindow( _win );
620 }
621 
622 void Task::activateRaiseOrIconify()
623 {
624  if ( !isActive() || isIconified() ) {
625  activate();
626  } else if ( !isOnTop() ) {
627  raise();
628  } else {
629  iconify();
630  }
631 }
632 
633 void Task::toDesktop(int desk)
634 {
635  NETWinInfo ni(tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMDesktop);
636  if (desk == 0)
637  {
638  if (_info.onAllDesktops())
639  {
640  ni.setDesktop(twin_module->currentDesktop());
641  KWin::forceActiveWindow(_win);
642  }
643  else
644  ni.setDesktop(NETWinInfo::OnAllDesktops);
645  return;
646  }
647  ni.setDesktop(desk);
648  if (desk == twin_module->currentDesktop())
649  KWin::forceActiveWindow(_win);
650 }
651 
652 void Task::toCurrentDesktop()
653 {
654  toDesktop(twin_module->currentDesktop());
655 }
656 
657 void Task::setAlwaysOnTop(bool stay)
658 {
659  NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
660  if(stay)
661  ni.setState( NET::StaysOnTop, NET::StaysOnTop );
662  else
663  ni.setState( 0, NET::StaysOnTop );
664 }
665 
666 void Task::toggleAlwaysOnTop()
667 {
668  setAlwaysOnTop( !isAlwaysOnTop() );
669 }
670 
671 void Task::setShaded(bool shade)
672 {
673  NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMState);
674  if(shade)
675  ni.setState( NET::Shaded, NET::Shaded );
676  else
677  ni.setState( 0, NET::Shaded );
678 }
679 
680 void Task::toggleShaded()
681 {
682  setShaded( !isShaded() );
683 }
684 
685 void Task::publishIconGeometry(TQRect rect)
686 {
687  NETWinInfo ni( tqt_xdisplay(), _win, tqt_xrootwin(), NET::WMIconGeometry);
688  NETRect r;
689  r.pos.x = rect.x();
690  r.pos.y = rect.y();
691  r.size.width = rect.width();
692  r.size.height = rect.height();
693  ni.setIconGeometry(r);
694 }
695 
696 void Task::updateThumbnail()
697 {
698  if ( !isOnCurrentDesktop() )
699  return;
700  if ( !isActive() )
701  return;
702  if ( !_grab.isNull() ) // We're already processing one...
703  return;
704 
705  //
706  // We do this as a two stage process to remove the delay caused
707  // by the thumbnail generation. This makes things much smoother
708  // on slower machines.
709  //
710  TQWidget *rootWin = tqApp->desktop();
711  TQRect geom = _info.geometry();
712  _grab = TQPixmap::grabWindow( rootWin->winId(),
713  geom.x(), geom.y(),
714  geom.width(), geom.height() );
715 
716  if ( !_grab.isNull() )
717  TQTimer::singleShot( 200, this, TQ_SLOT( generateThumbnail() ) );
718 }
719 
720 void Task::generateThumbnail()
721 {
722  if ( _grab.isNull() )
723  return;
724 
725  TQImage img = _grab.convertToImage();
726 
727  double width = img.width();
728  double height = img.height();
729  width = width * _thumbSize;
730  height = height * _thumbSize;
731 
732  img = img.smoothScale( (int) width, (int) height );
733  _thumb = img;
734  _grab.resize( 0, 0 ); // Makes grab a null image.
735 
736  emit thumbnailChanged();
737 }
738 
739 Startup::Startup( const TDEStartupInfoId& id, const TDEStartupInfoData& data,
740  TQObject * parent, const char *name)
741  : TQObject(parent, name), _id( id ), _data( data )
742 {
743 }
744 
745 Startup::~Startup()
746 {
747 
748 }
749 
750 void Startup::update( const TDEStartupInfoData& data )
751 {
752  _data.update( data );
753  emit changed();
754 }
755 
756 int TaskManager::currentDesktop() const
757 {
758  return twin_module->currentDesktop();
759 }
Startup
Represents a task which is in the process of starting.
Definition: taskmanager.h:364
Startup::changed
void changed()
Indicates that this startup has changed in some way.
TaskManager
A generic API for task managers.
Definition: taskmanager.h:420
TaskManager::numberOfDesktops
int numberOfDesktops() const
Returns the number of virtual desktops.
Definition: taskmanager.cpp:296
TaskManager::windowChanged
void windowChanged(WId)
Emitted when a window changes desktop.
TaskManager::findTask
Task * findTask(WId w)
Returns the task for a given WId, or 0 if there is no such task.
Definition: taskmanager.cpp:101
TaskManager::activeTaskChanged
void activeTaskChanged(Task *)
Emitted when the active window changed.
TaskManager::desktopName
TQString desktopName(int n) const
Returns the name of the nth desktop.
Definition: taskmanager.cpp:291
TaskManager::currentDesktop
int currentDesktop() const
Returns the number of the current desktop.
Definition: taskmanager.cpp:756
TaskManager::isOnTop
bool isOnTop(const Task *)
Returns true if the specified task is on top.
Definition: taskmanager.cpp:301
TaskManager::startupAdded
void startupAdded(Startup *)
Emitted when a new task is expected.
TaskManager::desktopChanged
void desktopChanged(int desktop)
Emitted when the current desktop changes.
TaskManager::startupRemoved
void startupRemoved(Startup *)
Emitted when a startup item should be removed.
TaskManager::taskAdded
void taskAdded(Task *)
Emitted when a new task has started.
TaskManager::taskRemoved
void taskRemoved(Task *)
Emitted when a task has terminated.
Task
A dynamic interface to a task (main window).
Definition: taskmanager.h:50
Task::raise
void raise()
Raise the task's window.
Definition: taskmanager.cpp:603
Task::isActive
bool isActive() const
Returns true if the task's window is the active window.
Definition: taskmanager.cpp:411
Task::maximize
void maximize()
Maximise the main window of this task.
Definition: taskmanager.cpp:575
Task::publishIconGeometry
void publishIconGeometry(TQRect)
This method informs the window manager of the location at which this task will be displayed when icon...
Definition: taskmanager.cpp:685
Task::isOnAllDesktops
bool isOnAllDesktops() const
Returns true if the task's window is on all virtual desktops.
Definition: taskmanager.cpp:406
Task::isShaded
bool isShaded() const
Returns true if the task's window is shaded.
Definition: taskmanager.cpp:396
Task::pixmap
TQPixmap pixmap() const
Returns a 16x16 (TDEIcon::Small) icon for the task.
Definition: taskmanager.h:102
Task::activate
void activate()
Activate the task's window.
Definition: taskmanager.cpp:615
Task::isModified
bool isModified() const
Returns true if the document the task is editing has been modified.
Definition: taskmanager.cpp:421
Task::lower
void lower()
Lower the task's window.
Definition: taskmanager.cpp:609
Task::iconChanged
void iconChanged()
Indicates that the icon for this task has changed.
Task::isIconified
bool isIconified() const
Returns true if the task's window is iconified.
Definition: taskmanager.cpp:386
Task::toDesktop
void toDesktop(int)
Moves the task's window to the specified virtual desktop.
Definition: taskmanager.cpp:633
Task::isAlwaysOnTop
bool isAlwaysOnTop() const
Returns true if the task's window will remain at the top of the stacking order.
Definition: taskmanager.cpp:391
Task::isOnCurrentDesktop
bool isOnCurrentDesktop() const
Returns true if the task's window is on the current virtual desktop.
Definition: taskmanager.cpp:401
Task::thumbnailChanged
void thumbnailChanged()
Indicates that the thumbnail for this task has changed.
Task::toCurrentDesktop
void toCurrentDesktop()
Moves the task's window to the current virtual desktop.
Definition: taskmanager.cpp:652
Task::activated
void activated()
Indicates that this task is now the active task.
Task::activateRaiseOrIconify
void activateRaiseOrIconify()
Perform the action that is most appropriate for this task.
Definition: taskmanager.cpp:622
Task::changed
void changed()
Indicates that this task has changed in some way.
Task::restore
void restore()
Restore the main window of the task (if it was iconified).
Definition: taskmanager.cpp:584
Task::bestIcon
TQPixmap bestIcon(int size, bool &isStaticIcon)
Returns the best icon for any of the TDEIcon::StdSizes.
Definition: taskmanager.cpp:483
Task::iconify
void iconify()
Iconify the task.
Definition: taskmanager.cpp:592
Task::icon
TQPixmap icon(int width, int height, bool allowResize=false)
Tries to find an icon for the task with the specified size.
Definition: taskmanager.cpp:464
Task::isOnTop
bool isOnTop() const
Returns true if the task's window is the topmost non-iconified, non-always-on-top window.
Definition: taskmanager.cpp:416
Task::setAlwaysOnTop
void setAlwaysOnTop(bool)
If true, the task's window will remain at the top of the stacking order.
Definition: taskmanager.cpp:657
Task::close
void close()
Activate the task's window.
Definition: taskmanager.cpp:597
Task::idMatch
static bool idMatch(const TQString &, const TQString &)
Returns true iff the windows with the specified ids should be grouped together in the task list.
Definition: taskmanager.cpp:560
Task::setShaded
void setShaded(bool)
If true then the task's window will be shaded.
Definition: taskmanager.cpp:671
Task::updateThumbnail
void updateThumbnail()
Tells the task to generate a new thumbnail.
Definition: taskmanager.cpp:696
Task::isMaximized
bool isMaximized() const
Returns true if the task's window is maximized.
Definition: taskmanager.cpp:381
Task::deactivated
void deactivated()
Indicates that this task is no longer the active task.

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

superkaramba

Skip menu "superkaramba"
  • kcalc
  •   knumber
  • superkaramba
Generated for superkaramba by doxygen 1.9.1
This website is maintained by Timothy Pearson.