diff options
Diffstat (limited to 'src/haiku_select.cc')
| -rw-r--r-- | src/haiku_select.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/haiku_select.cc b/src/haiku_select.cc index 041e244f3ea..d39000d8bbe 100644 --- a/src/haiku_select.cc +++ b/src/haiku_select.cc | |||
| @@ -29,6 +29,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 29 | static BClipboard *primary = NULL; | 29 | static BClipboard *primary = NULL; |
| 30 | static BClipboard *secondary = NULL; | 30 | static BClipboard *secondary = NULL; |
| 31 | static BClipboard *system_clipboard = NULL; | 31 | static BClipboard *system_clipboard = NULL; |
| 32 | static unsigned long count_clipboard = 0; | ||
| 33 | static unsigned long count_primary = 0; | ||
| 34 | static unsigned long count_secondary = 0; | ||
| 32 | 35 | ||
| 33 | int selection_state_flag; | 36 | int selection_state_flag; |
| 34 | 37 | ||
| @@ -174,6 +177,7 @@ BClipboard_set_system_data (const char *type, const char *data, | |||
| 174 | return; | 177 | return; |
| 175 | 178 | ||
| 176 | BClipboard_set_data (system_clipboard, type, data, len, clear); | 179 | BClipboard_set_data (system_clipboard, type, data, len, clear); |
| 180 | count_clipboard = system_clipboard->SystemCount (); | ||
| 177 | } | 181 | } |
| 178 | 182 | ||
| 179 | void | 183 | void |
| @@ -184,6 +188,7 @@ BClipboard_set_primary_selection_data (const char *type, const char *data, | |||
| 184 | return; | 188 | return; |
| 185 | 189 | ||
| 186 | BClipboard_set_data (primary, type, data, len, clear); | 190 | BClipboard_set_data (primary, type, data, len, clear); |
| 191 | count_primary = primary->SystemCount (); | ||
| 187 | } | 192 | } |
| 188 | 193 | ||
| 189 | void | 194 | void |
| @@ -194,6 +199,7 @@ BClipboard_set_secondary_selection_data (const char *type, const char *data, | |||
| 194 | return; | 199 | return; |
| 195 | 200 | ||
| 196 | BClipboard_set_data (secondary, type, data, len, clear); | 201 | BClipboard_set_data (secondary, type, data, len, clear); |
| 202 | count_secondary = secondary->SystemCount (); | ||
| 197 | } | 203 | } |
| 198 | 204 | ||
| 199 | void | 205 | void |
| @@ -220,6 +226,27 @@ BClipboard_secondary_targets (char **buf, int len) | |||
| 220 | BClipboard_get_targets (secondary, buf, len); | 226 | BClipboard_get_targets (secondary, buf, len); |
| 221 | } | 227 | } |
| 222 | 228 | ||
| 229 | bool | ||
| 230 | BClipboard_owns_clipboard (void) | ||
| 231 | { | ||
| 232 | return (count_clipboard | ||
| 233 | == system_clipboard->SystemCount ()); | ||
| 234 | } | ||
| 235 | |||
| 236 | bool | ||
| 237 | BClipboard_owns_primary (void) | ||
| 238 | { | ||
| 239 | return (count_primary | ||
| 240 | == primary->SystemCount ()); | ||
| 241 | } | ||
| 242 | |||
| 243 | bool | ||
| 244 | BClipboard_owns_secondary (void) | ||
| 245 | { | ||
| 246 | return (count_secondary | ||
| 247 | == secondary->SystemCount ()); | ||
| 248 | } | ||
| 249 | |||
| 223 | void | 250 | void |
| 224 | init_haiku_select (void) | 251 | init_haiku_select (void) |
| 225 | { | 252 | { |