[Top][All Lists]

[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)


                 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



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

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/
    - 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

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


File Attachments:

Date: Mon 12/12/05 at 15:27  Name: unified-tools.diff  Size: 38.28KB   By:
depends on patch #4695


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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