Changed getClipbaord and putClipboard functions to be more ghost like

Changed getClipboard to GHOST_getClipboard and putClipboard to GHOST_putClipboard

Removed ghost calls from blender and added the calls to winlay.h and ghostwinlay.c
This cleand up casts in drawtext.c
This commit is contained in:
2008-03-08 04:22:52 +00:00
parent b1fcb254c4
commit b5cdd1f2d6
5 changed files with 22 additions and 9 deletions

View File

@@ -763,12 +763,12 @@ extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
* Return the data from the clipboad
* @return clipboard data
*/
extern GHOST_TUns8* getClipboard(int flag);
extern GHOST_TUns8* GHOST_getClipboard(int flag);
/**
* Put data to the Clipboard
*/
extern void putClipboard(GHOST_TInt8 *buffer, int flag);
extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int flag);
#ifdef __cplusplus
}

View File

@@ -803,13 +803,13 @@ GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle,
return result;
}
GHOST_TUns8* getClipboard(int flag)
GHOST_TUns8* GHOST_getClipboard(int flag)
{
GHOST_ISystem* system = GHOST_ISystem::getSystem();
return system->getClipboard(flag);
}
void putClipboard(GHOST_TInt8 *buffer, int flag)
void GHOST_putClipboard(GHOST_TInt8 *buffer, int flag)
{
GHOST_ISystem* system = GHOST_ISystem::getSystem();
system->putClipboard(buffer, flag);

View File

@@ -84,8 +84,7 @@
#include "mydevice.h"
#include "blendef.h"
#include "GHOST_C-api.h"
#include "winlay.h"
#define TEXTXLOC 38
@@ -1363,7 +1362,7 @@ void txt_paste_clipboard(Text *text) {
void get_selection_buffer(Text *text)
{
char *buff = (char*)getClipboard(1);
char *buff = getClipboard(1);
txt_insert_buf(text, buff);
}
@@ -1376,7 +1375,7 @@ void txt_copy_clipboard(Text *text) {
copybuffer[bufferlength] = '\0';
temp = winNewLine(copybuffer);
putClipboard((GHOST_TInt8*)temp, 0);
putClipboard(temp, 0);
MEM_freeN(temp);
MEM_freeN(copybuffer);
copybuffer= NULL;
@@ -1539,7 +1538,7 @@ void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
do_selection(st, G.qual&LR_SHIFTKEY);
if (txt_has_sel(text)) {
buffer = txt_sel_to_buf(text);
putClipboard((GHOST_TInt8*)buffer, 1);
putClipboard(buffer, 1);
MEM_freeN(buffer);
}
do_draw= 1;

View File

@@ -833,3 +833,11 @@ void winlay_get_screensize(int *width_r, int *height_r) {
Window *winlay_get_active_window(void) {
return active_gl_window;
}
char *getClipboard(int flag) {
return (char*)GHOST_getClipboard(flag);
}
void putClipboard(char *buffer, int flag) {
GHOST_putClipboard((GHOST_TInt8*)buffer, flag);
}

View File

@@ -86,3 +86,9 @@ Window* winlay_get_active_window(void);
void winlay_process_events (int wait_for_event);
void winlay_get_screensize (int *width_r, int *height_r);
/* Copy and paste functions in ghostwinlay.c */
char *getClipboard(int flag);
void putClipboard(char *buffer, int flag);