Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-01 02:33:35 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-01 02:33:35 +0300
commit6cc89b9d4e6ab17bea0631b1be800dd9a022db23 (patch)
tree356e3649b94ec7f5a144f1fa6304f5646c4b9bf1 /intern
parent2469305376856e0f53b4ffdbe2bf2576fa25809c (diff)
2.5: Text Editor back.
There was very little structure in this code, using many globals and duplicated code. Now it should be better structured. Most things should work, the main parts that are not back yet are the python plugins and markers. Notes: * Blenfont is used for drawing the text, nicely anti-aliased. * A monospace truetype font was added, since that is needed for the text editor. It's Bitstream Vera Sans Mono. This is the default gnome terminal font, but it doesn't fit entirely well with the other font I think, can be changed easily of course. * Clipboard copy/cut/paste now always uses the system clipboard, the code for the own cut buffer was removed. * The interface buttons should support copy/cut/paste again now as well. * WM_clipboard_text_get/WM_clipboard_text_set were added to the windowmanager code. * Find panel is now a kind of second header, instead of a panel. This needs especially a way to start editing the text field immediately on open still. * Operators are independent of the actual space when possible, was a bit of puzzling but got it solved nice with notifiers, and some lazy init for syntax highlight in the drawing code. * RNA was created for the text editor space and used for buttons. * Operators: * New, Open, Reload, Save, Save As, Make Internal * Run Script, Refresh Pyconstraints * Copy, Cut, Paste * Convert Whitespace, Uncomment, Comment, Indent, Unindent * Line Break, Insert * Next Marker, Previous Marker, Clear All Markers, Mark All * Select Line, Select All * Jump, Move, Move Select, Delete, Toggle Overwrite * Scroll, Scroll Bar, Set Cursor, Line Number * Find and Replace, Find, Replace, Find Set Selected, Replace Set Selected * To 3D Object * Resolve Conflict
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/GHOST_C-api.h8
-rw-r--r--intern/ghost/GHOST_ISystem.h4
-rw-r--r--intern/ghost/intern/GHOST_C-api.cpp8
-rw-r--r--intern/ghost/intern/GHOST_System.h12
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.cpp6
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp7
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.h12
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp8
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h11
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.