2006-06-13 Bernhard Herzog * Sketch/Modules/skvisual.c (skvisual_pseudocolor_free) (SKVisual_FromWindow, skvisual_dealloc), Sketch/Modules/sktrafo.c (SKTrafo_FromDouble, sktrafo_dealloc), Sketch/Modules/skrect.c (SKRect_FromDouble, skrect_dealloc), Sketch/Modules/skpoint.c (SKPoint_FromXY, skpoint_dealloc), Sketch/Modules/skfm.c (SKFontMetric_New, skfm_dealloc), Sketch/Modules/skdither.c (SKVisual_InitDither), Sketch/Modules/skcolor.c (fill_free_list, SKColor_FromRGB) (skcolor_dealloc), Sketch/Modules/skaux.c (SKCache_New, SKCache_dealloc), Sketch/Modules/regionobject.c (SKRegion_FromRegion) (region_dealloc), Sketch/Modules/pstokenize.c (PSTokenizer_FromStream) (pstokenizer_dealloc), Sketch/Modules/imageobject.c (image_dealloc, SKImage_FromImage), Sketch/Modules/curveobject.c (SKCurve_New, curve_dealloc), Sketch/Modules/_libartmodule.c (SKSVP_FromArtSVP) (SKSVP_dealloc, SKArtPixBuf_FromArtPixBuf, SKArtPixBuf_dealloc): Use Python memory allocation API correctly so that e.g. memory allocated by PyObject_New is deallocated by PyObject_Del. Also, use the function based API instead of the macros. 2006-03-05 Bernhard Herzog * Sketch/Editor/doceditor.py, Sketch/UI/canvas.py: Remove unused imports 2006-03-05 Bernhard Herzog Silence some GtkDeprecationWarning * Sketch/UI/canvas.py (SketchCanvas.update_handles_idle): Use gobject.idle_add instead of gtk.idle_add * Sketch/UI/gtkmisc.py (SketchDrawingArea.UpdateWhenIdle): Use gobject.idle_add instead of gtk.idle_add (SketchDrawingArea.focus_in_event) (SketchDrawingArea.focus_out_event): Use True instead of gtk.TRUE 2006-03-04 Bernhard Herzog * po/fr.po: Use correct charset specification. 2006-03-04 Bernhard Herzog * Sketch/Editor/tools.py (ZoomToolInstance): Derive from TemporaryToolInstance (ZoomToolInstance.ButtonRelease, ZoomToolInstance.ButtonClick): call self.finished so that the zoom operations are temporary. 2006-03-04 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection.ButtonClick): Clarify the meaning of the state parameter a bit. 2006-02-26 Bernhard Herzog * Sketch/Editor/tools.py (ZoomToolInstance.ButtonRelease): Handle the case where the object returned by self.end_edit_object is None. This can happen when the user switches to the zoom tool with the keyboard while pressing down the mouse button. 2006-02-26 Bernhard Herzog Savannah Patch #4516 by Valentin Ungureanu: * Sketch/Editor/tools.py (TemporaryToolInstance): New. A class that implements a temporary editor tool. * Sketch/Editor/doceditor.py (__init__): New instance variable tool_stack. When a temporary tools is activated the current tool is added to this list instead of being ended. The list is emptied when a non-temporary tool is activated. (EditorWithSelection.SetTool): Adapt to temporary tools. Also make it a noop if the name of the current tool is the same as the name of the tool to be activated. (TemporaryToolFinished): New. Switch to the previous tool in the stack. This method is called by the temporary tools when they are done. 2006-01-29 Bernhard Herzog * Sketch/Modules/skreadmodule.c (sklex): Detect NUL-bytes after a backslash (it might be the end of the data!) (tokenize_line): Raise an SyntaxError when the tokenizer finds an error 2006-01-29 Bernhard Herzog * Sketch/Modules/curveobject.c (curve_parse_string_append), Sketch/Modules/skreadmodule.c (sklex), Sketch/Modules/pstokenize.c (read_name_or_number): Set LC_NUMERIC locale to "C" to make sure the C format for floats is recognized instead of any locale specific format. 2005-12-18 Bernhard Herzog Change which objects manage which tool is active. Previously it was the main context object, now it's the document editor. Savannah patch #4695, partly by Valentin Ungureanu * Sketch/Editor/context.py: Change the meaning of the context's TOOL message a little. Previously it indicated that the user selected a new tool and all editors had to be updated accordingly. Now it means that the current editor has switched to a different tool (or that a different editor has been made current). (tool): The tool attribute is now determined on the fly based on the current tool. It may be None now. (Context.editor_channels): Add TOOL so that the editor's new TOOL messages are forwarded by the context. (Context.__getattr__): New. Recognize "tool" attributes and return something sensible, usually the current editor's toolname. (Context.__init__): "tool" is no longer an instance variable. (Context.set_editor): Issue a TOOL message when the editor changes. The new editor may currently have a different tool than the previous one. (Context.SetTool): Simply call the current editor's SetTool method. Do not issue messages anymore. * Sketch/Editor/doceditor.py (EditorWithSelection.SetTool): Issue a TOOL message when the tool changes. * Sketch/UI/mainwindow.py (tool_changed): Removed. (SketchMainWindow.__init__, SketchMainWindow.close): removed the code that handled the TOOL messages or set the current tool. * Sketch/UI/toolbox.py (ToolButton.ToolChanged): Make the button insensitive when tool is None. * Sketch/UI/skapp.py (SketchApplication.__init__): No need to set the current tool anymore. That is done by the editor now. (SketchApplication.SetTool): Removed. * Sketch/Editor/aligntool.py (AlignToolInstance.ButtonClick): The tool is now managed directly by the editor. * Sketch/UI/canvas.py (SketchCanvas.subscribe_editor) (SketchCanvas.unsubscribe_editor): (Un)subscribe to/from the editor's TOOL messages too. (SketchCanvas.SetTool): Simply pass the tool through to the editor. (SketchCanvas.tool_changed): New. Has the cursor update logic formerly in SetTool. This method is subscribed to the TOOL message. (SketchCanvas.realize_method): New. Extend inherited method so that the cursors are set properly 2005-12-18 Bernhard Herzog * Sketch/Editor/aligntool.py (AlignToolInstance.ButtonClick): The canvas, has a DocToWin method. No need to access the canvas' gc directly. 2005-12-18 Bernhard Herzog * Sketch/Editor/aligntool.py (AlignToolInstance.ButtonClick): The context parameter is the canvas object the user is interacting with, not the global context object. Don't access the editor through it, use self instead. Also, add comment about the incorrect use of the context/canvas when calling align_selected 2005-12-11 Bernhard Herzog * Sketch/Editor/edittool.py: Remove unused imports 2005-11-06 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection): Fix typos in doc-string and extend the doc-string a bit. 2005-10-29 Bernhard Herzog The second part of Valentin Ungureanu's savannah patch #4537 unchanged: * Sketch/UI/fillpanel.py (FillPanel.__init__): Initialize the dialog with the fill of the current selection if any. 2005-10-29 Bernhard Herzog Address one of the problems of savannah patch #4537 -- that the pattern in the fill panel is not always updated when the selection changes -- but implement it in a completely different way: * Sketch/UI/fillpanel.py: Make sure the the frames issue CHANGED messages whenever the pattern has changed and that the CHANGED messages are issued when all of a group of related changes have taken place (such as when multiple widgets have to be updated because the selection changed). (PatternFrame.__init__): Init the new instance variables _inhibit_changed_messages and _has_chaned (PatternFrame.inhibit_changed, PatternFrame.allow_changed): New methods to temporarily inhibit the immediate issueing of the CHANGED messages. (PatternFrame.changed): Between calls to inhibit_changed and allow_changed only set a flag instead of actually issueing the message. (PatternFrame.SetPattern): Call self.changed if the new pattern and the old pattern are different (GradientPatternFrame.SetPattern, HatchingPatternFrame.SetPattern): Frame the bodies of this methods in inhibit_changed and allow_changed calls. 2005-10-29 Bernhard Herzog * Sketch/UI/fillpanel.py (PatternFrame.__init__): Remove unused instance variable. 2005-10-16 Bernhard Herzog Last part of savannah patch #4497 by Valentin Ungureanu: * Sketch/Editor/edittool.py (MultiEditor.SelectPoint): (MultiEditor.SelectPoint): Return whether a point was selected. This helps EditToolInstance decide what to do next. (EditToolInstance.ButtonPress): If the outline of a noneditable object was hit (MultiEditor.SelectPoint returns False) then start a rubber rect. 2005-10-16 Bernhard Herzog Another part of savannah patch #4497 by Valentin Ungureanu: * Sketch/Editor/editbezier.py (PolyBezierEditor.SelectPoint): Check if the point that would be selected lies in the rect provided as argument. 2005-10-15 Bernhard Herzog * Sketch/Editor/edittool.py (MultiEditor.ButtonDown) (MultiEditor.CurrentInfoText): Don't assume that the editor list is not empty. Based on part of savannah patch #4497 by Valentin Ungureanu 2005-10-15 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection.InfoText): Fix typo in doc-string 2005-10-15 Bernhard Herzog * Sketch/Graphics/base.py: Untabify 2005-10-03 Bernhard Herzog * Sketch/UI/fillpanel.py (GradientPatternFrame.__init__): Replace the gradient type optionmenu with a combobox based on CommonComboBox. (GradientPatternFrame.SetPattern, GradientPatternFrame.set_type): Adapt to the combobox. 2005-10-03 Bernhard Herzog * Sketch/UI/objectpanel.py (CommonComboBox): Deleted. It's now in gtkmisc. * Sketch/UI/gtkmisc.py (CommonComboBox): Moved here objectpanel.py 2005-09-25 Bernhard Herzog Add an Align tool whith its own handles and keymap. Patch by Valentin Ungureanu (savannah patch #4396) * Sketch/Pixmaps/AlignBL.xbm, Sketch/Pixmaps/AlignBR.xbm, Sketch/Pixmaps/AlignB.xbm, Sketch/Pixmaps/AlignC.xbm, Sketch/Pixmaps/AlignLC.xbm, Sketch/Pixmaps/AlignL.xbm, Sketch/Pixmaps/AlignR.xbm, Sketch/Pixmaps/AlignTC.xbm, Sketch/Pixmaps/AlignTL.xbm, Sketch/Pixmaps/AlignTR.xbm, Sketch/Pixmaps/AlignT.xbm: New. Handles for the align operations. * Sketch/Editor/const.py: Add the align handle types. * Sketch/UI/canvas.py (handle_info): Add the align handles. * Sketch/UI/skpixmaps.py (_bitmap_names): Add the align handles. * Sketch/Editor/builtins.py (align_selected): New. Align the selected objects and also add builtin commands for common align operations. * Sketch/Editor/__init__.py: Add new entries for the Align tool in standard_menu, standard_keystrokes, toolmap and create align_keystrokes. * Sketch/Editor/aligntool.py: New. Implementation of the Align tool. * Sketch/UI/canvas.py (SketchCanvas.lookup_key): Check if the Align tool is active when looking up the command. * Sketch/UI/skapp.py: Add the align keymap. * Sketch/Editor/context.py: Add a builtin command that activates the Align tool. 2005-09-24 Bernhard Herzog * Sketch/UI/canvas.py: Untabify 2005-09-24 Bernhard Herzog Patch by Valentin Ungureanu (savannah patch #4369): * Sketch/Editor/doceditor.py (EditorWithSelection.get_state_info, EditorWithSelection.set_state_info): Add the last selected objects to the state info of the editor. 2005-09-18 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.__del__): Removed. All it did was print a debug message. 2005-09-18 Bernhard Herzog * Sketch/UI/objectpanel.py: Use ComboBoxes instead of OptionMenus. This is yet another step in the quest to get rid of the deprecation warnings. The new implementation is currently a little less featureful, though, in that it doesn't support additional temporary items in the comboboxes. (CommonOptionMenu): Removed. (CommonComboBox): New class. The ComboBox based replacement for CommonOptionMenu (PixmapMenu, UnitMenu, LineDashesMenu, LineWidthMenu, ArrowMenu): Use CommonComboBox instead of CommonOptionMenu. The methods have been changed accordingly. (ArrowCellRenderer, LineCellRenderer): New. Helper classes to implement the combo boxes. (LinePropertiesFrame.on_units): Remove the set_adjustment and set_value calls. The set_all method of the adjustment does all that is necessary. The old implementation sent to may events and did so too early (LinePropertiesFrame.build_frame): Adjust to the new way to instantiate PixmapMenu (ObjectPanel.build_menu): Remove a debug print. * Sketch/UI/skpixmaps.py (load_pixbuf): New. Load a Skencil bitmap or pixmap as a gtk pixbuf. 2005-08-27 Bernhard Herzog * Sketch/UI/properties.py (StyleList.__init__): Remove the line that uses gtk.Pixmap. It was accidentally left in when the gtk.Pixmap calls were removed on 2005-08-20 2005-08-27 Bernhard Herzog * Sketch/UI/metapanel.py (MetaDataPanel.build_window): Assign some widgets to instance variables so that we can access them later. Make the delete button initially insensitive. (MetaDataPanel.selection_changed): Make the delete button sensitive iff a line is currently selected (MetaDataPanel.delete_data): Delete the metadata key/value pair indicated by the currently selected line, not by the key in the key entry widget. 2005-08-27 Bernhard Herzog * Sketch/UI/metapanel.py: Use a ListStore and TreeView instead of the deprecated CList. Use more modern Python (string methods instead of string module). Add doc-strings. 2005-08-20 Bernhard Herzog * Sketch/UI/skpanel.py (SketchPanel.__init__): Set the type hint to gtk.gdk.WINDOW_TYPE_HINT_NORMAL because panels are not really the same as dialogs. 2005-08-20 Bernhard Herzog * Sketch/UI/objectpanel.py (LineDashesMenu.build_options) (LineWidthMenu.build_options): More fixes because of deprecated pygtk APIs: gtk.create_pixmap -> gtk.gdk.Pixmap 2005-08-20 Bernhard Herzog * Sketch/UI/palette.py (SwatchWidget.get_motion_parameters) (SwatchWidget.Drag): Fix obvious typo (selg -> self) (SwatchWidget.RedrawMethod, SwatchTip.place): Explicitly convert some coordinates to int to avoid warnings when using them in gtk functions which expect ints not floats. 2005-08-20 Bernhard Herzog * Sketch/UI/gtkmisc.py (MessageBox.quit, message_box) (ModalDialogMixin.on_destroy, ModalDialogMixin.run): More fixes because of deprecated pygtk APIs: gtk.mainloop -> gtk.main, gtk.mainquit -> gtk.main_quit 2005-08-20 Bernhard Herzog * Sketch/UI/properties.py (StyleList.__init__): Use gtk.Image instead of gtk.Pixmap. Use a more modern python idiom (i.e. enumerate) to iterate of the titles. * Sketch/UI/mainwindow.py: Untabify 2005-08-14 Bernhard Herzog * Sketch/UI/fillpanel.py (FillPanel.build_window): Instead of using an OptionMenu (which is now deprecated in PyGTK) activate the tabs of the notebook we've been using already and use the new icons from Skencil 0.6 in the tabs. (FillPanel.set_pattern_type): Removed. it was a signal handler for the OptionMenu (FillPanel.page_switched): New. Signal handler for the notebook. (FillPanel.activate_frame): Only set the notebook page and update the sample when the active frame has actually changed to avoid endless recursion. Add a doc-string (FillPanel.update_sample): Add a doc-string. * Sketch/Pixmaps/fill_gradient.xpm, Sketch/Pixmaps/fill_hatch.xpm, Sketch/Pixmaps/fill_none.xpm, Sketch/Pixmaps/fill_solid.xpm, Sketch/Pixmaps/fill_tile.xpm: New. Icons for the fill panel. * Sketch/UI/skpixmaps.py (_pixmap_names): Add the new pixmaps 2005-08-14 Bernhard Herzog * Sketch/Editor/selection.py (Selection.GetInfo): Removed. It's not used anywhere anymore. (Selection.GetInfoCache, Selection._make_path_list): Renamed GetInfoCache to _make_path_list. The method shouldn't be public and now has a more descriptive name. Also, use a simpler implementation. (Selection.normalize): Deal with renaming of GetInfoCache. 2005-08-14 Bernhard Herzog Make the selection remember the list of last selected objects. Patch by Valentin Ungureanu (savannah patch #4283) * Sketch/Editor/selection.py (Selection): New lazy attribute "last_coord_rect" which is the coord_rect of the last selected objects. (Selection.normalize): Also normalize the list of last selected objects. (Selection.GetInfoCache): New. A version of Selection.GetInfo that also returns a cache. The purpose is to reuse this cache when normalizing the last_selected list. (Selection.SetSelection): Empty the last selected list. (Selection.Add): Set the last_selected list to the list of added objects. (Selection.Subtract): Also remove objects from the list of last selected objects. (Selection.GetLastSelected): Return the last selected objects as list. (Selection.update_last_coord_rect): Update the coord_rect of the last selected objects. * Sketch/Editor/doceditor.py (LastSelectedObjects): New. Return the last selected objects as list. 2005-08-13 Bernhard Herzog * Sketch/Editor/selection.py: Untabify + some more minor whitespace fixes 2005-08-07 Bernhard Herzog * Sketch/UI/fillpanel.py (InteractiveSample.__init__): Remove the instance variable center and choose a better initial value for current_pos. (SetCenter): Removed. (InteractiveSample._set_current_pos) (InteractiveSample.button_press) (InteractiveSample.motion_notify) (InteractiveSample.button_release): : Factor setting self.current_pos into a separate method (_set_current_pos) to reduce code duplication. Also, convert the coordinates to ints. In PyGTK the x and y attributes of events are floats now. (InteractiveSample.center_in_window_coordinates): New. Return the center of the current pattern in window coordinates. (InteractiveSample.constrain_center): Add a doc-string (InteractiveSample.draw_edit): Add doc-string. There's no need to convert the new center coordinates to int anymore. Use center_in_window_coordinates to get the center when drawing directions. (InteractiveSample.report_edit): Do not set self.center. Use center_in_window_coordinates to get the center when the direction was changed. (FillPanel.update_sample): No need anymore to set the center explicitly. Make the pattern sample take the center from the pattern. There's not need to set it separately. This also fixes a bug: The center was stored in window coordinates but it wasn't updated properly when the window was resized so that the direction vector would be drawn incorrectly. 2005-08-06 Bernhard Herzog * Sketch/UI/fillpanel.py (PatternSample, InteractiveSample): Add doc-strings 2005-07-31 Bernhard Herzog * Sketch/UI/skpixmaps.py (SketchPixmaps.InitFromWidget): Use gtk.gdk.pixmap_create_from_xpm instead of the deprecated gtk.create_pixmap_from_xpm 2005-07-31 Bernhard Herzog * Sketch/Modules/curveobject.c (curve_append_from_file): Allow any object as parameter. PyFile_GetLine can deal not only with real file objects, i.e. ones whose type is PyFile_Type, but any object which has a readline method. 2005-05-22 Bernhard Herzog * Sketch/Modules/_libartmodule.c (SKSVP_FromSKCurve): Use the newer libart rewind functions. This should get rid the numerical instabilities. Patch from Simon Budig. 2005-05-22 Bernhard Herzog Patch from Simon Budig: * Sketch/Modules/skrender.c (skrender_transform_image_32_trans): Remove unused variable * Sketch/Modules/curvelow.c: Add a missing include * Sketch/Modules/_sketchpublic.h, Sketch/Modules/_libartmodule.h: Use a comment in #endif lines. 2005-04-24 Bernhard Herzog * Sketch/Base/warn.py (_levels): Deactivate the bezier debug prints by default to make the test suite a bit quieter. 2005-04-24 Bernhard Herzog The PolyBezier commands. Savannah Patch #3693 (file #4469) by Valentin Ungureanu * Sketch/Editor/editbezier.py (PolyBezierEditor): Add methods used to set the sensitivity of the corresponding menu items. (PolyBezierEditor.CanSelectAllNodes, (PolyBezierEditor.CanOpenNodes, PolyBezierEditor.CanCloseNodes) (PolyBezierEditor.CanSetContinuity) (PolyBezierEditor.CanConvertSegments) (PolyBezierEditor.CanDeleteNodes) (PolyBezierEditor.CanInsertNodes): New methods. (PolyBezierEditor.CloseNodes): Now use CanCloseNodes to check. * Sketch/Editor/edittool.py: Added some PolyBezier commands present in Skencil 0.6: cont_angle, cont_smooth, cont_symmetrical, segments_to_lines, segments_to_curve, select_all_nodes, delete_nodes, insert_nodes, close_nodes, open_nodes. (EditToolInstance.CallObjectEditorMethod): New method, used to call methods from PolyBezierEditor. (check_polybezier_method, call_polybezier_method): New. Helpers for the commands related to PolyBeziers. * Sketch/Editor/context.py (Context): Add HANDLES to the forwarded channels. This is needed to trigger the sensitivity checks for the PolyBezier commands. * Sketch/Editor/__init__.py: Added the commands to standard_menu and standard_keystrokes. 2005-04-17 Bernhard Herzog Savannah Patch #3890 by Valentin Ungureanu: * Sketch/Editor/tools.py: Correct a bug where swithing the tool while creating an object generates an error and doesn't clear the canvas. (ToolInstance.End): Clear the canvas. (DrawToolInstance.ButtonRelease, FreehandToolInstance.ButtonRelease): Check whether end_edit_object returns an object or None. 2005-04-03 Bernhard Herzog * setup.py: Use libart2-config to determine the libart compile options. 2005-04-03 Bernhard Herzog Skencil requires PyGTK 2.4 now because of the following change: * Sketch/UI/canvas.py (SketchCanvas.set_window_cursor): In PyGTK 2.4 the cursor constants in gtk.gdk are not ints anymore, so we need to modify the check for the cursor type accordingly. Savannah Patch #3843 by Christof Ecker. 2005-04-03 Bernhard Herzog Savannah Patch #3746 by Valentin Ungureanu. Slightly modified by me (use GetObjects instead of accessing the objects attribute directly, and check the coordinates of the paths in the tests). * Sketch/Editor/doceditor.py: Added some commands from Skencil 0.6 related to curves: combine_beziers, split_beziers, convert_to_curve. The behavior of these commands is slightly changed, allowing them to be applied when the selection contains more than one object or other object types. (EditorWithSelection.CanCombineBeziers): New. Return true if the selection contains a least two objects that are curves or can be converted to curves. This is different from version 0.6, where the selection was required to contain only curves. (EditorWithSelection.CombineBeziers): New. Combines as many as possible of the selected objects into a single PolyBezier, first converting them to curves if necessary. The objects that are not curves and can not be converted to curves are simply kept in the selection. To preserve as much as possible of the status before the operation, the layer and stacking order of the resulted object will be those of the first object that will be combined. This is different from version 0.6, where the combined object was inserted into the active layer. (EditorWithSelection.CanSplitBeziers): New. Return true if the selection contains at least a PolyBezier which has more than one path. This is different from version 0.6, which only required that a single PolyBezier is selected and did not check its number of paths. (EditorWithSelection.SplitBeziers): New. Split the curves in the selection into paths. The objects that are not curves with more than one path are simply kept in the selection. (EditorWithSelection.CanConvertToCurve): New. Return true if the selection contains at least one object that can be converted to curves and is not already a Polybezier. This is different from version 0.6, which required that a single object is selected. (EditorWithSelection.ConvertToCurve): New. Convert as many as possible of the selected objects to PolyBeziers by replacing each of them with a curve containing the paths returned by the object's AsBezier method. The objects that can not be converted to curves are simply kept in the selection. * Sketch/Editor/__init__.py: Added the commands to standard_menu and standard_keystrokes. * test_doceditor.py: New tests for combine_beziers, split_beziers and convert_to_curve. (MockNonCurve): New. A minimal graphics object that is not a curve and cannot be converted to a curve. Used in the tests for commands that affect curve objects: combine, convert to curves, etc. This object is meant to be ignored by these commands, but still kept in the selection. It's the simplest placeholder for objects that are not curves, like groups, images or plugin objects that are not convertible to curves. (CurveCommandTest): New. Base class for the methods that affect curve objects: combine, convert to curves, etc. Used to make available a number of graphics objects ready to be inserted in the document. (CombineBeziersTest): New base class for combine_beziers tests. (TestCombineBeziersSimple, TestCombineBeziersComplex): New. (SplitBeziersTest): New base class for split_beziers tests. (TestSplitBeziersSimple, TestSplitBeziersComplex): New. (ConvertToCurveTest): New base class for convert_to_curve tests. (TestConvertToCurveSimple, TestConvertToCurveMultiple): New. 2005-02-06 Bernhard Herzog * Sketch/Editor/editbezier.py (PolyBezierEditor.ButtonDown): Convert to int properly to avoid a deprecation warning with Python 2.3. Savannah Patch #3692, by Valentin Ungureanu. 2005-02-06 Bernhard Herzog * Sketch/Editor/editbezier.py: Untabify 2005-01-15 Bernhard Herzog * Sketch/Editor/doceditor.py: Keep the selection normalized when objects are rearranged. This is not an ideal solution. See the commentsin the new object_changed method. (EditorWithSelection.subscribe_doc) (EditorWithSelection.unsubscribe_doc): (Un)subscribe to the document's OBJECT_CHANGED messages. (EditorWithSelection.object_changed): New. Subscribed to OBJECT_CHANGED. 2005-01-09 Bernhard Herzog * INSTALL: Skencil requires at leat gtk 2.2 now. 2005-01-09 Bernhard Herzog Add the history panel which shows the editing history of the current document. Savannah patch #3558 by Valentin Ungureanu. * Sketch/UI/historypanel.py: New. Implementation of the history panel. * Sketch/UI/toolbox.py (SketchToolbox.build_win_menu): Add the history panel to the Xtns menu. * Sketch/UI/skapp.py (history_panel, Command history_panel): New commandto open the history panel * Sketch/Editor/__init__.py (standard_menu): Add history panel to edit menu 2005-01-09 Bernhard Herzog The document has to send proper REDRAW messages when objects are rearranged with MoveObjectsToTop etc. * Sketch/Base/const.py (REARRANGED): New message channel * Sketch/Graphics/compound.py (EditableCompound._rearrange_children): Add parameter "affected_children" so that a REARRANGED message can be generated for them (EditableCompound.MoveObjectsToTop) (EditableCompound.MoveObjectsToBottom) (EditableCompound.MoveObjectsDown) (EditableCompound.MoveObjectsUp): Pass the affected children to _rearrange_children * Sketch/Graphics/maskgroup.py (MaskGroup._rearrange_children): Add the affected_children parameter here too. * Sketch/Graphics/document.py (EditDocument.object_changed): Handle REARRANGE message just like REMOVED and INSERTED. Add the bounding rects of all children separately instead of combining them. Having all the individual rects makes testing a bit easier. 2004-12-29 Bernhard Herzog * Sketch/Graphics/compound.py (Compound.move_objects_to_top): Removed this dummy implemetation of a now unused method. 2004-11-28 Bernhard Herzog * Sketch/Graphics/compound.py (Compound.GetObjectHandle): Call the children's GetObjectHandle with multiple = True as originally intended 2004-11-28 Bernhard Herzog * Sketch/Graphics/compound.py (Compound.GetObjectHandle): Reimplement without using self.ForAll (Compound.ForAll): Removed. It's not used anywhere (anymore) (Compound.FilterAll): Revmoed. It wasn't used. 2004-11-28 Bernhard Herzog * Sketch/Modules/skpoint.c: The coercion of SKPoint objects interferes with comparisons. point == list raises a misleading exception instead of simply giving False. Since the coercion is a kludge, is only needed for Python < 2.1 and we can now assume that we always have at least Python 2.2, we can simply remove all code only required for earlier versions: (USE_NEWSTYLE_NUMBERS): This flag would always be true when compiling skpoint.c for Python > 2.1, so I removed it and all parts of the code only compiled when it was false. (skpoint_coerce): Removed. Coercion is not needed with Py_TPFLAGS_CHECKTYPES in SKPointType which is always used now. (skpoint_as_number): The slot for coercion is 0 now. 2004-11-27 Bernhard Herzog * Sketch/Graphics/pattern.py (HatchingPattern.Execute): Make sure steps is an int so that it's OK as an argument for range (silences a DeprecationWarning) 2004-11-27 Bernhard Herzog * Sketch/UI/reload.py (ReloadPanel): Use a TreeView/TreeStore instead of the now deprecated CTree and few more updates for gtk 2.x. Scrolling works better now. Slightly modified patch by Bernhard Reiter 2004-11-19 Bernhard Herzog * Sketch/Editor/document.py: Remove some obsolete imports * Sketch/Graphics/blendgroup.py: Remove some obsolete imports * Sketch/Graphics/compound.py: Remove some obsolete imports 2004-11-18 Bernhard Herzog * Sketch/Graphics/document.py (EditDocument.add_guide_line): The layer's Insert method only returns undo info. (EditDocument.RemoveGuideLine): Go directly to the guide line's parent to remove the guide line. Now the remove_objects method which is erroneously only implemented in a derived class is unused. * Sketch/Editor/document.py (InteractiveDocument.remove_objects): Removed. It's unused now. 2004-11-18 Bernhard Herzog * Sketch/Graphics/document.py (EditDocument.as_group): Untabify 2004-11-18 Bernhard Herzog * Sketch/Graphics/compound.py (EditableCompound.RemoveObjects): Add a doc-string. 2004-11-18 Bernhard Herzog * Sketch/Graphics/compound.py (EditableCompound.DuplicateObjects): Make it faster. 2004-11-18 Bernhard Herzog Remove the permute_objects method from the compounds that have it. It's job is now effectively done by _rearrange_children. * Sketch/Graphics/compound.py (EditableCompound.permute_objects): Removed. * Sketch/Graphics/maskgroup.py (MaskGroup.permute_objects): Removed. * Sketch/Graphics/blendgroup.py (BlendGroup.permute_objects): Removed. It wasn't even used before this method became obsolete in EditableCompound because BlendGroup isn't derived from EditableCompound. 2004-11-18 Bernhard Herzog Performace improvements: * Sketch/Graphics/compound.py (EditableCompound._object_id_set) (EditableCompound._rearrange_children): New. Helper methods to improve performance. See their doc-strings for details of what they do. (EditableCompound.RemoveObjects) (EditableCompound.MoveObjectsToTop) (EditableCompound.MoveObjectsToBottom) (EditableCompound.MoveObjectsDown) (EditableCompound.MoveObjectsUp): Rework these methods to make them faster. * Sketch/Graphics/maskgroup.py (MaskGroup._rearrange_children): New. Override the inherited method to make sure the mask stays at the bottom. 2004-11-18 Bernhard Herzog * Sketch/Graphics/maskgroup.py: untabify 2004-11-18 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection.RemoveSelected): Implement removal in the same way as MoveObjectsToTop, etc, by directly going to the parents of the selected objects. * Sketch/Graphics/compound.py (EditableCompound.RemoveObjects): Make the parameter a simple list of objects. The implementation has become a lot simpler. * Sketch/Graphics/blendgroup.py (BlendGroup.RemoveObjects): The parameter is now a simple list of objects. Implementation is now almost the same as EditableCompound.RemoveObjects. (BlendGroup.remove): Set the removed object's document to None 2004-11-17 Bernhard Herzog * Sketch/Graphics/compound.py (EditableCompound.MoveObjectsToTop) (EditableCompound.MoveObjectsToBottom) (EditableCompound.MoveObjectsDown) (EditableCompound.MoveObjectsUp): The permutation can be determined completely before any changes are made and all changes happend in self.permute_objects. So there is no need to deal with undo at all outside of permute_objects. We can simply and immediately return its return value. The begin_change_children and end_change_children are not necessary for these methods and have been removed. 2004-11-17 Bernhard Herzog Implement the "move_to_top" and "move_to_bottom" commands * Sketch/Editor/doceditor.py (EditorWithSelection.selection_grouped_by_parent): Make sure that each parent of a selected object occurs only once. See the comments and the now extended doc-string for more details. (EditorWithSelection.MoveSelectedToTop) (EditorWithSelection.MoveSelectedToBottom): New. Editor level implementation of the new commands. (move_to_top command, move_to_bottom command): New. * Sketch/Graphics/compound.py (EditableCompound.MoveObjectsToTop) (EditableCompound.MoveObjectsToBottom): The parameter is now simply a list of objects just like in the new versions of other rearrangement methods. Add a doc-string (EditableCompound.move_objects_to_top): Removed. No longer needed. 2004-11-16 Bernhard Herzog Turn the message about whether "intl" was imported into a pdebug call. * Sketch/__init__.py: Import Base.warn (and thus also Base itself) before the gettext imports so that we can use the debug print facilities. Use pdebug to print the messages about whether the gettext stuff was imported. Also, change the message to use "gettext" instead of "intl" * Sketch/Base/undo.py: Do import _ directly. (UndoRedo.UndoText, UndoRedo.RedoText): Access _ explicitly through Sketch. This change is necessary so that Base can be imported early in Sketch/__init__.py. * Sketch/Base/warn.py (_levels): New level "i18n". off by default 2004-11-16 Bernhard Herzog Implement the "move_one_up" and "move_one_down" commands * Sketch/Graphics/compound.py (Compound.MoveObjectsToTop): Change parameter name to reflect new meaning (EditableCompound.MoveObjectsDown) (EditableCompound.MoveObjectsUp): Parameter is a simple list of objects new just as in the recent change in DuplicateObjects. * Sketch/Editor/doceditor.py (EditorWithSelection.MoveSelectedUp) (EditorWithSelection.MoveSelectedDown): New. Editor level implementation of the new commands. (move_one_up command, move_one_down command): New. 2004-11-16 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection.DuplicateSelected): Remove a superfluous line. 2004-11-15 Bernhard Herzog Implement the Edit/Duplicate command * Sketch/Editor/__init__.py (standard_keystrokes): Add keystroke for "duplicate" * Sketch/Editor/doceditor.py (duplicate command): New. (EditorWithSelection.DuplicateSelected): New. Duplicate all selected objects. (EditorWithSelection.selection_grouped_by_parent): New. Helper method useful for DuplicateSelected and probably some other features such as MoveToTop etc. as well. * Sketch/Graphics/compound.py (EditableCompound.DuplicateObjects): Remove holdovers from old selection management: change meaning of the parameter specifying which objects to duplicate. Instead of an "infolist" it's now simply a list of objects. Analogous change in the return value. Also the offset parameter has been removed. The duplicated objects can be moved by caller afterwards if desired. Add a doc-string. (Compound.DuplicateObjects): Update parameter name to better fit the new interface and remove the offset parameter. See EditableCompound. * Sketch/Graphics/blendgroup.py (BlendGroup.DuplicateObjects): Update parameter name and remove the offset parameter. Extend the comment about insertion into parent. 2004-11-13 Bernhard Herzog * Sketch/UI/gtkmisc.py (ColorButton.choose_color): Handle case where the user cancels the dialog 2004-11-13 Bernhard Herzog * Sketch/Graphics/blendgroup.py: Untabify 2004-11-13 Bernhard Herzog * Sketch/Base/warn.py (_levels): Disable debug output for __del__. It's annoying in the test suite. 2004-11-12 Bernhard Herzog * Sketch/Graphics/compound.py: Untabify 2004-11-10 Bernhard Herzog * setup.py (imaging_incdirs): New manual config variable to define the include directories for the PIL header files. Reference this list in the extensions that need it. 2004-10-29 Bernhard Reiter savannah patch #3466: * Sketch/UI/skapp.py (SketchApplication.Exit): gtk.main_quit(), because mainquit() is deprecated (SketchApplication.Run): gtk.main() instead of deprecated main_loop(). 2004-10-29 Bernhard Herzog * Sketch/UI/skapp.py: Untabify 2004-07-17 Bernhard Herzog * Sketch/Lib/dscparser.py (skip_to_comment): Savannah Patch #3134. Convert numbers in BeginData comments correctly. Patch by Bernhard Reiter 2004-07-17 Bernhard Herzog * Sketch/Lib/dscparser.py: untabify 2004-06-13 Bernhard Herzog * Examples/translucent.sk: Add example for translucent uniform fills 2004-06-13 Bernhard Herzog * Sketch/Editor/texttool.py (TextToolInstance.End): A tool's End method mustn't have the context parameter anymore. Forgot to change this method accordingly on 2004-03-21 2004-06-12 Bernhard Herzog * Sketch/Graphics/font.py (Font.__del__): Avoid attribute errors in the __del__ method of Font objects. The font_cache may already be None when __del__ is called. Reported by Antoon Pardon. Ported from 0.6.x 2004-06-12 Bernhard Herzog * Sketch/Modules/regionobject.c (SKRegion_UnionWithRegion): Remove unused variable 2004-06-05 Bernhard Herzog * README: Sketch->Skencil renaming. Web-site is now skencil.org * INSTALL: Sketch->Skencil renaming. Adapt the instructions to the new setup script. Remove outdated sections. Update the versions of the required dependencies 2004-06-05 Bernhard Herzog Superficial Sketch->Skencil renaming * po/Makefile (DOMAIN, POPACKAGE): sketch -> skencil * sketch.py, skencil.py: Renamed sketch.py to skencil.py. * setup.py: Sketch->Skencil in messages, and various parameters of he setup call, such as the name of the script and the install directories * MANIFEST.in: sketch.py -> skencil.py * Sketch/UI/toolbox.py (SketchToolbox.build_window): Window title: Sketch->Skencil * Sketch/UI/__init__.py (_usage, _version): Sketch->Skencil * Sketch/Graphics/psdevice.py (PostScriptDevice.__init__): Sketch->Skencil in the Creator DSC comment. * Sketch/UI/gtkmisc.py, Sketch/Graphics/properties.py, Sketch/Graphics/pattern.py: Sketch->Skencil in comments and doc-strings * Sketch/Base/config.py (name, sketch_command): Sketch->Skencil * Sketch/Base/configutil.py (Preferences._save): Sketch->Skencil in the comment at the beginning of the prefs file 2004-06-05 Bernhard Herzog * dsetup.py: Removed. It's functionality is now in setup.py * setup.py: Make this a copy of dsetup.py. ditutils based building is now the default. * MANIFEST.in: New. defines which files to distribute with distutils 2004-06-02 Bernhard Herzog * Sketch/Base/undodict.py: Untabify * Sketch/Base/skexceptions.py: Untabify. * Sketch/Base/configutil.py: Untabify. * Sketch/Base/config.py: Untabify. 2004-05-31 Bernhard Herzog * Sketch/Base/undo.py (UndoRedo.Reset): Implement correctly. 2004-05-31 Bernhard Herzog * Sketch/Base/undo.py: Untabify 2004-05-30 Bernhard Herzog Two connector fixes ported from Thuban: * Sketch/Base/connector.py (Connector.Issue): Iterate over a copy of the receivers list so that unsubscribing in a receiver doesn't modify it while iterating over it. (Publisher): Introduce a new flag, _was_destroyed, to indicate whether an publisher instance has already been destroyed. (Publisher.Unsubscribe): Only disconnect if the publisher has not been destroyed yet. (Publisher.Destroy): Set the _was_destroyed flag to true. 2004-05-30 Bernhard Herzog * Sketch/Base/connector.py: Add some comments. (Subscribe): Add doc-string 2004-05-30 Bernhard Herzog * Sketch/__init__.py (Unsubscribe): New. Unsubscribe from subscriptions done with Sketch.Subscribe * Sketch/Base/connector.py: Untabify * Sketch/Base/warn.py: Untabify, add doc-strings 2004-05-22 Bernhard Herzog * Sketch/Graphics/arrow.py (Arrow.BoundingRect): Handle ValueError raise by atan2 on some platforms 2004-05-20 Bernhard Herzog * CREDITS: Add some names already added to the CREDITS of 0.6.x * Sketch/UI/gtkdevice.py (SimpleGC.FillPolygon): Add a missing parameter to the draw_polygon call. Patch by Valentin Ungureanu 2004-05-20 Bernhard Herzog * Sketch/UI/gtkdevice.py (PatternDevice.TileImage): Remove debug print 2004-05-20 Bernhard Herzog * Sketch/UI/gtkdevice.py (GCDevice.InitClip): Remove the return that made this method effectively a no-op. It isn't necessary. I can't remember why I put it there :( 2004-05-15 Bernhard Herzog * Sketch/Modules/clipmask.c (mask_intersect_regions): Don't modify the input regions in place. Return a new region with the result. (SKClipMask_Intersect): Update to reflect the change in the return parameter of mask_intersect_regions 2004-03-27 Bernhard Herzog * Sketch/Graphics/arrow.py: untabify 2004-03-21 Bernhard Herzog Tool interface change: The End method no longer requires an argument. Tools keep track of which canvas the were used with last, in case they need to know when End is called. Fixes Savannah Bugs #3760 and #3918. * Sketch/Editor/tools.py: untabify (ToolInstance.__init__): Keep track of which canvas was used in ButtonPress or ButtonClick with the new instance variable canvas (ToolInstance.ButtonPress, ToolInstance.ButtonClick): Remember which canvas was used. (ToolInstance.PointerMotion, ToolInstance.ButtonRelease) (ToolInstance.stop_edit): Check whether the canvas is the correct one (ToolInstance.End): Remove the context parameter. Reset self.canvas (ZoomToolInstance.ButtonPress, ZoomToolInstance.ButtonRelease) (ZoomToolInstance.ButtonClick, DrawToolInstance.ButtonPress) (DrawToolInstance.ButtonRelease) (FreehandToolInstance.ButtonRelease): Call the base class method too since it now does something useful (DrawToolInstance.ButtonClick, FreehandToolInstance.ButtonClick): Removed so as not to block the base class version. This ButtonClick method should probably never have existed in the first place. (PolyDrawToolInstance): Derive from ToolInstance directly and not via DrawToolInstance. We would have to bypass all functionality of DrawToolInstance anyway. (PolyDrawToolInstance.__init__): Adapt to inheritance change. Store object_class like DrawToolInstance would have done. (PolyDrawToolInstance.ButtonPress): Call the base class method too since it now does something useful (PolyDrawToolInstance.ButtonRelease): Call the base class method too since it now does something useful. Adapt to finish() change. (PolyDrawToolInstance.finish): Remove the context parameter. Use self.canvas instead. Removed the self.original_class stuff since it wasn't actually used. (PolyDrawToolInstance.End): Remove the context parameter. * Sketch/Editor/selectiontool.py (SelectionToolInstance.End): Remove the context parameter * Sketch/Editor/edittool.py (EditToolInstance.End): Remove the context parameter * Sketch/Editor/doceditor.py (EditorWithSelection.SetTool): The tool's End methods don't have parameters anymore 2004-03-20 Bernhard Herzog * Sketch/Editor/selectiontool.py: untabify * Sketch/Editor/tools.py: untabify 2004-03-13 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.EndDraw): Import _skgtk only in this method to make the whole module less dependend on gtk. 2004-02-01 Bernhard Herzog Some more Python 2.3 and PyGTK 2 fixes * setup.py (convert): Use pure ascii strings * Sketch/Editor/selection.py (Selection.path_for_object): Do not use None as argument name. * Sketch/UI/gtkdevice.py (InvertingDevice.init_gc): Python 2.3 warns about literals like 0xFFFFFFFF because their interpretation will chagne in the future. We only need an int with all bits set, so we use ~0 instead. * Sketch/UI/fillpanel.py (InteractiveSample.init_gcs): Another 0xFFFFFFFF fix (InteractiveSample.draw_edit): Convert coordinates explicitly to int to avoid warnings in Python 2.3 * Sketch/UI/gtkmisc.py (ColorDialog.__init__, _gtk_colors): Conver the acmap.alloc_color arguments to int explicitly to avoid warnings with Python 2.3 * Sketch/Modules/_libartmodule.c (convert_color, set_opacity): Two new functions to handle convert to and manipulate libart colors which are 32 bit ints. Doing this in C avoids Python warnings. * Sketch/UI/libartdevice.py (LibartDevice.convert_color) (LibartDevice._set_opacity): Use the new functions to hande the color coinversions * Sketch/UI/toolbox.py (FreeHandOptions.__init__): PyGTK 2 Fix: the SpinButton's adj kw-arg is now called adjustment. * Sketch/Graphics/document.py (SketchDocument.__del__): Handle case where no filename is available for the document when printing debug info 2004-01-04 Bernhard Herzog First step towards real fill opacity * Sketch/UI/libartdevice.py (MinimalDevice.SetFillOpacity) (MinimalDevice.SetLineOpacity): New. The methods to set fill/line opacity (LibartDevice.__init__): New instance variable opacity. Initially 1.0 (LibartDevice.convert_color): Honor opacity (LibartDevice.SetLineColor): Always set opacity to 1.0 for lines (LibartDevice.SetFillOpacity, LibartDevice.SetLineOpacity): New methods to set opacity (LibartDevice._set_opacity): New. Actual implementation of SetFillOpacity and SetLineOpacity (LibartDevice.export_image): New. Save the rendered image for test/debug purposes * Sketch/Graphics/properties.py: New property fill_opacity (PropertyStack.ExecuteFill): Set the fill opacity before executing the pattern (PropertyStack.ExecuteLine): Explicitly set the line opacity to 1.0. For now there's no actual line opacity * Sketch/UI/fillpanel.py (FillPanel.build_window): Add the opacity spin button (FillPanel.context_changed): Set the opacity spin button's value from the fill_opacity (FillPanel.do_apply): Set the fill_opacity too * Sketch/Graphics/psdevice.py (PostScriptDevice.SetFillOpacity) (PostScriptDevice.SetLineOpacity): New. No-op implementations of the opacity setters * Sketch/UI/gtkdevice.py (SimpleGC.SetFillOpacity) (SimpleGC.SetLineOpacity): New. No-op implementations of the opacity setters 2003-12-21 Bernhard Herzog * Sketch/Graphics/psdevice.py: Untabify, minor reformatting * Sketch/UI/gtkdevice.py: Untabify, minor reformatting, remove some of the old commented out code * Sketch/UI/libartdevice.py: Untabify, minor reformatting, remove some of the old commented out code * Sketch/UI/fillpanel.py: Minor reformatting 2003-11-26 Bernhard Herzog * w32setup.py: Fonts were missing, a path was wrong, moved closer to dsetup.py. Savannah Patch #2356, by Joonas Paalasmaa 2003-11-26 Bernhard Herzog * Sketch/Modules/regionobject.c (SKRegion_PyFromPolygon): The GdkPoint members are gints now (they used to be shorts in gtk 1.2), so use the correct format char for ParseTuple. Fixes Savannah Bug #6740 Also, decref the list item properly. 2003-11-20 Bernhard Herzog * dsetup.py: New. Another distutils setup script. This one for Unix-like systems. 2003-11-20 Bernhard Herzog Add support for building Sketch on windows platforms. Contributed by Joonas Paalasmaa * w32/sketch_postinstall.py: wininst postinstall script * INSTALL-w32.txt: New. Build and install instructions for Windows * INSTALL: Refer to INSTALL-w32.txt for windows builds * w32setup.py: New. distutils script for windows builds * setup.cfg: New. config for distutils * sketch.py: Add PATH fiddling for GTK under windows 2003-10-25 Bernhard Herzog * Sketch/Modules/skvisual.c (skvisual_dealloc): Use the correct function to free the instance. Patch by Antoon Pardon. 2003-10-25 Bernhard Herzog Make Sketch compile on MSW platforms. Patch by Joonas Paalasmaa. * Sketch/Modules/skvisual.c, Sketch/Modules/sktrafo.c, Sketch/Modules/skrect.c, Sketch/Modules/skpoint.c, Sketch/Modules/skfm.c, Sketch/Modules/skcolor.c, Sketch/Modules/skaux.c, Sketch/Modules/regionobject.c, Sketch/Modules/imageobject.c, Sketch/Modules/curveobject.c: Initialize the ob_type fields of custom type objects with NULL. It will be filled in later by the appropriate module init function. * Sketch/Modules/pstokenize.c (initpstokenize): Initialize the ob_type field of PSTokenizerType which is initially NULL now * Sketch/Modules/_skgtkmodule.c (init_skgtk): Initialize the ob_type fields of all custom type objects from the _skgtk module * Sketch/Modules/_sketchmodule.c (init_sketch): Initialize the ob_type fields of all custom type objects from the _sketch module. * Sketch/Modules/skvisual.c (skvisual_fill_tile): The member mem of GdkImage is a void pointer so we have to cast it to (unsigned char*) before using it. * Sketch/Modules/skgtkimage.c (image_scale_rgb_16) (image_scale_rgb_24, image_scale_rgb_8, image_scale_gray_16) (image_scale_gray_24, image_scale_gray_8, image_trafo_rgb_16) (image_trafo_rgb_24, image_trafo_rgb_8, image_trafo_gray_16) (image_trafo_gray_24, image_trafo_gray_8): The member mem of GdkImage is a void pointer so we have to cast it to (unsigned char*) before using it. * Sketch/Modules/skfm.h, Sketch/Modules/skfm.c: Move the extern SKFontMetricType declaration to skfm.h * Sketch/Modules/skaux.h, Sketch/Modules/skaux.c: Move the extern SKCacheType to skaux.h * Sketch/Modules/_libartmodule.c (init_libart, custom types): Defer initialization the ob_type fields of or custom types until init_libart is run. 2003-10-25 Bernhard Herzog * Sketch/Lib/type1.py (read_subrs): Handle case of no subrs. (CharStringInterpreter.start_flex) (CharStringInterpreter.end_flex): Remove debug prints (CharStringInterpreter.callsubr): Do the default subr processing only when none of the special cases applies. This fixes a bug in the way the flex feature was handled. 2003-10-25 Bernhard Herzog * Sketch/Lib/type1.py: Untabify 2003-10-11 Bernhard Herzog * Sketch/Plugin/load.py (LoaderWithComposites.end_composite): Allow plugin objects to be empty containers and ignore empty them if they're empty. (LoaderWithComposites.check_object): For plugin objects also check whether they're not empty. Add doc-string 2003-10-10 Bernhard Herzog * Sketch/Modules/regionobject.c (region_dealloc): Use a function to free the object that matches the PyObject_NEW * Sketch/Modules/_skgtkmodule.c (skgtk_set_foreground_and_fill): The real gc is gc_object->obj 2003-05-15 Bernhard Herzog * Sketch/Graphics/psdevice.py (PostScriptDevice.DrawGrid): New. This method does nothing but it might be called by e.g. the sktops.py script when drawing all visible layers and the grid layer is visible. 2003-03-15 Bernhard Herzog * Sketch/Graphics/pattern.py: Untabify and add lots of doc-strings. (ImageTilePattern.Transformed): Behave as in 0.6 and take self.trafo into account. * Sketch/Modules/curveobject.c (curve_append_from_file): Handle lines following the bezier curve description that have more than 500 chars. Based on a patch by Andy Thaller. 2003-03-01 Bernhard Herzog * Sketch/UI/converters.py (angle_format): Turn this format string into a unicode string so that GTK displays the degree symbol properly and Python 2.3 won't complain about the non-ascii character. * Sketch/UI/menu.py (SketchMenuCommand): Derive from gtk.ImageMenuItem to allow stock items. (SketchMenuCommand.__init__): New parameter stock_id with the id of the stock item to use. Get rid of the label instance variable as we can easily get the label through get_child. (SketchMenuItem.changed): There is not label instance variable anymore. Simply go through get_child to get the label (make_menu): Check whether a stock item exists for the command and pass its id to SketchMenuCommand (stock_item_map): New. Mapping from command names to stock_ids * Sketch/UI/gtkmisc.py (MessageBox.__init__, MessageBox.quit): PyGTK2 updates 2003-02-23 Bernhard Herzog * Sketch/UI/gtkmisc.py (SketchDrawingArea.focus_in_event) (SketchDrawingArea.focus_out_event): Two new event handlers to override the default behavior to avoid unnecessary redraws. (SketchDrawingArea.bind_events): Bind the new handlers. 2003-02-22 Bernhard Herzog * sketch.py: Enable the code that chooses the pygtk version. * Sketch/UI/libartdevice.py (LibartDevice.drawable_size): Use the get_size method which is implemented by all drawables * Sketch/UI/metapanel.py (MetaDataPanel.build_window), Sketch/UI/msgpanel.py (MessagePanel.build_window): Remove setting the width * Sketch/UI/objectpanel.py (PixmapMenu.build_options) (ArrowMenu.build_options, LineDashesMenu.build_options): Use gtk.Image instead of gtk.Pixmap (LineDashesMenu.build_options, LineWidthMenu.build_options): Use get_size instead of the width attribute (LineWidthMenu.build_options): Use gtk.Image instead of gtk.Pixmap and set_size_request instead set_usize (LinePropertiesFrame.on_auto_update, LinePropertiesFrame.on_none): Use get_active instead of the active attribute (LinePropertiesFrame.on_add, LinePropertiesFrame.on_width) (LinePropertiesFrame.on_units) (LinePropertiesFrame.extract_properties): Use get_value instead of get_value_as_float (ObjectPanel.build_menu): Use get_children instead of children. Comment out the accelgroup calls because they are not wrapped in PyGTK2. Remove the hidden buttons as they're not necessary. (ObjectPanel.build_window): The hidden buttons are removed now. (ObjectPropertiesFrame.build_menu, ObjectPanel.build_menu): Keep a reference to the itemfactory around. Otherwise it will be collected and the menu will be empty * Sketch/UI/palette.py (SwatchWidget.__init__): Use set_size_request instead set_usize (SwatchWidget.compute_trafo): Use get_size instead of the width attribute (SwatchWidget.layout): In PyGTK2 the window isntance variable always exists so we have to check whether it's None (SwatchWidget.render): Only render if the gcs have been initialized. The pixmap constructor has changed in PyGTK2 (SwatchWidget.RedrawMethod): Use gc methods to draw (SwatchSample.RedrawMethod): In PyGTK2 the window isntance variable always exists so we have to check whether it's None (SwatchTip.__init__): Can't assign to self.parent in PyGTK2 (SwatchTip.build_window): Generic PyGTK2 changes (set_resizable, set_size_request. Can't assign to frame in PyGTK2 (SwatchTip.Pointer): Generic PyGTK2 changes (get_origin) (SwatchTip.show, SwatchTip.popup, SwatchTip.set_clock): rename show to popup to avoid conflicts with the inherited show method and the popup method. Update the reference in set_clock (SwatchTip.place): generic PyGTK2 changes (SwatchFrame.__init__, SwatchFrame.key_press) (SwatchFrame.key_release, SwatchFrame.on_event): Can't use state as instance variable so rename it to _state (SwatchFrame.__init__, SwatchFrame.add): can't assign to child but the child attribute already does what we need (PaletteFrame.__init__, SolidPaletteFrame.__init__): can't assign to child (PalettePanel.__init__, PalettePanel.build_palettes): generic PyGTK2 changes (PalettePanel.set_title): Can't assign to title so use _title instead * Sketch/UI/reload.py (ReloadPanel.build_window): Use set_size_request (ReloadPanel.update_list, ReloadPanel.do_reload): untabify * Sketch/UI/scratchpad.py (ScratchPad._new_pixmap): The pixmap constructor has changed in PyGTK2 2003-02-13 Bernhard Herzog More PyGTK 2 and GTK 2 changes * Sketch/UI/fillpanel.py (FillPanel.build_window): Use set_size_request instead of size (FillPanel.activate_frame): Use set_current_page instead of set_page (SolidPatternFrame.ChooseColor): get_result now returns an RGBColor object, not a tuple. * Sketch/UI/gtkmisc.py: Use alloc_color instead of alloc (ColorButton.SetColor): Use get_children instead of children (ColorDialog.__init__, ColorDialog.get_result): Use the get/set_current_color methods and convert from RGBColor objects to and from gdk color objects. get_result now returns an RGBColor object, not a tuple. (ColorButton.ColorButton.choose_color): get_result now returns an RGBColor object, not a tuple. * Sketch/UI/scratchpad.py (ScratchPad._new_pixmap): * Sketch/UI/properties.py (PropertyPanel.build_window): Generic pygtk 0.6/2.0 naming changes * Sketch/UI/skapp.py (SketchApplication.load_file_dialog): hide doesn't accept arguments anymore so can't be used directly as the callback. Use a lambda instead. * Sketch/UI/skpanel.py (SketchPanel.__init__): Remove the set_policy call. It's not needed. * Sketch/UI/tree.py (TreeViewPanel.build_window): Remove setting the width. self.destroy doesn't accept arguments anymore so can't be used directly as the callback. Use a lambda instead. (SketchTree.selection_changed): get_selectable works now. 2003-02-11 Bernhard Herzog First chunk of changes to move to PyGTK 2 and GTK 2 * Sketch/Modules/_skgtkmodule.c * Sketch/Modules/_skgtkmodule.h: * Sketch/Modules/clipmask.c: * Sketch/Modules/curvedraw.c: * Sketch/Modules/imageobject.c: * Sketch/Modules/regionobject.c: * Sketch/Modules/skgtkimage.c: * Sketch/Modules/skvisual.c: * Sketch/UI/__init__.py: * Sketch/UI/canvas.py: * Sketch/UI/cursors.py: * Sketch/UI/fillpanel.py: * Sketch/UI/gtkdevice.py: * Sketch/UI/gtkmisc.py: * Sketch/UI/libartdevice.py: * Sketch/UI/mainwindow.py: * Sketch/UI/menu.py: * Sketch/UI/metapanel.py: * Sketch/UI/msgpanel.py: * Sketch/UI/objectpanel.py: * Sketch/UI/palette.py: * Sketch/UI/poslabel.py: * Sketch/UI/properties.py: * Sketch/UI/reload.py: * Sketch/UI/skapp.py: * Sketch/UI/skpanel.py: * Sketch/UI/skpixmaps.py: * Sketch/UI/toolbox.py: * Sketch/UI/tree.py: * Sketch/UI/view.py: * Sketch/UI/viewport.py: Changes for GTK2/PyGTK1.99. These are mostly mechanical changes due to the naming differences between pygtk 0.6 and pygtk 2 or other differences in the interface of the objets. * sketch.py: Remove the now outdated python version test. * setup.py (find_config): Use pkg-config instead of gtk-config and use it to determine pygtk config as well. * Sketch/UI/__init__.py (_process_args): New option --sync * Sketch/UI/canvas.py: (SketchCanvas.motion_notify): Handle Motion hints correctly. Remove the event loop and the 'recursive' flag. It's not needed on fast enough machines. 2003-02-07 Bernhard Herzog * NEWS: Updates for 0.7.12 * Sketch/VERSION: 0.7.12 * Examples/translucent.sk, Examples/fade.png: New. Example drawing for translucency effects and corresponding raster image. 2003-01-25 Bernhard Herzog * Sketch/Editor/doceditor.py: Untabify. Add lots of doc-strings and comments. (EditorWithSelection.__init__): Remove the unsued snap_move_relative instance variable. (EditorWithSelection.SetTool): Remove the context parameter (which should have been called canvas in the first place). It doesn't make sense in the current architecture where the editor is not bound to one particular canvas * Sketch/UI/canvas.py (SketchCanvas.SetTool): The editor's SetTool method doesn't need the canvas parameter any more. 2003-01-16 Bernhard Herzog * Sketch/Lib/util.py (rx_format): Correct the regexp to allow one character names. 2003-01-16 Bernhard Herzog * Sketch/Lib/util.py (rx_format): Change regexp to allow digits in keys and converter names 2003-01-12 Bernhard Herzog * Sketch/Editor/selection.py (Selection.Subtract): Remove debug print (Selection.InfoText): Insert the layer name for single objects too. Add doc-string. * Sketch/UI/gtkdevice.py (InvertingDevice.DrawPixmapHandle): Untabify. Add doc-string. Allow a string as pixmap parameter so that code in Sketch.Editor doesn't have to import a module from Sketch.UI * Sketch/Editor/selectiontool.py (TrafoRectangle.DrawDragged): Pass the name of the Center pixmap instead of the pixmap itself to DrawPixmapHandle. No need to import Sketch.UI.skpixmaps anymore 2003-01-05 Bernhard Herzog * Sketch/Graphics/properties.py: Untabify. Add lots of doc-strings and comments. 2002-12-15 Bernhard Herzog Part of David Boddie's transparency support * Sketch/Modules/skrender.h (SKPixbuf): New member has_alpha. * Sketch/Modules/skrender.c (BLEND_SRC_ALPHA): New macro to help with the alpha blending code. (skrender_scale_image_run_alpha_trans): New helper function to render scaled raster images with alpha component. (skrender_transform_image_run_alpha_trans): New helper function to render transformed raster images with alpha component. (skrender_scale_image_svp_alpha): Handle source image with alpha channel (skrender_scale_image_32_trans): New function to render transformed images with alpha channel (skrender_scale_image): Handle source image with alpha channel. (skrender_transform_image_32_trans): New function to render a transformed image with alpha channel (skrender_transform_image): Handle source images with alpha channel * Sketch/Modules/_libartmodule.c (SKArtPixBuf_FromArtPixBuf): Copy has_alpha too. (convert_image_or_pixbuf): Initialize has_alpha too. (sksvp_render_rgb): Remove an unused variable. (sksvp_render_scaled_image, sksvp_render_transformed_image): Use convert_image_or_pixbuf for the source image too. (skpixbuf_export_pixbuf): New function to make it easier to save the rendered image for debug purposes. 2002-11-18 Bernhard Herzog * Sketch/Modules/Makefile.pre.in: Remove @DEFS@ as it causes problems with current CVS Python and isn't needed anyway. * Sketch/Modules/pstokenize.c (read_name_or_number): Handle a number at the end of stream correctly. Add comments. 2002-11-01 Bernhard Herzog * Sketch/Lib/util.py (xbm_string): Removed because it's not used anywhere (rx_format): Remove the redundant version of this regular expression object (format): Add doc-string 2002-09-14 Bernhard Herzog * NEWS: Update for 0.7.11 * Sketch/VERSION: 0.7.11 2002-08-02 Bernhard Herzog * Sketch/Graphics/psdevice.py (PostScriptDevice.__init__) (PostScriptDevice.handle_writes_to_embedded_eps) (PostScriptDevice.DrawEps): Handle the case where we write into an EPS file referenced by the drawing we're saving. 2002-08-01 Bernhard Herzog * NEWS: Update for 0.7.10 * Sketch/VERSION: 0.7.10 * CREDITS: Add some more contributors * README (Contact): Update the mailing list information. Add the devel mailing list at savannah. (Limitations): Removed this section as it was quite outdated * Sketch/Graphics/guide.py: untabify (GuideLine.Info): Implement this. Needed for the tree view. 2002-08-01 Bernhard Herzog All changes contributed by Mark Rose : * Sketch/UI/read_palette.py: New. Code for reading color palettes. * Sketch/UI/objectpanel.py: New. A new object property dialog * Sketch/UI/palette.py: New. Palette widgets and dialogs * Sketch/UI/scratchpad.py: New. Class to render into pixmaps. * Sketch/UI/toolbox.py (SketchToolbox.build_win_menu): Add the palette and object panels. * Sketch/UI/skapp.py (palette_panel, object_panel): New commands to open the new panels. * Sketch/UI/__init__.py (UIPreferences.user_line_widths) (UIPreferences.user_line_widths_length): New config options for the object panel 2002-07-13 Bernhard Herzog * Sketch/Plugin/plugins.py (ConfigInfo.__init__): New parameter, load_immediately. If true, load the plugin immediately and not later on demand. (ImportInfo.__init__, ExportInfo.__init__, PluginCompoundInfo.__init__): New parameter, load_immediately. Pass it rough to the base class. 2002-05-13 Bernhard Herzog * Sketch/Modules/regionobject.h, Sketch/Modules/clipmask.h, Sketch/Modules/clipmask.c: Correct the license statement to LGPL. It should have been LGPL all along, just like the rest of Sketch. 2002-05-04 Bernhard Herzog * Sketch/Modules/sktrafo.c (sktrafo_dealloc): * Sketch/Modules/skrect.c (skrect_dealloc): * Sketch/Modules/skpoint.c (skpoint_dealloc): * Sketch/Modules/skfm.c (skfm_dealloc): * Sketch/Modules/skcolor.c (skcolor_dealloc): * Sketch/Modules/skaux.c (SKCache_New, SKCache_dealloc): * Sketch/Modules/curveobject.c (SKCurve_New, curve_dealloc): Use PyMem_DEL instead of free so as to not mix memory management APIs. 2002-04-15 Bernhard Herzog * Sketch/UI/libartdevice.py (LibartDevice.DrawRectangle): Change DrawRectangle's signature to match that of the other device implementations. * Sketch/UI/toolbox.py (ToolOptions.destroyed, ToolOptions.close): Rename close to destroyed as that's the method where channels have to be unsubscribed. (ToolOptions.build_window): Use the close method as callback for the close button. 2002-03-25 Bernhard Herzog * Sketch/Modules/skrender.c: Add lots of comments. * Sketch/Modules/_libartmodule.c: Add comments. * Sketch/Modules/skrender.c (skrender_svp_alpha_callback): Removed. skrender_svp_alpha_opaque_callback does the job just as well. (skrender_svp_alpha_opaque_callback, skrender_svp_aa_callback): Renamed to skrender_svp_aa_callback. Look up the alpha in alphatab before deciding which fill function to use. (skrender_scale_image_svp_alpha, skrender_rgb_svp_alpha): Always use skrender_svp_aa_callback as the callback for art_svp_render_aa (skrender_transform_image): Use skrender_svp_aa_callback. * Sketch/Editor/curvefunc.py (insert_node_at): Set the continuity of the new node to smooth. Bug report by Antoon Pardon. 2002-02-25 Bernhard Herzog * Sketch/Graphics/eps.py (render_preview): Quote the filename properly * Sketch/Lib/util.py (sh_quote): New function to quote filenames for use in shell commands 2002-02-10 Bernhard Herzog * Sketch/Editor/edittool.py (EditToolInstance.ButtonClick): Make sure that the handles are updated. * Sketch/Graphics/arrow.py (Arrow.__cmp__): comment out some debug prints * Sketch/UI/skapp.py (SketchApplication.panel_closed): Fix doc-string typo 2002-01-29 Bernhard Herzog * Sketch/UI/toolbox.py (dnd_targets, SketchToolbox.dnd_drop): Use text/uri-list instead of text/plain as the mime-type for a list of URLs. Patch by Thomas Leonard. 2002-01-07 Bernhard Herzog * Sketch/Graphics/psdevice.py (PostScriptDevice.DrawLineXY): Use correct y coordinate for the end point 2002-01-03 Bernhard Herzog * Sketch/Graphics/psdevice.py (PostScriptDevice.set_font): Use a float format for the font size. Fixes SF Bug 497003. 2001-12-14 Bernhard Herzog * Sketch/UI/gtkmisc.py (DialogWrapper, ModalDialogMixin): Rename DialogWrapper to ModalDialogMixin, because it's only used as a mixin for modal dialogs. Several changes to the methods to get rid of the now unnecessary modal flag and to use a more gtk-like way to implement modal dialogs with the set_modal method. Finally, make sure to quit the main-loop in a destroy signal handler, as pointed out by Mark Rose. (FileSelector.__init__, get_filename, ColorDialog.__init__, get_color): Delete all modal flags because of the ModalDialogMixin changes. 2001-12-14 Mark Rose * Sketch/UI/gtkmisc.py (SketchDrawingArea.realize_method): Update gcs if window changes (e.g. widget is reparented). * Sketch/Editor/edittool.py (MultiEditor.CurrentInfoText): Add missing return statement. 2001-12-09 Mark Rose * Sketch/Graphics/arrows.py (read_arrows): Fix typo in Arrow constructor argument * Sketch/UI/properties.py (StyleList.convert_cap): Fix typo in line cap name (CapProjecting) 2001-12-07 Bernhard Herzog * Sketch/UI/skpanel.py: Add the class attribute multiple which indicates whether there can be multiple panels of this class. Default is false, i.e. there can be only one. * Sketch/UI/skapp.py (SketchApplication.InstantiatePanel): Extend it to honor the panelclass.multiple flag. (SketchApplication.panel_closed): Handle multiple instances of the same panel class. * Sketch/UI/fillpanel.py (FillPanel.destroyed): New method extending the inherited version to also unsubscribe the SELECTION channel 2001-12-04 Bernhard Herzog * Sketch/Plugin/plugins.py (create_packages): Return the package's module object (_search_dir): Turn Lib/ subdirectories into subpackages of the package currently searched. The Lib subpackage is intended as a place for plugin specific support modules. * Sketch/Modules/_skgtkmodule.c (skgtk_colormap_alloc_color): Use temproary variables for the colors so that the ParseTuple specification in the matches the types. 2001-11-29 Mark Rose * Sketch/Base/loadres.py (read_resource_file): Fix the skread import 2001-11-28 Bernhard Herzog * README: Update README * NEWS: Update for 0.7.9 * CREDITS: Add some contributors 2001-11-09 Bernhard Herzog * Sketch/UI/tree.py (SketchTree.object_changed): Fix a case where a list's append method was called with two arguments. * Sketch/Editor/selection.py: Add some comments and doc-strings. (Selection.ResetRectangle) (Selection.SetInfo): Removed since they're not used anymore. (Selection.InfoText): (Selection.update_common_path, Selection.CommonPath): Split CommonPath into the public part which now simply returns a lazy attribute and the work-horse update_common_path which recomputes the lazy attribute 2001-11-08 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection.Insert): Remove the at parameter. It wasn't used by the callers and if there's need to control which object to insert into, it's better to call that object's or the document's Insert method anyway. * Sketch/UI/skapp.py (SketchApplication.LoadDocumentIntoNewEditor): Remove some debug prints. * Sketch/Graphics/compound.py (EditableCompound.Insert): Return only undo info and only allow changes to self (instead of allowing inserts into children as well). (EditableCompound.Remove, EditableCompound.RemoveSlice): Use self.Insert for the undo info now that it returns only undo info. (_insert_with_undo): Removed. It's not needed anymore with the new Insert (do_remove_child): Folded into Remove * Sketch/Graphics/document.py (SketchDocument.Insert, SketchDocument.Insert): Remove the insert method and add Insert instead. The new Insert method has a more sensible interface given the architecture of the 0.7 versions. Insert also requires the new EditableCompound.Insert behavior. * Sketch/Editor/doceditor.py (EditorWithSelection.Insert) (EditorWithSelection.UngroupSelected) (EditorWithSelection.group_selected): Use the new document method Insert 2001-11-07 Bernhard Herzog * Sketch/UI/skapp.py (file_new, SketchApplication.NewDocument): Put the functionality of the file/new command into an application method (SketchApplication.LoadDocumentIntoNewEditor): If the file to be loaded doesn't exist yet, create a new empty document for that file. (SketchApplication.build_window): Use LoadDocumentIntoNewEditor so that non-existing files are automatically created. 2001-11-05 Bernhard Herzog * Sketch/Graphics/font.py (read_char_metrics, read_afm_file): Pass the FontBBox to read_char_metrics so that it can be used for character entries that don't specify the bbox. 2001-11-03 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection): Remove the first GroupSelected definition. It's unused (overwritten by the one defined later) and wrong. (EditorWithSelection.UngroupSelected, EditorWithSelection.CanUngroup): implement ungrouping. 2001-08-21 Bernhard Herzog * test: new directory with the beginnings of a test suite. See test/REEADME for details on how to run the test suite. 2001-08-04 Bernhard Herzog * setup.py (find_config): Run libart-config instead of gnome-config to determine the libart compiler flags. Suggested by Stephane Conversy * Sketch/Modules/_skgtkmodule.c (skgtk_set_clip_mask): Pass NULL to gdk_gc_set_clip_mask if mask is None. Pointed out by Eric Jacobs. 2001-07-13 Bernhard Herzog * Sketch/Modules/_skgtkmodule.c (skgtk_read_bitmap_data): Removed. This was the last place that directly accessed Xlib. * Sketch/Lib/readxbm.py: new module to load XBM files through PIL. * Sketch/UI/skpixmaps.py (load_bitmap): Use the new xbmloader module 2001-06-18 Bernhard Herzog * Sketch/Graphics/plugobj.py (TrafoPlugin.Trafo): New method to return the trafo stored in the object. (TrafoPlugin.__init__): accept a trafo object as the trafo kw-arg and accept the loading kw-arg. * Sketch/Plugin/load.py (LoaderWithComposites.check_object): Fix for sourceforge bug #433393 2001-06-13 Bernhard Herzog * Sketch/Graphics/psdevice.py (PostScriptDevice.TileImage): Handle RGBA images correctly. 2001-06-06 Bernhard Herzog * Sketch/Plugin/load.py (LoaderWithComposites.end_composite, LoaderWithComposites.check_object, LoaderWithComposites.append_object): Move the sanity check of bezier-objects from append_object to the new method check_object and perform the check in end_composite before adding the object to the new composite. This change should finally catch all cases. The old implementation didn't check bezier objects that immediately preceded a group, for instance. 2001-05-28 Bernhard Herzog * Sketch/Modules/skreadmodule.c (sklex): Recognize and convert \x escapes properly. Python 2.1's repr generates those instead of octal escapes in a string. 2001-05-05 Bernhard Herzog * Sketch/Modules/skrect.c (skrect_compare): Add the special case where both operands are identical. This is required for the rich comparisons in Python 2.1 even for objects that don't use them. 2001-04-27 Bernhard Herzog * Sketch/Modules/_type1module.c (decode): Use "i" and a temporary variable instead of "h" to decode the optinal argument to make it work with Python >= 2.0. * Sketch/Modules/skpoint.c: (skpoint_compare): (skpoint_add): (skpoint_sub): (skpoint_multiply): (skpoint_divide): (skpoint_repeat): (SKPointType): When compiled with Python 2.1 or later, set the Py_TPFLAGS_CHECKTYPES in the type object to use the newly introduced way binary operators are implemented for extension types. * Sketch/Modules/skpoint.c (FLOAT_AS_DOUBLE): New macro to convert a python object to a C double if possible 2001-04-24 Bernhard Herzog * Sketch/Modules/skreadmodule.c (initskread): * Sketch/Modules/_type1module.c (init_type1): * Sketch/Modules/_libartmodule.c (init_libart): * Sketch/Modules/_skgtkmodule.c (init_skgtk): * Sketch/Modules/skcolor.c (fill_free_list): * Sketch/Modules/skpoint.c (skpoint_not_implemented): * Sketch/Modules/skfm.c (SKFontMetric_New): * Sketch/Modules/_sketchmodule.c (init_sketch): * Sketch/Modules/skrect.c (fill_free_list): make the parameter list explicitly void to silence compiler warnings. * Sketch/Modules/pstokenize.c (read_hex_string): * Sketch/Modules/skrender.c (skrender_grid): * Sketch/Modules/_libartmodule.c (render_grid): Remove some unused variables * Sketch/Graphics/ellipse.py (Ellipse.update_rects): Put the atan2 calls into a try block to catch the ValueError exceptions some platforms may raise and handle those cases gracefully. 2001-04-21 Bernhard Herzog * po/ru.po: New. contributed by Andrey Kiselev 2001-04-20 Bernhard Herzog * Sketch/Base/warn.py (warn, warn_tb): rename the two positional parameters to have leading underscores to avoid nameclashes with keyword parameters. 2001-04-04 Bernhard Herzog * Sketch/VERSION: increment to 0.7.8 * CREDITS: Update the list of contributors * Sketch/Plugin/loader.py: * Sketch/Plugin/scaffold.py: New modules which refactor the contents of Sketch/Plugin/load.py. loader.py contains baseclasses for import filters and scaffold.py contains classes to build a new document. * Sketch/Plugin/__init__.py (PluginPreferences.native_format): Set the native format to SK-2 * Sketch/Graphics/plugobj.py (PluginCompound.PluginArgs): Add a default implementation for the new method for saving plugin objects. It just raises NotImplementedError. 2001-04-02 Bernhard Herzog * Sketch/Graphics/pattern.py (ImageTilePattern.Trafo): (ImageTilePattern.Image): (ImageTilePattern.WithImage): New methods to query pattern properties and to create slightly modified copies. 2001-03-02 Bernhard Herzog * Sketch/Plugin/load.py: Reject empty poly bezier objects 2001-02-18 Bernhard Herzog * po/README: Update the URL of the po-utils 2000-11-03 Bernhard Herzog * Sketch/Graphics/psdevice.py (PostScriptDevice.DrawText): (PostScriptDevice.DrawComplexText): Use floats in the postscript code for the case of simply translated text. 2000-09-24 Bernhard Herzog * Sketch/Graphics/arrow.py (Arrow.Paths): New method that returns the curve objects that describe the path. Similar to a GraphicsObject's Paths method. (Arrow.IsFilled): New method. Return true if the arrow is filled, false if it's stroked. * Sketch/Graphics/curveop.py (arrow_vectors): New function that returns the directions of the arrow heads for a curve object. (arrow_trafos): New function that returns the transformations needed for the arrow heads of a curve object The module curveop is also new. It's intended to hold all the curve operations that aren't editor or bezier object specific. 2000-09-19 Bernhard Herzog * Sketch/Graphics/document.py (EditDocument.MarkAsSaved): The method of the undo object is called MarkAsSaved as well, not ResetUndoCount. Reported by Florian Marquardt. 2000-09-14 Bernhard Herzog * Sketch/UI/skapp.py (meta_defaults): Uncomment the format_name name default. The format_name name meta info is not actually accessed anywhere it seems. * Sketch/Plugin/plugins.py (load_plugin_configuration): (ExportInfo.__call__): * Sketch/UI/mainwindow.py (SketchMainWindow.SaveToFile): Use Sketch.Plugin.preferences.native_format instead of plugins.NativeFormat * Sketch/UI/mainwindow.py (SketchMainWindow.SaveInteractively): The else branch of 'if force_dialog...' is not needed. * Sketch/Plugin/plugins.py (NativeFormat): Removed. This constant is now available as Sketch.Plugin.preferences.native_format * Sketch/UI/devcmds.py (meta_panel): * Sketch/UI/skapp.py (meta_panel): Moved the meta_panel command to skapp. * Sketch/UI/devcmds.py: Removed the meta data commands. * Sketch/UI/metapanel.py (MetaDataPanel.add_data): (MetaDataPanel.delete_data): Check whether key is an empty string * NEWS: Summarized the changes since 0.7.7. 2000-09-13 Bernhard Herzog * Sketch/UI/metapanel.py (MetaDataPanel.add_data): (MetaDataPanel.delete_data): Go through the CallObjectMethod of the current editor. * Sketch/Editor/doceditor.py (EditorWithSelection.CallObjectMethod): Added a keyword parameter, title, that is passed to self.BeginTransaction(). Changed the implementation completely. It now works as a transaction that just calls the selection's CallObjectMethod and handles the undo info. * Sketch/Modules/skvisual.c (skvisual_pseudocolor_free): Applied a patch by Thomas Gellekum to make Sketch compile with Python 1.6/2.0b1. The PyMem_XDEL macro isn't available any more. 2000-09-12 Bernhard Herzog * Sketch/Editor/tools.py (ToolInstance.CallObjectMethod): Removed. * Sketch/Editor/texttool.py (TextToolInstance.CallObjectMethod): (TextToolInstance.CallObjectEditorMethod): Renamed CallObjectMethod to CallObjectEditorMethod and modified so that it only call the current text editor's methods and doesn't call the base class' CallObjectMethod anymore. (call_method): (insert_char): Get the current tool from the context's editor and call CallObjectEditorMethod instead of CallObjectMethod. * Sketch/Editor/doceditor.py (EditorWithSelection.Tool): New method that returns the current tool object 2000-09-10 Bernhard Herzog * Sketch/Graphics/__init__.py: Also export ObjectWithMetaData 2000-09-09 Bernhard Herzog * Sketch/UI/metapanel.py (MetaDataPanel.delete_data): (MetaDataPanel.add_data): Strip the key string read from the entry field before using it. 2000-09-08 Bernhard Herzog * Sketch/Graphics/selection.py: Removed because it's no longer needed. Selections are implemented in Sketch/Editor/selection.py * Sketch/Plugin/load.py (add_meta_data): New function. (load_drawing_from_file): Call add_meta_data to set the document meta data instead of relying on the filter to set this standard information. * Sketch/Plugin/__init__.py (PluginPreferences): New preference, native_format * Sketch/Graphics/compound.py (Compound.destroy_objects): Don't call self._changed here. * Sketch/Plugin/__init__.py: Added a comment about the meaning of the path preferences. * Sketch/UI/metapanel.py: Added entries to let the users modify, add and delete meta data items. * Sketch/Graphics/base.py (ObjectWithMetaData.DelData): Return undo info 2000-09-07 Bernhard Herzog * Sketch/Modules/skreadmodule.c (parse_line): The new file format I'm experimenting with omits the parens around the arguments of a sk file line. Add new a new parameter need_parens, so that the new format is expected when it's false and the old when it's true. (parse_sk_line2): New optinal Python parameter to be passed as need_parens to parse_line (parse_sk_line): Call parse_line with need_parens set to 1. 2000-09-06 Bernhard Herzog * Sketch/Graphics/text.py (InternalPathText.Trafo): Added Trafo method. 2000-08-23 Bernhard Herzog * Sketch/Graphics/psdevice.py (PostScriptDevice.__init__): Call the /initialize proc in the Setup section, move the setmiterlimit into the script body and remove the 'SketchDict begin' since that's now done in /initialize. (PostScriptDevice.Close): Add the call to /terminate in the %%Trailer section (PostScriptDevice.MultiBezier): Fix a bug where open curves would be written with a closepath at the end. * Resources/Misc/sketch-proc.ps: Add /initialize and /terminate procedures and init. skstartmatrix in initialize so that it uses the CTM at the beginning of the page description not when the procset is defined. This changes the way the procset is to be used, so I changed the version to 1.1 0. 2000-08-22 Bernhard Herzog * Sketch/UI/metapanel.py: New file implementing a panel that shows the meta data of the currently selected object. 2000-08-21 Bernhard Herzog * Sketch/Base/const.py (META_CHANGED): New constant for the _changed method * Sketch/Graphics/base.py (ObjectWithMetaData): New base class for ojects that can have meta data attached (GraphicsObject): Derive GraphicsObject from ObjectWithMetaData as well. * Sketch/UI/properties.py (StyleList.SetStyleList): Reset the width of column 0 to the optimal width when the list changes 2000-08-20 Bernhard Herzog * Sketch/UI/reload.py: New file implementing a panel that lets you reload python modules. * Sketch/UI/toolbox.py (SketchToolbox.build_win_menu): * Sketch/UI/devcmds.py (reload_panel): New command to show the reload panel. It's shown in the context menu and the Xtns menu. * Sketch/Base/configutil.py (Preferences._save): (_runtime_prefs): New class vrbl, _runtime_prefs, whose keys are the preferences that are not to be saved because their value is reconstructed from other values at startup and is only meaningful during runtime. Sketch.Plugins.preferences uses this. * Sketch/UI/skapp.py: * Sketch/UI/mainwindow.py: * Sketch/__init__.py (compatibility_bindings): The modules plugins and load are in Sketch.Plugin now 2000-08-19 Bernhard Herzog * Sketch/Editor/__init__.py (init): Also init Sketch.Plugins here * Sketch/Base/config.py (plugin_dir): (plugin_path): * Sketch/Base/configutil.py (init_directories): Removed plugin_dir and plugin_path * Sketch/Base/load.py: * Sketch/Plugin/load.py: * Sketch/Base/plugins.py: * Sketch/Plugin/plugins.py: Moved files from Sketch/Base to Sketch/Plugin * Sketch/Graphics/__init__.py (init): Introduced global vrbl _initialized to make it possible to call init several times * Sketch/UI/toolbox.py (SketchToolbox.build_menu): (SketchToolbox.build_file_menu): (SketchToolbox.build_win_menu): Add a new menu Xtns (like in Gimp) that has the message_panel, fill_panel and similar commands. 2000-08-18 Bernhard Herzog * Sketch/Editor/drawer.py: Removed the Selectable class because it's not needed here (SelectAndDrag.__init__): Removed the call to Selectable.__init__ * Sketch/Graphics/base.py: Get rid of this copy of the Draggable class altogether. The one actually used has been in Sketch.Editor.drawer for quite some time. * Sketch/Graphics/guide.py: The Draggable baseclass of GuideLine is no longer needed. 2000-08-17 Bernhard Herzog * Sketch/UI/toolbox.py (SketchToolbox.build_file_menu): Put the message panel command into the menu. * Sketch/UI/skpanel.py (SketchPanel.destroyed): New method. Connect this method to the destroy signal to unsubscribe the CHANGED messages instead of the close method. (SketchPanel.close): Simply call destry now. * Sketch/UI/msgpanel.py: New file implementing a panel that prints error messages. * Sketch/UI/skapp.py (SketchApplication.__init__): (SketchApplication.print_warning): New instance vrbl msgpanel. If not None it's an instance of the MessagePanel class in msgpanel.py and warnings are printed in the panel instead of a message box * Sketch/UI/skapp.py (SketchApplication.MessagePanel): * Sketch/UI/skapp.py: Added MessagePanel method and message_panel command. 2000-08-16 Bernhard Herzog * Sketch/Editor/selectiontool.py (SizeRectangle.apply_constraint): * Sketch/Editor/editbezier.py (PolyBezierEditor.apply_constraints): Ported the diagonal constraints for normal drags from the stable version. 2000-08-14 Bernhard Herzog * Sketch/Graphics/compound.py (Compound.set_objects): Call SetParent and SetDocument of the old and new children with the appropriate parameters. * Sketch/Graphics/blendgroup.py (BlendInterpolation.set_objects): Unset the document of the old children 2000-08-13 Bernhard Herzog * Sketch/Graphics/blendgroup.py (BlendInterpolation.set_objects): (BlendGroup.remove): (BlendGroup.insert): Call _changed for the notification that objects have been removed and or inserted * Sketch/Graphics/compound.py (Compound.set_objects): Removed superfluous call to disconnect_objects which doesn't even exist anymore (Compound.destroy_objects): (Compound.set_objects): Call _changed for the notification that objects have been removed and or inserted 2000-08-12 Bernhard Herzog * Sketch/Graphics/base.py (HierarchyNode.__init__): (HierarchyNode.issue_changed): Remove the libart_cache instance vrbl. * Sketch/UI/view.py (SketchView.transaction_end): (SketchView.object_changed): (SketchView.unsubscribe_doc): (SketchView.subscribe_doc): Subscribe/Unsubscribe to/from the TRANSACTION_END and OBJECT_CHANGED channels to pass the info which objects have been removed or changed to the LibartDevice (SketchView.__init__): New instance vrbl changed_objects that will be filled with the objects that changed during a transaction. * Sketch/UI/libartdevice.py (LibartDevice.__init__): (LibartDevice.get_svps): Use the new instance vrbl svp_cache to store svps and related info instead of relying on the object attribute (LibartDevice.objects_changed): New method to clear the cached information for objects that have changed. 2000-08-08 Bernhard Herzog * Sketch/Editor/doceditor.py (EditorWithSelection._set_selection): Initialize changed to 0 2000-08-06 Bernhard Herzog * Sketch/Editor/selection.py (Selection.path_for_object): Use the cache again. 2000-08-04 Bernhard Herzog * Sketch/Editor/document.py: Removed everything that had to do with selections, which means practically all methods. * Sketch/Graphics/document.py: Trimmed the imports a bit now that the selection code is mostly gone. * Sketch/Graphics/document.py (EditDocument.queue_selection): (EditDocument.PickActiveObject): (EditDocument.deselect_layer): (EditDocument.SelectLayer): (EditDocument.UpdateDynamicStyleSel): (EditDocument.CanCreateStyle): (EditDocument.CreateStyleFromSelection): Removed these methods because they are only relevant with a selection. PickActiveObject is now available in the document editor. (EditDocument.Insert): Ditto, but may be reintroduced later as a convenient way to add objects to the object tree, but with a different argument list. (EditDocument.SetLayerState): (EditDocument.end_transaction): Remove more references to the selection. * Sketch/Editor/texttool.py (CommonTextEditor.MoveForwardChar): (CommonTextEditor.MoveBackwardChar): (CommonTextEditor.MoveToBeginningOfLine): (CommonTextEditor.MoveToEndOfLine): (SimpleTextEditor.ButtonUp): (CommonTextEditor.update_selection): Remove update_selection and all calls to it. * Sketch/Editor/doceditor.py (EditorWithSelection.Cursor): Call self's PickActiveObject instead of the document's. (EditorWithSelection.selection_from_point): Added default value for path argument (EditorWithSelection.CallObjectMethod): Update handles after the call. * Sketch/Graphics/document.py (EditDocument.__init__): (EditDocument.Destroy): removed selection instance vrbl. * Sketch/Editor/texttool.py (TextToolInstance.ButtonPress): Call self.editor's selection_from_point instead of the document's. * Sketch/Graphics/document.py (EditDocument.Destroy): (EditDocument.reset_transaction): (EditDocument.begin_transaction): (EditDocument.end_transaction): (EditDocument._real_add_undo): Get rid of the selinfo argument of _real_add_undo and remove the instance variable transaction_sel. (EditDocument._undo_set_sel): Removed since it's not needed anymore. * Sketch/Editor/__init__.py: * Sketch/Editor/doceditor.py: Removed the DocumentEditor class 2000-08-01 Bernhard Herzog * Sketch/Modules/_sketchmodule.c: * Sketch/Modules/_type1module.c: * Sketch/Modules/curveobject.c: * Sketch/Modules/imageobject.c: * Sketch/Modules/pstokenize.c: * Sketch/Modules/regionobject.c: * Sketch/Modules/skcolor.c: * Sketch/Modules/skfm.c: * Sketch/Modules/skpoint.c: * Sketch/Modules/skreadmodule.c: * Sketch/Modules/skrect.c: * Sketch/Modules/sktrafo.c: * Sketch/Modules/skvisual.c: Use METH_VARARGS instead of 1 in the method defs. 2000-07-29 Bernhard Herzog * Sketch/Modules/pstokenize.c (pslex): recognize the << and >> operators. 2000-07-27 Bernhard Herzog * Sketch/Graphics/text.py (InternalPathText.CharacterTransformations): New method. Return the list of trafos for the individual characters. Useful e.g. for export fiters which simulate pathtext by positioning each character individually. 2000-07-23 Bernhard Herzog * Sketch/Editor/editbezier.py (PolyBezierEditor.ButtonUp): (PolyBezierEditor.DrawDragged): Fix some bugs in the code that draws/updates the previous and next segments in SelCurvePoint mode. * Sketch/UI/toolbox.py (SketchToolbox.build_window): * Sketch/UI/mainwindow.py (SketchMainWindow.build_window): * Sketch/UI/__init__.py (main): Push the gdkrgb visual and colormap once at the beginning in main before any widgets are created. 2000-07-16 Bernhard Herzog * Sketch/Graphics/image.py (ImageData.Image): New method to return the underlying PIL-image. * Sketch/Graphics/maskgroup.py (MaskGroup.Mask): (MaskGroup.MaskedObjects): Two new methods to return the mask-object and the masked objects respectively 2000-07-15 Bernhard Herzog * Sketch/Editor/editbezier.py (PolyBezierEditor.ButtonUp): (PolyBezierEditor.DrawDragged): Simplify the formula for alpha in the t > 0.5 case 2000-07-14 Bernhard Herzog * Sketch/Editor/editbezier.py (PolyBezierEditor.DrawDragged): (PolyBezierEditor.ButtonDown): Fix special case of dragging the first segment if it's a line segment. 2000-07-05 Bernhard Herzog * Sketch/Editor/edittool.py (EditToolInstance.ButtonPress): Call self.multiedit's SelectPoint method when the selection but not a handle is hit. * Sketch/Editor/editbezier.py (PolyBezierEditor.ButtonDown): (PolyBezierEditor.ButtonUp): (PolyBezierEditor.DrawDragged): Make the segments themselves draggable. Ported from demo code by Simon Budig 2000-06-30 Bernhard Herzog * Sketch/Graphics/pattern.py (HatchingPattern.Width): Added this missing method 2000-06-28 Bernhard Herzog * Sketch/UI/canvas.py (tool_cursors): removed as it's no longer needed (SketchCanvas.SetTool): Get the cursorname from the tool object. * Sketch/UI/cursors.py (CurCreate): (CurDraw): Renamed CurCreate to CurDraw * Sketch/UI/toolbox.py (SketchToolbox.build_window): The title is no longer an attribute of the tool object, use the Title() method istead. Also use the iconname from the tool object. (ToolOptions.tool_changed): The title is no longer an attribute of the tool object, use the Title() method istead. * Sketch/Editor/doceditor.py (EditorWithSelection.SetTool): (DocumentEditor.SetTool): Adapted to the new way of instantiating tools * Sketch/Editor/__init__.py: * Sketch/Editor/edittool.py: * Sketch/Editor/texttool.py: * Sketch/Editor/selectiontool.py: * Sketch/Editor/tools.py: Important change in the way tools are handled: Tools are now identified by an object and not just by their name anymore. These objects are derived from the new class ToolInfo and have some attributes that describe the object including a method that instantiates the tool for a given document editor. The old tool classes like MouseTool and derived classes are the classes for these editor specific instances. The changes include some renamings: MouseTool -> ToolInstance ZoomTool -> ZoomToolInstance DrawTool -> DrawToolInstance PolyDrawTool -> PolyDrawToolInstance CreateRect -> RectangleToolInstance CreateEllipse -> ElipseToolInstance FreehandTool -> FreehandToolInstance CreateCurve -> PolyBezierToolInstance CreatePoly -> PolyLineToolInstance SelectionTool -> SelectionToolInstance EditTool -> EditToolInstance TextTool -> TextToolInstance The toolinfo objects now have the same name as the instance classes without the trailing 'Instance' 2000-06-24 Bernhard Herzog * released Sketch 0.7.7 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