File: yuditwindow.txt

package info (click to toggle)
yudit 2.5.4-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,528 kB
  • ctags: 8,403
  • sloc: cpp: 59,394; ansic: 2,585; perl: 2,398; makefile: 864; sh: 321
file content (105 lines) | stat: -rw-r--r-- 4,473 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Yudit Design Document
=====================
Author: Gáspár Sinai <gsinai@yudit.org>
Date: 2001-03-03 Tokyo 

1 Intoduction
=====================================================================
This document describes the basic design of yudit, THE unicode text 
editor. You may find a lot of things missing, I am adding things to 
this document in a priprity order.

1.1 Global Overview
=====================================================================
Yudit source code contains the following library directories:
o stoolkit contains the basic toolkit. Yudit uses only c library
  and it relies solely on this toolkit. 
  You may find the following components most useful:

  SString  - a string Object
  SVector - a vector for Objects
  SBinVector - a vector for basic types, integer pointer, e.t.c.
  SHashtable -  a hashtable for Objects
  SBinhashtable - a hashtable for basic types
  SEncoder - a text conversion utility
  SEvent - platform independent event handling
  STimer - a timer 
  SIO - io classes: files, directories, pipes
  SIOStream - io interaction class, streams, readers and writers.

o swindow contains the platfrom independent gui library
  You may find the following components most useful:
  SCanvas  - a drawing interface to draw lines, cubic splines,
    native fonts, images.
  SGEngine - a drawing engine to implement splines for platforms
   where splices are not supported. 
  SAwt - the asbtract widget toolkit. Every platform should extend this.
  SWindow - the abstract window, implements SCanvas.  Every 
   plaform should extend this.
  SFontNative - a native font. Postscript fonts are rendered with the
   drawing interface; native fonts are renderes by the platform 
   dependent window. Every platfrom should extend this, if native
   fonts are suppoerted.
  SColor - a basic color object with alpha transparency
  SPen - a pen that has a color and some with.
  SPrinter  - a canvas, that renders on a printer, a SPostscript
   printer for instance.

o swidget contains high level widgets that rely on the abstract window.
  You may find the following components most useful:

  SComponent - a basic component with no window and no layout.
  SPanel - a component that has window and layout
  SFrame - a top level SPanel
  SDialog - a top level SFrame that is modal and has a parent SPanel.
  SLabel - a label to draw text and icons
  STextEdit - a text editor
  SListBox - a list
  SButton - a button
  STextTable - a multi-column list
  SIconFactory - a factory that loads icons
  SFileDialog - a file selection box.
  STextDialog - a dialog to display messages, ask questions

o tests

  This directory is normally not compiled. It has drawing tests like
  Speed.cpp - rendering speed measurement utility. You need to set
    swidget/STextView.cpp: #define DEBUG_SPEED 0 should be redefined 1
    to make speed measurements with ./speed speed.txt
  Yuko.cpp - a simple spline-draw test.
  Test.cpp - any current test

2 True Type Font Drawing
=====================================================================
 
 1. When drawing a glyph in a font, font creates a cache name using
 the glyph, actual font, fontsize (not implemented: rotation
 parameter, penwidth), well basically everything minus the
 translation component in the matrix.
 2. font tries to write itself on a canvas object using newpath(x, y,
 cachename).

 3. If newpath returns true, the rendered image is cached so nothing
 but fill(pen) is called where pen contains additional parameters
 like linewidth + fore and back colors.

 4. If newpath returns false, the canvas drawing functions are called
 to actually draw the glyph.  Then fill(pen) is called.  This may
 cache the object in canvas unless the cache name is "".
 
 The actual drawing functions I implemented in yudit are postscript
 drawing functions, as you can see in swindow/SCanvas.h.

 - swindow/SPrinter (this is a canvas too!) uses these using
 SPostscript as a printer.  (It does almost nothing but translates the
 drawing functions to strings).  In case of printer I draw the same
 text twice, once to cache all glyphs, second to use cache to do the
 actual printout.
 
 - swindow/sx11/SX11Window (this is a canvas too, and it is pluggable
 because it is SWindow) uses the swindow/SGEngine as a helper to make
 these drawing functions available in X11.  If X11 starts to support
 some of these functions (like transparency, splines etc.) then
 SGEngine would not be needed at all.