Old Virtual Pen Project History
31 May 2002
- While trying to debug the logic behind the style edition and cloning
mechanisms, I hit a wall... It is nearly impossible to understand, yet
maintain, the complexity involved in the current implementation. I see only
one solution : develop a simpler mechanism (if this is possible).
- At noon, things were clear : I really have to redesign the
attribute edition code. Spent part of the afternoon designing a new, simpler
approach, where the core no longer does any magick behind the back of the
front-end. Cloning will be the front-end's responsibility.
30 May 2002
- Updated Sink class to make every named
sink a unique sink. Sinks with the same name
map to the same instance... This makes enabling and disabling commands very
easy. This required lots of changes in the VP.Forms
namespace.
- Fixed a bug in object deletion. The order in which objects were deleted
sometimes caused the undo not to move the objects back into the
document.
- Making attribute edition available when objects are selected. This
required grasping (again! -- I should definitively document the complex
piece of code implemented in styled.cpp) how
style cloning works.
- Chasing bugs...
29 May 2002
- Implemented the deletion of a selection. The simple DeleteObject
command could not be used, since it did not deselect/reselect the objects;
added DeleteSelObjects command, which can
delete a list of selected objects in a single operation. Also modified the SelGrips
attribute, so that it can be marked as deleted; this avoids changing
too much the object structure when a selected object is deleted.
- The Sink class maintains information about
the associated widgets.
28 May 2002
- The document view is now screen resolution aware. Class VP.FrontEnd.Controllers.DocView
computes the document size [pixels] based on the document size [units], the
screen resolution and the zoom factor.
- Fixed a few problems introduced yesterday while changing the coordinate
systems of the document view. VP.Path.Grip.Record
now also provides information about the exact document coordinates, not just
the screen coordinates. This was needed for the Bézier curve edition.
- Added command GUI.DocView.SetZoom which
can be used to change the zooming factor of the document view. It finally
works !
- Added a new kind of adorner for the document view : DocViewAdorner.PageInfo,
which can be used to put controls to the left of the horizontal scroll bar.
The demo plug-in now also implements a zoom information label, which is
displayed there.
- Cleaning up the selection chooser.
27 May 2002
- Finished refactoring, so that external plug-ins can put adorners to the
document view and provide a magnetic grid feature. I have written a sample
plug-in which draws adorners on the left and top of the document view; this
will be the ideal base for a ruler...
- Plug-ins can specify a GUI precedence attribute (VP.PIS.GUIPrecedenceAttribute)
which is used to sort the plug-ins in a logical order, rather than using the
default load order (which is arbitrary).
- The IFormCreator derived plug-ins don't
necessarily show up in the Tools menu. If their ObjectClass
string starts with a '*', then they won't be
shown as interactive commands. Moreover, they get the opportunity to modify
their attached command sink (to replace the default GUI.ShowForm
with something different).
- The command sink now generates an Executing
event before it executes the script, and an Executed
command after it executed it. An IFormCreator
derived plug-in could register an Executing
handler in order to replace or complement the script execution.
- The front-end provides support for implicit command definition
through sink script modification : if a sink's script is set to a
string such as "#def:GUI.MakeFoo bar",
VP.FrontEnd.Logic.SinkOverride will bind the
command "GUI.MakeFoo bar" with the
associated sink. When executing "GUI.MakeFoo
bar", the sink's HandleClick
method will be called. This will generate the Executing
and Executed events, but will not execute
the script itself, since it will be handled as a comment (#).
- Fixed a bug in the floating point parsing code in the core (it produced an
overflow on numbers with a lot of digits after the decimal point).
- Finally implemented and tested the zoom for the document view. This
required a few modifications. The rendering is now done in a different way,
since in the original method, the dashed selections were zoomed too.
26 May 2002
25 May 2002
- Continuing refactoring :
- VP.Path.Grip now
provides standard EventHandler and EventArgs.
- VP.FrontEnd.Controllers.DocView was
extensively modified in order to have a cleaner event handling
mechanism.
- VP.FrontEnd.Logic.Application handles
shutting down notifications with events.
- VP.FrontEnd.Controllers.ToolsToolBar
no longer uses the QueryDefObject/SetDefObject
commands. It also stores the last tool used in the default settings.
- VP.PIS.GUI.IObject now
has Attach/Detach
methods, which are used to bind the plug-in's event handlers to the
document view controller's event sources.
- VP.FrontEnd.Logic.Application
handles shutting down with events. It also provides more events (such as
ActiveDocViewChanging).
- VP.CoreWrapper.Application.Access
is no longer needed, since the plug-ins can talk directly to the
front-end.
- Reorganised the CursorEvent class, which
is now part of the VP.FrontEnd.Controllers
namespace. It is extensible for the use of a graphic tablet (using
additional Wintab information, such as pressure, tilt, etc.) thanks
to the SetTabletInfo and GetTabletInfo
methods.
- VP.Ucid.ID can now be initialised directly
from a string.
24 May 2002
- Refactoring and cleaning up following classes :
- VP.FrontEnd.Controllers.DocView.
- VP.CoreWrapper.CallbackHub.
- VP.PlugIn.GUI.AttributePanelAlpha.
- Refactored VP.Forms.Graphic.DocView(Scrollable)
in order to support more than a single crosshairs cursor, which will become
useful when constraining the main cursor coordinates to a grid, for
instance.
- Added support for adorners in the document view, which can then be used to
implement rulers, for instance.
23 May 2002
- Added buttons to select which object of a multiple object selection the
user wants to work on. While doing so, improved the VP.Forms.Factory
and VP.Forms.LayoutHelper classes.
- Working on multiple object selection : this had a lot of far-reaching
implications in the GUI code. I now have a working version where the user
can select which object is actively selected, but I am not sure that the
implementation is as clean as it should be. I get a messy spaghetti like
event handling structure, and I hate it.
22 May 2002
- The selections are no longer painted by the selection attribute :
they are recorded in the render context and can therefore be redrawn very
quickly (there is no need to walk through the document to animate the
selected objects, for instance). VP::Render::Context
implements RecordSelectionPath and DrawSelectionPath.
- Command RenderView can be configured to
render only part of the document view (for instance, just the selected
objects cached during a past update). The selection can now be animated with
a rotating dashed line if the selection is marked as active.
- Added command SetSelBodyHilite to specify
how the specified selected objects must be hilited (supported modes are None,
Simple and Active).
- Changed how the default creation object is specified (every time command ObjectCreation
gets executed, it also gets the UCID of the
object to create; this avoids the strange problems which happened when the
undo/redo was out of sync with the active tool, e.g. after loading a
document).
21 May 2002
- Command DetectObjectsInBox
returns both the object and its UCID, which
allows the selector to keep track of how many different object classes are
selected.
- Command SelectObjects returns the
attributes which have been inserted into the objects.
- Added a GUI.OpMode for the plug-ins
(method IObject.InstanciateGUI), which
allows the plug-ins to know if they are to generate a GUI for object
creation or for object edition. Moreover, the base plug-in object class
generates a title which contains the number of selected objects and the
number of objects with the matching UCID.
- Started changes in the selection handing, so that multiple object types
can be selected and edited together.
20 May 2002
- Testing the PointDef... commands. They
seem to work as expected.
- Modified the interaction between VP::DocObj::BBox
and VP::Render::Context; the bounding boxes
are now stored as a stack while rendering, which allows an easy
restoration of the previous bounding box when leaving an object. It can also
be used to identify more precisely to which block an attribute is bound.
- Methods VP::Render::Context::FindObjectAttributes
and FindStyleAttributes now fill a VP::Render::AttributeDef
array, which allows the caller to get more information about the attributes
(such as where the attribute is located, which is needed to differentiate a
local attribute from one applied to a parent wrapper).
- When creating points and objects, it is now possible to
specify whether the undo/redo should be bound to the previous/next command
in the command history. This was needed to handle the Bézier curve
specificities.
- When loading a document, things get reset properly in the
core and in the front-end.
- Implemented a new method, Cmd::Manager::Optimise,
which can be used to force a command optimisation just after a command has
been inserted into the command history. This is used by MoveObject
and MoveGrip commands.
- Command MoveGrip now
accepts several grip specifications for a single command, which is useful
for the Bézier curve (several grip movements can be associated and
optimised if needed, which would be much more complicated to implement with
split commands).
- Added support for dynamically loading C++ plug-ins
(currently by executing command "app.LoadPlugIn
xyz.dll"). Should this kind of loading be automatic ?
19 May 2002
- Added command CreateObject which can be
used to create any kind of object based on its UCID.
- Continuing work on point definition attributes.
18 May 2002
- No work on Virtual Pen today. A lot of work nevertheless.
17 May 2002
- Added command UpdateMovePointCreation,
which allows the Bézier curve creator to update the secondary points
instead of only the last one. This allowed me to finish the Bézier curve creation process (with symetrical secondary
point creation).
- Designing a new attribute which can be used to associate special
properties (or attributes) to points. The points can be real (as in a
polygonal line or Bézier curve) or virtual (as in a rectangle, where 2
points do not really exist in the object description, or as in a
polygon, where only one really exists).
- Implemented the VP::DocAttr::PointDef
class, its manager PointDefManager and its
specific commands (InsertPtDefXxx, ReadPtDef,
WritePtDefXxx, RemovePtDef).
The commands are not all finished yet.
16 May 2002
- Made sure the window got redrawn when the user drags grips or figures,
since otherwise the window invalidation would simply accumulate and no
redrawing would happen under heavy load...
- Rewritten the multi-point creation class; it is no longer dependent on O-Line,
but is now a common core base class (VP::DocObj::MultiPt
and VP::DocObj::MultiPtCreator). This allows
o.bezier, o.line
and o.polyline to use a common base class.
- Added command QueryObjectUcid, needed in
order to identify the object being edited. This was needed in order to call
the proper event handler when an object's grips got moved.
- The event handlers are now differenciated between object creation (GUI.IEdition)
and object edition (GUI.ICreation). The
Bézier plug-in implements its own IEdition
and ICreation event handlers to support
smart grip positioning and moving.
- Reparented the VP.CoreWrapper.Unit and VP.CoreWrapper.Grip
namespaces to VP.Unit and VP.Path.Grip,
which is much more consistent with what is used in the C++ implementation.
- Changed the namespace VP.PlugInServices to
VP.PIS which is much shorter.
15 May 2002
- Continuing work on Bézier curve and its far reaching implications.
- The plug-ins can handle grip movements (HandleMoveGrip).
- Grips are now defined by following information :
- An object index.
- A grip index (consecutive values from 0 to n).
- A sequence ID which can be used to identify the grip more precisely; this
is new.
- X and Y coordinates. What these coordinates represent is not yet
precisely defined (pixels on the screen or real world coordinates with
units ?)
- Added command DelayNotifications.
- Updating the transformation mechanisms (classes in the VP::DocTrans
namespace). They are responsible for the forward and backward coordinate
transformations. A point is now processed with its original units and is no
longer converted to points to do the math.
- I have drawn my first Blupi with VP today. It is an ugly Blupi, but
Blupi nevertheless :
14 May 2002
- Worked on the Bézier curve. It must be able to draw special items, such
as extra lines, when the figure is selected or being created. The Bézier
curve also needs special care to be able to drag primary grips and move the
associated secondary grips with it.
- Worked for the .NET installation program (avoiding that the wrong version
of .NET gets installed on Windows 98). This is not VP related...
- Finished reading OTLS (OpenType Layout) and related documentation from the
Microsoft Typography page. Great stuff, but few examples. And the hz
program from Peter Karov is full of good ideas. See links of previous day
for details.
- Very long phone call with Daniel Roux... He will be working on plug-ins
for VP soon !
13 May 2002
- Updated DocView::RenderView
to be more generalised. It can now be used to do both rendering and detection.
This feature is used by command DetectObjectsAtPos.
- The CallbackHub now
provides an access to a default HDC for the
core, which can be used in contexts where the core does not know that it
should provide a HDC or GDI+
graphics context.
- Adding Bézier curve support. This required the
introduction of method AddBezier in the path
operator and related classes.
- Finished reading the excellent book The
Elements of Typographic Style written by Robert Bringhurst. This lead me
to the HZ
algorithm and variations
of it for smart justification (still better than TeX). And I also
returned to Microsoft's Typography
which contains lots of interesting stuff, such as Open Type, Uniscribe, etc.
Text edition might turn out to be very complex if I want to benefit from
modern fonts and all the information on contextual kerning and substitutions
(e.g. for ligatures).
12 May 2002
- Commands such as DetectObjectsInBox,
DetectObjectsAtPos, etc. should be only
applied to the visible roots of the view the user is working on. This is now
possible thanks to command DetectRootsAtPos.
- Implemented command QuerySelectedObjects.
- Fixed bug in selection mechanism (command QueryObjectSelState
was not always finding the SelGrips
attribute properly).
11 May 2002
- Removing useless code in the core document manager. Following files had
become obsolete and were removed :
- SelManager, the selection manager. All
selection processing is done by the front-end and by the selection
commands.
- DocObj::Selector, the selection
helper.
- Command GripNotification
has become useless.
- Every DocView instance now gets its own Render::Context.
Thanks to this change, a view can cache some state (such as the path of the
selected objects) and this results in a significant speed-up and
simplification of some commands.
- Class GripManager was very much
simplified. Most of the work is done in the front-end. The O-Line
was also simplified thanks to the plug-in infrastructure, which provides the
event handling.
- Adapted the bootstrap sample from Microsoft in order to make a .NET
installer for the CRESUS CD-ROM. Nothing to do with VP, but I will be able
to re-use this program when VP ships.
- Added more debugging information for the DebugDumpDocument
command : now display the textual representation of the Info::Generic
objects.
- Added command DetectRootsAtPos.
10 May 2002
- Clean up (new ideas section) and administrative
work. I hate doing this, it makes me feel unproductive.
- Finished reading a document about the Aqua user interface.
- Design phase.
09 May 2002
- I did not work for VP today.
- Read documentation on the Aqua
user interface (Macintosh OS X). Nice ideas.
08 May 2002
- Reworking the event transmission from front end to core and updating the
creation process, so that plug-ins can have access to the whole event chain.
- Think about the graphic tablets... They seem to adhere to a standardised
API known as Wintab.
- Implemented support for generalised unit representation and transformation
in C#. This is useful to avoid having to talk to the core to get the units
converted (VP.CoreWrapper.Unit.Value).
- More work on CRESUS Safe...
- Submitted my h/cpp switching macro to www.CodeProject.com.
The article is here.
07 May 2002
- Provided the plug-ins with the possibility to define their custom area in
the attribute palette. This required a cleaner separation between the IAttribute
and IObject interfaces, thus I added an IUcid
interface which can be used for all UCID
related plug-ins.
- Again, I did not expect to work on CRESUS Safe project. Denis started to
integrate it with EpBackup, and thus required a few changes (and found a few
bugs on Windows 98 and with another SMTP server). There is now a German
version too of this non-VP tool.
06 May 2002
- Changed the FrontEnd application to a
class library. This was needed, since plug-ins had to access some of the
application types and classes, and .NET does not allow a DLL to reference an
EXE. A new (very small) VirtualPen.exe
serves as the launching application. The PlugInServices
class library was merged with the FrontEnd.
- Extracted the color, alpha and line width edition panels and put them into
separate plug-ins.
- Worked for CRESUS Safe project... This is not VP.
03-05 May 2002
- I took a (well deserved ?) break... Alas, the weather was very rainy, even
in Intragna (TI). So I had no choice but to think about design questions in
VP.
02 May 2002
- Worked on a non-VP project today (CRESUS Safe, aka CryptoBackup).
- Bug hunting :
- When drawing a polygonal figure, undoing a point and closing the
figure, a fork happens in the command history. This seemed to
cause some trouble, but it was in fact a dead-end... The problem was
that when undoing a point creation, the first point of the polygonal
line was re-inserted as a hot grip. The original one (numbered 0)
was lost and not removed at the end of the creation, which caused the
front-end to think there still was a valid grip, etc.
- Hot grips got not removed properly when the core switched from
creation to idle mode. This also sometimes produced crashes (I had
broken VP::CallbackHub::CallGripDefinition
while fixing things on 22 April).
01 May 2002
- No Virtual Pen today. Experimenting some unknown areas of the .NET
framework.
History of previous months.