Introduce DebuggerModel, which will be updated by the BackEnd.
[macgdbp.git] / Source / BSSplitView.m
1 /*
2 * MacGDBp
3 * Copyright (c) 2007 - 2011, Blue Static <http://www.bluestatic.org>
4 *
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
10 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
15 */
16
17 #import "BSSplitView.h"
18
19
20 @implementation BSSplitView
21
22 /**
23 * Override the drawing method for the divider so we can make it prettier
24 *
25 * @todo draw the dimple
26 */
27 - (void)drawDividerInRect:(NSRect)rect
28 {
29 // Draw the gradient.
30 NSColor* startColor = [NSColor colorWithDeviceRed:0.875 green:0.875 blue:0.875 alpha:1.0];
31 NSColor* endColor = [NSColor colorWithDeviceRed:0.812 green:0.812 blue:0.812 alpha:1.0];
32 NSGradient* gradient = [[NSGradient alloc] initWithStartingColor:startColor endingColor:endColor];
33 [gradient drawInRect:rect angle:([self isVertical] ? 0.0 : 90.0)];
34 [gradient release];
35
36 // Stroke the divider.
37 [[NSColor colorWithDeviceRed:0.667 green:0.667 blue:0.667 alpha:1.0] setStroke];
38 [NSBezierPath setDefaultLineWidth:0.5];
39 [NSBezierPath strokeRect:rect];
40
41 // Draw the dimple image.
42 NSImage* dimple = [NSImage imageNamed:@"dimple.png"];
43 NSSize dmpSize = [dimple size];
44 NSPoint origin = NSMakePoint(NSMidX(rect) - (dmpSize.width / 2),
45 NSMidY(rect) - (dmpSize.height / 2));
46 [dimple drawAtPoint:origin
47 fromRect:NSZeroRect
48 operation:NSCompositeSourceOver
49 fraction:1.0];
50 }
51
52 /**
53 * Returns the size of the divider to draw
54 */
55 - (CGFloat)dividerThickness;
56 {
57 return 6.0;
58 }
59
60 @end