Commit graph

383 commits

Author SHA1 Message Date
fredkiefer
9d8dc3ba55 * Source/NSView.m (-beginPageInRect:atPlacement): Remove check for
empty rect. This will now use the placement translation all the time.
2018-07-27 10:09:44 +02:00
fredkiefer
85ba90244b * Source/NSView.m (-_rebuildCoordinates): Use simple path only
when both window and superview are nil. Set the visibleRect in
this case to bounds.
2018-01-07 16:47:36 +01:00
Daniel Ferreira
758d524547 NS{Cell,View}: implement stubs for layout direction handling
Implement stubs for the layout direction properties in NSCell and
NSView. Currently, they default to left-to-right layouting.
2017-07-25 22:33:12 +01:00
Daniel Ferreira
bb6805742d NSView: define layer-related properties
Define layer-related properties in NSView for compatibility purposes,
and keep their getters and setters as stubs, since they will not have
any effect before NSView-CALayer integration is implemented.
2017-07-25 22:33:12 +01:00
Gregory John Casamento
564ea8d330 Revert change to NSView.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40017 72102866-910b-0410-8b05-ffd578937521
2016-07-19 14:48:12 +00:00
Riccardo Mottola
c990c0152e fix again\!
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40012 72102866-910b-0410-8b05-ffd578937521
2016-07-19 10:43:12 +00:00
Gregory John Casamento
6541c05a04 Move changes to new branch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40011 72102866-910b-0410-8b05-ffd578937521
2016-07-18 15:59:44 +00:00
Gregory John Casamento
cd216f8e32 Reverted previous changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40009 72102866-910b-0410-8b05-ffd578937521
2016-07-18 15:47:56 +00:00
Riccardo Mottola
dae84d53ea Use CGFloat as original structures do and double for scale instead of CGFloat -> double -> float
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40006 72102866-910b-0410-8b05-ffd578937521
2016-07-18 09:01:51 +00:00
Riccardo Mottola
d0a064e93c use classic syntax
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40005 72102866-910b-0410-8b05-ffd578937521
2016-07-18 08:56:15 +00:00
Gregory John Casamento
15763766e5 Minor change. Properly initialize float xoff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40004 72102866-910b-0410-8b05-ffd578937521
2016-07-16 22:47:35 +00:00
Gregory John Casamento
d391a290ff Remove 'margin'
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40003 72102866-910b-0410-8b05-ffd578937521
2016-07-16 22:22:32 +00:00
Gregory John Casamento
dd398ac140 2016-07-16 18:12-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Source/NSPrintInfo.m: Add a comment so it's clear what
	this method is meant for.
	* Source/NSView.m: In beginPage🏷️bBox:fonts: align top level
	view with current page dimensions.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40002 72102866-910b-0410-8b05-ffd578937521
2016-07-16 22:18:43 +00:00
Richard Frith-MacDonald
08910fb913 lintian spelling correctes provided by Eric Heintzmann
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39816 72102866-910b-0410-8b05-ffd578937521
2016-05-28 09:49:15 +00:00
Riccardo Mottola
dbcaec319a Add more (dummy) layer property stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38940 72102866-910b-0410-8b05-ffd578937521
2015-08-28 20:26:30 +00:00
Fred Kiefer
59fa666263 * Tests/gui/NSView/NSView_autoresize_and_rounding.m: Add tests
for centerScanRect: with flipped view.
        * Source/NSView.m (-centerScanRect:): Change to get the failed
        tests to pass.
        * Source/GSThemeTools.m (-drawRoundBezel:withColor:): Make round
        bezel look a bit nicer.
        * Source/NSButtonCell.m (-drawImage:withFrame:inView:): Use
        centerScanRect: instead of similar code.
        * Source/NSCell.m: Use imageRectForBounds: and
        titleRectForBounds: in drawInteriorWithFrame:inView:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38929 72102866-910b-0410-8b05-ffd578937521
2015-08-25 21:33:04 +00:00
Riccardo Mottola
5568c3f60e add alphaValue property... although we don't use it anyway it helps to compile stuff
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38840 72102866-910b-0410-8b05-ffd578937521
2015-07-26 21:04:57 +00:00
Sebastian Reitenbach
e097f5d773 Remove some extra parameters from debug outputs
OK Fred Kiefer



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38567 72102866-910b-0410-8b05-ffd578937521
2015-05-26 17:08:41 +00:00
Richard Frith-MacDonald
461dcd25c9 fixes for bug reported by marcus
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36834 72102866-910b-0410-8b05-ffd578937521
2013-07-04 07:54:52 +00:00
Fred Kiefer
b1fc7cb066 Correct coding/decoding after type changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36160 72102866-910b-0410-8b05-ffd578937521
2013-02-17 16:53:48 +00:00
Quentin Mathe
37311e0e04 Fixed -encodeWithCoder: in NSView to encode the superview conditionally as Cocoa
does (Apple discusses  superview encoding as a use case for conditional encoding 
in the Archiving related documentation).

Note: A view can now be archived (or copied) without having to remove the view 
from its hierarchy before archiving it.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36065 72102866-910b-0410-8b05-ffd578937521
2013-02-06 17:28:52 +00:00
Fred Kiefer
d870275b7f * Headers/AppKit/NSCell.h
* Headers/AppKit/NSColor.h
        * Headers/AppKit/NSGraphics.h
        * Headers/AppKit/NSView.h
        * Source/Functions.m
        * Source/GSThemeDrawing.m
        * Source/GSTitleView.m
        * Source/NSApplication.m
        * Source/NSCell.m
        * Source/NSView.m: More NSInteger/NSUInteger/CGFloat cleanup



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36035 72102866-910b-0410-8b05-ffd578937521
2013-01-29 21:57:41 +00:00
Fred Kiefer
30da16dafc * Source/NSView.m (-_rebuildCoordinates): Check if the flipped
state of the view has changed. Call this method all the times
        instead of checking _coordinates_valid.
        This change allows views to dynamically change their flipped
state.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35928 72102866-910b-0410-8b05-ffd578937521
2012-12-31 18:55:36 +00:00
Wolfgang Lux
be389d2459 Remove incorrect transformation of tracking rectangle coordinates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35663 72102866-910b-0410-8b05-ffd578937521
2012-10-10 08:13:56 +00:00
Wolfgang Lux
b0b86079ca Fix implementation of tracking rectangles to use the coordinate system
of their views, as they do under Cocoa.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35645 72102866-910b-0410-8b05-ffd578937521
2012-10-06 19:42:56 +00:00
Wolfgang Lux
c29763d8cc Improve keyboard navigation by automatically computing a key view loop
for a window (and tab view item). This implicit key view is created
when a window is made key and does not have an explicit key view loop,
which is detected by checking the initial first responder of the
window.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35632 72102866-910b-0410-8b05-ffd578937521
2012-10-04 09:20:08 +00:00
Gregory John Casamento
22f55b8c28 * Headers/AppKit/NSTableView.h: Add _isValidating
* Source/NSCell.m (+initialize): Expose title binding.
	* Source/NSOpenPanel.m (-runModal): Use _directory if it is set.
	* Source/NSTableView.m (-validateEditing): Check _isValidating to
	prevent recursive calls into validateEditing.
	* Source/NSTabView.m (-initWithCoder:): Set _selected_item to
	NSNotFound.
	* Source/NSView.m (-addSubview:): Do not throw an exception when
	adding a nil subview, just ignore it.  This matches behavior on
	Cocoa.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35562 72102866-910b-0410-8b05-ffd578937521
2012-09-11 04:16:51 +00:00
Eric Wasylishen
d55752b22c * Source/NSView.m (-setBounds:, -setBoundsOrigin:, -setBoundsSize:):
Revert a portion of r32955 which I committed last april but I now
see was a mistake, and I just discovered is breaking the  copy-on-scroll
behaviour of NSClipView - we end up always redrawing the entire visible
portion of the document view right now.

In r32955 I added [self setNeedsDisplay: YES] calls to these methods
even though these are documented explicitly as not marking the view for
needing display. Approved by Fred for commit during the code freeze.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34606 72102866-910b-0410-8b05-ffd578937521
2012-01-21 19:15:51 +00:00
Eric Wasylishen
2f0f50cc95 Undo last change as it broke Graphos printing
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34353 72102866-910b-0410-8b05-ffd578937521
2011-12-23 21:22:41 +00:00
Eric Wasylishen
d374f0acae * Source/NSView.m (-beginPageInRect:atPlacement:): Always translate
by the placement value. Previously, we would translate only if the
rect parameter was empty, which doesn't make sense to me.
This fixes the bug where the last page of a document printed from
Ink/TextEdit was incorrectly positioned at the bottom of the
printed page.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34352 72102866-910b-0410-8b05-ffd578937521
2011-12-23 20:33:19 +00:00
Fred Kiefer
8ad4aa86c4 Replace some occurences of int with NSInteger
and unsigned with NSUInteger. This allows to recompile gui on 
64 bit systems after the change to NSNotFound in base.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34312 72102866-910b-0410-8b05-ffd578937521
2011-12-17 17:16:09 +00:00
Eric Wasylishen
e6db640322 * Source/NSView.m: centerScanRect patch from Sebastian Reitenbach.
Note that this makes the NSView autoresizing and rounding test pass,
but the new centerScanRect test I just added fail.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34104 72102866-910b-0410-8b05-ffd578937521
2011-11-01 17:45:21 +00:00
Fred Kiefer
23b1ff3f36 Fix XIB loading bug reported by Julian Mayer as bug #34454.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33931 72102866-910b-0410-8b05-ffd578937521
2011-10-03 12:48:15 +00:00
Eric Wasylishen
c4048d4f4b * Source/NSView.m (_setNeedsDisplayInRect_real:): Enlarge
(if necessary) _invalidRect so it lies on integral device pixels.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33809 72102866-910b-0410-8b05-ffd578937521
2011-09-07 05:33:25 +00:00
Fred Kiefer
4e05c96c6f * Source/NSView.m (-setBoundsSize:): Adjust the origin as well.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33717 72102866-910b-0410-8b05-ffd578937521
2011-08-11 08:14:53 +00:00
Fred Kiefer
c100baf6b4 Lots of minimal changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33613 72102866-910b-0410-8b05-ffd578937521
2011-07-23 13:43:33 +00:00
Fred Kiefer
34266c025a Declare variable at begin of method to allow compilation with older
compilers.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33493 72102866-910b-0410-8b05-ffd578937521
2011-07-08 22:52:35 +00:00
Eric Wasylishen
e5bd93c5d8 * Source/NSView.m (-resizeWithOldSuperviewSize:): Factor out
autoresizing logic into a function. Add an extra code path to handle
when the flexible space is 0, which behaves like the old version
of the code (it divides the available space evenly).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33490 72102866-910b-0410-8b05-ffd578937521
2011-07-08 19:29:50 +00:00
Eric Wasylishen
88be063a41 * Headers/AppKit/NSView.h:
* Source/NSView.m (-resizeWithOldSuperviewSize): Pixel-align
view frame when autoresizing.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33483 72102866-910b-0410-8b05-ffd578937521
2011-07-07 23:16:02 +00:00
Fred Kiefer
a71f6baac8 * Source/NSView.m (-resizeWithOldSuperviewSize): Reimplement to
resize proportionally as Cocoa does.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33482 72102866-910b-0410-8b05-ffd578937521
2011-07-07 22:19:07 +00:00
Fred Kiefer
87c05a3ba1 * Source/GSDragView.m (-init): Set the window background colour to clear.
* Headers/AppKit/NSAffineTransform.h,
* Headers/AppKit/NSView.h,
* Source/NSAffineTransform.m,
* Source/NSPrintOperation.m,
* Source/NSView.m: Use CGFlaot instead of float.
* Tests/gui/NSView/NSView_bounds_scale.m: New test file that currently fails.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33398 72102866-910b-0410-8b05-ffd578937521
2011-06-28 20:59:24 +00:00
Fred Kiefer
52aee6a0ee * Source/NSView.m (-_viewWillMoveToWindow:): Move the invalidation of
the coordinate transformations and the cursor rects before the
window test. Remove calls to coordinate invalidation from other places.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33347 72102866-910b-0410-8b05-ffd578937521
2011-06-19 10:04:24 +00:00
Fred Kiefer
b1a51425e6 * Source/NSView.m (-setBounds:, -setBoundsSize:): Rewrite of this
methods plus a few helpers. We pass now all the frame/bounds test cases.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33343 72102866-910b-0410-8b05-ffd578937521
2011-06-18 22:59:58 +00:00
Eric Wasylishen
1a25ffa41e * Source/NSView.m (-scrollRectToVisible:): Work when the receiver
isn't partially visible in the clip view.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33297 72102866-910b-0410-8b05-ffd578937521
2011-06-14 02:27:35 +00:00
Fred Kiefer
f4a8cab41b * Source/NSView.m (-setSubviews:): New method.
Code by Banlu Kemiyatorn <object@gmail.com>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33068 72102866-910b-0410-8b05-ffd578937521
2011-05-19 08:19:13 +00:00
Fred Kiefer
6c54fd6be5 Remove most uses of the method [NSView -removeSubview:].
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33047 72102866-910b-0410-8b05-ffd578937521
2011-05-15 14:42:08 +00:00
Eric Wasylishen
5b0bfe8f6e 011-05-07 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSView.m (-convertPoint:toView:): Correct this
	method; it was applying the transforms backwards :-(


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33001 72102866-910b-0410-8b05-ffd578937521
2011-05-07 21:30:25 +00:00
Eric Wasylishen
b00942ae92 * Source/NSView.m (-updateBoundsMatrix):
Fix a bug where updateBoundsMatrix would refuse to restore a
view's scale to its original value, after a modified bounds rect
had been set.
* Source/NSView.m (-setBounds:, -setBoundsOrigin:, -setBoundsSize:):
Call [self setNeedsDisplay: YES]; at the ends of these methods.
While the Cocoa docs explicitly say that calling these methods
won't mark the view as needing redisplay, this doesn't seem to
be true in practice.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32955 72102866-910b-0410-8b05-ffd578937521
2011-04-30 06:40:14 +00:00
Eric Wasylishen
a5a57fdfdf * Source/NSView.m (-_rebuildCoordinates): Remove assumption that
the window content view's superview's transformation matrix is
the identity matrix.
* Source/NSView.m (-convertPoint..., convertRect..., convertSize...):
Rewrite these methods to remove the same assumption as above, and
also call -_matrixToWindow/-_matrixFromWindow rather than accessing
ivars directly.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32887 72102866-910b-0410-8b05-ffd578937521
2011-04-18 21:02:36 +00:00
Fred Kiefer
a953d2bda0 Release the key value binding as it will be
retained in the binding table.
Leak found by static code analyser.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32484 72102866-910b-0410-8b05-ffd578937521
2011-03-07 13:35:37 +00:00