static BClipboard *primary = NULL;
static BClipboard *secondary = NULL;
static BClipboard *system_clipboard = NULL;
-static unsigned long count_clipboard = 0;
-static unsigned long count_primary = 0;
-static unsigned long count_secondary = 0;
+static int64 count_clipboard = -1;
+static int64 count_primary = -1;
+static int64 count_secondary = -1;
int selection_state_flag;
if (!system_clipboard)
return;
- BClipboard_set_data (system_clipboard, type, data, len, clear);
count_clipboard = system_clipboard->SystemCount ();
+ BClipboard_set_data (system_clipboard, type, data, len, clear);
}
void
if (!primary)
return;
- BClipboard_set_data (primary, type, data, len, clear);
count_primary = primary->SystemCount ();
+ BClipboard_set_data (primary, type, data, len, clear);
}
void
if (!secondary)
return;
- BClipboard_set_data (secondary, type, data, len, clear);
count_secondary = secondary->SystemCount ();
+ BClipboard_set_data (secondary, type, data, len, clear);
}
void
bool
BClipboard_owns_clipboard (void)
{
- return (count_clipboard
- == system_clipboard->SystemCount ());
+ return (count_clipboard >= 0
+ && (count_clipboard + 1
+ == system_clipboard->SystemCount ()));
}
bool
BClipboard_owns_primary (void)
{
- return (count_primary
- == primary->SystemCount ());
+ return (count_primary >= 0
+ && (count_primary + 1
+ == primary->SystemCount ()));
}
bool
BClipboard_owns_secondary (void)
{
- return (count_secondary
- == secondary->SystemCount ());
+ return (count_secondary >= 0
+ && (count_secondary + 1
+ == secondary->SystemCount ()));
}
void