diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/GHOST_C-api.h | 8 | ||||
-rw-r--r-- | intern/ghost/GHOST_ISystem.h | 4 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_C-api.cpp | 8 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_System.h | 12 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCarbon.cpp | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCarbon.h | 6 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 7 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.h | 12 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 8 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.h | 11 |
10 files changed, 42 insertions, 40 deletions
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index cb1eac7a9a6..c3158214830 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -771,14 +771,16 @@ extern GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle, /** * Return the data from the clipboad - * @return clipboard data + * @param return the selection instead, X11 only feature + * @return clipboard data */ -extern GHOST_TUns8* GHOST_getClipboard(int flag); +extern GHOST_TUns8* GHOST_getClipboard(int selection); /** * Put data to the Clipboard + * @param set the selection instead, X11 only feature */ -extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int flag); +extern void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection); #ifdef __cplusplus } diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h index baf0cb813f8..08794dfd085 100644 --- a/intern/ghost/GHOST_ISystem.h +++ b/intern/ghost/GHOST_ISystem.h @@ -356,12 +356,12 @@ public: * @return Returns "unsinged char" from X11 XA_CUT_BUFFER0 buffer * */ - virtual GHOST_TUns8* getClipboard(int flag) const = 0; + virtual GHOST_TUns8* getClipboard(bool selection) const = 0; /** * Put data to the Clipboard */ - virtual void putClipboard(GHOST_TInt8 *buffer, int flag) const = 0; + virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0; protected: /** diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index ad5189af0e9..401dba8d240 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -810,15 +810,15 @@ GHOST_TSuccess GHOST_ClipRectangle(GHOST_RectangleHandle rectanglehandle, return result; } -GHOST_TUns8* GHOST_getClipboard(int flag) +GHOST_TUns8* GHOST_getClipboard(int selection) { GHOST_ISystem* system = GHOST_ISystem::getSystem(); - return system->getClipboard(flag); + return system->getClipboard(selection); } -void GHOST_putClipboard(GHOST_TInt8 *buffer, int flag) +void GHOST_putClipboard(GHOST_TInt8 *buffer, int selection) { GHOST_ISystem* system = GHOST_ISystem::getSystem(); - system->putClipboard(buffer, flag); + system->putClipboard(buffer, selection); } diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h index efce931860a..9310e9b2591 100644 --- a/intern/ghost/intern/GHOST_System.h +++ b/intern/ghost/intern/GHOST_System.h @@ -284,18 +284,18 @@ public: /** * Returns the selection buffer - * @param flag Only used on X11 - * @return Returns the clipboard data + * @param selection Only used on X11 + * @return Returns the clipboard data * */ - virtual GHOST_TUns8* getClipboard(int flag) const = 0; + virtual GHOST_TUns8* getClipboard(bool selection) const = 0; /** * Put data to the Clipboard - * @param buffer The buffer to copy to the clipboard - * @param flag The clipboard to copy too only used on X11 + * @param buffer The buffer to copy to the clipboard + * @param selection The clipboard to copy too only used on X11 */ - virtual void putClipboard(GHOST_TInt8 *buffer, int flag) const = 0; + virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const = 0; protected: /** diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp index 203b3847019..1043d0938b4 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.cpp +++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp @@ -1119,7 +1119,7 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even return err; } -GHOST_TUns8* GHOST_SystemCarbon::getClipboard(int flag) const +GHOST_TUns8* GHOST_SystemCarbon::getClipboard(bool selection) const { PasteboardRef inPasteboard; PasteboardItemID itemID; @@ -1158,9 +1158,9 @@ GHOST_TUns8* GHOST_SystemCarbon::getClipboard(int flag) const } } -void GHOST_SystemCarbon::putClipboard(GHOST_TInt8 *buffer, int flag) const +void GHOST_SystemCarbon::putClipboard(GHOST_TInt8 *buffer, bool selection) const { - if(flag == 1) {return;} //If Flag is 1 means the selection and is used on X11 + if(selection) {return;} // for copying the selection, used on X11 PasteboardRef inPasteboard; CFDataRef textData = NULL; diff --git a/intern/ghost/intern/GHOST_SystemCarbon.h b/intern/ghost/intern/GHOST_SystemCarbon.h index 2a1d6325784..51c2a4f0a7a 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.h +++ b/intern/ghost/intern/GHOST_SystemCarbon.h @@ -169,10 +169,10 @@ public: /** * Returns Clipboard data - * @param flag Indicate which buffer to return - * @return Returns the selected buffer + * @param selection Indicate which buffer to return + * @return Returns the selected buffer */ - virtual GHOST_TUns8* getClipboard(int flag) const; + virtual GHOST_TUns8* getClipboard(bool selection) const; /** * Puts buffer to system clipboard diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 6b5fcfe7705..e79a075ff2c 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -913,7 +913,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, return lResult; } -GHOST_TUns8* GHOST_SystemWin32::getClipboard(int flag) const +GHOST_TUns8* GHOST_SystemWin32::getClipboard(bool selection) const { char *buffer; char *temp_buff; @@ -943,9 +943,10 @@ GHOST_TUns8* GHOST_SystemWin32::getClipboard(int flag) const } } -void GHOST_SystemWin32::putClipboard(GHOST_TInt8 *buffer, int flag) const +void GHOST_SystemWin32::putClipboard(GHOST_TInt8 *buffer, bool selection) const { - if(flag == 1) {return;} //If Flag is 1 means the selection and is used on X11 + if(selection) {return;} // for copying the selection, used on X11 + if (OpenClipboard(NULL)) { HLOCAL clipbuffer; char *data; diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h index 00f7af00162..9387b6cad50 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.h +++ b/intern/ghost/intern/GHOST_SystemWin32.h @@ -170,17 +170,17 @@ public: /** * Returns unsinged char from CUT_BUFFER0 - * @param flag Flag is not used on win32 on used on X11 - * @return Returns the Clipboard + * @param selection Used by X11 only + * @return Returns the Clipboard */ - virtual GHOST_TUns8* getClipboard(int flag) const; + virtual GHOST_TUns8* getClipboard(bool selection) const; /** * Puts buffer to system clipboard - * @param flag Flag is not used on win32 on used on X11 - * @return No return + * @param selection Used by X11 only + * @return No return */ - virtual void putClipboard(GHOST_TInt8 *buffer, int flag) const; + virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const; protected: /** diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 0d19c3b230d..2e76b50fe7a 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -1006,7 +1006,7 @@ convertXKey( GHOST_TUns8* GHOST_SystemX11:: -getClipboard(int flag +getClipboard(bool selection ) const { //Flag //0 = Regular clipboard 1 = selection @@ -1027,7 +1027,7 @@ getClipboard(int flag compound_text = XInternAtom(m_display, "COMPOUND_TEXT", False); //lets check the owner and if it is us then return the static buffer - if(flag == 0) { + if(!selection) { Primary_atom = XInternAtom(m_display, "CLIPBOARD", False); owner = XGetSelectionOwner(m_display, Primary_atom); if (owner == m_window) { @@ -1077,14 +1077,14 @@ getClipboard(int flag void GHOST_SystemX11:: putClipboard( -GHOST_TInt8 *buffer, int flag) const +GHOST_TInt8 *buffer, bool selection) const { static Atom Primary_atom; Window m_window, owner; if(!buffer) {return;} - if(flag == 0) { + if(!selection) { Primary_atom = XInternAtom(m_display, "CLIPBOARD", False); if(txt_cut_buffer) { free((void*)txt_cut_buffer); } diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h index 4b0ddd7a4f9..6eacd88b8c2 100644 --- a/intern/ghost/intern/GHOST_SystemX11.h +++ b/intern/ghost/intern/GHOST_SystemX11.h @@ -202,18 +202,17 @@ public: /** * Returns unsinged char from CUT_BUFFER0 - * @param flag Flag indicates which buffer to return 0 for clipboard 1 for selection - * @return Returns the Clipboard indicated by Flag + * @param selection Get selection, X11 only feature + * @return Returns the Clipboard indicated by Flag */ - GHOST_TUns8* - getClipboard(int flag) const; + GHOST_TUns8* getClipboard(bool selection) const; /** * Puts buffer to system clipboard * @param buffer The buffer to copy to the clipboard - * @param flag Flag indicates which buffer to set ownership of 0 for clipboard 1 for selection + * @param selection Set the selection into the clipboard, X11 only feature */ - virtual void putClipboard(GHOST_TInt8 *buffer, int flag) const; + virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const; /** * Atom used for ICCCM, WM-spec and Motif. |