FreeOS.com logo

FreeOS Most Popular
* Most Read stories
* Commented Stories
* Active Categories
* Non Linux Section
* User Submitters
* Top Polls
* Top Authors
* Top Reviews
* Top Rated
* Top Search Terms

Top Articles
* Writing a Linux device driver
* The Linux filesystem explained
* Samba NT Domain Controller
* Setting up Squid as your caching HTTP/FTP proxy
* Web server tutorial - Part 1

FreeOS Highlights
* Howtos (72)
* Reviews (20)
* Opinions (18)
* Interviews (8)
* News (3)

My FreeOS

Nick:
Pass:
Register

Forgot your password?

Contact Us
Contact Us

       

Project: Linux triangle Howtos triangle

From Power (point) to Magic(point) -- Presentations using your Linux box

By Trevor Warren <trevor@freeos.com>
Posted: ( 2001-02-21 11:26:28 EST by )

At FreeOS.com, we have a simple rule: all work must be done on Open Source software as far as possible. The first victim of this rule was our CEO who would crib about not having a suitable application to make presentations on. Of course, we had Star Office, but there always was the feeling that there must be better ways of doing the job than using CPU hungry bloatware.

So we decided to look around and what better place than Freshmeat (www.freshmeat.net). A little sniffing around Freshmeat and we came up with some good tools to make simple and handsome presentations. We downloaded the following software:

Prestimel
PPresenter
Magic Point

Prestimel turned out to be a no-brainer as we could not install it. We were testing it on a SuSE 6.4 Installation running the 2.2.14 kernel. However, we just could not figure out why Prestimel would not compile on our box although all the dependencies were satisfied. We finally gave up and are therefore unable to review Prestimel. We however did have some previous experience with Prestimesl and would recommend that you give it a try (i.e. if you can compile it). Creating slides in Prestimel was a piece of cake as we remember. It was as simple as taking the sample XML file provided with the stock compilation of Prestimel and tweaking it to suit our needs. You then run Prestimel again with the appropriate command line switches parsing it a template for the background and color scheme according to your choice and lo....... Prestimel creates all the slides as separate HTML files interlinked to each other and created using the template mentioned by you during parsing of the XML file. All you then need is an HTML browser to view the slides.

That was as far as Prestimel goes. The next application to be chucked off our list was PPresenter. This was another pain in the .......? You know how cryptic some of these packages can be. We soon realized that getting started with PPresenter would require us to code our own slides in some scripting language that was almost equivalent to messing around with assembly code. Not that PPresenter was any different from the others in the way things worked, but we felt that it was too cryptic for the average user to get a hold on. And to expect a novice to start coding in some cryptic scripting language just to make a elegant presentation is asking quite a lot.

Than left us with Magic Point and fortunately for our CEO (or us!), we had a better experience.
MagicPoint is an X11 based presentation tool designed to make simple presentations easy and complicated presentations possible. Its presentation file (whose suffix is typically .mgp) is just text so you can create presentation files quickly with your favorite editor (e.g. vim, Emacs, pico, etc). MagicPoint is completely free and is offered under absolutely no warranty from it's developers. For more information, please refer to the Copy-write info bundled along with the package. Since MagicPoint extensively uses fonts in various sizes, the developers recommend installing good font rendering systems on the system. Please refer to README.fonts or README.fonts.jp for more details. However, in our experience, most stock installations of Linux from various leading distributions have no problem rendering the most common fonts required by MagicPoint.

Let us get started with down loading and compiling MagicPoint. The official home page of MagicPoint is http://www.mew.org/mgp/. Get the tarball from the homepage or look out for RPMs. The latest tarball available at the site is magicpoint-1.07a.tar.gz.

Untar the source as follows.

tar -xvzf magicpoint-1.07a.tar.gz

Follow the steps below to compile MagicPoint:

./configure
xmkmf
make Makefiles
make

When you believe that everything is OK, install MagicPoint as follows after logging in as root:

make install
make install.man

In case, you were able to lay hands on the MagicPoint RPM, more the better. First login as root and type the following command

rpm -ivh mgp-*.rpm

This wraps up installing MagicPoint using either the sources or the RPMS?s.

Having installed MagicPoint we will test some of the sample presentations. In the directory in which you have down loaded the source, there is another directory called sample. Illustrated below is a snapshot of part of our MagicPoint directory structure.

-rw-r--r-- 1 trevor users 40668 Feb 11 09:47 print.o
drwxr-xr-x 2 trevor users 1024 Feb 16 10:24 sample
-rw-r--r-- 1 trevor users 62701 Feb 11 09:45 scanner.c
-rw-r--r-- 1 trevor users 7094 Sep 10 1999 scanner.l

Inside the directory sample, you will find a lot of sample MagicPoint presentations. Run one of the presentations as follows:

mgp -g 800x600 sample.mgp

The above command will run the MagicPoint presentation for you in window of size 800x600.

Creating your own Presentations

We would suggest you first have a look at the various sample presentations, most of them are good enough to get you started. You can also create your own slides using the default ?sample.mgp? as reference. The basic funda of MagicPoint is all the slides are created in a single ASCII TEXT file stored with an extension of ?mgp?. Every slide is scripted using a very simple language as we are going to illustrate as follows. Open your favorite text editor and name your first presentation with an extension of mgp(*.mgp).

The first slide is illustrated as follows:


%include default.mgp <-- 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%page <--2
%nodefault <--3
%fore yellow, size 5, font standard, back darkblue <-- 4

%center, fore red, font thick <--5
%font standard, rcutin <--6
WELCOME TO THE MAGIC POINT TUTORIAL <--7
%center, size 4, fore white, lcutin <--8
And also Welcome to Linux <--9
%rcutin <--10
From FreeOS.com <--11
%size 3, lcutin <--12
trevor@freeos.com <--13
%size 4, fore yellow <--14
!! Type SPC key to get to next page!! <--15


Let's look at a a line by line explanation of the presentation. The line numbers are the ones to the right of the script on each line. Neglect them when scripting your own presentation.

%include default.mgp <-- 1

One of the golden rules to remember while using MagicPoint is that every line begins with a "%? sign. Every line in the script line is of significance even the blank ones. The blank lines in the script file(*.mgp) are interpreted by MagicPoint as blank lines in the respective slide. So you know how to keep your distance.
The first line is a default line, which as in C/C++, is equivalent to a pre-processor directive and over here is made use of to include the basic template necessary to create your presentation. This default template will give your slide a lot of default values, but just as in C/C++ you can over ride a method, similarly even here you can over ride the default values by specifying your own values to the various parameters. We will be covering that shortly.

%page <--2
This marks the beginning of a new slide.

%nodefault <--3

In short this means that this slide isn't going to make use of the default parameters supplied by the default template( default.mgp). Therefore, you have some more scripting coming your way.

%fore yellow, size 5, font standard, back darkblue <-- 4
Let us take these lines apart and understand it. The first part %fore yellow suggests that the slide should use yellow to draw the words that come up next.
size 5 of course means use letters of height 5.
font standard tells MagicPoint to make use of the standard font as included by the default.mgp file.
back darkblue tells MagicPoint to draw the background as darkblue as the default is to draw the background as black. You could always change the colors to suit your own fancy. Just make sure you stick to the common range of colors and refrain from using any exotic names out here. The first line is used as a global default for the entire first slide.

Now let's jump to the rendering of the first line.
%center, fore red, font thick <--5
%rcutin <--6
WELCOME TO THE MAGIC POINT TUTORIAL <--7

%center, fore red, font thick <--5
%center of course is used to position the words in the center of the screen. Various combinations possible out here are as follows, center, right and left.

center
right left

These positions are relative to the size of the frame you ask the MagicPoint to be drawn in. Let us illustrate with this example,

mgp -g 800x600 timepass.mgp and

mgp -g 400x300 timepass.mgp.

Both of these lines would display the same slide but in a frame of reducing size. As a word of caution always test your slides for the positioning and the way they look as the frame size changes.

%center, fore red, font thick <--5
The last part of the command is fore red, which mentions that MagicPoint should draw the words in RED.
font thick specifies that the words should be drawn BOLD. So you see it's as simple as it looks.
%rcutin <--6

You might have noticed the particular feature in PowerPoint, which allows your point to be shot in from the sides of the screen with a bullet effect. Similar is the rcutin and lcutin options out here. The rcutin option causes the following line to be shot in from the right of the screen while lcutin causes the line to be shot in from the left of the screen. Try out some of these exquisite effects for your presentations, it makes things look really impressive.

WELCOME TO THE MAGIC POINT TUTORIAL <--7

All the commands that we mentioned in lines 5 and 6 were applicable to line number 7.

%center, size 4, fore white, lcutin <--8
And also Welcome to Linux <--9

Let us have a look at the following lines as mentioned above. There is nothing new out here in lines 8 and 9. All the points as explained earlier apply themselves similarly.

%rcutin <--10
From FreeOS.com <--11

%size 3, lcutin <--12
trevor@freeos.com <--13

%size 4, fore yellow <--14
!! Type SPC key to get to next page!! <--15

Similar is the situation for the following lines as illustrated above. Also note that the functionality is mentioned by the last line, i.e line number 15.

This brings us to the end of the first slide. We now look at some more concepts.

%page <--16
%bgrad 0 0 16 0 0 blue darkblue <-- 17
%size 5, font standard, fore yellow, lcutin <--18
Moving around the presentation <--19
%size 4, font standard, fore yellow, rcutin <--20
# To view the next slide -> press left mouse button <--21
%rcutin <--22
# To view the previous slide -> press right mouse button <--23
%rcutin <--24
# To quit -> press q key <-- 25
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The second slide as mentioned above gives the effect of drawing a color gradient on the background. The color gradient is between blue and darkblue. These are just some of the stunning effects possible with MagicPoint. To know more about some of the default templates available check out the MagicPoint homepage for good links.

Let's now go through line numbers 16-25 in this section.

%page <--16
%bgrad 0 0 16 0 0 blue darkblue <-- 17

Line 16 denotes the starting of a new slide. Line 17 creates a color gradient between blue and dark blue. The grade variable takes 5 parameters, which can be described as follows.

%bgrad


:: width of generated image(0-100%)
0 means physical display size
:: height of generated image(0-100%)
0 means physical display size
:: number of colors, 0 means no reduction.
default 256 colors(8bit)
:: gradation direction (0-360 degree)
0 :Top to Bottom 90 :Left to Right
180:Bottom to Top 270 :Right to Left
default 0
negative value means non-liner gradation
:: zoom to max size
0 nozoom, 1 zoom
default 0
:: colors in the gradation image

For simplicity sake, just follow the values that we have given you and tweak them a bit to get satisfactory results.

%size 5, font standard, fore yellow, lcutin <--18
Moving around the presentation <--19

%size 4, font standard, fore yellow, rcutin <--20
# To view the next slide -> press left mouse button <--21

%rcutin <--22
# To view the previous slide -> press right mouse button <--23

%rcutin <--24
# To quit -> press q key <-- 25
the rest of the statements are quite simple enough and it's functionality is the same as illustrated earlier.


Let's have a look at the next slide.
%page <--26
%back orange <--27
%size 4, font standard, fore darkblue, lcutin <--28
Font sizes and zooming effects <--29
%size 3, font standard, fore darkblue, rcutin <--30
Open source ROCKZ ......... :-) <--31

%CENTER <-- 32
%SIZE 10,FORE orange, lcutin <-- 33
Hello World <--34
%SIZE 7,FORE gray, lcutin <--35
Hello World <--36
%SIZE 5,FORE blue, lcutin <--37
Hello World <--38
%SIZE 4,FORE yellow, lcutin <--39
Hello World <--40
%SIZE 3,FORE green, lcutin <--41
Hello World <--42
%SIZE 2,FORE red, lcutin <--43
Hello World <--44
%SIZE 1,FORE pink, lcutin <--45
Hello World <--46
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Lines 33-46 display the words Hello World in reducing font sizes and varying colors. Also we have made it a point to use the lcutin bullet effect for elegance and style.

Now we take a look at the next slide.

%page <--47

%fore red, font thick <--48
Visualize inline images! <--49

%center <--50
%image dad.jpg <--51
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The above lines insert an image, dad.jpg into the slide and notice how closely the image is center justified.

Now a look at the next slide.
%page <--52
%size 4, lcutin <--53
Pause <--54
%size 4, lcutin <--55
Type SPC key (twice) to proceed. <--56
%center, fore red <--57
Happy hacking! <--58
%pause, fore blue <--59
Happy hacking! <--60
%pause, fore green <--61
Happy hacking! <--62

The important feature that we want to highlight out here is as follows,

%center, fore red <--57
Happy hacking! <--58

%pause, fore blue <--59
Happy hacking! <--60

%pause, fore green <--61
Happy hacking! <--62

If you notice carefully, lines 57-58 are of the normal type. However, after displaying lines 57-58 the presentation will pause due to the use of the pause keyword in line number 59. To continue the presentation you can use the SPACEBAR key. This feature is important if you don't want all the points barging onto the screen in one go and you would want to decide when the next point should appear on screen.

The next slide is quite interesting. Using this particular feature, you could embed output of live system commands into your presentation.
%PAGE <--63
Grab command output into foils <--64
ls -l /boot <--65
%size 3, prefix " " <--66

%filter ls -l /boot " <--67
%endfilter <--68
echo this is test | rev <--69

%filter rev <--70
this is test <--71
%endfilter <--72
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%filter ls -l /boot " <--67
%endfilter <--68
Take a closer look at the lines 67-68, these lines incorporate a feature called FILTERS into the slide. Using this particular feature, you can pipe the output of a live system command into your presentation. The above line number 67 pipes the output of the ls -la /boot command into your slide. This command is equivalent to displaying the following data on screen.

trevor@freeos.com:~ > ls -al /boot
total 1062
drwxr-xr-x 3 root root 1024 Sep 7 06:51 .
drwxr-xr-x 21 root root 387 Jan 7 23:55 ..
-rw-r--r-- 1 root root 254408 Mar 25 2000 System.map-2.2.14
-rw-r--r-- 1 root root 512 Sep 7 06:51 boot.0300
-rw-r--r-- 1 root root 4568 Mar 25 2000 boot.b
-rw-r--r-- 1 root root 612 Mar 25 2000 chain.b
drwxr-xr-x 2 root root 12288 Sep 7 06:25 lost+found
-rw------- 1 root root 11776 Sep 7 06:51 map
-rw-r--r-- 1 root root 620 Mar 25 2000 os2_d.b
-rw-r--r-- 1 root root 792796 Mar 25 2000 vmlinuz

Last but not the least we will demonstrate how you can embed an X application into your slide. This powerful feature allows you to display a movie or an mpeg video during your presentation or maybe even run some other application as a demo during the slide.

%page <--69
Wanna See an X APP (multimedia!) <--70
%system xeyes -geometry %50x20+25+60" <--71
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This slide uses the system variable to startup a X application during this particular slide. You could startup any application using the same command line arguments you would have used, had you been working at the CLI ( Command Line Interface).

For a start you could use the script given at the bottom of the article. Run it using the following command:
mgp -g 800x600 sample.mgp

The above command will run the MagicPoint presentation for you in window of size 800x600.
Of course, you could always vary the window size according to your screen resolution. If everything works fine, you know you have taken another step forward towards making your life a little simpler.

This is as far as we go for now. We sincerely hope this tutorial has helped you discover some of the finer aspects of making some elegant presentations on Linux using MagicPoint.

Till next time CIAO !

Other articles by Trevor Warren

Current Rating: [ 7.54 / 10 ] Number of Times Rated: [ 28 ]

More Howtos
* Kernel Compilation & Avoiding ‘Unresolved Symbol’
* Configuring CVS and CVSUP on Linux
* Knoppix installation tips
* Maximum Mount
* A WebServer Guide -- Help Using Apache

Contents
Articles
  Howtos
  Interviews
  News
  Opinions
  Reviews
Comparison
Links
  Articles
  Howtos
  Interviews
  Opinions
  Reviews
  Websites
News

Linux
About Linux

Print It!
Printer Friendly Version