From dcf64eac4fdb246cf6fb169c1279b67966478173 Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Wed, 18 Jan 2012 10:05:06 +0000 Subject: Rename src/linux to src/gtk (which is more accurate) git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@392 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64 --- tikzit/src/gtk/TikzDocument.h | 163 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 tikzit/src/gtk/TikzDocument.h (limited to 'tikzit/src/gtk/TikzDocument.h') diff --git a/tikzit/src/gtk/TikzDocument.h b/tikzit/src/gtk/TikzDocument.h new file mode 100644 index 0000000..2e29677 --- /dev/null +++ b/tikzit/src/gtk/TikzDocument.h @@ -0,0 +1,163 @@ +// +// TikzDocument.h +// TikZiT +// +// Copyright 2010 Chris Heunen +// Copyright 2010 Alex Merry +// +// This file is part of TikZiT. +// +// TikZiT is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// TikZiT is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with TikZiT. If not, see . +// + +#import "TZFoundation.h" +#import +#import "PickSupport.h" +#import "StyleManager.h" + +@interface TikzDocument : NSObject { + StyleManager *styleManager; + Graph *graph; + PickSupport *pickSupport; + NSUndoManager *undoManager; + NSString *tikz; + NSString *path; + NSSet *nodesetBeingModified; + NSMapTable *nodesetBeingModifiedOldCopy; + NSSet *edgesetBeingModified; + NSMapTable *edgesetBeingModifiedOldCopy; + NSPoint currentNodeShift; + Node *nodeBeingModified; + Node *nodeBeingModifiedOldCopy; + Edge *edgeBeingModified; + Edge *edgeBeingModifiedOldCopy; + NSRect oldGraphBounds; + GraphElementData *oldGraphData; + BOOL hasChanges; +} + ++ (TikzDocument*) documentWithStyleManager:(StyleManager*)manager; ++ (TikzDocument*) documentWithGraph:(Graph*)g styleManager:(StyleManager*)manager; ++ (TikzDocument*) documentWithTikz:(NSString*)t styleManager:(StyleManager*)manager; ++ (TikzDocument*) documentFromFile:(NSString*)path styleManager:(StyleManager*)manager error:(NSError**)error; + +- (id) initWithStyleManager:(StyleManager*)manager; +- (id) initWithGraph:(Graph*)g styleManager:(StyleManager*)manager; +- (id) initWithTikz:(NSString*)t styleManager:(StyleManager*)manager; +- (id) initFromFile:(NSString*)path styleManager:(StyleManager*)manager error:(NSError**)error; + +- (Graph*) graph; +- (PickSupport*) pickSupport; +- (NSString*) path; +- (NSString*) name; +- (NSString*) suggestedFileName; +- (BOOL) hasUnsavedChanges; + +- (StyleManager*) styleManager; +- (void) setStyleManager:(StyleManager*)manager; + +- (NSString*) tikz; +- (BOOL) setTikz:(NSString*)tikz; + +- (Graph*) cutSelection; +- (Graph*) copySelection; +- (void) paste:(Graph*)graph; +- (void) pasteFromTikz:(NSString*)tikz; + +// some convenience methods: +- (BOOL) isNodeSelected:(Node*)node; +- (BOOL) isEdgeSelected:(Edge*)edge; +- (NSEnumerator*) nodeEnumerator; +- (NSEnumerator*) edgeEnumerator; + +- (BOOL) canUndo; +- (void) undo; +- (BOOL) canRedo; +- (void) redo; +- (NSString*) undoName; +- (NSString*) redoName; + +- (void) startUndoGroup; +- (void) nameAndEndUndoGroup:(NSString*)nm; +- (void) endUndoGroup; + +- (void) startModifyNode:(Node*)node; +- (void) modifyNodeCheckPoint; +- (void) endModifyNode; +- (void) cancelModifyNode; + +- (void) startModifyNodes:(NSSet*)nodes; +- (void) modifyNodesCheckPoint; +- (void) endModifyNodes; +- (void) cancelModifyNodes; + +- (void) startShiftNodes:(NSSet*)nodes; +- (void) shiftNodesUpdate:(NSPoint)shiftChange; +- (void) endShiftNodes; +- (void) cancelShiftNodes; + +- (void) startModifyEdge:(Edge*)edge; +- (void) modifyEdgeCheckPoint; +- (void) endModifyEdge; +- (void) cancelModifyEdge; + +- (void) startModifyEdges:(NSSet*)edges; +- (void) modifyEdgesCheckPoint; +- (void) endModifyEdges; +- (void) cancelModifyEdges; + +- (void) startChangeBoundingBox; +- (void) changeBoundingBoxCheckPoint; +- (void) endChangeBoundingBox; +- (void) cancelChangeBoundingBox; + +- (void) startChangeGraphProperties; +- (void) changeGraphPropertiesCheckPoint; +- (void) endChangeGraphProperties; +- (void) cancelChangeGraphProperties; + +- (void) removeSelected; +- (void) addNode:(Node*)node; +/*! + * Convenience function to add a node in the active style + * at the given point. + * + * @param pos the position (in graph co-ordinates) of the new node + * @return the added node + */ +- (Node*) addNodeAt:(NSPoint)pos; +- (void) removeNode:(Node*)node; +- (void) addEdge:(Edge*)edge; +- (void) removeEdge:(Edge*)edge; +/*! + * Convenience function to add an edge in the active style + * between the given nodes. + * + * @param source the source node + * @param target the target node + * @return the added edge + */ +- (Edge*) addEdgeFrom:(Node*)source to:(Node*)target; +- (void) shiftSelectedNodesByPoint:(NSPoint)offset; +- (void) insertGraph:(Graph*)g; +- (void) flipSelectedNodesHorizontally; +- (void) flipSelectedNodesVertically; + +- (BOOL) saveCopyToPath: (NSString*)path error: (NSError**)error; +- (BOOL) saveToPath: (NSString*)path error: (NSError**)error; +- (BOOL) save: (NSError**)error; + +@end + +// vim:ft=objc:sts=4:sw=4:et -- cgit v1.2.3