Changeset View
Changeset View
Standalone View
Standalone View
xwl/selection_source.h
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 55 | public: | |||
---|---|---|---|---|---|
61 | void setTimestamp(xcb_timestamp_t time) { | 61 | void setTimestamp(xcb_timestamp_t time) { | ||
62 | m_timestamp = time; | 62 | m_timestamp = time; | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | protected: | 65 | protected: | ||
66 | Selection *selection() const { | 66 | Selection *selection() const { | ||
67 | return m_sel; | 67 | return m_sel; | ||
68 | } | 68 | } | ||
69 | void setWindow(xcb_window_t window) { | ||||
70 | m_window = window; | ||||
71 | } | ||||
72 | xcb_window_t window() const { | ||||
73 | return m_window; | ||||
74 | } | ||||
69 | 75 | | |||
70 | private: | 76 | private: | ||
71 | xcb_timestamp_t m_timestamp = XCB_CURRENT_TIME; | 77 | xcb_timestamp_t m_timestamp = XCB_CURRENT_TIME; | ||
72 | Selection *m_sel; | 78 | Selection *m_sel; | ||
79 | xcb_window_t m_window; | ||||
73 | }; | 80 | }; | ||
74 | 81 | | |||
75 | /* | 82 | /* | ||
76 | * Representing a Wayland native data source. | 83 | * Representing a Wayland native data source. | ||
77 | */ | 84 | */ | ||
78 | class WlSource : public SelSource | 85 | class WlSource : public SelSource | ||
79 | { | 86 | { | ||
80 | Q_OBJECT | 87 | Q_OBJECT | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 120 | public: | |||
126 | 133 | | |||
127 | Mimes offers() const { | 134 | Mimes offers() const { | ||
128 | return m_offers; | 135 | return m_offers; | ||
129 | } | 136 | } | ||
130 | void setOffers(const Mimes &offers); | 137 | void setOffers(const Mimes &offers); | ||
131 | 138 | | |||
132 | bool handleSelNotify(xcb_selection_notify_event_t *event); | 139 | bool handleSelNotify(xcb_selection_notify_event_t *event); | ||
133 | 140 | | |||
141 | void setRequestor(xcb_window_t window) { | ||||
142 | setWindow(window); | ||||
143 | } | ||||
144 | | ||||
134 | Q_SIGNALS: | 145 | Q_SIGNALS: | ||
135 | void offersChanged(QVector<QString> added, QVector<QString> removed); | 146 | void offersChanged(QVector<QString> added, QVector<QString> removed); | ||
136 | void transferReady(xcb_atom_t target, qint32 fd); | 147 | void transferReady(xcb_atom_t target, qint32 fd); | ||
137 | 148 | | |||
138 | private: | 149 | private: | ||
139 | void handleTargets(); | 150 | void handleTargets(); | ||
140 | void startTransfer(const QString &mimeName, qint32 fd); | 151 | void startTransfer(const QString &mimeName, qint32 fd); | ||
141 | 152 | | |||
Show All 10 Lines |