Commit Graph

193 Commits

Author SHA1 Message Date
Abdelrazak Younes
d37fae169c In order to support multiple LyXView each BufferView needs its own CoordCache. This is what's implemented in this commit.
theCoords is now a thing of the past and all CoordCache accesses are done via BufferView::coordCache() now. I had to modify a number of methods to pass BufferView.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15324 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-13 16:44:44 +00:00
Michael Schmitt
1b5f5e58ed Change tracking:
* src/paragraph.h: remove enum ChangeTracking;
	remove default parameters for insertChar and insertInset
	* src/BufferView.h: constify getCurrentChange()
	* src/changes.h: make Change constructor explicit
	* src/insets/*.C: 
	* src/*.C: adjust accordingly; add FIXMEs


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15302 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 20:01:32 +00:00
Abdelrazak Younes
28ad960255 This commit cleans up everything related to singleton. The other important change is that lyx::dispatch() and lyx::getStatus become _the_ official way to use LyXFunc equivalent methods.
* lyxfunc.h:
  - theLyXFunc(): new function in the global namespace.
  - lyx::dispatch():  new function in the lyx namespace.
  - lyx::getStatus():  new function in the lyx namespace.

* bufferlist.h:
  - theBufferList(): new function in the global namespace.

* Clipboard.h:
  - theClipboard(): new function in the global namespace.

* Selection.h:
  - theSelection(): new function in the global namespace.

* FontLoader.h:
  - theFontLoader(): new function in the global namespace.

* FontMetrics.h:
  - theFontMetrics(LyXFont const &): new function in the global namespace.

* Application.C: implements the functions defined above.

* LyXView.h:
  - getLyXFunc(): deleted.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15298 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 17:24:46 +00:00
Abdelrazak Younes
4add252628 * frontends/Painter:
- text(): now returns drawn text width()

* rowpainter:
 - paintChars(): use the returned width from Painter::text() instead of recalculating it.

All other files: implement the API change. qt3 and gtk not 100% guaranted to compile nor work.






git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15294 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-10 13:24:08 +00:00
Abdelrazak Younes
00edcc582f This commit is a big rework of the FontLoader/FontMetrics interaction. Only Qt4 for now, I would be grateful is somebody steps up for qt3 and gtk.
Basically, I replaced all methods in the font_metrics namespace by a proper virtual interface FontMetrics. The FontLoader is _the_ container for FontMetrics.

This patch should also bring some optimizations in a number of place in the code. This is because we do not need any more to search for the LyXFont at each font_metrics call. In effect, the speed advantage is not as sensible and this is a bit deceiving considering that this was my primary motivation behind the patch. But I like the patch anyway as it cleans up the relation and interfacing between fonts, metrics and frontends.

* frontends/FontMetrics.h: new virtual interface. Renamed from font_metrics.h

* qt4/GuiFontMetrics: corresponding qt4 implememtation. Renamed from qfont_metrics.C. The smallCaps particular case treatment has been transfered here as well as the width cache for MacOSX and Windows.

* qt4/QLPainter.C: the smallCapsText has been reworked to return the width of the drawn text.C

all other files: replace font_metric helper function call with corresponding FontMetrics method calls.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15265 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-07 16:15:06 +00:00
Michael Schmitt
4160f069a7 * src/LyXAction.C:
* src/BufferView.C:
	* src/lfuns.h: introduce LFUN_CHANGE_NEXT

	* src/text3.C: activate LFUN_ACCEPT/REJECT_CHANGE only in CT mode

	* src/rowpainter.C: reduce change bar width
	* src/rowpainter.h: enlarge change bar margin

	* lib/ui/stdmenus.ui: add "Next Change" in "Navigate" menu


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15249 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-04 21:43:40 +00:00
Abdelrazak Younes
b171e5f150 Free BufferView from LyXView!
* BufferView
  - layoutChanged: new boost signal.
  - LyXView owner(), owner_: deleted

* text3.C
  - emit BufferView::layoutChanged instead of calling LyXView::setLayout directly
  - LFUN_MOUSE_RELEASE: delete LyXView updateMenubar() and updateToolbars() direct calls.
    The update is of both bars is done in WorkArea::dispatch().

* WorkArea.C
  - dispatch(): add LyXView updateMenubar() call.

* LyXView
  - connects to BufferView::layoutChanged directly to Toolbars::setLayout()
  - setLayout(): deleted.

* qt4/GuiImplementation: modify BufferView construction (without LyXView).

All other files: cleanup header declaration of LyXView.h


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15153 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-26 10:06:46 +00:00
Abdelrazak Younes
972e1eec7c delete BufferView::text() method and add two FIXME in text.C
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15017 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-16 13:34:09 +00:00
Lars Gullik Bjønnes
43b77ba2d7 Change _() to return a docstring. Fixup callers with the help of lyx::to_utf8.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14952 a592a061-630c-0410-9148-cb99ea01b6c8
2006-09-09 15:27:44 +00:00
Lars Gullik Bjønnes
c46b7d8955 Merge the unicode branch into trunk.
- src/support/unicode.[Ch]: new files with functions for converting
  to and fro ucs4, ucs2 and utf8.
- src/support/docstring.h: specialization of basic_string that
  holds a uint32_t internally.
- Several functions changed to use char_type instead of char or unsigned char.
- Qt3 and Qt4 sends ucs2 on to core
- Gtk sends ucs4 on to core
- Read and write utf-8 .lyx files.
- font_metrics and painter updated to handle ucs4 chars as input.
- Quite a bit of ugly compability code, conversion string->docstring, etc.
- Have fun...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14661 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-13 22:54:59 +00:00
Lars Gullik Bjønnes
34eb5e241e Extracted from r14281
* rowpainter:
    - paintText: take the painter as an argument


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14384 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-08 21:16:21 +00:00
Abdelrazak Younes
7cca51ed18 Fix potential crashes related to element presence in a given map.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14377 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-08 14:40:22 +00:00
Lars Gullik Bjønnes
ee1871ef71 Partially extracted from r14281 from the younes branch.
* BufferView, BufferView::Pimpl:
	- painter(): remove method
* rowpainter.C:
	- paintText(): get painter through LyXView and WorkArea


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14330 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-03 22:54:30 +00:00
Lars Gullik Bjønnes
752cab15d7 Second part of r14315 from the younes branch:
* BufferView and Bufferview::pimpl: repaintAll() methods deleted.

	* rowpainter.C:
 		- refreshInside : new variable in the anonymous namespace.
 		- use of refreshInside instead of the repaintAll() methods


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14324 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-03 20:37:34 +00:00
Martin Vermeer
4cb9cd44ec Redefine the speed-up "Wide" patch to draw proper boxes
in available space instead of line pairs.

	* rowpainter.C
	(paintPar): change background rectangle

	* insets/insettext.C
	(InsetText::draw):
	(InsetText::drawSelection): simplify rectangle drawing

	* insets/insettext.h: dump Tall()

	* insets/insetcollapsable.C
	(InsetCollapsable::metrics): subtract button from available
	space in case of inlined inset



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14161 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-20 12:39:39 +00:00
Abdelrazak Younes
d8ae51dbe1 This is the merging of the GUI API cleanup branch that was developed in svn+ssh://svn.lyx.org/lyx/lyx-devel/branches/personal/younes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14152 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-20 08:39:16 +00:00
Michael Schmitt
10c8081a54 src/paragraph.h:
remove lookupChangeType;
  rename setChange to setChangeType;
  rename setChangeFull to setChange

src/paragraph_pimpl.h:
  remove lookupChange;
  rename lookupChangeFull to lookupChange;
  rename setChange to setChangeType;
  rename setChangeFull to setChange

src/changes.h: remove lookup;
  rename lookupFull to lookup;
  rename loose_contains to containsOrPrecedes;

adjust the other files accordingly


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13812 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-08 20:30:52 +00:00
Michael Schmitt
d7bcff50a9 src/paragraph.h:
src/BufferView_pimpl.C:
	src/lyxfunc.C:
	src/paragraph_funcs.C:
	src/lyxfind.C:
	src/bufferparams.h:
	src/rowpainter.C:
	src/paragraph.C:
	src/text.C: rename methods: lookupChange => lookupChangeType,
	lookupChangeFull => lookupChange


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13802 a592a061-630c-0410-9148-cb99ea01b6c8
2006-05-05 23:11:19 +00:00
Lars Gullik Bjønnes
618ca28af6 * support/types.h: introduce the char_type type
* paragraph.h: make value_type point at char_type
* other files: change some bald 'char' to 'char_type'


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13609 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 02:30:40 +00:00
Lars Gullik Bjønnes
cf4293824f * Change several freestanding and class methods with first letter
capitalized to have first letter lowercased.
* Adjust all affected files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13605 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 00:26:19 +00:00
André Pönitz
1f5c5a06ee support/textutils.h:
support/filetools.h: rename IsDirWriteable IsFileReadable IsLyXFilename
IsSGMLFilename IsLineSeparatorChar IsLetterChar IsPrintable
IsPrintableNonspace IsDigit to lower case initial

lyxvc.C:
LaTeXFeatures.C:
lyx_cb.C:
insets/insetbibtex.C:
insets/insetexternal.C:
insets/insetgraphics.C:
insets/ExternalSupport.C:
insets/insetinclude.C:
BufferView_pimpl.C:
graphics/GraphicsCacheItem.C:
text2.C:
converter.C:
buffer.C:
lyxfunc.C:
frontends/gtk/ghelpers.C:
frontends/controllers/ControlGraphics.C:
frontends/controllers/ControlInclude.C:
frontends/controllers/ControlSpellchecker.C:
support/filetools.C:
support/filetools.h: adjust


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13595 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-08 09:09:57 +00:00
Lars Gullik Bjønnes
3b9338a3a8 Whitespace cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13565 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-05 23:56:29 +00:00
Georg Baum
70b8cfdf59 * src/insets/insetbase.h
* src/insets/insettext.h
	(asTextInset): constify

	* src/rowpainter.C
	(RowPainter::paintInset): remove unneeded casts
	(paintPar): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13420 a592a061-630c-0410-9148-cb99ea01b6c8
2006-03-18 17:39:54 +00:00
Jürgen Spitzmüller
c370abab81 expand redrawing of current row to endpos() AGAIN
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13418 a592a061-630c-0410-9148-cb99ea01b6c8
2006-03-18 17:04:28 +00:00
Martin Vermeer
3d0c878966 Changes to the within-inset row rendering caching code.
* insets/insetenv.h: 
	* insets/insetcollapsable.h: remove method
	* insets/insettabular.h:
	* insets/insetbase.h: rename, add methods
	* insets/insettext.[Ch]: rename method; add Tall()
	* paragraph_pimpl.C
	(Paragraph::Pimpl::simpleTeXSpecialC): rename call
	* mathed/math_hullinset.h: rename method
	* rowpainter.C
	(RowPainter::paintInset):
	(paintPar): remove isTrueTextInset, move to insets 



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13415 a592a061-630c-0410-9148-cb99ea01b6c8
2006-03-17 19:45:28 +00:00
Martin Vermeer
5ab40ff0f0 fix painting of change bar with only paragraph break changed
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13356 a592a061-630c-0410-9148-cb99ea01b6c8
2006-03-13 11:05:07 +00:00
Martin Vermeer
22cdac5d5d Fix bug 2195: Slowness in rendering inside insets, especially on the Mac
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13328 a592a061-630c-0410-9148-cb99ea01b6c8
2006-03-10 16:10:35 +00:00
Jürgen Spitzmüller
3490f23a1d Fix defaultFont problems (bug 2308)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13266 a592a061-630c-0410-9148-cb99ea01b6c8
2006-02-22 15:44:57 +00:00
Martin Vermeer
6688a55908 Fix bug 2115 ("blueline bug")
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10808 a592a061-630c-0410-9148-cb99ea01b6c8
2006-02-05 13:20:16 +00:00
Martin Vermeer
aac47f6579 Blueline-under-insets fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10805 a592a061-630c-0410-9148-cb99ea01b6c8
2006-02-03 17:21:51 +00:00
Jürgen Spitzmüller
177ca3eb70 expand redrawing of current row to endpos()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10742 a592a061-630c-0410-9148-cb99ea01b6c8
2006-01-16 15:17:17 +00:00
Martin Vermeer
aa8478b7e5 let's always repaint the row with the cursor in it
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10696 a592a061-630c-0410-9148-cb99ea01b6c8
2006-01-01 23:06:23 +00:00
Martin Vermeer
e7ef29fa2d The speed patch: redraw only rows that have changed
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10692 a592a061-630c-0410-9148-cb99ea01b6c8
2005-12-30 19:02:52 +00:00
Georg Baum
035861d4dc partial fix for bug 1973
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10664 a592a061-630c-0410-9148-cb99ea01b6c8
2005-12-17 15:03:41 +00:00
Jean-Marc Lasgouttes
6f8059d09f fix centering of LABEL_CENTERED_TOP_ENVIRONMENT
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10642 a592a061-630c-0410-9148-cb99ea01b6c8
2005-12-02 13:20:26 +00:00
Martin Vermeer
ebcb289b7c The speedup patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10528 a592a061-630c-0410-9148-cb99ea01b6c8
2005-10-07 12:00:41 +00:00
Martin Vermeer
5b33310202 Fix bug 2029 (RtL space width)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10459 a592a061-630c-0410-9148-cb99ea01b6c8
2005-09-19 11:18:20 +00:00
Jean-Marc Lasgouttes
cf182ead75 fix display of top labels
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10458 a592a061-630c-0410-9148-cb99ea01b6c8
2005-09-19 10:18:37 +00:00
Jean-Marc Lasgouttes
52a2eb2c52 John&JMarc's change tracking patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10424 a592a061-630c-0410-9148-cb99ea01b6c8
2005-09-07 10:37:05 +00:00
André Pönitz
1e65605e25 use the FontSpan trick in drawing as well
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10326 a592a061-630c-0410-9148-cb99ea01b6c8
2005-07-18 14:25:20 +00:00
André Pönitz
f5e68ec257 fix bug 1795
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10321 a592a061-630c-0410-9148-cb99ea01b6c8
2005-07-18 12:13:32 +00:00
André Pönitz
af5acb6dc7 ~4% speedup by inlining a few one-line accessors
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10320 a592a061-630c-0410-9148-cb99ea01b6c8
2005-07-18 11:00:15 +00:00
Jean-Marc Lasgouttes
6b264151e1 reduce number of calls to LyXText::getFont
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10044 a592a061-630c-0410-9148-cb99ea01b6c8
2005-06-10 14:55:01 +00:00
Martin Vermeer
a683500118 Axe processEvents, fix cursor draw artifacts, put update flags into an enum,
allow single-paragraph update


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9986 a592a061-630c-0410-9148-cb99ea01b6c8
2005-05-31 14:40:30 +00:00
Jürgen Spitzmüller
8c8e438e4c fix drawing of appendix start
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9907 a592a061-630c-0410-9148-cb99ea01b6c8
2005-05-05 13:11:05 +00:00
Angus Leeming
fb70c52b05 Whitespace, only whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9877 a592a061-630c-0410-9148-cb99ea01b6c8
2005-04-26 11:12:20 +00:00
Jean-Marc Lasgouttes
887137a87a honor secnumdepth for section headers; avoid multiple labels for environments; update counters when switching class
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9831 a592a061-630c-0410-9148-cb99ea01b6c8
2005-04-19 09:04:25 +00:00
Martin Vermeer
f2ae756062 Fix the metric bug left after fixing the inset font bug
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9810 a592a061-630c-0410-9148-cb99ea01b6c8
2005-04-12 18:42:27 +00:00
Martin Vermeer
882a1f2e7e Fix language underline bug from previous fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9801 a592a061-630c-0410-9148-cb99ea01b6c8
2005-04-10 20:15:47 +00:00
Martin Vermeer
d5d5562e02 Fix font inside inset (bugs 1766, 1809)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9799 a592a061-630c-0410-9148-cb99ea01b6c8
2005-04-10 14:07:33 +00:00