patchSkencil - Patches: patch #4699, Remove the ToolInfo class

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4699: Remove the ToolInfo class

Submitter:  Valentin Ungureanu <vung>
Submitted:  Mon 12 Dec 2005 03:27:15 PM UTC
   
 
Category:  0.7.x Priority:  5 - Normal
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open

Tue 13 Dec 2005 09:19:47 AM UTC, comment #1: 

Added some cursor attributes (for zoom and polys) and added
to the ChangeLog some renames from tools.py

Valentin Ungureanu <vung>
Mon 12 Dec 2005 03:27:15 PM UTC, original submission:  

Before applying this patch you should apply both diffs
attached to patch #5576 (that is: file #5576 and file #5578)

This is a patch that proposes to add some information to
ToolInstance rather than have a separate class (the current
ToolInfo).

This is done in the hope that it would be easier for an user of
Skencil's API to create a tool (which may be necessary for some
advanced scripts). All that is required now is to create a class
derived from ToolInstance.

The important changes are in Sketch/Editor/tools.py:
    - There is a metaclass: RegisteredTool which adds the tools
      to the toolmap and adds two attributes (name and icon).

      Only classes that have a "title" attribute are added to
      toolmap, "title" is a user visible string (it is the
      tooltip) so using its existence as a hint that a class
      needs to be registered seemed appropriate.

      This also allows for classes that are derived from
      ToolInstance but are not tools themselves (e.g.
      DrawToolInstance which is the base of RectangleTool and
      EllipseTool is not registered as it doesn't have a title).

    - ToolInstance has two new class attributes: cursor and
      active_cursor.

With the exception of the new cursor attributes, the various
tool definitions are unchanged.

The rest is just eliminating the ToolInfo calls, modifying the
tool names in various places and renaming the icons (hence the
big size of the patch). The tests were also modified.

Maybe ToolInstance should be renamed to Tool; but there were
already many small changes and I tried to keep them to a
minimum.

Valentin Ungureanu <vung>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #4068:  unified-tools2.diff added by vung (39KiB - text/x-diff - use this instead of unified-tools.diff)
file #8010:  unified-tools.diff added by vung (38KiB - text/x-diff - depends on patch #4695)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-13 vung Attached File- Added unified-tools2.diff, #5586
2005-12-12 vung Attached File- Added unified-tools.diff, #5585

Back to the top

Powered by Savane 3.13-758e.
Corresponding source code