return (char *) value;
}
-static void
-be_get_clipboard_targets_1 (BClipboard *cb, char **buf, int buf_size)
-{
- BMessage *data;
- char *name;
- int32 count_found;
- type_code type;
- int32 i;
- int index;
-
- if (!cb->Lock ())
- {
- buf[0] = NULL;
- return;
- }
-
- data = cb->Data ();
- index = 0;
-
- if (!data)
- {
- buf[0] = NULL;
- cb->Unlock ();
- return;
- }
-
- for (i = 0; (data->GetInfo (B_ANY_TYPE, i, &name,
- &type, &count_found)
- == B_OK); ++i)
- {
- if (type == B_MIME_TYPE)
- {
- if (index < (buf_size - 1))
- {
- buf[index++] = strdup (name);
-
- if (!buf[index - 1])
- break;
- }
- }
- }
-
- buf[index] = NULL;
-
- cb->Unlock ();
-}
-
static void
be_set_clipboard_data_1 (BClipboard *cb, const char *type, const char *data,
ssize_t len, bool clear)
data, len, clear);
}
-void
-be_get_clipboard_targets (enum haiku_clipboard id, char **targets,
- int len)
-{
- be_get_clipboard_targets_1 (get_clipboard_object (id), targets,
- len);
-}
-
static bool
clipboard_owner_p (void)
{
}
void
-init_haiku_select (void)
+be_clipboard_init (void)
{
system_clipboard = new BClipboard ("system");
primary = new BClipboard ("primary");
haiku_note_drag_motion_2);
}
+void
+init_haiku_select (void)
+{
+ be_clipboard_init ();
+}
+
void
syms_of_haikuselect (void)
{
#ifdef __cplusplus
extern "C"
{
-/* Also declared in haikuterm.h for use in emacs.c. */
-extern void init_haiku_select (void);
#endif
-/* Whether or not the selection was recently changed. */
+extern void be_clipboard_init (void);
extern char *be_find_clipboard_data (enum haiku_clipboard, const char *, ssize_t *);
extern void be_set_clipboard_data (enum haiku_clipboard, const char *, const char *,
ssize_t, bool);
-extern void be_get_clipboard_targets (enum haiku_clipboard, char **, int);
extern bool be_clipboard_owner_p (enum haiku_clipboard);
extern void be_update_clipboard_count (enum haiku_clipboard);
extern int be_add_message_message (void *, const char *, void *);
extern int be_lock_clipboard_message (enum haiku_clipboard, void **, bool);
extern void be_unlock_clipboard (enum haiku_clipboard, bool);
+
#ifdef __cplusplus
};
#endif