File: CODING

package info (click to toggle)
pronto 2.4.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,112 kB
  • ctags: 488
  • sloc: perl: 22,159; makefile: 140; sh: 34; sql: 7
file content (27 lines) | stat: -rw-r--r-- 1,719 bytes parent folder | download | duplicates (2)
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
The basic idea behind the approach I chose, is to use as much
Pronto-Code as possible. This is made easy by the fact, that Pronto
does not use OO that much and that Perl isn't a strongly typed
language. Pronto uses global variables for it's main widgets (created
in pronto-main). It then calls Library-functions to manipulate this
widgets. So what I did was to write my own widgets and create
variables with the same name as they are called in Pronto-Main. The
packets which hold "my" widgets all have a function called AUTOLOAD,
so that no functions calls will trigger a "not defined"-error. I than
only had to implement the functions which are important for the web
client (e.g. insert_row in the message list). Every widget than has a
method "draw", which is used to dump it's contents (formatted in HTML)
to STDOUT (which will be redirected to the browser by the web-server)
The HTML formatting is done via the Perl-Module "Template". The reason
for that is, that it's fairly easy do change the design of the webpage
without knowing any Perl. You just have to change the files under the
templates/ directory.
Pictures:
Pronto uses a couple of pictures. They are all created via the
constructor of the Gtk::Gdk::Pixmap library. I did create my own class
which is called the same, but which does not create an object but only
a HTML-string (the img-tag). The extension of the filename is changed
from .xpm to .png and the path is adjusted to /pixmap (which evaluates
to http://server.domain.com/pixmap/..., or DocumentRoot/pixmap/... on your
filesystem). You what you have to do is to convert all pixmaps of one
Pronto-style (e.g. aqua) to pngs (e.g. with xmp2ppm | ppm2png) and
copy (link) them into the pixmap dir.