sketch-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #4699] Remove the ToolInfo class


From: Valentin Ungureanu
Subject: [patch #4699] Remove the ToolInfo class
Date: Mon, 12 Dec 2005 15:27:16 +0000
User-agent: Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.3 (like Gecko)

URL:
  <http://savannah.nongnu.org/patch/?func=detailitem&item_id=4699>

                 Summary: Remove the ToolInfo class
                 Project: Skencil
            Submitted by: vung
            Submitted on: Mon 12/12/05 at 15:27
                Category: 0.7.x
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open

    _______________________________________________________

Details:

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.





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 12/12/05 at 15:27  Name: unified-tools.diff  Size: 38.28KB   By:
vung
depends on patch #4695
<http://savannah.nongnu.org/patch/download.php?item_id=4699&item_file_id=5585>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?func=detailitem&item_id=4699>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]