Commit graph

152 commits

Author SHA1 Message Date
Riccardo Mottola
bdcced992c fix redundant semicolons 2023-11-20 22:43:49 +01:00
Sergii Stoian
fcee2e2c63 * Headers/Additions/GNUstepGUI/GSLayoutManager.h,
Source/GSLayoutManager.m: new method -typingAttributes returns default typing
  attributes of NSTextView.
* Source/NSLayoutManager.m: override GSLayoutManager's -typingAttributes - primitive
  method - provides access to _typingAttributes ivar.
* Source/GSHorizontalTypesetter.m: use new GSLayoutManager's -typingAttributes method
  to get paragraph style and font of new empty text container. Normally `curLayoutManager`
  is a NSLayoutManager object so actually we get NSLayoutManager's _typingAttributes.
2019-12-10 19:23:04 +02:00
Fred Kiefer
099257dac9 Fix some clang static analyser warnings reported by
Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40484 72102866-910b-0410-8b05-ffd578937521
2017-04-16 11:54:21 +00:00
Fred Kiefer
2572daeff4 * Source/GSLayoutManager.m (-advancementForGlyphAtIndex:):
Simplify this method and move it in the file.
	* Source/NSLayoutManager.m: Use the pre-computed advancement
	instead of calculating it every time.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40167 72102866-910b-0410-8b05-ffd578937521
2016-10-23 20:13:37 +00:00
Fred Kiefer
ff61d4c642 2015-09-13 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTextView.m: Invalidate insertion point timer in
        dealloc.
        * Source/NSToolbarItem.m: Check for drawing rect within bounds
        before drawing toolbar item.
        Patch by Marcian Lytwyn <gna@advcsi.com>.

2015-09-10  Doug Simons <doug.simons@testplant.com> and Paul Landers
<paul.landers@testplant.com>

        * Source/NSLayoutManager.m: Fix a bug that would try to adjust
        the length of the selected range to a negative number, leading
        to an exception and eventual crashes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38986 72102866-910b-0410-8b05-ffd578937521
2015-09-13 21:36:40 +00:00
Fred Kiefer
09614d4d35 * Source/GSTextStorage.m
* Source/NSSpellChecker.m
        Two small cleanups.
        Patch by Marat Ibadinov <ibadinov@me.com>
        * Source/NSLayoutManager.m
        Changed == to >= to fix a crash when layout_char is beyond the
        length of the string.
        Patch by Paul Landers <paul.landers@testplant.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38312 72102866-910b-0410-8b05-ffd578937521
2015-01-31 18:19:29 +00:00
Fred Kiefer
6fc06cce3d * Source/NSLayoutManager.m
(_insertionPointRectForCharacterIndex:textContainer:): Fix
initial
        cursor insertion location with paragraph alignment setting.
        This patch has no visual effect as the alignment of the typing
        attributes never gets set.
        Based on patch by Marcian Lytwyn <gna@advcsi.com>.
        * Source/NSLayoutManager.m: Fix some compiler warnings.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38238 72102866-910b-0410-8b05-ffd578937521
2014-12-08 10:09:42 +00:00
Fred Kiefer
f36bb5811e * Source/NSLayoutManager.m
(-drawBackgroundForGlyphRange:atPoint:): Make save against
        glyph_run being null. Should fix part of #43454.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38141 72102866-910b-0410-8b05-ffd578937521
2014-10-31 14:12:44 +00:00
Ivan Vučica
42f7c46547 NSLayoutManager: advancementbuf[0] was not being filled. Most backends, including cairo, ignore advancements, so the bug was not immediately apparent until opal backend started using the advancements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37100 72102866-910b-0410-8b05-ffd578937521
2013-09-17 21:58:21 +00:00
Fred Kiefer
7ef53c8232 More CGFloat, NSUInteger and NSInteger changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36153 72102866-910b-0410-8b05-ffd578937521
2013-02-16 21:37:29 +00:00
Fred Kiefer
e62fddeea0 Change NSBezierPath to use NSInteger and CGFloat and adjust uses to
this.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36054 72102866-910b-0410-8b05-ffd578937521
2013-02-01 14:03:08 +00:00
Fred Kiefer
e370aab73b * Headers/AppKit/NSTextContainer.h,
* Source/NSTextContainer.m,
        * Source/GSHorizontalTypesetter.m: Correct the definition of
        NSLineMovementDirection.
        * Headers/AppKit/NSFont.h
        * Source/NSFont.m: Add a few missing 10.4 methods.
        * Header/AppKit/NSLayoutManager.h,
        * Source/NSLayoutManager.m: Add one 10.5 method.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35999 72102866-910b-0410-8b05-ffd578937521
2013-01-19 18:22:45 +00:00
Fred Kiefer
e93fd24f0d * Source/NSFont.m (-initWithName:...): Move replacement name into
separate method -_replacementFontName and add replacement for
"Helvetica-" prefix.
* Header/AppKit/NSLayoutManager.h: Add some 10.5 methods.
* Source/NSLayoutManager.m: Simple implementations for these new
methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35922 72102866-910b-0410-8b05-ffd578937521
2012-12-23 23:24:14 +00:00
Wolfgang Lux
95c5829fa5 Fix two incorrect comparisons in NSLayoutManager which were causing
range exceptions when moving the cursor up in the first line and down
in the last line of a NSTextView, respectively.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34375 72102866-910b-0410-8b05-ffd578937521
2012-01-01 11:29:20 +00:00
Wolfgang Lux
b046febc21 Get the insertion point rectangle right for character index 0.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34364 72102866-910b-0410-8b05-ffd578937521
2011-12-29 18:34:27 +00:00
Gregory John Casamento
e9aaaf4b61 Changes to correct bug#34919. NSTextView should now correctly show the padding set in the lineFragmentPadding attribute of NSTextContainer.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34222 72102866-910b-0410-8b05-ffd578937521
2011-11-28 02:37:58 +00:00
Fred Kiefer
727e1993f0 Unbind key bindings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33511 72102866-910b-0410-8b05-ffd578937521
2011-07-11 08:40:31 +00:00
Riccardo Mottola
394d42736a Add support for for link attributes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33433 72102866-910b-0410-8b05-ffd578937521
2011-07-02 22:15:17 +00:00
Fred Kiefer
c744492fee Add a few key value bindings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33277 72102866-910b-0410-8b05-ffd578937521
2011-06-11 12:01:59 +00:00
Eric Wasylishen
5f73c3f623 * Source/NSLayoutManager.m:
* Source/NSGraphicsContext.m:
* Headers/AppKit/DPSOperators.h:
* Headers/AppKit/NSGraphicsContext.h:
* Headers/Additions/GNUstepGUI/GSMethodTable.h:
New GSShowGlyphsWithAdvances, which replaces
GSShowGlyphs as the primitive text drawing method.
(used by -[NSLayoutManager drawGlyphsForGlyphRange:atPoint:])

Requires r33121 in -back.

Note that the advances aren't actually used by -back yet so
text output should be unchanged.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33122 72102866-910b-0410-8b05-ffd578937521
2011-05-26 03:55:55 +00:00
Eric Wasylishen
4736b353dc Add a FIXME to NSLayoutManager
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33118 72102866-910b-0410-8b05-ffd578937521
2011-05-25 21:47:30 +00:00
Eric Wasylishen
b384d732ff * Source/NSLayoutManager.m
(-characterIndexMoving:fromCharacterIndex:originalCharacterIndex:distance:):
Rework this method to suport moving the insertion point between text
containers, for both left/right and up/down movements. However, it will
only have this behaviour when distance == 0.

This is part of what is needed to support moving the insertion point
between text views in, e.g., TextEdit when using the multi-page view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32964 72102866-910b-0410-8b05-ffd578937521
2011-05-01 22:06:45 +00:00
Fred Kiefer
924b24dde4 Fix warnigns reported by clang.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32814 72102866-910b-0410-8b05-ffd578937521
2011-04-08 23:21:55 +00:00
Eric Wasylishen
f14cd5a450 Don't draw spelling underlines when printing
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32567 72102866-910b-0410-8b05-ffd578937521
2011-03-14 09:05:29 +00:00
Eric Wasylishen
2d713e6cca * Source/NSLayoutManager.m: Clear temporary attributes
on the modified range when informed of a change in the text
storage
* Source/NSTextView.m: Add a context menu with spelling
suggestions and cut/copy/paste


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32561 72102866-910b-0410-8b05-ffd578937521
2011-03-14 04:19:32 +00:00
Eric Wasylishen
b460081f8c NSTextView continuous spell checking
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32534 72102866-910b-0410-8b05-ffd578937521
2011-03-12 07:45:14 +00:00
Richard Frith-MacDonald
19f8307312 add warning comment
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32527 72102866-910b-0410-8b05-ffd578937521
2011-03-10 08:22:44 +00:00
Eric Wasylishen
e39fed5a42 gui: implement NSLayoutManager temporary attributes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32503 72102866-910b-0410-8b05-ffd578937521
2011-03-09 05:28:47 +00:00
David Chisnall
12fd784151 Remove some tests that are always true (NSRange.length > 0 - NSUIntegers are always > 0).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32348 72102866-910b-0410-8b05-ffd578937521
2011-02-24 13:21:37 +00:00
Eric Wasylishen
227381f621 preliminary implementation of underlining
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32304 72102866-910b-0410-8b05-ffd578937521
2011-02-22 20:53:13 +00:00
Wolfgang Lux
678df29a94 Prevent potential null pointer dereference when computing the size of
an attachment.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31814 72102866-910b-0410-8b05-ffd578937521
2011-01-01 16:43:34 +00:00
Fred Kiefer
62a8ead182 * Source/NSLayoutManager.m: Add code to handle temporary
attributes. This code is taken from NSAttributedString and the
two
        core methods are still missing.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31798 72102866-910b-0410-8b05-ffd578937521
2010-12-30 15:29:05 +00:00
Wolfgang Lux
efd0bc2248 Clip the rectangle computed by -rectArrayForGlyphRange: for the last
line to the line fragment's used rectangle if the line doesn't end
with a newline (or other invisible character). This better matches
Apple's implementation.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31720 72102866-910b-0410-8b05-ffd578937521
2010-12-09 18:04:25 +00:00
Fred Kiefer
49fdc602ba Remove a few compiler warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31587 72102866-910b-0410-8b05-ffd578937521
2010-11-03 20:26:30 +00:00
Fred Kiefer
d08b23d9b0 First batch of corrections based on David's static analysis.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31337 72102866-910b-0410-8b05-ffd578937521
2010-09-12 16:34:22 +00:00
Fred Kiefer
6f2c2f94ea Correction of the declarations for the methods to handle temporary attributes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31205 72102866-910b-0410-8b05-ffd578937521
2010-08-29 18:49:03 +00:00
Wolfgang Lux
424440dd30 Make NSLayoutManager attributes and flags persistent when using a
keyed archiver, i.e., saving or loading a .nib file.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30490 72102866-910b-0410-8b05-ffd578937521
2010-05-30 17:51:29 +00:00
Richard Frith-MacDonald
a45f28148f Fix error updating dynamic services
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29768 72102866-910b-0410-8b05-ffd578937521
2010-02-26 05:20:59 +00:00
Wolfgang Lux
c076dbd009 Fix issue where the insertion point was not placed in an empty last
line of a text view when clicking with the mouse.
Fix issue where the insertion point was not placed in an empty last
line when using the down arrow key (bug #15893).
Fix issue where the insertion point was placed incorrectly if the last
line of a text view ends in an invisible character (e.g., a tab).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29584 72102866-910b-0410-8b05-ffd578937521
2010-02-12 15:27:02 +00:00
Gregory John Casamento
4991a29743 * Source/GSStandardWindowDecorationView.m: Live window resize changes
for when using GNUstep decorations in resizeWindowStartingWithEvent:.
	* Source/NSLayoutManager.m: Unarchive the text containers into an 
	array in initWithCoder:.
	* Source/NSTextContainer.m: Get the layout manager in initWithCoder:.
	* Source/NSTextView.m: Changes to include text container from nib
	file into the nib loading process in initWithCoder:.   


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28296 72102866-910b-0410-8b05-ffd578937521
2009-05-23 15:50:51 +00:00
Gregory John Casamento
d0d81bf1b1 * Source/GSNibLoader.m: Correct the message to indicate an issue
loading a nib, not a gorm, file.
	* Source/GSNibLoading.m: Uncomment the release in the dealloc
	method.
	* Source/NSApplication.m: Restrict the icon size to the size of the
	miniwindow if it's larger, but don't expand it, if it's smaller.
	* Source/NSLayoutManager.m: -initWithCoder: Initialize when 
	loading a nib in the same way that we initialize when loading 
	a gorm file.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27775 72102866-910b-0410-8b05-ffd578937521
2009-02-04 06:48:06 +00:00
Fred Kiefer
ddf1b1a269 Improvement of attributed string loading and attachment display in text
view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27705 72102866-910b-0410-8b05-ffd578937521
2009-01-27 19:16:04 +00:00
Gregory John Casamento
8b23e80c6d * Headers/AppKit/NSLayoutManager.h: Declarations for new methods
to handle temporary attributes.
	* Source/GSNibCompatibility.m: Corrections to nib loading logic.
	* Source/NSLayoutManager.m: Skeleton implementations of new
	methods to handle temporary attributes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27124 72102866-910b-0410-8b05-ffd578937521
2008-11-23 23:54:00 +00:00
Adam Fedor
7afdd32ac1 Revert library license version to 2 until applications can be converted
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26619 72102866-910b-0410-8b05-ffd578937521
2008-06-10 04:01:49 +00:00
Fred Kiefer
f59bbe5aa8 Extract glyph generation code into separate class.
Plus some additional cleanup.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26523 72102866-910b-0410-8b05-ffd578937521
2008-05-13 19:40:20 +00:00
Richard Frith-MacDonald
03a4a96a40 Update includes ... closer MacOS-X compatibility.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25635 72102866-910b-0410-8b05-ffd578937521
2007-11-29 20:28:03 +00:00
Fred Kiefer
193e31e678 Change all files to use GPL 3 and LGPL 3.
Prepare for next release.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25536 72102866-910b-0410-8b05-ffd578937521
2007-10-29 21:16:17 +00:00
Fred Kiefer
86264a8284 Diverse gui patches by Wolfgang Lux <wolfgang.lux@gmail.com>.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25451 72102866-910b-0410-8b05-ffd578937521
2007-09-04 23:29:05 +00:00
Fred Kiefer
4835a35c1c Add new MacOSX methods. Code mostly by Nikolaus Schaller.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25270 72102866-910b-0410-8b05-ffd578937521
2007-06-18 21:08:54 +00:00
Richard Frith-MacDonald
701853d407 bugfix for #13564
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24697 72102866-910b-0410-8b05-ffd578937521
2007-02-27 06:07:01 +00:00