diff options
author | Alex Merry <alex.merry@cs.ox.ac.uk> | 2012-12-03 19:02:53 +0000 |
---|---|---|
committer | Alex Merry <alex.merry@cs.ox.ac.uk> | 2012-12-04 11:12:28 +0000 |
commit | 94ff07fc9d728d97dde159e0c3e6ab80e29e0855 (patch) | |
tree | 2e74ff3d709db87e2e2b27aa501ed46727c054d7 /tikzit/src/gtk/GraphInputHandler.m | |
parent | 0d715a7f17b8e5570b42d7802c502e4aa234a3c1 (diff) |
Refactor MainWindow into Application and Window
Basic multiple-window support, but no tools.
Diffstat (limited to 'tikzit/src/gtk/GraphInputHandler.m')
-rw-r--r-- | tikzit/src/gtk/GraphInputHandler.m | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/tikzit/src/gtk/GraphInputHandler.m b/tikzit/src/gtk/GraphInputHandler.m index 02d39a1..788dfeb 100644 --- a/tikzit/src/gtk/GraphInputHandler.m +++ b/tikzit/src/gtk/GraphInputHandler.m @@ -18,25 +18,15 @@ #import "GraphInputHandler.h" #import <gdk/gdkkeysyms.h> -#import "MainWindow.h" #import "Edge+Render.h" static const InputMask unionSelectMask = ShiftMask; -@interface GraphInputHandler (Notifications) -- (void) nodeSelectionChanged:(NSNotification*)n; -- (void) edgeSelectionChanged:(NSNotification*)n; -@end - @implementation GraphInputHandler - (id) initWithGraphRenderer:(GraphRenderer*)r { - return [self initWithGraphRenderer:r window:nil]; -} -- (id) initWithGraphRenderer:(GraphRenderer*)r window:(MainWindow*)w { self = [super init]; if (self) { - window = w; renderer = r; mode = SelectMode; state = QuietState; @@ -47,12 +37,6 @@ static const InputMask unionSelectMask = ShiftMask; currentResizeHandle = NoHandle; // FIXME: listen only to the doc's PickSupport // (need to track document changes) - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(nodeSelectionChanged:) - name:@"NodeSelectionChanged" object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(edgeSelectionChanged:) - name:@"EdgeSelectionChanged" object:nil]; } return self; @@ -125,21 +109,6 @@ static const InputMask unionSelectMask = ShiftMask; [self deselectAll]; if (mode == BoundingBoxMode) { [renderer setBoundingBoxHandlesShown:YES]; - [window favourGraphControls]; - } else if (mode == CreateNodeMode) { - [window favourNodeControls]; - } else if (mode == DrawEdgeMode) { - [window favourEdgeControls]; - } else if (mode == HandMode) { - [window favourGraphControls]; - } else if (mode == SelectMode) { - // FIXME: also change on selection change - if ([[[[self doc] pickSupport] selectedNodes] count]) - [window favourNodeControls]; - else if ([[[[self doc] pickSupport] selectedEdges] count]) - [window favourEdgeControls]; - else - [window favourGraphControls]; } } } @@ -497,28 +466,4 @@ static const InputMask unionSelectMask = ShiftMask; @end -@implementation GraphInputHandler (Notifications) -- (void) nodeSelectionChanged:(NSNotification*)n { - if (mode == SelectMode) { - if ([[[[self doc] pickSupport] selectedNodes] count]) - [window favourNodeControls]; - else if ([[[[self doc] pickSupport] selectedEdges] count]) - [window favourEdgeControls]; - else - [window favourGraphControls]; - } -} - -- (void) edgeSelectionChanged:(NSNotification*)n { - if (mode == SelectMode) { - if ([[[[self doc] pickSupport] selectedNodes] count]) - [window favourNodeControls]; - else if ([[[[self doc] pickSupport] selectedEdges] count]) - [window favourEdgeControls]; - else - [window favourGraphControls]; - } -} -@end - // vim:ft=objc:ts=8:et:sts=4:sw=4 |