src/video/haiku/SDL_bclipboard.cc
changeset 12082 09999a0e8f9a
parent 11811 5d94cb6b24d3
child 12201 8bdc4d340419
equal deleted inserted replaced
12081:277e57c09ff4 12082:09999a0e8f9a
    33 
    33 
    34 #ifdef __cplusplus
    34 #ifdef __cplusplus
    35 extern "C" {
    35 extern "C" {
    36 #endif
    36 #endif
    37 
    37 
    38 int BE_SetClipboardText(_THIS, const char *text) {
    38 int HAIKU_SetClipboardText(_THIS, const char *text) {
    39 	BMessage *clip = NULL;
    39 	BMessage *clip = NULL;
    40 	if(be_clipboard->Lock()) {
    40 	if(be_clipboard->Lock()) {
    41 		be_clipboard->Clear();
    41 		be_clipboard->Clear();
    42 		if((clip = be_clipboard->Data())) {
    42 		if((clip = be_clipboard->Data())) {
    43 			/* Presumably the string of characters is ascii-format */
    43 			/* Presumably the string of characters is ascii-format */
    49 		be_clipboard->Unlock();
    49 		be_clipboard->Unlock();
    50 	}
    50 	}
    51 	return 0;
    51 	return 0;
    52 }
    52 }
    53 
    53 
    54 char *BE_GetClipboardText(_THIS) {
    54 char *HAIKU_GetClipboardText(_THIS) {
    55 	BMessage *clip = NULL;
    55 	BMessage *clip = NULL;
    56 	const char *text = NULL;	
    56 	const char *text = NULL;	
    57 	ssize_t length;
    57 	ssize_t length;
    58 	char *result;
    58 	char *result;
    59 	if(be_clipboard->Lock()) {
    59 	if(be_clipboard->Lock()) {
    74 	}
    74 	}
    75 	
    75 	
    76 	return result;
    76 	return result;
    77 }
    77 }
    78 
    78 
    79 SDL_bool BE_HasClipboardText(_THIS) {
    79 SDL_bool HAIKU_HasClipboardText(_THIS) {
    80 	SDL_bool result = SDL_FALSE;
    80 	SDL_bool result = SDL_FALSE;
    81 	char *text = BE_GetClipboardText(_this);
    81 	char *text = HAIKU_GetClipboardText(_this);
    82 	if (text) {
    82 	if (text) {
    83 		result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
    83 		result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
    84 		SDL_free(text);
    84 		SDL_free(text);
    85 	} 
    85 	} 
    86 	return result;
    86 	return result;