comparison orgfiles/index.muse @ 0:5aca939dbfbe

MatButterfly is a SVG browser
author Thinker K.F. Li <thinker@branda.to>
date Tue, 22 Jul 2008 20:45:30 +0800
parents
children 6eecdd331fe7
comparison
equal deleted inserted replaced
-1:000000000000 0:5aca939dbfbe
1 * MadButterfly
2 #MadButterfly
3 MadButterfly is a [[#SVG][SVG]] browser, HTML browser (ex, Firefox) is a HTML
4 respective one. MadButterfly only understand SVG, controlling from users,
5 and API for applications base on it. It is supposed to be a GUI framework
6 for applications. The host applications can interact with MadButterfly
7 like Javascript applications interacts with DOM objects. MadButterfly
8 is a GUI evnironment based on SVG technologies for desktop and mobile
9 device. It tries to make the work of programmers closed to client-side
10 Javascript ones.
11
12 MadButterfly is a SVG browser, it can be used to implement file manager,
13 UI of commerical application for business, and even window manager for
14 X Window. We try to implement MadButterfly as a library that can be
15 embedded by host programs. It is alike Firefox been embedded by
16 host programs.
17
18 * SVG
19 #SVG
20 SVG is "Scalable Vector Graphics". It is a standard of W3C.
21 MadButterfly implements [[http://www.w3.org/TR/SVGMobile12/][SVG Tiny 1.2]], a simplified version of SVG for
22 mobile devices.
23
24 * Design
25 Most notable of SVG, except sharps, is coordination transforms. To make
26 MadButterfly efficiency, the execution of code should highly leverage
27 time locality and spartial locality. So, we should aggregate computation
28 of a function together. The data of container and contained elements
29 should also be aggregated together.
30
31 Since the attributes of SVG objects will be chagned frequently,
32 unnecessarily recomputing for coordination transforms should be avoided.
33 A sequential number should be attached to the objects to ditinguish
34 dirty transformation result and recompute it when it is needed.
35
36 ** Aggregate Computation
37 Every update potentially invokes a function for every graphic elements.
38 To be efficient, calls of a function are collected into a loop to avoid
39 overhead of function calls. It also avoid interleaving of calls of
40 functions to leverage time locality of code cache.
41
42 ** Aggregate Relative Data
43 Changes of a container usually effect contained elements. So, it had
44 better to put container together with contained elements to increase
45 hit rate of cache.
46
47 * Transform
48 If a coordination transformation transforms (x, y) to (x', y'), then
49 > x' = xa * x + xb * y + xc
50 > y' = ya * x + yb * y + yc
51 is equal to
52 > | xa xb xc | | x |
53 > | ya yb yc | * | y |
54 > | 0 0 1 | | 1 |
55
56 A transform function of a element to canvas is production of all
57 transform functions of containers, it is called aggregated transform
58 function. The aggregated transform function of elements are
59 computed with [[http://en.wikipedia.org/wiki/Dynamic_programming][dynamic programming]].