Commit Graph

40 Commits

Author SHA1 Message Date
33accdb725 use (const char*) rather than (char*) where possible.
also removed some unused function definitons.
2011-11-05 11:04:28 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
f5ec4cf4e9 fix own mistake [#27451] Flip to Top / Flip to Bottom menuitems on right click on header not working
also get rig of more shadowed vars (-Wshadow).
2011-05-23 08:14:29 +00:00
471c28f91c Fix #27319: Text editor "Find" does not locate words.
Added new option to find panel of space text which toggles
case-esensitive search.

Additional changes:
- Send NC_TEXT|NA_EDITED when removing markers in find_and_replace modifier
  this prevents "sticked" markers which disappears on first redraw when
  search text wasn't found
- Do not show "Text wasn't found" error when text to be searched is contained
  in the end of buffer and it's selected. Replacing/marking used to happen, but
  this popup message was really annoying for this case.

TODO: It's incorrect to use UI_GetThemeColor4ubv from this operator
2011-05-07 17:52:44 +00:00
661d6ff7e5 Fix #27014: ctrl-A, ctrl-C, ctrl-V breaks formatting of script
This bug was caused by tabs->spaces conversion. Change pate-ing logic to
paste buffer AS-IS (without any conversions).

This commit also fixes undo-ing  block deletion which contains tabs when
"Tabs as spaces" is toggled on. Also, markes shouldn't be moved after
pasteing new buffer.
2011-04-20 07:44:42 +00:00
Nathan Letwory
22638e22ea doxygen: blenkernel under core as module. 2011-02-18 13:05:18 +00:00
3bed4cbf2b fix [#25283] Edge length display difficult to read
- made theme colors for mesh edge len & face angle/area display.
- use %g rather then %f for float display, trims unneeded zeros.
- store cached 2d and 3d text color as bytes rather then floats, compare when drawing to avoid setting the context.
- use unsigned char for more color functions, avoids casting to glColorubv().
2010-12-20 03:59:22 +00:00
51dcbdde03 use 'const char *' by default with RNA functions except when the value is flagged as PROP_THICK_WRAP.
Also use const char in many other parts of blenders code.

Currently this gives warnings for setting operator id, label and description since these are an exception and allocated beforehand.
2010-11-17 09:45:45 +00:00
b1f53d98e4 patch [#23088] 2.5 Text Editor: Preserve indentation with spaces
from Fabian Fricke (frigi)
2010-07-29 22:34:46 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
d86864027d PyConsole improvements
- Commands from the history wont get modified in-place when you cycle back and re-use them.
- Ctrl Left/Right skip words.
- Autocompletion on a variable that has no alternatives adds a '.'
  'bpy' -> 'bpy.', generally more useful since autocomp again will give the members of bpy

also moved text_check_* functions into BKE_text.h for the console to access.
2009-09-22 16:23:46 +00:00
cc100eadc5 Operator cheat sheet (from the help menu)
writes all operators (including PyOperators) and their default values into a textblock.
Useful for an overview and checking consistancy.

eg. http://www.pasteall.org/7918/python

added rna functions text.clear() and text.write(str)
2009-09-16 06:02:56 +00:00
5dd9f7635a 2.5
Make local and make single user are back for ID template.

Internally these calls got unified, id_make_local and
id_copy are now used to do these operations for all types
that support it. Also reveals that for some ID types the
implementation is still missing.

Further, some small changes:

* unlink_text is now in blenkernel.
* copy_group was implemented.
* ID template now has an open operator again.
* fix preview to not change material reference count,
  even if temporary it shows up with threaded preview.
* id_unlink unifies unlink for text, object and group.
2009-09-04 21:02:43 +00:00
6cc89b9d4e 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
2009-02-28 23:33:35 +00:00
f7cb86df3a 2.5
Think global, act local!

The old favorite G.scene gone! Man... that took almost 2 days.
Also removed G.curscreen and G.edbo.

Not everything could get solved; here's some notes.
- modifiers now store current scene in ModifierData. This is not
  meant for permanent, but it can probably stick there until we
  cleaned the anim system and depsgraph to cope better with
  timing issues.
- Game engine G.scene should become an argument for staring it.
  Didn't solve this yet.
- Texture nodes should get scene cfra, but the current implementation
  is too tightly wrapped to do it easily.
2009-01-04 14:14:06 +00:00
062bf735e7 Minor tidying and commenting 2008-08-31 16:23:31 +00:00
bf0803c0c2 Added better grouping for text markers with a separate group field (instead of using flags). The lower two bytes of the group are used for python scripts while the upper two (or more) are reserved for internal grouping. Plenty either way. 2008-08-24 13:30:35 +00:00
310a6e2179 Esc removes markers in stages. Temporary markers are removed first (if any) then other markers follow. 2008-08-16 14:38:08 +00:00
7b1a2d5f3a Got rid of the horrible blocking UI problems with Find and Replace by using a blockhandler panel. The panel is shown when find is invoked with Alt F (or from the menu). Successive presses of Alt F search again, while the panel is visible. Alt H does the same for replace. (Ctrl F and Ctrl H also work - more like other editors) 2008-08-14 16:22:25 +00:00
6c0f4660ed Various UI drawing and event tweaks to make markers feel more natural and avoid getting in the way. If there is a marker under the cursor, ESC will remove it and others in its group. Otherwise all temporary markers are removed. Tab finds/cycles/removes temp. markers, cycles non-temp. markers (under cursor) and behaves normally in all other cases. 2008-08-06 13:46:44 +00:00
06c3dee92b Find and Replace now support "Mark All" which marks all occurrences of a string and allows them to be edited from one instance. Improvements have also been made to the UI allowing better control over which occurrences to replace. 2008-08-05 17:43:03 +00:00
53e535dfcf Text Markers: multiple, coloured selections within a Text object with group relationships. They allow portions of text to be edited as one and enable quick jumping between and editing of different areas.
Flags control the behaviour and grouping of markers. At present, Ctrl+M places a marker with TMARK_EDITALL set for testing purposes.

I have also split the text area event handler into separate methods for marker handling and the existing text tools. This makes the events system much easier to follow as it was getting a little hairy.
2008-08-04 23:01:47 +00:00
3b70337f7f Improvements to text find (and replace):
- Added GUI panel
 - Selected text is copied to "find" field
 - Option to search "all texts"
 - Option to replace text
 - Alt+F finds, Ctrl+Alt+F finds again (without UI)
 - Alt+H replaces (UI), Ctrl+Alt+H replaces again (and undo works)
 - Fixed: Find didn't push undos so cursor position was wrong
2008-07-23 19:35:13 +00:00
05ce388f35 Added functions to the BPy Text object for positioning the cursor and inserting text. It seems Text.write() actually inserts *then* moves to the end of the buffer, so it doesn't really append as it says in the docs. However, with these new functions both appending and inserting can be achieved. 2008-06-17 19:26:26 +00:00
a68975f4e1 Whole word operations added:
* Alt-Left/Right: moves cursor/selection a word to the left/right
 * Alt-/Ctrl-Delete/Backspace deletes whole words at a time
2008-06-04 23:20:54 +00:00
2dcab87383 Overwrite mode added, toggled with INSERTKEY 2008-06-04 12:32:06 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
ffcbff62dd Added Copy and Paste functions to GHOST.
- Moved WIN32 code to ghost and added code for other systems.
- Added functions getClipboard(flag), and putClipboard(buffer, flag)
    -Flag is used on X11 to request selection buffer or clipboard.
    -If any other system uses flag = 1 the function returns doing nothing.
- Changed ctrl +c/v and shift+ctrl + c/v to do the same thing (use the clipboard).
- Changed the menu items (copy, paste) to use the clipboard.
2008-03-04 00:41:30 +00:00
e0c77c0f14 made all data adding functions accept a name such as add_mesh or add_curve, previously only some datatypes adding functions accepted a name.
also updated the Bpy.py epydocs
2007-03-11 16:25:17 +00:00
7cf600be30 Adds menu item in text editor under format menu to convert whitespace to
Spaces or to tabs.
Adds function void convert_tabs(struct SpaceText *st, int tab)
int tab is eather 0 or 1; 1 if converting to tabs
I was going to make this auto run when running a script but did not know what that would do to the GE or any thing else.
2006-03-05 19:50:14 +00:00
Stephen Swaney
d32b100464 bugfix: #3420 Indent/Unindent in text editor not undoable
contributed by Mr. TextEditor - themyers.  Thanks!
2005-12-12 18:35:15 +00:00
Stephen Swaney
e8a6bf6fb9 Bugfix for disappearing hilight bug and code re-org for text editor
from Ricki Myers (themyers).

Comes with nice juicy commit msg, too!

- source/blender/blenkernel/BKE_text.h

	- Removed indent_paste, uncommen, unindent_lines, comment_paste,
	uncomment_paste, uncomment, set_tabs.

	All these functions cut and re-added text (I felt this was
	unsafe). whicch is was caused the highlight loss.


	- Now the only functions are Indent, Unindent, comment, uncomment,
	  setcurr_tab. 	All these functions only take one @parm (struct Text)

	-indent(struct Text *text)
		copy's the selected text in a MEM_mallocN line by line added a
		tab at the begginning

	- Unindent(struct Text *text)
		Tests if current line starts with a tab.
		if TAB remove it
	- comment(struct Text *text)
		copy's the selected text in a MEM_mallocN and adding a # at the begginning

	- Uncomment(struct Text *text)
		Tests if current line starts with a #.
		if # remove it

	- setcurr_tab (Text *text)
		Checks for Tabs pri. to any text
		if : is found and not in a comment then Tabs is increased by one
		if "return", "break", "pass" is found then Tabs is decreased

- blender/source/blender/src/header_text.c

	Changed:	txt_cut_sel(text);
			indent_paste(text);
	TO:
			txt_order_cursors(text);
			indent(text);
	* no more cutting of the text

- source/blender/src/drawtext.c

	set_tabs(Text *text) just calls setcurr_tab(text);
2005-04-10 14:01:41 +00:00
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00
cae8b8783d - Added initialize to '4' for new tab variable in text window
(prevents crash reported by sgefant!)
- Selection outline for Curve objects didnt draw right after leave
  editmode
- outliner now default when first viewing Oops window (dangerous?)
- Zoom with ctrl+middlemouse works in Oops again
2004-11-01 20:50:42 +00:00
Stephen Swaney
4ac4629905 a patch for the Text editor contributed by themeyers.
adds new features for indenting and commenting.

Note: I am not sure if the best menu spot for these features
is under the Select menu, but we can argue about that later.
They do work on a selection, though.

from the mailing list post:

1&2. Added Indent/Unindent under Edit->Select
just select the text you want to indent and go to the menu (
note if nothing is selected Indent will just indent ( tab )
the line the line )

3&4. Added Comment/Uncomment to the same menu
same applies as above

5. Added Tab setting on the menu bar in text editor
Sets the number of spaces a tab ==
changing the setting will change the hole script

6. Added Auto indent
when you hit enter it goes to the next line at the same
tab number and the line above it ( needs more testing and input)
2004-10-14 23:37:04 +00:00
558711325f - removes warnings 2003-10-25 12:27:16 +00:00
f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00