summaryrefslogtreecommitdiff
path: root/tikzit/src/common
diff options
context:
space:
mode:
authorAlex Merry <alex.merry@cs.ox.ac.uk>2012-12-11 18:23:29 +0000
committerAlex Merry <alex.merry@cs.ox.ac.uk>2012-12-11 18:23:29 +0000
commit24c26ce52aa95e4dddfaceb23025a0438ed34350 (patch)
treeaffcb8495b1da36432bd48dfaf5234358277a6ef /tikzit/src/common
parentf0005d52707e1e8bfb19ba44782f169e59aa815d (diff)
Remove the concept of an "active style" from StyleManager
It's all tool-based in the GTK+ interface now.
Diffstat (limited to 'tikzit/src/common')
-rw-r--r--tikzit/src/common/StyleManager.h4
-rw-r--r--tikzit/src/common/StyleManager.m60
2 files changed, 0 insertions, 64 deletions
diff --git a/tikzit/src/common/StyleManager.h b/tikzit/src/common/StyleManager.h
index 406a86a..0fb2436 100644
--- a/tikzit/src/common/StyleManager.h
+++ b/tikzit/src/common/StyleManager.h
@@ -21,18 +21,14 @@
@interface StyleManager: NSObject {
NSMutableArray *nodeStyles;
- NodeStyle *activeNodeStyle;
NSMutableArray *edgeStyles;
- EdgeStyle *activeEdgeStyle;
}
+ (StyleManager*) manager;
- (id) init;
@property (readonly) NSArray *nodeStyles;
-@property (retain) NodeStyle *activeNodeStyle;
@property (readonly) NSArray *edgeStyles;
-@property (retain) EdgeStyle *activeEdgeStyle;
// only for use by loading code
- (void) _setNodeStyles:(NSMutableArray*)styles;
diff --git a/tikzit/src/common/StyleManager.m b/tikzit/src/common/StyleManager.m
index 1f895ea..837a094 100644
--- a/tikzit/src/common/StyleManager.m
+++ b/tikzit/src/common/StyleManager.m
@@ -99,9 +99,7 @@
if (self) {
// we lazily load the default styles, since they may not be needed
nodeStyles = nil;
- activeNodeStyle = nil;
edgeStyles = nil;
- activeEdgeStyle = nil;
}
return self;
@@ -198,14 +196,6 @@
[[NSNotificationCenter defaultCenter] postNotificationName:@"EdgeStylesReplaced" object:self];
}
-- (void) postActiveNodeStyleChanged {
- [[NSNotificationCenter defaultCenter] postNotificationName:@"ActiveNodeStyleChanged" object:self];
-}
-
-- (void) postActiveEdgeStyleChanged {
- [[NSNotificationCenter defaultCenter] postNotificationName:@"ActiveEdgeStyleChanged" object:self];
-}
-
- (NSArray*) nodeStyles {
if (nodeStyles == nil) {
[self loadDefaultNodeStyles];
@@ -225,15 +215,10 @@
[nodeStyles release];
[styles retain];
nodeStyles = styles;
- NodeStyle *oldActiveStyle = activeNodeStyle;
- activeNodeStyle = nil;
for (NodeStyle *style in styles) {
[self listenToNodeStyle:style];
}
[self postNodeStylesReplaced];
- if (oldActiveStyle != activeNodeStyle) {
- [self postActiveNodeStyleChanged];
- }
}
- (void) _setEdgeStyles:(NSMutableArray*)styles {
@@ -241,49 +226,10 @@
[edgeStyles release];
[styles retain];
edgeStyles = styles;
- EdgeStyle *oldActiveStyle = activeEdgeStyle;
- activeEdgeStyle = nil;
for (EdgeStyle *style in styles) {
[self listenToEdgeStyle:style];
}
[self postEdgeStylesReplaced];
- if (oldActiveStyle != activeEdgeStyle) {
- [self postActiveEdgeStyleChanged];
- }
-}
-
-- (NodeStyle*) activeNodeStyle {
- if (nodeStyles == nil) {
- [self loadDefaultNodeStyles];
- }
- return activeNodeStyle;
-}
-
-- (void) setActiveNodeStyle:(NodeStyle*)style {
- if (style == activeNodeStyle) {
- return;
- }
- if (style == nil || [nodeStyles containsObject:style]) {
- activeNodeStyle = style;
- [self postActiveNodeStyleChanged];
- }
-}
-
-- (EdgeStyle*) activeEdgeStyle {
- if (edgeStyles == nil) {
- [self loadDefaultEdgeStyles];
- }
- return activeEdgeStyle;
-}
-
-- (void) setActiveEdgeStyle:(EdgeStyle*)style {
- if (style == activeEdgeStyle) {
- return;
- }
- if (style == nil || [edgeStyles containsObject:style]) {
- activeEdgeStyle = style;
- [self postActiveEdgeStyleChanged];
- }
}
- (NodeStyle*) nodeStyleForName:(NSString*)name {
@@ -309,9 +255,6 @@
if (nodeStyles == nil) {
[self loadDefaultNodeStyles];
}
- if (activeNodeStyle == style) {
- [self setActiveNodeStyle:nil];
- }
[self ignoreNodeStyle:style];
[style retain];
@@ -343,9 +286,6 @@
if (edgeStyles == nil) {
[self loadDefaultEdgeStyles];
}
- if (activeEdgeStyle == style) {
- [self setActiveEdgeStyle:nil];
- }
[self ignoreEdgeStyle:style];
[style retain];