Sizes of presentation objects, and MRL parser

Pedro Szekely ([email protected])
Mon, 05 Jun 1995 11:01:04 PDT

Hi,

In the presentation model developers define the sizes of objects, the
distances between them etc. In amulet, and many other systems, these sizes
are defined in pixels.

We were thinking that in Mastermind it would be a good idea to support the
definition of sizes in a device independent way. I think this is important
given that down the line we want to experiment with scalable interfaces.

So, in the presentation model we introduced the notion of a Magnitude, defined
as follows:

Enum Magnitude_Unit {
Pixel, Pica, Point, Cm, Inch
};

Object Magnitude {
attribute value : Double
attribute units : Magnitude_Unit;
};

Developers can thus model their interface in whatever units they want
(including pixels).

The code that translates expressions into Amulet formulas will wrap the
expression with code that translates the units into pixels. So, I think the
implementation of this is fairly striaght forward.

An issue comes up in the MRL. It would be nice to be able to type things like
the following, where units are used in literals:

hguide : MM_Guide {
position = [object_name.bottom + top_margin];
top_margin = 10 pixels;
bottom_margin = 10 pixels;
}

or the following, where units are used in expressions:

grids =
hgrid : MM_Grid {
direction = Horizontal;
start = [hguide.bottom_margin];
end = [bottom.top_margin];
distance = [height(font) + 2 pixels];
};

You can imagine how horrible the syntax would look if we had to create the
Magnitude objects with the standard MRL syntax.

QUESTIONS:

- ANY OBJECTIONS TO HAVING DEVICE INDEPENDENT SIZES?

- WOULD IT BE HARD TO UPDATE THE MRL PARSER TO SUPPORT THE MAGNITUDE UNITS?

Pedro Szekely
USC/ISI, 4676 Admiralty Way, Marina del Rey, CA 90292
Phone: 310/822-1511, Fax: 310/823-6714
URL: http://www.isi.edu/isd/szekely.html