2000-06-23 Bernhard Herzog * NEWS: Some more minor changes. * Sketch/Editor/__init__.py (standard_menu): Added the fill_panel and the property_panel commands to the Style menu. * Sketch/UI/skapp.py: Don't put the fill_panel and property_panel commands into the Devel menu * Sketch/UI/toolbox.py (SketchToolbox.build_file_menu): remove the fill_panel command from the menu * Sketch/UI/__init__.py: New default value for UIPreferences.window_size. The old value was a bit small. 2000-06-22 Bernhard Herzog * NEWS: some minor changes for 0.7.7 * Sketch/UI/menu.py (make_menu): Don't .show() commands with an empty title. * Sketch/Graphics/properties.py (PropertyStack.CreateStyle): Make sure that font is not None if the style contains the font property. * Sketch/VERSION: increment to 0.7.7 2000-06-14 Bernhard Herzog * Sketch/Graphics/properties.py (PropertyStack.CreateStyle): Removed the test that would only include fill properties in the new style if self.HasFill() was true. ditto for line and font properties. Now you can have EmptyPattern as fill_pattern or line_pattern in a style. It's arguable, though, whether the test for HasFont() should be left in. * NEWS: remove the trailing backslash in the configure command line in the news for 0.7.4 2000-06-13 Bernhard Herzog * Sketch/UI/fillpanel.py: New file. A more or less direct port of the fill panel of the stable Sketch 0.6.x. It's still incomplete, but what's implemented so far should work. * po/.cvsignore: Ignore sketch.pot and POTFILES as they're generated 2000-06-09 Bernhard Herzog * Doc/styles: Some minor fixes. * NEWS: Updated with some of the changes since 0.7.6 in preparation for a 0.7.7 release. 2000-05-31 Bernhard Herzog * Sketch/UI/gtkdevice.py (GCDevice.StartDblBuffer): (GCDevice.EndDblBuffer): Uncommented and ported to gdk 2000-05-22 Bernhard Herzog * Sketch/UI/gtkmisc.py (ColorButton): (gtk_color_tuple): * Sketch/Editor/doceditor.py (EditorWithSelection.SetProperties): New method. A copy of the same method in Sketch.Editor.document 2000-05-21 Bernhard Herzog * Sketch/Graphics/pattern.py (LinearGradient.WithGradient): (LinearGradient.WithDirection): (LinearGradient.WithBorder): (RadialGradient.WithGradient): (RadialGradient.WithCenter): (RadialGradient.WithBorder): (ConicalGradient.WithGradient): (ConicalGradient.WithCenter): (ConicalGradient.WithDirection): (HatchingPattern.WithDirection): (HatchingPattern.WithBackground): (HatchingPattern.WithForeground): New methods to return copies of patterns with just one attribute changed. * Sketch/Graphics/__init__.py: Also import CreateSimpleGradient. Some minor cleanups. * Sketch/UI/gtkmisc.py (DialogWrapper): (FileSelector): Refactored the FileSelector class into a generic wrapper around gtk dialogs, DialogWrapper, and the FileSelector specific part. Also changed the way the result of the dialog is handles, so that there are only two methods that a class derived from DialogWrapper has to override, __init__ and get_result. (ColorDialog): New class wrapper for the color selection dialog, also derived from DialogWrapper (get_color): Equivalent to get_filename for the color dialog 2000-05-18 Bernhard Herzog * Sketch/Graphics/pattern.py (Pattern.changed): (GradientPattern.SetGradient): (LinearGradient.SetDirection): (LinearGradient.SetBorder): (RadialGradient.SetCenter): (RadialGradient.SetBorder): (ConicalGradient.__set_center_and_dir): (ConicalGradient.SetCenter): (ConicalGradient.SetDirection): (HatchingPattern.SetDirection): (HatchingPattern.SetSpacing): (HatchingPattern.SetForeground): (HatchingPattern.SetBackground): (ImageTilePattern.set_transformation): Deleted all these methods because patterns should be immutable. Objects that can easily accidentally be shared between objects cause significantly less headaches when they're immutable. * Sketch/Graphics/gradient.py (MultiGradient.SetStartColor): (MultiGradient.SetEndColor): (MultiGradient.SetColors): Removed these methods, because like patterns, gradients should be immutable. * Sketch/Graphics/properties.py (PropertyStack.Transform): Use the Transformed method of the pattern object and remove special handling of the case where there is only one non-dynamic style. * Sketch/Graphics/pattern.py (Pattern.Transform): (Pattern.Transformed): (LinearGradient.Transform): (LinearGradient.Transformed): (RadialGradient.Transform): (RadialGradient.Transformed): (ConicalGradient.Transform): (ConicalGradient.Transformed): (HatchingPattern.Transform): (HatchingPattern.Transformed): (ImageTilePattern.Transform): (ImageTilePattern.Transformed): Renamed Transform to Transformed. Unlike Transform which modified the pattern in place, Transformed returns a transformed copy. * Sketch/Graphics/pattern.py (Pattern.Name): (Pattern.SetName): Remove these unused methods and the unused name class variable * Sketch/Editor/texttool.py (TextTool.ButtonPress): Unselect all objects when the mouse press starts a normal text object. 2000-05-16 Bernhard Herzog * INSTALL: Update required PIL version to 1.0 2000-05-15 Bernhard Herzog * Sketch/Editor/texttool.py (CommonTextEditor.Destroy): (SimpleTextEditor.Destroy): Added editor argument. This will be the document editor instance the tool is associated with. This is used in SimpleTextEditor.Destroy to remove the text object if it's empty after editing. (TextTool.selection_changed): (TextTool.get_texteditor): Supply the new editor argument to the texteditor's Destroy method 2000-05-14 Bernhard Herzog * Sketch/Graphics/text.py (CommonText.SetText): (InternalPathText.SetText): Removed the caret arg. (CommonText.set_editor): (CommonText.unset_editor): Removed these methods and the editor instance variable * Sketch/Editor/texttool.py (CommonTextEditor.__init__): (CommonTextEditor.set_object): (CommonTextEditor.Destroy): Removed the calls to self.object's set_editor and unset_editor methods. (CommonTextEditor.InsertCharacter): (CommonTextEditor.DeleteCharBackward): Removed the caret arg from the calls to self.SetText. Call self.SetCaret for that now. (TextTool.SetStateInfo): (TextTool.StateInfo): New methods to read and set editor state info, i.e. the caret position of self.texteditor * Sketch/Editor/tools.py (MouseTool.StateInfo): (MouseTool.SetStateInfo): (MouseTool.ResetStateInfo): Three new methods to manage tool-specific state, such as the currently selected nodes or the position of the text-caret. The default implementation of StateInfo returns None and the others do nothing. * Sketch/Editor/doceditor.py (EditorWithSelection.get_state_info): (EditorWithSelection.set_state_info): (EditorWithSelection.transaction_start): (EditorWithSelection.transaction_end): Two new methods to collect the editor state information associated with a transaction and to set it (get_state_info and set_state_info). Up to now, this state was just the set of selected objects, now there's also the current tool and tool-specific state information. Updated transaction_start and transaction_end accordingly. 2000-05-13 Bernhard Herzog * Sketch/Editor/__init__.py (standard_menu): Remove the empty title strings. 2000-05-10 Bernhard Herzog * Sketch/__init__.py: Use pygtk's gettext instead of intl for now. * Sketch/UI/skapp.py (property_panel command): * Sketch/UI/devcmds.py (add_arrow_hotspot command): (add_arrow_retract command): Use new AddItem syntax * Sketch/Editor/registry.py (ScriptRegistry.Command): Removed this class. * Sketch/UI/menu.py (SketchMenuCommand.__init__): Remove the title parameter and use command.Title() instead. (SketchMenuCheck.__init__): Remove the title parameter and use command.Title() instead. * Sketch/UI/toolbox.py (SketchToolbox.build_file_menu): * Sketch/UI/skapp.py (SketchApplication.Menu): * Sketch/UI/menu.py (make_menu): Change make_menu to accept a Menu instance and change both callers accordingly * Sketch/Editor/registry.py (Menu): New class for menus. A replacement for MenuTree (BuildMenuTree): New function to construct a tree of Menu instances from the description from __init__.py. * Sketch/Editor/__init__.py: import Menu and BuildMenuTree from registry 2000-05-09 Bernhard Herzog * Sketch/Editor/command.py (EditorCommand.DynText): (Command.DynText): Call self.Title() to get the title if the text isn't dynamic to honor the translatable flag. * Sketch/UI/mainwindow.py (file_save_as command): add trailing ... to the title * Sketch/Editor/command.py (Command): New attribute translatable. If true, the title can be translated with gettext. The default is 0. (Command.Title): Return a translated title if self.translatable is true (BuiltinCommand): (BuiltinEditorCommand): Set the translated attribute to 1 by default. 2000-04-26 Bernhard Herzog * Sketch/UI/viewport.py (Viewport.zoom_fit_rect): New kwarg out to handle zooming out. * Sketch/UI/canvas.py (SketchCanvas.zoom_point): Added new out kwarg. If out is true (default is false), zoom out, zoom in otherwise. Also, use self.scale instead of self.gc.scale. (SketchCanvas.zoom_area): Added new out kwarg that is simply passed through to zoom_fit_rect. * Sketch/Editor/tools.py (ZoomTool.ButtonRelease): (ZoomTool.ButtonClick): Call the canvas' zoom_area resp. zoom_point method with the new out kwarg set to state & ZoomOutMask. * Sketch/Editor/const.py (ZoomOutMask): New constant. 2000-04-24 Bernhard Herzog * Sketch/UI/canvas.py (view_outlined command): remove the "not not" because the IsOutlineActive method now returns 1 or 0 2000-04-23 Bernhard Herzog * Sketch/UI/gtkdevice.py (GraphicsDevice.IsOutlineActive): Make sure return value is always either 1 or 0. 2000-04-22 Bernhard Herzog * Sketch/Base/plugins.py (PluginCompoundInfo.__init__): Added a new kw-arg to the constructor, custom_dialog, that was also added to the stable 0.6 version. This allows plugin objects to have custom dialogs instead of the one automatically constructed from the parameter description. (PluginCompoundInfo.HasCustomDialog): New method returning true if the plugin object described has a custom_dialog (PluginCompoundInfo.CreateCustomDialog): Create the custom dialog. This is just a copy of the version in 0.6.6 and will have to be adapted once the UI is actually implemented. * Sketch/Editor/wrapper.py (Wrapper.__cmp__): Wrap __cmp__ explicitly because the 'other' arg may also be a wrapped object. (Wrapper.__getattr__): Don't give a warning message when the requested attribute is '__coerce__'. Just raise the AttributeError exception if it's not in the object's cript_access dict 2000-04-15 Bernhard Herzog * Sketch/Editor/selectiontool.py (SelectionTool.__init__): Removed commented out line tha called the document's SetMode method 2000-04-14 Bernhard Herzog * Sketch/Editor/edittool.py: * Sketch/Editor/selectiontool.py: * Sketch/Editor/texttool.py: * Sketch/Editor/tools.py: Replace N_() with ''"" strings 2000-04-13 Bernhard Herzog * Sketch/Editor/__init__.py (standard_menu): Added tree view to the view menu * Sketch/UI/skapp.py (AppContext.SetWindow): issue a changed message it the window changed. If the editor also changes, this is done by set_editor, so only do it if the editor is the same 2000-04-12 Bernhard Herzog * Sketch/Graphics/base.py (Primitive.ObjectChanged): Removed superfluous line * Sketch/UI/mainwindow.py (SketchMainWindow.__init__): (SketchMainWindow.close): The editor is now also refcounted * Sketch/Editor/doceditor.py (DocumentEditor.docmethods): Added SelectionInfoText (DocumentEditor.DecRef): (DocumentEditor.IncRef): (DocumentEditor.__init__): Added refcounting * Sketch/Editor/texttool.py (_insert_path_text): * Sketch/Graphics/compound.py (EditableCompound.ReplaceChild): Set the old child's parent and document to None *before* setting the new child's parent and document. This allows replacing a child by a compound that contains child * Sketch/Editor/texttool.py (SimpleTextCreator.__init__): Renamed the argument and instance variable document to editor (TextTool.ButtonPress): Instantiate SimpleTextCreator with the editor not the document as argument (maybe_remove_text): (SimpleTextEditor.Destroy): Refer to the document via self.editor because the document isn't an instance variable anymore. Also added a new parameter, editor, to the after handler maybe_remove_text because selections are now done via the editor. 2000-04-11 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.DrawDocument): Also set a layer's outline color if outline mode is active * Sketch/UI/canvas.py (SketchCanvas.set_handle_cursor): If self is not the active canvas set the cursor to self.cursor_shape if not above a handle * Sketch/Editor/__init__.py (standard_menu): Moved view menu directly behind the edit menu and added create_new_editor and create_new_view commands * Sketch/Graphics/document.py (EditDocument.WasEdited): call the undo's WasEdited method and not UndoCount. (EditDocument.StateNumber): New method that returns self.undo's state number (EditDocument.ClearEdited): (EditDocument.MarkAsSaved): Renamed ResetUndoCount to MarkAsSaved. * Sketch/Base/undo.py (UndoRedo): Renamed undo_count to state_number and the last saved state is now determined by an additional variable saved_state which holds the state number of the last save and not by undo_count being 0. (UndoRedo.ResetUndoCount): (UndoRedo.MarkAsSaved): Renamed ResetUndoCount to MarkAsSaved. This function now sets saved_state instead of resetting undo_count to 0 (UndoRedo.UndoCount): (UndoRedo.StateNumber): Renamed UndoCount to StateNumber (UndoRedo.WasEdited): New method WasEdited that returns true if the current state number is the state number of the last saved state (as determined by the last call to MarkAsSaved) * Sketch/Base/plugins.py (ExportInfo.__call__): * Sketch/Graphics/document.py (EditDocument.ClearEdited): (EditDocument.MarkAsSaved): Renamed ClearEdited to MarkAsSaved * Sketch/UI/mainwindow.py (SketchMainWindow.build_window): Make the "modified"-label work * Sketch/Editor/doceditor.py (DocumentEditor.InfoText): call self.SelectionInfoText, not self.document.SelectionInfoText 2000-04-10 Bernhard Herzog * Sketch/UI/skapp.py (SketchApplication.CreateDocumentEditor): * Sketch/UI/mainwindow.py (SketchMainWindow.__init__): New kw-arg editor and the document arg is now optional. Either of these parameters must be provided. * Sketch/Graphics/document.py (EditDocument.object_changed): (EditDocument.reset_transaction): (EditDocument.end_transaction): Introduced a new transaction variable, transaction_change_messages. In object_changed, OBJECT_CHANGED messages aren't just queued with queue_message anymore because it's much too slow (quadratic time in the number of modified objects per transaction) they're now stored in this new dictionary with id(object) and the "what" detail as keys. This means that the number of different messages per object is more limited and the order in which they're issued in end_transaction is random but that shouldn't be a problem. * Sketch/Modules/_sketchmodule.c: * Sketch/Modules/skaux.h: * Sketch/Modules/skaux.c (SKAux_IdIndex): New function IdIndex. like list.index but tests for identity not equality. * Sketch/Graphics/selection.py: Removed the lazy attribute rect. * Sketch/UI/view.py (SketchView.FitToWindow): Removed the selected_only argument because it requires an editor. * Sketch/UI/canvas.py: Removed duplicate definition of the view_fit_selection_to_window command and changed the remaining one to use the new canvas methiod FitSelectedToWindow. * Sketch/Graphics/document.py (EditDocument.end_transaction): Issue a message on the new channel INSERTED that has the current transaction_insertions as parameter 2000-04-09 Bernhard Herzog * Sketch/Editor/editbezier.py (PolyBezierEditor.ChangeRect): * Sketch/Graphics/selection.py (Selection.ChangeRect): * Sketch/Editor/drawer.py (Editor.ChangeRect): Removed the now unused ChangeRect methods * Sketch/Graphics/document.py (EditDocument.reset_transaction): Reset transaction_insertions to None (EditDocument.begin_transaction): Initialize transaction_insertions to Insertions() (EditDocument.end_transaction): Removed the call to self.selection.ResetRectangle() if call_after_handlers returns true. It will be called anyway below. * Sketch/Graphics/selection.py (Selection): remove obsolete class variable is_EditSelection (Selection.__init__): Remove the unused copy_from argument and the code that used it. * Sketch/Graphics/compound.py (EditableCompound.do_remove_child): (EditableCompound.RemoveSlice): (EditableCompound.ReplaceChild): Add missing calls to the removed object's SetDocument methods to set the document to None and make them call the document's object_removed method * Sketch/Graphics/document.py (SketchDocument.object_inserted): (SketchDocument.object_removed): (EditDocument.object_inserted): (EditDocument.object_removed): * Sketch/Graphics/base.py (HierarchyNode.SetDocument): In SetDocument, if new and old document are different, call the old document's object_removed method and the new document's object_inserted method to keep track of inserted and removed object's during a transaction. The versions of these new methods in SketchDocument are noops. * Sketch/Graphics/document.py (Insertions): New class to keep track of which objects were inserted or removed from the document. (EditDocument.reset_transaction): New instance variable transaction_insertions, an instance of Insertions. (EditDocument.Insert): (SketchDocument.insert): Removed the superfluous calls to the new object's SetDocument methods (EditDocument.__init__): Initialize self.transaction_insertions before the call to the superclass' __init__ * Sketch/Graphics/document.py (EditDocument.object_changed): * Sketch/Graphics/compound.py (EditableCompound.Insert): (EditableCompound.ReplaceChild): (EditableCompound.do_remove_child): Pass the children of the REMOVED/INSERTED details of CHILDREN messages as a sequence even if it's only one child and change object_changed accordingly * Sketch/Graphics/blendgroup.py (BlendGroup.ReplaceChild): * Sketch/Editor/document.py (InteractiveDocument._init_undo): Override the inherited method to initialize the undo history with undo_limit taken from Sketch.Editor.preferences. * Sketch/Editor/__init__.py: * Sketch/Base/__init__.py: Moved the undo_limit preference to Sketch.Editor.preferences. 2000-04-08 Bernhard Herzog * Sketch/Base/undo.py (UndoRedo.__init__): (UndoRedo.Reset): (UndoRedo.init): New method init that initializes the undo and redo lists. This is now called both by __init__ and Reset (instead od doing it in __init__ and Reset calling __init__. __init__ now has an additional optional kw-argument, undo_limit, that initializes the undo limit. It defaults to 0. * Sketch/Editor/texttool.py (SimpleTextCreator.CreatedObject): * Sketch/Editor/tools.py (PolyDrawTool.finish): (DrawTool.ButtonRelease): (FreehandTool.ButtonRelease): Use the editor's Insert method, not the document's * Sketch/Editor/doceditor.py (DocumentEditor.Insert): New method to use instead of the document's Insert method. The active layer should be maintained by the editor and not the document. * Sketch/Graphics/document.py (EditDocument.Insert): removed the add_clear_rect. It's automatically done by the compound object the new object is inserted into. * Sketch/__init__.py (Issue): * Sketch/UI/skapp.py (SketchApplication.SavePreferences): * Sketch/Base/warn.py (warn): * Sketch/Base/__init__.py (init): Sketch.Issue is now only used for global messages (publisher is None), so the first argument can be omitted. * Sketch/Graphics/properties.py (DefaultTextProperties): The default_font is in Sketch.Graphics.preferences * Sketch/UI/poslabel.py (InfoLabel.__init__): * Sketch/UI/poslabel.py (InfoLabel.destroy_event): Subscribe to and Unsubscribe from Sketch.UI.preferences' CHANGED channel * Sketch/UI/poslabel.py (PositionLabel.SetUnit): poslabel_sets_default_unit is in Sketch.UI.preferences * Sketch/Base/__init__.py (init): * Sketch/Base/configutil.py (load_user_preferences): Move the preferences._load to init * Sketch/Base/plugins.py: * Sketch/Base/undo.py: * Sketch/Base/warn.py: * Sketch/Editor/context.py: * Sketch/Graphics/arrow.py: * Sketch/Graphics/eps.py: * Sketch/Graphics/psdevice.py: * Sketch/UI/gtkdevice.py: Updated to use Sketch.Base.preferences instead of Sketch.config.preferences * Sketch/Base/config.py: * Sketch/Base/__init__.py: Moved BasePreferences and preferences from config.py to __init__.py * Sketch/__init__.py (init_base): * Sketch/Base/__init__.py (init): * Sketch/Graphics/__init__.py (init): Move Sketch.init_base to Sketch.Base and call it init. Updated all callers * Sketch/Lib/encoding.py (Reencoder.build_mapping): comment out debug print * Sketch/UI/viewport.py (Viewport.update_scrollbars): Update the rulers through the args mechanism and not with set_range() * Sketch/Base/load.py: * Sketch/Base/plugins.py: * Sketch/Editor/__init__.py: * Sketch/Editor/builtins.py: * Sketch/Editor/command.py: * Sketch/Editor/context.py: * Sketch/Editor/doceditor.py: * Sketch/Editor/document.py: * Sketch/Editor/drawer.py: * Sketch/Editor/editbezier.py: * Sketch/Editor/edittool.py: * Sketch/Editor/registry.py: * Sketch/Editor/selectiontool.py: * Sketch/Editor/selrect.py: * Sketch/Editor/smoothcurve.py: * Sketch/Editor/texttool.py: * Sketch/Editor/wrapper.py: * Sketch/Graphics/__init__.py: * Sketch/Graphics/arrow.py: * Sketch/Graphics/base.py: * Sketch/Graphics/bezier.py: * Sketch/Graphics/blend.py: * Sketch/Graphics/blendgroup.py: * Sketch/Graphics/clone.py: * Sketch/Graphics/dashes.py: * Sketch/Graphics/document.py: * Sketch/Graphics/ellipse.py: * Sketch/Graphics/external.py: * Sketch/Graphics/font.py: * Sketch/Graphics/group.py: * Sketch/Graphics/maskgroup.py: * Sketch/Graphics/pattern.py: * Sketch/Graphics/plugobj.py: * Sketch/Graphics/properties.py: * Sketch/Graphics/psdevice.py: * Sketch/Graphics/selection.py: * Sketch/Graphics/text.py: * Sketch/Lib/dscparser.py: * Sketch/UI/__init__.py: * Sketch/UI/gtkdevice.py: * Sketch/UI/mainwindow.py: * Sketch/UI/menu.py: * Sketch/UI/poslabel.py: * Sketch/UI/skapp.py: * Sketch/UI/skpixmaps.py: * Sketch/UI/toolbox.py: * Sketch/UI/tree.py: * Sketch/UI/view.py: Import the objects/modules that are now in Sketch.Base from there and not from Sketch * Sketch/Graphics/properties.py: (DefaultTextProperties): GetFont is now in Sketch.Graphics not Sketch * Sketch/UI/toolbox.py: (FreeHandOptions.entry_changed): freehand_accuracy is in Sketch.Editor.preferences * Sketch/Base/configutil.py (Preferences.__init__): Get Subscribe directly from connector * Sketch/UI/view.py (SketchView.queue_message): Rename the argument Publisher to channel * Sketch/Graphics/document.py (EditDocument.Subscribe): (EditDocument.Unsubscribe): Removed because they did exactly what the inherited version from QueueingPublisher did (EditDocument.issue_redraw): Call self.issue instead of Issue (EditDocument.Destroy): Call QueueingPublisher.Destroy() instead of RemovePublisher(). * Sketch/Base/connector.py (Publisher.issue): (Publisher.ignore_issue): Removed the ignore_issue attribute and changed issue accordingly. Its effect is better achieved by subclassing. Issue now always calls Issue directly. * Sketch/__init__.py: Don't put Base into __path__. Base is now a submodule 2000-04-07 Bernhard Herzog * Sketch/UI/mainwindow.py (SketchMainWindow.build_window): Get the window size from Sketch.UI.preferences (SketchMainWindow.update_rulers): New method subscribed to the canvas' POSITION channel that updates the marks on the rulers. * Sketch/UI/__init__.py: New preference, window_size for the initial size of a document window. * Sketch/UI/mainwindow.py (SketchMainWindow.build_window): Add tooltip for the indicator button and unset its CAN_FOCUS flag * Sketch/UI/toolbox.py (SketchToolbox.build_window): Use the application's tooltips object instead of a separate one. * Sketch/UI/skapp.py (SketchApplication.__init__): Added new instance variable tooltips. 2000-04-06 Bernhard Herzog * Sketch/UI/mainwindow.py: New class IndicatorButton for a button in the mainwindow that indicates whether the document in the window is the active document. Clicking on the button makes the document in the window the active document. (SketchMainWindow.build_window): Add the indicator button in the top right corner. * Sketch/Pixmaps/LightBulbOff.xpm: * Sketch/Pixmaps/LightBulbOn.xpm: Two new pixmaps for the indicator button * Sketch/Graphics/text.py (SimpleText.Disconnect): (SimpleText.SetParent): Removed the Disconnect method. It's functionality is now implemented in the new SetParent method (InternalPathText.Disconnect): (InternalPathText.SetParent): Removed the Disconnect method. It's functionality is now implemented in the new SetParent method * Sketch/Graphics/compound.py (Compound.disconnect_objects): (Compound.Disconnect): Removed completely because the HierarchyNode's Disconnect method is now removed. * Sketch/Graphics/compound.py (EditableCompound.do_remove_child): (EditableCompound.RemoveSlice): (EditableCompound.ReplaceChild): * Sketch/Graphics/blendgroup.py (BlendGroup.remove): (BlendGroup.ReplaceChild): * Sketch/Graphics/base.py (HierarchyNode.Disconnect): Removed the Disconnect method from the graphics objects and updated all callers. This method didn't do anything and wasn't overwritten anywhere. Extending the SetParent method is just as good. (Disconnect was the counterpart to the now also removed Connect method) * Sketch/Graphics/base.py (HierarchyNode.UntieFromDocument): (HierarchyNode.TieToDocument): Removed the remark about the Connect/Disconnect calls. * Sketch/Graphics/compound.py (EditableCompound.Insert): Removed the call to obj.Connect() from the side effects comment. * Sketch/Graphics/blendgroup.py (BlendGroup.__init__): Removed the commented out calls to self.Connect() * Sketch/Graphics/compound.py (Compound.connect_objects): (Compound.Connect): Removed completely because the HierarchyNode's Connect method is now removed. * Sketch/Graphics/compound.py (EditableCompound.Insert): (EditableCompound.ReplaceChild): * Sketch/Graphics/blendgroup.py (BlendGroup.insert): (BlendGroup.ReplaceChild): * Sketch/Graphics/base.py (HierarchyNode.Connect): Removed the Connect method from the graphics objects and updated all callers. This method didn't do anything and wasn't overwritten anywhere. Extending the SetParent method is just as good. * Sketch/Graphics/compound.py (EditableCompound.RemoveObjects): Commenting out the calls to begin_change_children and end_change_children wasn't the right thing to do. Uncomment them again. * Sketch/Graphics/base.py (GraphicsObject._changed): Only call the documents object_changed method if the "what" parameter is given. Now just calling self._changed() will simply force a recomputation of the lazy attributes (through del_lazy_attrs()) and call the parent's ChildChanged() method through issue_changed(). 2000-04-05 Bernhard Herzog * Sketch/Graphics/document.py (EditDocument._real_add_undo): Swap the order of undo and undo_sel for UndoAfter, so that the selection is restored after all other changes. * Sketch/Graphics/compound.py (EditableCompound.RemoveObjects): Commented out the begin_change_children and end_change_children calls. They shouldn't be necessary here. * Sketch/Graphics/document.py (EditDocument.object_changed): Special cases for REMOVED and INSERTED details of CHILDREN messages. In these cases the bounding rects of the objects that were inserted or removed are added to the transaction_changed_objects dict under a unique key (currently the id if the rect) and with None as the object (EditDocument.end_transaction): Handle new special case of None for an object in transaction_changed_objects.values() tuples. * Sketch/Graphics/compound.py (EditableCompound.Insert): Added INSERTED detail to the self._changed call (EditableCompound.ReplaceChild): call self._changed twice, once with REMOVED detail, once with INSERTED detail. (EditableCompound.RemoveSlice): (EditableCompound.do_remove_child): Added REMOVED detail to self._changed call. Also, call Connect in the new child and Disconnect on the old child. * Sketch/Base/const.py (REMOVED): (INSERTED): Two new constants for the detail of the OBJECT_CHANGED, CHILDREN messages 2000-04-04 Bernhard Herzog * Sketch/Editor/context.py: Use the new AddBuiltin function to define commands * Sketch/UI/canvas.py: * Sketch/Editor/texttool.py: * Sketch/Editor/doceditor.py: Use the new AddEditorBuiltin function to define commands * Sketch/Editor/__init__.py (AddEditorBuiltin): (AddBuiltin): New functions to add builtin comands to the registry. * Sketch/Editor/command.py (BuiltinCommand): (BuiltinEditorCommand): Two new command classes for builtin commands. 2000-04-03 Bernhard Herzog * Sketch/Editor/document.py (InteractiveDocument.FlipSelected): (InteractiveDocument.AbutVertical): (InteractiveDocument.AbutHorizontal): Removed as they're now implemented in Sketch/Editor/builtins.py (InteractiveDocument.SetLineColor): Removed because it's not used anymore * Sketch/Editor/builtins.py: New file containing definitions for the standard commands. * Sketch/Editor/registry.py: removed the _noop script * Sketch/UI/menu.py (make_menu): Handle case where Registry.Command returns None and take the title of the command object instead of the one listed in the menu tree. (make_menu): Make sure there aren't two separators directly one after the other * Sketch/UI/canvas.py (SketchCanvas.key_press): Handle case where Registry.Command returns None * Sketch/Editor/registry.py (ScriptRegistry.Command): Return None instead of _noop if the command is not registered. * Sketch/Editor/__init__.py: Commented out AddFunction. I'm not sure it's a good idea to have this function and it isn't used anywhere yet. The only reason for its existance is backwards compatibility with 0.6, but since a lot of other things in the API will change incompatibly, this isn't important. * Sketch/UI/toolbox.py: removed import of Document from Sketch * Sketch/UI/view.py (SketchView.__init__): Make document a required parameter. Automatically creating an empty document here isn't really useful as we can't know what document class to use. SketchView is only used as a base class for the SketchCanvas anyway and SketchCanvas requires the document argument. * Sketch/UI/mainwindow.py: removed import of Document from Sketch * Sketch/Editor/drawbezier.py: * Sketch/Editor/editellipse.py: * Sketch/Editor/drawellipse.py: * Sketch/Editor/editguide.py: * Sketch/Editor/document.py: * Sketch/UI/libartdevice.py: * Sketch/UI/gtkdevice.py: * Sketch/Editor/texttool.py: * Sketch/Editor/drawer.py: Import objects that are now defined in Sketch.Graphics from there instead of Sketch * Sketch/Editor/__init__.py (GetTextEditor): * Sketch/Editor/editrectangle.py (RectangleEditor): * Sketch/Editor/__init__.py (GetEditor): SimpleText, InternalPathText, Rectangle, Ellipse and PolyBezier are in Sketch.Graphics now * Sketch/Graphics/document.py (SelectionMode): (EditMode): Get rid of these silly constants * Sketch/Editor/document.py (InteractiveDocument.Blend): blendgroup and blend are modules in Sketch.Graphics, so import them from there (InteractiveDocument.CreateMaskGroup): import MaskGroup from Sketch.Graphics * Sketch/UI/properties.py: Removed all imports for objects that aren't used and import the objects defined in Sketch.Graphics from there and not from Sketch. * Sketch/Base/load.py (GenericLoader.layer): (GenericLoader.begin_layer_class): Use Sketch.Graphics.Layer instead of layer.Layer. (GenericLoader.begin_group): Use Sketch.Graphics.Group instead of group.Group. * Sketch/UI/toolbox.py (FreeHandOptions.__init__): The freehand_accuracy preference is in Sketch.Editor.preferences * Sketch/UI/devcmds.py (add_arrow_hotspot): * Sketch/UI/devcmds.py (add_arrow_retract): get Arrow from Sketch.Graphics instead of Sketch * Sketch/__init__.py: All objects that were imported from the Graphics subpackage are now only available if the compatibility_bindings() function is called which is currently done by default. (compatibility_bindings): New function that imports objects from the Graphics subpackage and puts them in the Sketch globals. * Sketch/Graphics/__init__.py: The graphics subpackage now exports most of the objects that Sketch/__init__.py imports from Sketch.Graphics. * Sketch/Editor/__init__.py: Remove the _ function definition (standard_menu): Use xpot's ''"" strings instead of a noop _() (which really should have been named N_) function to mark translatable strings. 2000-03-31 Bernhard Herzog * Sketch/Graphics/document.py (EditDocument.queue_edited): Removed this method * Sketch/Editor/document.py (InteractiveDocument._call_layer_method_sel): (InteractiveDocument.ConvertToCurve): Get rid of the self.queue_edited() call and the edited local variable. * Sketch/Graphics/document.py (EditDocument.end_transaction): Remove the kwarg queue_edited and remove the call to self.queue_edited() (EditDocument.EndTransaction): Make it identical to end_transaction. All it did was calling end_transaction with queue_edited = 1. * Sketch/Editor/document.py (InteractiveDocument.apply_to_selected): (InteractiveDocument.RemoveSelected): (InteractiveDocument.MoveSelectionToLayer): (InteractiveDocument.CutForClipboard): (InteractiveDocument.AlignSelection): (InteractiveDocument.AbutHorizontal): (InteractiveDocument.AbutVertical): (InteractiveDocument.CallObjectMethod): (InteractiveDocument.Blend): (InteractiveDocument.CancelBlend): (InteractiveDocument.CreatePathText): (InteractiveDocument.CreateClone): (InteractiveDocument.CombineBeziers): (InteractiveDocument.SplitBeziers): Remove the call to self.queue_edited() * Sketch/UI/tree.py (SketchTree.transaction_end): added *args parameter to ignore the new parameters of TRANSACTION_END * Sketch/Editor/context.py: don't import EDITED from Sketch.const * Sketch/UI/properties.py (PropertyPanel.close): (PropertyPanel.__init__): Use the context's TRANSACTION_END channel instead of the EDITED channel * Sketch/Editor/doceditor.py (DocumentEditor.unsubscribe_doc): (DocumentEditor.subscribe_doc): Use the document's TRANSACTION_END channel instead of the EDITED channel * Sketch/Editor/context.py (document_channels): Removed the EDITED channel * Sketch/Graphics/document.py (EditDocument.end_transaction): Added aparameters to the TRANSACTION_END messages. If the transaction ends because it has been aborted (normally due to an errorm there one parameter, "aborted". If it's a normal end of the transaction, there are two parameters, "normal" and a flag indication whether any objects changed (1) or not (0). 2000-03-29 Bernhard Herzog * Sketch/UI/properties.py (PropertyPanel.close): Also unsubscribe from the EDITED channel 2000-03-26 Bernhard Herzog * Sketch/Base/const.py: Removed MODE. It's not used anywhere anymore. The document's MODE channel has been replaced by the editor's TOOL channel. * Sketch/Graphics/document.py: Don't import MODE as it's unused now * Sketch/Graphics/document.py (EditDocument.begin_transaction): (EditDocument.end_transaction): Removed the last traces of self.transaction_sel_mode (EditDocument._real_add_undo): Removed the selclass argument. (EditDocument._undo_set_sel): removed the redo_class and selclass parameters and changed _real_add_undo, the only caller, accordingly. * NEWS: Some minor corrections. * released Sketch 0.7.6 2000-03-25 Bernhard Herzog * README: Added section about CVS and some other smaller changes * NEWS: New section for release 0.7.6 * Sketch/VERSION: increased to 0.7.6 2000-03-24 Bernhard Herzog * Sketch/UI/tree.py (SketchTree.__init__): (SketchTree.transaction_start): (SketchTree.transaction_end): Subscribe the new methods transaction_start and transaction_end to the context's TRANSACTION_START and TRANSACTION_END channels respectively and in the methods freeze and thaw the tree view. * Sketch/Editor/context.py (document_channels): Added the TRANSACTION_START and TRANSACTION_END channels * Sketch/Graphics/document.py (EditDocument.begin_transaction): Issue a TRANSACTION_START message for the first call to begin_transaction (EditDocument.end_transaction): Issue a TRANSACTION_END message for the last call to end_transaction regardless of whether it's a normal end of transaction or an aborted transaction * Sketch/Base/const.py (TRANSACTION_END): (TRANSACTION_START): Two new message channels for the document objects 2000-03-23 Bernhard Herzog * Doc/arrows: * Doc/styles: Fixed a few typos 2000-03-22 Bernhard Herzog * Sketch/UI/__init__.py: Set default color_cube to (5, 5, 5, 5) which seems to work quite well on my system. * Sketch/UI/gtkdevice.py (InitFromWidget): Use the color_cube preference after all 2000-03-21 Bernhard Herzog * Sketch/UI/gtkdevice.py (InitFromWidget): Hardwire a 5x5x5 color cube. That seems to produce good looking results on my machine. The proper solution would require to information not provided by gdkrgb. (fill_colormap): Add shades_r, shades_g, shades_b parameters and don't take them from config. * Sketch/UI/toolbox.py (SketchToolbox.build_window): * Sketch/UI/skapp.py (SketchApplication.__init__): Move the initialization of structures that depend on a valid window from SketchApplication.__init__ to SketchToolbox.build_window, and add push_rgb_visual and pop_visual calls to make sure, the colormap initialization uses the gdkrgb colormap. * Sketch/UI/gtkdevice.py (fill_colormap): don't allocate a private colormap for now, because we want to use the gdkrgb colormap * Sketch/Graphics/properties.py (Style.SetProperty): Copy fill_pattern and line_pattern properties to make sure they're not shared between styles * Sketch/Base/configutil.py (Preferences._save): Remove the superfluous space char at the end of the first line of the output file 2000-03-18 Bernhard Herzog * Sketch/UI/gtkdevice.py (fill_colormap): Take the reduce_color_flashing attribute from Sketch.UI.preferences * Sketch/Modules/_skgtkmodule.c (skgtk_colormap_alloc_color): New function that uses gdk_colormap_alloc_color to allocate colors because pygtk still uses the deprecated gdk_color_alloc. (skgtk_functions): add skgtk_colormap_alloc_color to skgtk_functions as "allocate_color". Use METH_VARARGS in skgtk_functions instead of the literal 1 (skgtk_copy_colormap): (skgtk_widget_visual_type): (skgtk_window_set_colormap): (skgtk_set_foreground_and_fill): (skgtk_set_clip_mask): (get_pixel): Use the PyG[dt]k*_Get macros instead of accessing the obj filed directly 2000-03-17 Bernhard Herzog * Sketch/Modules/skvisual.c (skvisual_pseudocolor_get_pixel): Added a \n at the end of the error message * Sketch/UI/gtkdevice.py (fill_colormap): (InitFromWidget): Take the color_cube attribute from Sketch.UI.preferences 2000-03-16 Bernhard Herzog * Sketch/Modules/_libartmodule.c (SKSVP_FromSKCurveStroke): * Sketch/UI/gtkdevice.py (SimpleGC.SetLineAttributes): * Sketch/Graphics/psdevice.py (PostScriptDevice.SetLineAttributes): Treat dashes for lines thinner than 1pt as if the line were 1pt thick. None of the devices actually did that and all handled very thin lines differently. * Sketch/Graphics/psdevice.py (PostScriptDevice.SetLineAttributes): Introduced the width_changed local variable to make sure the dash pattern is written again if either the logical dash pattern or the line width changes. * Sketch/Graphics/font.py (_number): New function for the 'number' data type of Adobe's AFM-spec. (converters): Use _number to parse 'Ascender' and 'Descender' (_bb): Accept floating point numbers as well, but round them to ints (read_char_metrics): Accept floating point numbers as well for the values of the 'WX', and 'B' keys, but round them to ints. 2000-03-14 Bernhard Herzog * Sketch/Editor/document.py (InteractiveDocument.SelectObject): Dont't select empty layers. This is a bit of a hack. There should be a better solution. * Sketch/Graphics/layer.py (Layer.SelectionInfo): Add a default value of None to the child arg and handle the case where SelectionInfo is called without it to make it possible to select the layer object itself. * Sketch/UI/tree.py (SketchTree.build_tree): Make the special layers unselectable. 2000-03-11 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.DrawObjects): Added some kludge with self.line to make text visible in outline mode and fix the problem that in outline mode, objects above a text object wouldn't be rendered at all * Sketch/Graphics/text.py (InternalPathText.__init__): Use FactoryTextStyle() instead of getting the font from config. 2000-03-09 Bernhard Herzog * Sketch/UI/skapp.py (SketchApplication.TreeView): Use TreeViewPanel instead of SketchTree (printargs): removed this silly function * Sketch/UI/tree.py: Split the SketchTree class in two new classes, SketchTree(GtkCTree) just for the tree view and TreeViewPanel for the whole dialog widget which uses SketchTree instead of CTree * Sketch/Base/connector.py (Connector.Issue): added a \n at the end of the warning message * Sketch/UI/tree.py: Further extensive changes, most to allow the user to select objects with both the tree view and the canvas. 2000-03-08 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.get_pattern_image): Check for an empty region, i.e. l == r or t == b, to avoid creating empty images which may cause segfaults * Sketch/UI/gtkdevice.py (PatternDevice.get_pattern_image): Check for an empty region, i.e. l == r or t == b, to avoid creating empty images which may cause segfaults 2000-03-07 Bernhard Herzog * Sketch/UI/tree.py: Almost complete rewrite of the tree panel to make updates more efficient using the new OBJECT_CHANGED messages * Sketch/Editor/document.py: import Group from Sketch * Sketch/Graphics/layer.py (Layer.Info): Override base class method to produce meaningful information for the tree widget. * Sketch/UI/properties.py (PropertyPanel.__init__): * Sketch/UI/skpanel.py (SketchPanel.close): Don't subscribe to/unsubscribe from context's EDITED channel * Sketch/UI/skpanel.py (SketchPanel.__init__): Remove the subscription to EDITED. * Sketch/UI/tree.py (SketchTree.object_changed): (SketchTree.__init__): subscribe the new method object_changed to the context's OBJECT_CHANGED signal in __init__ * Sketch/Graphics/text.py (CommonText.SetText): (SimpleText.SetAlignment): (InternalPathText.PathChanged): (InternalPathText.SetStartPos): (InternalPathText.set_transformation): added SHAPE parameter to _changed call * Sketch/Graphics/rectangle.py (Rectangle.SetTrafoAndRadii): added SHAPE parameter to _changed call * Sketch/Graphics/plugobj.py (UnknownPlugin._changed): add what and detail args and pass them on to the base class * Sketch/Graphics/ellipse.py (Ellipse.SetAngles): (Ellipse.SetArcType): added SHAPE parameter to _changed call * Sketch/Graphics/compound.py (Compound.set_objects): (EditableCompound.Insert): (EditableCompound.do_remove_child): (EditableCompound.RemoveSlice): (EditableCompound.ReplaceChild): (EditableCompound.permute_objects): added CHILDREN parameter to _changed call * Sketch/Graphics/blendgroup.py (BlendInterpolation.set_objects): (BlendGroup.insert): (BlendGroup.remove): added CHILDREN parameter to _changed call * Sketch/Graphics/bezier.py (PolyBezier.do_undo): (PolyBezier.Translate): (PolyBezier.Transform): (PolyBezier.set_paths): added SHAPE parameter to _changed call * Sketch/Graphics/base.py (Primitive.properties_changed): (Primitive.ObjectChanged): added PROPERTIES parameter to _changed call (RectangularObject.set_transformation): added SHAPE parameter to _changed call * Sketch/Editor/editbezier.py (PolyBezierEditor.ButtonUp): (PolyBezierEditor.CloseNodes): added SHAPE parameter to _changed call * Sketch/Editor/context.py (Context.document_channels): added OBJECT_CHANGED * Sketch/Graphics/document.py (EditDocument.object_changed): new args what and detail (the same meaning as in the new GraphicsObject._changed). Queue a message (OBJECT_CHANGED, object, what, detail) * Sketch/Base/const.py (OBJECT_CHANGED): new channel (SHAPE): (PROPERTIES): (CHILDREN): "what" parameters for OBJECT_CHANGED messages * Sketch/Graphics/base.py (GraphicsObject._changed): Two new args: what to hold a string describing what has changed and a tuple called detail for details. what and details are passed through to the document's object_changed method. * Sketch/Graphics/document.py (EditDocument.AddClearRect): Removed this method completely. (EditDocument.begin_transaction): get rid of the no_selection kwarg as well. It's also not used anywhere. (EditDocument.end_transaction): Delete the branch for self.transaction_sel_ignore being true. it's always false now that begin_transaction's no_selection has been removed (EditDocument.reset_transaction): Remove resetting transaction_sel_ignore (EditDocument.Insert): Changed undo_text's default value to None and replace it with an i18n'ed string at run time. * Sketch/Graphics/compound.py (Compound.set_objects): removed the commented out AddClearRect code completely * Sketch/Graphics/document.py (EditDocument.begin_transaction): (EditDocument.reset_transaction): removed the last bits referring to the old redraw region scheme (i.e. self.transaction_clear) (EditDocument.begin_transaction): removed the clear_selection_rect kw-arg. updated all callers. 2000-03-06 Bernhard Herzog * Sketch/Graphics/document.py (EditDocument.__init__): removed the connector instance variable (EditDocument.Destroy): removed the self.connector stuff * Sketch/Graphics/base.py (Primitive.LineWidth): Removed because it's not used anywhere (HierarchyNode.issue_changed): removed the self.Issue(CHANGED, self) (HierarchyNode.Subscribe): (HierarchyNode.Unsubscribe): (HierarchyNode.Issue): Removed as they're not used and object change notifications will be sent through the document object. Subscribe/Unsubscribe are used by the clone object, but that's not working at the moment anyway. (HierarchyNode.__del__): removed as well as all it did was related to self being a Publisher 2000-03-05 Bernhard Herzog * Sketch/Graphics/document.py (EditDocument.AddClearRect): (EditDocument.add_clear_rect): add_clear_rect is now the actual implementation of AddClearRect which now prints a message that AddClearRect is deprecated and calls add_clear_rect. add_clear_rect should be considered protected now. * Sketch/Graphics/text.py (InternalPathText.PathChanged): call self._changed() instead of self.del_lazy_attrs() because _changed also takes care of redrawing (PathText.ChildChanged): Don't call self.document.AddClearRect(). The changes in InternalPathText.PathChanged should take care of redrawing the correct region 2000-03-04 Bernhard Herzog * sketch.py: * Sketch/__init__.py: Move the sys.path manipulation to put the Filter (resp. Lib) directories into the path from sketch.py to Sketch/__init__.py * Sketch/Graphics/maskgroup.py: removed the commented out commands stuff (a holdover from Sketch 0.6) (MaskGroup.ChildChanged): Removed this method. It's unnecessary now to override the base class version. The AddClearRect part is taken care of automatically * Sketch/Graphics/document.py (EditDocument.end_transaction): Remove the commented out code that implemented the old update region stuff that relied on self.transaction_clear. (EditDocument.begin_transaction): (EditDocument.reset_transaction): commented out the transaction_clear code * Sketch/Graphics/compound.py (Compound.set_objects): use self._changed instead of using AddClearRect and del_lazy_attrs directly * Sketch/Graphics/blendgroup.py: don't import SelectAdd as it's unused (BlendInterpolation.set_objects): (BlendGroup.do_remove_child): removed the old AddClearRect code completely. * Sketch/Graphics/base.py (GraphicsObject.Editor): Removed this method as it's unused now. 2000-03-03 Bernhard Herzog * Sketch/Graphics/base.py: don't import UnionRects as it's now unused * Sketch/Graphics/base.py (Primitive.ObjectChanged): removed the old AddClearRect code completely. * Sketch/Base/load.py: don't import config as it's unused * Sketch/UI/skapp.py (SketchApplication.SavePreferences): issue SAVE_PREFERENCES instead of calling each preferemce object's _save() method explicitly * Sketch/Base/configutil.py (save_user_preferences): removed because it's not used anymore. * Sketch/__init__.py: import connector earlier to make sure Subscribe is defined when Base/config.py is imported * Sketch/Base/const.py (SAVE_PREFERENCES): new global message channel. the various save preferences methods should be subscribed to this channel. Just before Sketch exits, a message is issued on this channel so that the prefs are saved. * Sketch/Base/config.py (BasePreferences): removed warn_method. Unneded because of yesterday's changes in warning/error reporting * Sketch/Graphics/compound.py: don't import CHANGED as it's unnecessary * Sketch/UI/skapp.py (SketchApplication.print_warning): (SketchApplication.print_traceback): (SketchApplication.__init__): new methods to subscribe to the new PRINT_WARNING and PRINT_TRACEBACK channesl in __init__ 2000-03-02 Bernhard Herzog * Sketch/Base/main.py: Removed this file because it not needed anymore * Sketch/Base/warn.py: Don't import main module. * Sketch/Base/warn.py (warn): (warn_tb): Change the way errors and warnings are reported. They're always printed to stderr and inf they're not INTERNAL, issued as global messages on the PRINT_WARNING or PRINT_TRACEBACK channels * Sketch/Base/connector.py (Connector.Issue): use stderr directly to report errors. Don't use the warn module * Sketch/Base/const.py: Two new message channels, PRINT_WARNING and PRINT_TRACEBACK * Sketch/UI/__init__.py (_process_args): new function to parse the command line args (main): parse command line arguments * Sketch/Modules/skrender.c (skrender_grid): fix off by one errors * Sketch/UI/libartdevice.py (LibartDevice.DrawDocument): add grid support (LibartDevice.DrawGrid): new method to draw the grid (LibartDevice.DrawGrid): use outline color (LibartDevice.DrawGuideLine): use outline color * Sketch/Modules/skrender.h (skrender_grid): add prototype * Sketch/Modules/skrender.c (skrender_grid): new function to render the grid * Sketch/Modules/_libartmodule.c (convert_image_or_pixbuf): new functin to "convert" PIL images and SKArtPixBufObjects to SKPixbufs (sksvp_render_rgb): (sksvp_render_scaled_image): (sksvp_render_transformed_image): (render_guide_line): use the new function convert_image_or_pixbuf 2000-03-01 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.draw_image): take the PIL image and the transformation as arguments and not just the GraphicsObject (LibartDevice.DrawObjects): added support for EPS objects * Sketch/Graphics/eps.py (EpsData.__init__): Don't render the preview here since it's not always needed (EpsData.UpdatePreview): New method called by EpsImage to render/update the preview image. (EpsImage.DrawShape): call self.data.UpdatePreview before rendering (EpsImage.Preview): New method. Return the preview image or None if it doesn't exist, which normally means that it can't be rendered for some reason. 2000-02-29 Bernhard Herzog * Sketch/UI/canvas.py (SketchCanvas.set_handles): * Sketch/Graphics/ellipse.py (snap_to_line): (Ellipse.Snap): * Sketch/Graphics/document.py (EditDocument._move_layer_up): (EditDocument._move_layer_down): (EditDocument._remove_layer): * Sketch/Graphics/bezier.py (PolyBezier.Snap): * Sketch/Editor/registry.py (MenuTree.AddItem): * Sketch/Editor/editbezier.py (PolyBezierEditor.SelectPoint): In preparation for Python 1.6, call list append methods with exactly one argument. 2000-02-27 Bernhard Herzog * Sketch/UI/__init__.py (init): new function to initialize the UI subpackage. * Sketch/Graphics/__init__.py (init): new function to initialize the Graphics subpackage. * Sketch/Editor/__init__.py (init): new function to initialize the Editor subpackage. * Sketch/UI/skapp.py (AppContext.__init__): also forward CHANGED messages from Sketch.UI.preferences * Sketch/Editor/context.py (Context.__init__): also forward CHANGED messages from Sketch.Graphics.preferences and Sketch.Editor.preferences * Sketch/UI/canvas.py: * Sketch/Editor/document.py: removed unnecessary imports * Sketch/Graphics/pagelayout.py (PageLayout.__init__): take default_paper_format and default_page_orientation from Sketch.Graphics.preferences * Sketch/Graphics/font.py (read_metric): (GetFont): take fallback_font from Sketch.Graphics.preferences * Sketch/Graphics/layer.py (GridLayer.__init__): take grid_geometry, grid_visible and grid_color from Sketch.Graphics.preferences (GuideLayer.__init__): take guide_color from Sketch.Graphics.preferences * Sketch/Graphics/__init__.py: added preferences * Sketch/UI/gtkdevice.py (InvertingDevice.init_gc): Take editor_line_width from Sketch.UI.preferences * Sketch/Graphics/properties.py (FactoryTextStyle): Take default_font from Sketch.Graphics.preferences * Sketch/Editor/document.py (InteractiveDocument.CreateMaskGroup): always use the topmost object as mask * Sketch/UI/mainwindow.py (SketchMainWindow.set_window_title): take window_title_template from Sketch.UI.preferences * Sketch/UI/viewport.py (Viewport.save_viewport): take viewport_ring_length from Sketch.UI.preferences * Sketch/UI/toolbox.py (SketchToolbox.build_file_menu): (load_mru_file): (mru_text): take mru_files from Sketch.UI.preferences * Sketch/UI/skapp.py (SketchApplication.add_mru_file): take mru_files and mru_files_length from Sketch.UI.preferences (SketchApplication.remove_mru_file): take mru_files from Sketch.UI.preferences * Sketch/UI/canvas.py (SketchCanvas.max_snap_distance): take max_snap_distance from Sketch.UI.preferences (SketchCanvas.set_current_pos): take snap_current_pos from Sketch.UI.preferences * Sketch/UI/gtkdevice.py (GraphicsDevice.draw_text_on_gc): take greek_threshold from Sketch.UI.preferences * Sketch/Editor/document.py (InteractiveDocument.DuplicateSelected): take duplicate_offset from Sketch.Editor.preferences * Sketch/UI/poslabel.py (PositionLabel.SetUnit): (PositionLabel.__init__): * Sketch/UI/converters.py (conv_length): take default unit from Sketch.UI.preferences * Sketch/Editor/__init__.py: Added editor specific config * Sketch/Base/configutil.py (Preferences): new base class for user preferences 2000-02-24 Bernhard Herzog * Sketch/Modules/pstokenize.c (pslex): add support for hex-encoded string literals (read_hex_string): new function to parse hex-encoded string literals * Sketch/UI/view.py (SketchView.IsAntialiasedSupported): New method to determine whether antialiased drawing is supported at all. * Sketch/UI/canvas.py (SketchCanvas.IsUsingLibart): (SketchCanvas.ToggleUseLibart): * Sketch/UI/view.py (SketchView.ToggleAntialiased): (SketchView.IsAntialiased): Moved to the canvas like the rest of the libart specific methods and renamed to use the more generic "Antialiased" instead of "Libart" * Sketch/UI/view.py (SketchView.redraw_libart): (SketchView.set_gc_transforms): (SketchView.init_gcs): * Sketch/UI/canvas.py (SketchCanvas.redraw_with_libart): (SketchCanvas.ResizedMethod): (SketchCanvas.__init__): (SketchCanvas.init_gcs): (SketchCanvas.set_gc_transforms): moved the libart rendering support from SketchCanvas to SketchView * Sketch/UI/view.py (SketchView.__init__): added new keyword argument antialiased. If 1 draw antialiased if libart is supported, if 0 don't. 2000-02-23 Bernhard Herzog * Sketch/UI/view.py (SketchView.__init__): initialize hadjust and vadjust to None * Sketch/Base/configutil.py (save_repr): unnecessary because point objects aren't stored in the prefs anymore. All prefs are standard Python objects and can be converted to strings via repr(). * Sketch/Base/config.py: don't import add_program_default, get_preference, remove_mru_file and add_mru_file from configutil * Sketch/Base/configutil.py (add_program_default): (get_preference): (remove_mru_file): (add_mru_file): removed because they're unused * Sketch/UI/skapp.py (SketchApplication.build_window): (SketchApplication.__init__): self.filename is now called filenames and is a list of filename to allow multiple files to be opened from the command line * Sketch/Base/config.py (ProgramDefaults): removed some of the preferences that are not needed anymore: show_special_menu, show_advanced_snap_commands, creation_is_temporary * Sketch/Base/configutil.py (add_options): removed because its not used in the gtk based versions 2000-02-22 Bernhard Herzog * Sketch/UI/__init__.py (main): new entry point to use for Sketch as an interactive program. * sketch.py: use the new entry point Sketch.UI.main() * Sketch/__init__.py: Determine the package directory always from __path__ and not also from __file__ (init_base): new function to initialize the base part of Sketch. Removed unnecessary import sys 2000-02-14 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.create_image): don't create ximage as it's not needed anymore * Sketch/Graphics/image.py: removed superfluous config import 2000-02-13 Bernhard Herzog * Sketch/UI/skpixmaps.py: Removed superfluous import Image * Sketch/UI/libartdevice.py (LibartDevice.get_pattern_image): * Sketch/UI/gtkdevice.py (PatternDevice.get_pattern_image): * Sketch/Graphics/image.py (load_image): (ImageData.Invert): * Sketch/Graphics/eps.py (render_preview): use PIL as a package, therefore change "import Image" to "from PIL import Image" or use "import PIL.Image" and refer to PIL.Image 2000-02-11 Bernhard Herzog * Sketch/Modules/curveobject.c (curve_compare): * Sketch/Modules/sktrafo.c (sktrafo_compare): Removed the cast to int in the pointer comparison. It's better to compare the points directly and avoids problems on 64 bit systems. 2000-01-30 Bernhard Herzog * Sketch/Modules/_libartmodule.c (SKSVP_FromLine): Check properly whether the optional dashtuple was actually passed in. * Sketch/UI/libartdevice.py (LibartDevice.SetLineAttributes): (LibartDevice.DrawLineXY): removed the code that ensures a minimum line width as that is now handled completely in _libartmodule. The code was only needed because libart doesn't like zero line widths. * Sketch/Modules/_libartmodule.c (SKSVP_FromLine): Make sure line width is at least 1.0 * Sketch/Editor/__init__.py (standard_menu): new menu entry View->Outlined * Sketch/UI/canvas.py: Added the implementation of the new menu command view_outlined * Sketch/UI/libartdevice.py (LibartDevice.DrawDocument): Activate outline mode for layers with outlined flag set (LibartDevice.get_svps): Change cache strategy for svps slightly to allow for outline mode (LibartDevice.StartOutlineMode): (LibartDevice.EndOutlineMode): (LibartDevice.IsOutlineActive): New methods overriding the no-op defaults to implement outline mode in anti-aliased rendering as well. (LibartDevice.SetProperties): Only change font properties in outline mode (LibartDevice.__init__): Initialize the new instance variables needed for outline mode, outline_style and outline_mode, and initialize properties with an empty PropertyStack. * Sketch/Editor/edittool.py (EditTool.ButtonPress): Special case clicking on a guide line so that the user can move them in the edit tool as well. 2000-01-29 Bernhard Herzog * Sketch/Modules/skrender.c (skrender_vertical_guide_line): (skrender_horizontal_guide_line): new functions to render guide horizontal and vertical guide lines * Sketch/Modules/skrender.h: added prototypes for skrender_vertical_guide_line and skrender_horizontal_guide_line * Sketch/Modules/_libartmodule.c (render_guide_line): Python interface for guide line rendering * Sketch/Graphics/guide.py: removed the commented out code that had already been moved to Sketch/Editors/editguide.py * Sketch/UI/libartdevice.py (LibartDevice.DrawGuideLine): new method (LibartDevice.DrawObjects): added support for guide lines * Sketch/Modules/_libartmodule.c (fill_art_dash): new function to convert tuples of numbers to ArtVpathDash structs. (SKSVP_FromSKCurveStroke): Use fill_art_dash to convert dashtuple to ArtVpathDash (SKSVP_FromLine): Added optional positional arg dashtuple. 2000-01-28 Bernhard Herzog * Sketch/Modules/.cvsignore: added config.c * Sketch/UI/libartdevice.py (LibartDevice.DrawDocument): new keyword arg draw_page_outline. if it's true, draw the page outline * Sketch/UI/canvas.py (SketchCanvas.redraw_with_libart): draw the page outline * Sketch/Modules/_libartmodule.c (SKSVP_FromFilledRectangle): added. * Sketch/UI/libartdevice.py (LibartDevice.DrawLine): actually implement it. (LibartDevice.DrawRectangle): (LibartDevice.DrawPageOutline): (LibartDevice.convert_color): added (LibartDevice.FillRectangle): (LibartDevice.FillCircle): (LibartDevice.FillPolygon): Intersect the svp with clip_region only if clip_region is not None (LibartDevice._set_color): implement in terms of convert_color * Sketch/UI/toolbox.py (FreeHandOptions.__init__): Changed label to "Tolerance" 2000-01-26 Bernhard Herzog * Sketch/Modules/_skgtkmodule.c: Removed redundant declaration of SKArtPixBufObject and added #include "_libartmodule.h" for the correct one. Renamed SKArtPixBufType to PSKArtPixBufType so that we can include _libart.h without name clashes. Made PSKArtPixBufType static. * Sketch/Modules/_skgtkmodule.h: Removed declaration of SKArtPixBufType * Sketch/Modules/Setup.config (_skgtkmodule): don't link against libart. 2000-01-25 Bernhard Herzog * Sketch/Modules/config.c: Removed from CVS because it's automatically created * Sketch/Modules/.cvsignore: ignore files automatically created by the python extension building process 2000-01-23 Bernhard Herzog * ChangeLog: created