353
353
virtual void _outputChangeNotify() = 0;
357
* A wrapping of the X display screen. This takes care of communication to the
360
class CompScreenImpl : public CompScreen
366
bool init (const char *name);
370
CompFileWatchHandle addFileWatch (const char *path,
372
FileWatchCallBack callBack);
374
void removeFileWatch (CompFileWatchHandle handle);
376
const CompFileWatchList& getFileWatches () const;
378
CompWatchFdHandle addWatchFd (int fd,
380
FdWatchCallBack callBack);
382
void removeWatchFd (CompWatchFdHandle handle);
384
void storeValue (CompString key, CompPrivate value);
385
bool hasValue (CompString key);
386
CompPrivate getValue (CompString key);
387
void eraseValue (CompString key);
391
CompOption::Vector & getOptions ();
393
bool setOption (const CompString &name, CompOption::Value &value);
405
SnDisplay * snDisplay ();
407
Window activeWindow ();
409
Window autoRaiseWindow ();
411
const char * displayString ();
414
CompWindow * findWindow (Window id);
416
CompWindow * findTopLevelWindow (Window id,
417
bool override_redirect = false);
419
bool readImageFromFile (CompString &name,
424
bool writeImageToFile (CompString &path,
429
unsigned int getWindowProp (Window id,
431
unsigned int defaultValue);
434
void setWindowProp (Window id,
439
unsigned short getWindowProp32 (Window id,
441
unsigned short defaultValue);
444
void setWindowProp32 (Window id,
446
unsigned short value);
452
XWindowAttributes attrib ();
456
CompWindowList & windows ();
457
CompWindowList & serverWindows ();
458
CompWindowList & destroyedWindows ();
460
void warpPointer (int dx, int dy);
462
Time getCurrentTime ();
464
Window selectionWindow ();
466
void forEachWindow (CompWindow::ForEach);
468
void focusDefaultWindow ();
470
void insertWindow (CompWindow *w, Window aboveId);
471
void unhookWindow (CompWindow *w);
473
void insertServerWindow (CompWindow *w, Window aboveId);
474
void unhookServerWindow (CompWindow *w);
476
Cursor normalCursor ();
478
Cursor invisibleCursor ();
480
/* Adds an X Pointer and Keyboard grab to the stack. Since
481
* compiz as a client only need to grab once, multiple clients
482
* can call this and all get events, but the pointer will
483
* be grabbed once and the actual grab refcounted */
484
GrabHandle pushGrab (Cursor cursor, const char *name);
486
/* Allows you to change the pointer of your grab */
487
void updateGrab (GrabHandle handle, Cursor cursor);
489
/* Removes your grab from the stack. Once the internal refcount
490
* reaches zero, the X Pointer and Keyboard are both ungrabbed
492
void removeGrab (GrabHandle handle, CompPoint *restorePointer);
494
/* Returns true if a grab other than the grabs specified here
496
bool otherGrabExist (const char *, ...);
498
/* Returns true if the specified grab exists */
499
bool grabExist (const char *);
501
/* Returns true if the X Pointer and / or Keyboard is grabbed
502
* by anything (another application, pluigins etc) */
505
const CompWindowVector & clientList (bool stackingOrder = true);
507
bool addAction (CompAction *action);
509
void removeAction (CompAction *action);
511
void updateWorkarea ();
513
void toolkitAction (Atom toolkitAction,
520
void runCommand (CompString command);
522
void moveViewport (int tx, int ty, bool sync);
524
void sendWindowActivationRequest (Window id);
526
int outputDeviceForPoint (int x, int y);
527
int outputDeviceForPoint (const CompPoint &point);
529
CompRect getCurrentOutputExtents ();
531
const CompRect & getWorkareaForOutput (unsigned int outputNum) const;
533
void viewportForGeometry (const CompWindow::Geometry &gm,
534
CompPoint &viewport);
536
int outputDeviceForGeometry (const CompWindow::Geometry& gm);
538
const CompPoint & vp () const;
540
const CompSize & vpSize () const;
542
int desktopWindowCount ();
543
unsigned int activeNum () const;
545
CompOutput::vector & outputDevs ();
546
CompOutput & currentOutputDev () const;
548
const CompRect & workArea () const;
550
unsigned int currentDesktop ();
552
unsigned int nDesktop ();
554
CompActiveWindowHistory *currentHistory ();
556
bool shouldSerializePlugins () ;
558
const CompRegion & region () const;
560
bool hasOverlappingOutputs ();
562
CompOutput & fullscreenOutput ();
564
std::vector<XineramaScreenInfo> & screenInfo ();
566
CompIcon *defaultIcon () const;
568
bool updateDefaultIcon ();
570
void updateSupportedWmHints ();
572
unsigned int showingDesktopMask() const;
573
virtual bool grabsEmpty() const;
574
virtual void sizePluginClasses(unsigned int size);
575
virtual void setWindowState (unsigned int state, Window id);
576
virtual void removeFromCreatedWindows(CoreWindow *cw);
577
virtual void addToDestroyedWindows(CompWindow * cw);
578
virtual void processEvents ();
579
virtual void alwaysHandleEvent (XEvent *event);
583
static bool showDesktop (CompAction *action,
584
CompAction::State state,
585
CompOption::Vector &options);
587
static bool windowMenu (CompAction *action,
588
CompAction::State state,
589
CompOption::Vector &options);
591
static bool closeWin (CompAction *action,
592
CompAction::State state,
593
CompOption::Vector &options);
595
static bool unmaximizeWin (CompAction *action,
596
CompAction::State state,
597
CompOption::Vector &options);
599
static bool minimizeWin (CompAction *action,
600
CompAction::State state,
601
CompOption::Vector &options);
603
static bool maximizeWin (CompAction *action,
604
CompAction::State state,
605
CompOption::Vector &options);
607
static bool maximizeWinHorizontally (CompAction *action,
608
CompAction::State state,
609
CompOption::Vector &options);
611
static bool maximizeWinVertically (CompAction *action,
612
CompAction::State state,
613
CompOption::Vector &options);
615
static bool raiseWin (CompAction *action,
616
CompAction::State state,
617
CompOption::Vector &options);
619
static bool lowerWin (CompAction *action,
620
CompAction::State state,
621
CompOption::Vector &options);
623
static bool toggleWinMaximized (CompAction *action,
624
CompAction::State state,
625
CompOption::Vector &options);
627
static bool toggleWinMaximizedHorizontally (CompAction *action,
628
CompAction::State state,
629
CompOption::Vector &options);
631
static bool toggleWinMaximizedVertically (CompAction *action,
632
CompAction::State state,
633
CompOption::Vector &options);
635
static bool shadeWin (CompAction *action,
636
CompAction::State state,
637
CompOption::Vector &options);
640
virtual bool _setOptionForPlugin(const char *, const char *, CompOption::Value &);
641
virtual bool _initPluginForScreen(CompPlugin *);
642
virtual void _finiPluginForScreen(CompPlugin *);
643
virtual void _handleEvent(XEvent *event);
644
virtual void _logMessage(const char *, CompLogLevel, const char*);
645
virtual void _enterShowDesktopMode();
646
virtual void _leaveShowDesktopMode(CompWindow *);
647
virtual void _addSupportedAtoms(std::vector<Atom>& atoms);
649
// These are stubs - but allow mocking of AbstractCompWindow
650
virtual void _fileWatchAdded(CompFileWatch *);
651
virtual void _fileWatchRemoved(CompFileWatch *);
652
virtual void _sessionEvent(CompSession::Event, CompOption::Vector &);
653
virtual void _handleCompizEvent(const char *, const char *, CompOption::Vector &);
654
virtual bool _fileToImage(CompString &, CompSize &, int &, void *&);
655
virtual bool _imageToFile(CompString &, CompString &, CompSize &, int, void *);
656
virtual CompMatch::Expression * _matchInitExp(const CompString&);
657
virtual void _matchExpHandlerChanged();
658
virtual void _matchPropertyChanged(CompWindow *);
659
virtual void _outputChangeNotify();