summaryrefslogtreecommitdiff
path: root/tikzit/src/gtk/GraphInputHandler.m
diff options
context:
space:
mode:
Diffstat (limited to 'tikzit/src/gtk/GraphInputHandler.m')
-rw-r--r--tikzit/src/gtk/GraphInputHandler.m55
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