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

KDEUI

Signals | Public Member Functions | Protected Member Functions | List of all members
KSelectionOwner Class Reference

#include <kmanagerselection.h>

Inheritance diagram for KSelectionOwner:
Inheritance graph
[legend]

Signals

void lostOwnership ()
 

Public Member Functions

 KSelectionOwner (Atom selection, int screen=-1, QObject *parent=NULL)
 
 KSelectionOwner (const char *selection, int screen=-1, QObject *parent=NULL)
 
virtual ~KSelectionOwner ()
 
bool claim (bool force, bool force_kill=true)
 
bool filterEvent (XEvent *ev_P)
 
Window ownerWindow () const
 
void release ()
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Protected Member Functions

virtual bool genericReply (Atom target, Atom property, Window requestor)
 
virtual void getAtoms ()
 
virtual bool handleMessage (XEvent *ev)
 
virtual void replyTargets (Atom property, Window requestor)
 
void setData (long extra1, long extra2)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

This class implements claiming and owning manager selections, as described in the ICCCM, section 2.8.

The selection atom is passed to the constructor, claim() attemps to claim ownership of the selection, release() gives up the selection ownership. Signal lostOwnership() is emitted when the selection is claimed by another owner. ICCCM manager selection owner

Definition at line 45 of file kmanagerselection.h.

Constructor & Destructor Documentation

KSelectionOwner::KSelectionOwner ( Atom  selection,
int  screen = -1,
QObject *  parent = NULL 
)
explicit

This constructor initializes the object, but doesn't perform any operation on the selection.

Parameters
selectionatom representing the manager selection
screenX screen, or -1 for default
parentparent object, or NULL if there is none

Definition at line 88 of file kmanagerselection.cpp.

KSelectionOwner::KSelectionOwner ( const char *  selection,
int  screen = -1,
QObject *  parent = NULL 
)
explicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This constructor accepts the selection name and creates the appropriate atom for it automatically.

Parameters
selectionname of the manager selection
screenX screen, or -1 for default
parentparent object, or NULL if there is none

Definition at line 94 of file kmanagerselection.cpp.

KSelectionOwner::~KSelectionOwner ( )
virtual

Destructor.

Calls release().

Definition at line 100 of file kmanagerselection.cpp.

Member Function Documentation

bool KSelectionOwner::claim ( bool  force,
bool  force_kill = true 
)

This function attemps to claim ownership of the manager selection, using the current X timestamp.

If force is false, and the selection is already owned, the selection is not claimed, and false is returned. If claiming is forced and the selection is owned by another client, it is waited for up to 1 second for the previous owner to disown the selection, if force_kill is true, and the previous owner fails to disown the selection in time, it will be forcibly killed. True is returned after successfully claiming ownership of the selection.

Definition at line 106 of file kmanagerselection.cpp.

bool KSelectionOwner::filterEvent ( XEvent *  ev_P)

Definition at line 208 of file kmanagerselection.cpp.

bool KSelectionOwner::genericReply ( Atom  target,
Atom  property,
Window  requestor 
)
protectedvirtual

Called when a SelectionRequest event is received.

A reply should be sent using the selection handling mechanism described in the ICCCM section 2.

Parameters
targetrequested target type
propertyproperty to use for the reply data
requestorrequestor window

Definition at line 345 of file kmanagerselection.cpp.

void KSelectionOwner::getAtoms ( )
protectedvirtual

Called to create atoms needed for claiming the selection and communication using the selection handling mechanism.

The default implementation must be called if reimplemented. This method may be called repeatedly.

Definition at line 350 of file kmanagerselection.cpp.

bool KSelectionOwner::handleMessage ( XEvent *  ev)
protectedvirtual

Called for every X event received on the window used for owning the selection.

If true is returned, the event is filtered out.

Definition at line 252 of file kmanagerselection.cpp.

void KSelectionOwner::lostOwnership ( )
signal

This signal is emitted if the selection was owned and the ownership has been lost due to another client claiming it, this signal is emitted.

IMPORTANT: It's not safe to delete the instance in a slot connected to this signal.

Window KSelectionOwner::ownerWindow ( ) const

If the selection is owned, returns the window used internally for owning the selection.

Definition at line 195 of file kmanagerselection.cpp.

void KSelectionOwner::release ( )

If the selection is owned, the ownership is given up.

Definition at line 186 of file kmanagerselection.cpp.

void KSelectionOwner::replyTargets ( Atom  property,
Window  requestor 
)
protectedvirtual

Called to announce the supported targets, as described in the ICCCM section 2.6.

The default implementation announces the required targets MULTIPLE, TIMESTAMP and TARGETS.

Definition at line 337 of file kmanagerselection.cpp.

void KSelectionOwner::setData ( long  extra1,
long  extra2 
)
protected

Sets extra data to be sent in the message sent to root window after successfully claiming a selection.

These extra data are in data.l[3] and data.l[4] fields of the XClientMessage.

Definition at line 202 of file kmanagerselection.cpp.


The documentation for this class was generated from the following files:
  • kmanagerselection.h
  • kmanagerselection.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:03 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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

Search



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