Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/f70ed78b65b9acda2569e...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/f70ed78b65b9acda2569ed5...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/f70ed78b65b9acda2569ed5ee...
The branch, svenw/cocoa has been updated
via f70ed78b65b9acda2569ed5ee4e8f0d7847ed615 (commit)
via 4f7885e277eb53af1662c507c145767d699056bf (commit)
via f035d6dbeb398cbb64df75f2ad400624b26efb5f (commit)
via fdaad39a57029971f0663b402d6335527f7a6039 (commit)
via 6e5344464bdc5275eb04782284c0e19c26c217e4 (commit)
from 36a26db7848f4b59fb3ce716b748339ba83c05d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=f70ed78b65b9acda256...
commit f70ed78b65b9acda2569ed5ee4e8f0d7847ed615
Author: Sven Weidauer <sven(a)5sw.de>
Commit: Sven Weidauer <sven(a)5sw.de>
Fix scroll bars.
diff --git a/frontends/cocoa/ScrollableView.m b/frontends/cocoa/ScrollableView.m
index 130fce2..6f20bfe 100644
--- a/frontends/cocoa/ScrollableView.m
+++ b/frontends/cocoa/ScrollableView.m
@@ -38,17 +38,14 @@
- (void)adjustFrame
{
- NSSize frameSize = [[self superview] frame].size;
+ NSSize frameSize = self.enclosingScrollView.contentSize;
[self setFrameSize:NSMakeSize(MAX(self.minimumSize.width, frameSize.width),
MAX(self.minimumSize.height, frameSize.height))];
}
- (void)frameChangeNotification:(NSNotification *)note
{
- // TODO: Correctly handle window resizing.
- // Removing this call is a quick hack to avoid an endless layout loop due to
appearing/disappearing
- // scroll bars.
- //[self adjustFrame];
+ [self adjustFrame];
}
- (void)viewDidMoveToSuperview
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=4f7885e277eb53af166...
commit 4f7885e277eb53af1662c507c145767d699056bf
Author: Sven Weidauer <sven(a)5sw.de>
Commit: Sven Weidauer <sven(a)5sw.de>
Fix position of caret when zooming content.
diff --git a/frontends/cocoa/BrowserView.h b/frontends/cocoa/BrowserView.h
index 596100f..cf1b0dc 100644
--- a/frontends/cocoa/BrowserView.h
+++ b/frontends/cocoa/BrowserView.h
@@ -25,8 +25,6 @@
@interface BrowserView : ScrollableView <NSTextInput> {
struct browser_window *browser;
- NSPoint caretPoint;
- CGFloat caretHeight;
BOOL caretVisible;
BOOL hasCaret;
NSTimer *caretTimer;
@@ -45,7 +43,7 @@
@property (readwrite, assign, nonatomic, getter=isHistoryVisible) BOOL historyVisible;
- (void)removeCaret;
-- (void)addCaretAt:(NSPoint)point height:(CGFloat)height;
+- (void)addCaretAtX: (int)caretX Y: (int)caretY height: (int)caretHeight;
- (void)updateHistory;
diff --git a/frontends/cocoa/BrowserView.m b/frontends/cocoa/BrowserView.m
index c1cf9be..31d4335 100644
--- a/frontends/cocoa/BrowserView.m
+++ b/frontends/cocoa/BrowserView.m
@@ -38,6 +38,8 @@
@property (readwrite, copy, nonatomic) NSString *markedText;
+@property (readwrite, nonatomic) NSRect caretRect;
+
- (void)scrollHorizontal:(CGFloat)amount;
- (void)scrollVertical:(CGFloat)amount;
- (CGFloat)pageScroll;
@@ -92,34 +94,22 @@ static const NSTimeInterval CaretBlinkTime = 0.8;
[history redraw];
}
-static inline NSRect cocoa_get_caret_rect(BrowserView *view)
-{
- float bscale = browser_window_get_scale(view->browser);
-
- NSRect caretRect = {
- .origin = NSMakePoint(view->caretPoint.x * bscale, view->caretPoint.y *
bscale),
- .size = NSMakeSize(CaretWidth, view->caretHeight * bscale)
- };
-
- return caretRect;
-}
-
- (void)removeCaret
{
hasCaret = NO;
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect: self.caretRect];
[self setCaretTimer:nil];
}
-- (void)addCaretAt:(NSPoint)point height:(CGFloat)height
+- (void)addCaretAtX: (int)caretX Y: (int)caretY height: (int)caretHeight;
{
if (hasCaret) {
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect:self.caretRect];
}
- caretPoint = point;
- caretHeight = height;
+ self.caretRect = cocoa_rect_wh(caretX, caretY, CaretWidth, caretHeight);
+
hasCaret = YES;
caretVisible = YES;
@@ -129,14 +119,14 @@ static inline NSRect cocoa_get_caret_rect(BrowserView *view)
[caretTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:CaretBlinkTime]];
}
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect:self.caretRect];
}
- (void)caretBlink:(NSTimer *)timer
{
if (hasCaret) {
caretVisible = !caretVisible;
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect: self.caretRect];
}
}
@@ -165,10 +155,9 @@ static inline NSRect cocoa_get_caret_rect(BrowserView *view)
browser_window_redraw(browser, 0, 0, &clip, &ctx);
}
- NSRect caretRect = cocoa_get_caret_rect(self);
- if (hasCaret && caretVisible && [self needsToDrawRect:caretRect])
{
+ if (hasCaret && caretVisible && [self
needsToDrawRect:self.caretRect]) {
[[NSColor blackColor] set];
- [NSBezierPath fillRect:caretRect];
+ [NSBezierPath fillRect: self.caretRect];
}
}
}
diff --git a/frontends/cocoa/gui.m b/frontends/cocoa/gui.m
index f564563..599c3b4 100644
--- a/frontends/cocoa/gui.m
+++ b/frontends/cocoa/gui.m
@@ -253,9 +253,7 @@ static void
gui_window_place_caret(struct gui_window *g, int x, int y, int height,
const struct rect *clip)
{
- [[(__bridge BrowserViewController *)g browserView]
- addCaretAt:cocoa_point(x, y)
- height:cocoa_px_to_pt(height)];
+ [[(__bridge BrowserViewController *)g browserView] addCaretAtX:x Y:y height:height];
}
static void gui_window_remove_caret(struct gui_window *g)
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=f035d6dbeb398cbb64d...
commit f035d6dbeb398cbb64df75f2ad400624b26efb5f
Merge: 36a26db fdaad39
Author: Sven Weidauer <sven(a)5sw.de>
Commit: Sven Weidauer <sven(a)5sw.de>
Merge remote-tracking branch 'origin/master' into svenw/cocoa
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/plotters.c | 4 +++-
frontends/cocoa/BrowserView.h | 4 +---
frontends/cocoa/BrowserView.m | 33 +++++++++++----------------------
frontends/cocoa/ScrollableView.m | 7 ++-----
frontends/cocoa/gui.m | 4 +---
5 files changed, 18 insertions(+), 34 deletions(-)
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index 7c5df46..b848543 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -239,13 +239,15 @@ void ami_plot_ra_free(struct gui_globals *gg)
{
init_layers_count--;
+ if(init_layers_count < 0) return;
+
if((init_layers_count == 0) && (pool_pens != NULL)) {
ami_memory_itempool_delete(pool_pens);
pool_pens = NULL;
}
if(gg->rp) {
- DeleteLayer(0,gg->rp->Layer);
+ if(gg->rp->Layer != NULL) DeleteLayer(0, gg->rp->Layer);
free(gg->rp->TmpRas);
free(gg->rp->AreaInfo);
free(gg->rp);
diff --git a/frontends/cocoa/BrowserView.h b/frontends/cocoa/BrowserView.h
index 596100f..cf1b0dc 100644
--- a/frontends/cocoa/BrowserView.h
+++ b/frontends/cocoa/BrowserView.h
@@ -25,8 +25,6 @@
@interface BrowserView : ScrollableView <NSTextInput> {
struct browser_window *browser;
- NSPoint caretPoint;
- CGFloat caretHeight;
BOOL caretVisible;
BOOL hasCaret;
NSTimer *caretTimer;
@@ -45,7 +43,7 @@
@property (readwrite, assign, nonatomic, getter=isHistoryVisible) BOOL historyVisible;
- (void)removeCaret;
-- (void)addCaretAt:(NSPoint)point height:(CGFloat)height;
+- (void)addCaretAtX: (int)caretX Y: (int)caretY height: (int)caretHeight;
- (void)updateHistory;
diff --git a/frontends/cocoa/BrowserView.m b/frontends/cocoa/BrowserView.m
index c1cf9be..31d4335 100644
--- a/frontends/cocoa/BrowserView.m
+++ b/frontends/cocoa/BrowserView.m
@@ -38,6 +38,8 @@
@property (readwrite, copy, nonatomic) NSString *markedText;
+@property (readwrite, nonatomic) NSRect caretRect;
+
- (void)scrollHorizontal:(CGFloat)amount;
- (void)scrollVertical:(CGFloat)amount;
- (CGFloat)pageScroll;
@@ -92,34 +94,22 @@ static const NSTimeInterval CaretBlinkTime = 0.8;
[history redraw];
}
-static inline NSRect cocoa_get_caret_rect(BrowserView *view)
-{
- float bscale = browser_window_get_scale(view->browser);
-
- NSRect caretRect = {
- .origin = NSMakePoint(view->caretPoint.x * bscale, view->caretPoint.y *
bscale),
- .size = NSMakeSize(CaretWidth, view->caretHeight * bscale)
- };
-
- return caretRect;
-}
-
- (void)removeCaret
{
hasCaret = NO;
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect: self.caretRect];
[self setCaretTimer:nil];
}
-- (void)addCaretAt:(NSPoint)point height:(CGFloat)height
+- (void)addCaretAtX: (int)caretX Y: (int)caretY height: (int)caretHeight;
{
if (hasCaret) {
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect:self.caretRect];
}
- caretPoint = point;
- caretHeight = height;
+ self.caretRect = cocoa_rect_wh(caretX, caretY, CaretWidth, caretHeight);
+
hasCaret = YES;
caretVisible = YES;
@@ -129,14 +119,14 @@ static inline NSRect cocoa_get_caret_rect(BrowserView *view)
[caretTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:CaretBlinkTime]];
}
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect:self.caretRect];
}
- (void)caretBlink:(NSTimer *)timer
{
if (hasCaret) {
caretVisible = !caretVisible;
- [self setNeedsDisplayInRect:cocoa_get_caret_rect(self)];
+ [self setNeedsDisplayInRect: self.caretRect];
}
}
@@ -165,10 +155,9 @@ static inline NSRect cocoa_get_caret_rect(BrowserView *view)
browser_window_redraw(browser, 0, 0, &clip, &ctx);
}
- NSRect caretRect = cocoa_get_caret_rect(self);
- if (hasCaret && caretVisible && [self needsToDrawRect:caretRect])
{
+ if (hasCaret && caretVisible && [self
needsToDrawRect:self.caretRect]) {
[[NSColor blackColor] set];
- [NSBezierPath fillRect:caretRect];
+ [NSBezierPath fillRect: self.caretRect];
}
}
}
diff --git a/frontends/cocoa/ScrollableView.m b/frontends/cocoa/ScrollableView.m
index 130fce2..6f20bfe 100644
--- a/frontends/cocoa/ScrollableView.m
+++ b/frontends/cocoa/ScrollableView.m
@@ -38,17 +38,14 @@
- (void)adjustFrame
{
- NSSize frameSize = [[self superview] frame].size;
+ NSSize frameSize = self.enclosingScrollView.contentSize;
[self setFrameSize:NSMakeSize(MAX(self.minimumSize.width, frameSize.width),
MAX(self.minimumSize.height, frameSize.height))];
}
- (void)frameChangeNotification:(NSNotification *)note
{
- // TODO: Correctly handle window resizing.
- // Removing this call is a quick hack to avoid an endless layout loop due to
appearing/disappearing
- // scroll bars.
- //[self adjustFrame];
+ [self adjustFrame];
}
- (void)viewDidMoveToSuperview
diff --git a/frontends/cocoa/gui.m b/frontends/cocoa/gui.m
index f564563..599c3b4 100644
--- a/frontends/cocoa/gui.m
+++ b/frontends/cocoa/gui.m
@@ -253,9 +253,7 @@ static void
gui_window_place_caret(struct gui_window *g, int x, int y, int height,
const struct rect *clip)
{
- [[(__bridge BrowserViewController *)g browserView]
- addCaretAt:cocoa_point(x, y)
- height:cocoa_px_to_pt(height)];
+ [[(__bridge BrowserViewController *)g browserView] addCaretAtX:x Y:y height:height];
}
static void gui_window_remove_caret(struct gui_window *g)
--
NetSurf Browser