--- /dev/null
+/* DirectFB presentation app
+ *
+ * Copyright (C) 2001 convergence integrated media
+ * Authors: Sven Neumann <sven@convergence.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <directfb.h>
+
+#include <glib-object.h>
+
+#include "apptypes.h"
+
+#include "action.h"
+#include "context.h"
+#include "header.h"
+#include "image.h"
+#include "listitem.h"
+#include "render.h"
+#include "resources.h"
+#include "slides.h"
+#include "slide.h"
+#include "text.h"
+#include "video.h"
+
+
+static void render_bullet (Context *context,
+ gint *offx,
+ gint offy);
+
+void
+render_bg (Context *context)
+{
+ guchar *color;
+
+ color = context_get_bgcolor (context);
+ context->surface->SetColor (context->surface,
+ color[0], color[1], color[2], color[3]);
+ context->surface->FillRectangle (context->surface,
+ 0, 0, context->w, context->h);
+}
+
+void
+render_bgimage (Context *context)
+{
+ gchar *image;
+
+ image = context_get_bgimage (context);
+ if (image)
+ {
+ IDirectFBSurface *src;
+ gint w, h;
+
+ src = resources_get_surface (image);
+ if (!src)
+ return;
+
+ src->GetSize (src, &w, &h);
+
+ if (w == context->w && h == context->h)
+ {
+ context->surface->Blit (context->surface, src, NULL, 0, 0);
+ }
+ else
+ {
+ DFBRectangle rect = { 0, 0, context->w, context->h };
+
+ context->surface->StretchBlit (context->surface,
+ src, NULL, &rect);
+ }
+
+ resources_release_surface (image);
+ }
+}
+
+void
+render_image (Context *context,
+ Image *image)
+{
+ Item *item;
+ IDirectFBSurface *src;
+ DFBRectangle rect;
+ DFBSurfacePixelFormat format;
+ gint w, h, ratio;
+
+ if (IS_VIDEO (image))
+ {
+ Video *video;
+
+ video = (Video *) image;
+ video->dest_surface = context->surface;
+
+ return;
+ }
+
+ src = resources_get_surface (ITEM (image)->value);
+
+ if (!src)
+ return;
+
+ src->GetSize (src, &w, &h);
+ src->GetPixelFormat (src, &format);
+
+ if (format == DSPF_ARGB)
+ context->surface->SetBlittingFlags (context->surface,
+ DSBLIT_BLEND_ALPHACHANNEL);
+
+ ratio = (w * 1024) / h;
+ item = (Item *) image;
+
+ rect.w = item->flags & WIDTH ?
+ item->width : (item->flags & HEIGHT ? (item->height * ratio) / 1024 : w);
+ rect.h = item->flags & HEIGHT ?
+ item->height : (item->flags & WIDTH ? (item->width * 1024) / ratio : h);
+
+ rect.x = item->flags & XOFFSET ? item->x : 0;
+ rect.y = item->flags & YOFFSET ? item->y : 0;
+
+ if (format == DSPF_ARGB)
+ context->surface->SetBlittingFlags (context->surface,
+ DSBLIT_BLEND_ALPHACHANNEL);
+
+ if (w == rect.w || h == rect.h)
+ context->surface->Blit (context->surface, src, NULL, rect.x, rect.y);
+ else
+ context->surface->StretchBlit (context->surface, src, NULL, &rect);
+
+ context->surface->SetBlittingFlags (context->surface, DSBLIT_NOFX);
+
+ resources_release_surface (ITEM (image)->value);
+}
+
+void
+render_text (Context *context,
+ Text *text,
+ gint *offy)
+{
+ guchar *color;
+ gchar *face;
+ gint size;
+ gint offx;
+ IDirectFBFont *font;
+
+ context_push (context, (Item *) text);
+
+ color = context_get_fgcolor (context);
+ context->surface->SetColor (context->surface,
+ color[0], color[1], color[2], color[3]);
+
+ face = context_get_face (context);
+ size = context_get_size (context);
+
+ g_return_if_fail (face != NULL);
+ g_return_if_fail (size > 0);
+
+ offx = 10;
+
+ if (IS_HEADER (text))
+ size = (size * 64) / 52;
+ else if (IS_LISTITEM (text))
+ size = (size * 48) / 64;
+ else
+ offx+=40;
+
+ font = resources_get_font (face, size);
+
+ if (IS_LISTITEM (text))
+ {
+ gint asc;
+
+ font->GetAscender (font, &asc);
+ render_bullet (context, &offx, *offy + asc);
+ }
+
+ context->surface->SetFont (context->surface, font);
+ context->surface->DrawString (context->surface,
+ ITEM (text)->value, -1,
+ offx, *offy, DSTF_TOPLEFT);
+
+ *offy += (size * 64) / 48;
+
+ context_pop (context, (Item *) text);
+}
+
+static void
+render_bullet (Context *context,
+ gint *offx,
+ gint offy)
+{
+ IDirectFBSurface *src;
+ gchar *image;
+ gint w, h;
+
+ image = context_get_bullet (context);
+ if (image)
+ {
+ src = resources_get_surface (image);
+ if (!src)
+ return;
+
+ src->GetSize (src, &w, &h);
+
+ context->surface->SetBlittingFlags (context->surface,
+ DSBLIT_BLEND_ALPHACHANNEL);
+ context->surface->Blit (context->surface,
+ src, NULL, *offx + 20, offy - h);
+ context->surface->SetBlittingFlags (context->surface, DSBLIT_NOFX);
+
+ resources_release_surface (image);
+
+ *offx += w + 24;
+ }
+}
-<?xml version='1.0'?>
-
-<slides effect="slide top left, blend"
- bgcolor="#000000" fgcolor="#FFFFFF"
- face="../ttf/decker.ttf" size="15"
- bgimage="../img/bg.png"
+<?xml version='1.0' encoding='iso-8859-1'?>
+<slides bgcolor="#222266" fgcolor="#9999ff"
+ face="../ttf/decker.ttf" size="15"
bullet="../img/bullet.png"
screen_width="1024" screen_height="768">
-
-<slide effect="none">
-<header size="10"></header>
-<header fgcolor="#5080FF" size="80">WaveLAN</header>
-<header size="20"></header>
-<header fgcolor="#5080FF" size="35">Teil 1: Wireless LAN unter Linux</header>
-<header size="40"></header>
-<text>Benedikt 'Hunz' Heinz, Frank Zirkelbach</text>
-<text/>
-<text>email: hunz@hunz.org, frank@luga.de</text>
-<text>event: Linuxinfotag 2003</text>
-<text>location: FH-Augsburg</text>
+<slide>
+<header size="20" fgcolor="#22FF22"> 1.1 Was ist Wireless LAN?</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Drahtlose Netzwerk Technologie</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> 2.4 GHz Bereich, 14 Channels (unterschiedl. Frequenzen)</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Übertragungsraten 1 - 54 MBit</listitem>
</slide>
<slide>
-<header size="10"></header>
-<header fgcolor="#8080FF" size="35">Inhalt</header>
-<header size="20"></header>
-
-<text size="20">1 Einfuehrung</text>
-<text/>
-<text size="20"> 1.1 Was ist Wireless LAN?</text>
-<text size="20"> 1.2 WaveLAN Hardware</text>
-<text/>
-<text size="20">2 Funktionsweise </text>
-<text/>
-<text size="20"> 2.1 Begriffserklaerungen</text>
-<text size="20"> 2.2 Managed Mode</text>
-<text size="20"> 2.3 AdHoc Mode</text>
-<text size="20"> 2.4 WDS</text>
-<text/>
-<text size="20">3 WaveLAN unter Linux</text>
-<text/>
-<text size="20"> 3.1 Vorraussetzungen</text>
-<text size="20"> 3.2 Client Setup</text>
-<text size="20"> 3.3 AP Setup</text>
-<text/>
-<text size="20">4 Sicherheit</text>
-<text/>
-<text/>
+<header size="20" fgcolor="#22FF22"> 1.2 WaveLAN Hardware</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Accesspoint 120 - 800 Euro</listitem>
+<text> auch als DSL-Router</text>
+<text> siehe Punkt 5</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> WaveLAN Karten 30 - 150 Euro</listitem>
+<text> 22 MBit +40 Euro, 54 MBit > 100 Euro</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Bundles (z.B. AP, 2 Karten) billiger</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Antennen (Planar, Omnidirektional, Richt)</listitem>
+<text> http://www.turnpoint.net/wireless/cantennahowto.html</text>
+<text> Aber: nicht alle Karten/APs haben (gleichen) Antennenanschluss</text>
+<text> maximale Reichweiten 2 - 20 km (nicht alles erlaubt)</text>
</slide>
<slide>
-<header size="10"></header>
-<header fgcolor="#8080FF" size="35">1 Einfuehrung</header>
-<header size="20"></header>
-
+<header size="20" fgcolor="#22FF22"> 2.1 Begriffserklaerungen</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> SSID: Netzwerkname</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> WEP: Verschluesselung (RC4)</listitem>
+<text></text>
+<listitem size="20"> 40 (64) oder 104 (128) Bit Schluessellaenge</listitem>
</slide>
<slide>
-<header size="10"></header>
-<header fgcolor="#8080FF" size="35">2 Funktionsweise </header>
-<header size="20"></header>
+<header size="20" fgcolor="#22FF22"> 2.2 Managed Mode</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Dazu meldet sich jeder Client an einem AccessPoint an</listitem>
+<text> Der AP stellt so die Verbindung zum Ethernet her</text>
+<text> Bsp.: {Client} ~~~ (AP)---[Ethernet]</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Channel wird vom AP festgelegt</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Client wird auf selbe SSID wie AP konfiguriert (automat.)</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Client muss die selben WEPkeys benutzen wie AP</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> An einem Ethernet koennen mehrere APs angeschlossen werden</listitem>
+<text> </text>
+</slide>
+<slide>
+<header size="20" fgcolor="#22FF22"> 2.3 AdHoc Mode</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Nur Wireless Clients ohne AP </listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> daher keine Ethernetverbindung</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Clients muessen selben Channel, SSID und WEPkey haben</listitem>
+<text> Bsp.: {Client 1} ~~~ {Client 2} ~~~ ...</text>
</slide>
<slide>
-<header size="10"></header>
-<header fgcolor="#8080FF" size="35">3 WaveLAN unter Linux</header>
-<header size="20"></header>
+<header size="20" fgcolor="#22FF22"> 2.4 WDS</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Mehrere Ethernets ohne direkte Verbindun werden durch AccessPoints verbunden</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> keine Clients noetig</listitem>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> APs muessen auf selbem Channel sein und die selben WEPkeys haben</listitem>
+</slide>
+<slide>
+<header size="20" fgcolor="#22FF22"> 3.1 Vorraussetzungen</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Kernel</listitem>
+<text> http://www.kernel.org (>=2.4.20 - nicht unbedingt pre/testing/2.5)</text>
+<text> hier: kein PCMCIA Support im Kernel sondern pcmcia-cs</text>
+<text> Network device support ---></text>
+<text> [*] Network device support</text>
+<text> ...</text>
+<text> Wireless LAN (non-hamradio) ---></text>
+<text> [*] Wireless LAN (non-hamradio)</text>
+<text> fuer PCI Karten auch:</text>
+<text> <M> Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)</text>
+<text> <M> Hermes in PLX9052 based PCI adaptor support</text>
+<text> <M> Prism 2.5 PCI 802.11b adaptor support</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> wireless_tools</listitem>
+<text> http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html</text>
+<text></text>
+<listitem size="20"> linux/wireless.h installen</listitem>
+<text> entweder wireless.h ueber /usr/include/linux/wireless.h kopieren oder</text>
+<text> bei neuem kernel /usr/include/linux nach /usr/src/linux/include/linux linken</text>
+<text></text>
+<listitem size="20"> compilen</listitem>
+<text> make</text>
+<text> sudo make install</text>
+<text> /etc/ld.so.conf: /usr/local/lib/ (falls noetig) && ldconfig</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> pcmcia-cs (hier - weil nicht im Kernel)</listitem>
+<text> http://pcmcia-cs.sourceforge.net</text>
+<text></text>
+<listitem size="20"> compilen:</listitem>
+<text> make config (interaktiv)</text>
+<text> make all && make install</text>
+<text></text>
+<listitem size="20"> config: card Eintrag in /etc/pcmcia/config (cardctl info)</listitem>
</slide>
<slide>
-<header size="10"></header>
-<header fgcolor="#8080FF" size="35">4 Sicherheit</header>
-<header size="20"></header>
+<header size="20" fgcolor="#22FF22"> 3.2 Client Setup</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> setzen des WEPkeys</listitem>
+<text> iwconfig eth0 key s:123456789abcd (104 Bit key benutzen, wenn supported!)</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> setzen der SSID</listitem>
+<text> iwconfig eth0 essid "" oder iwconfig eth0 essid any</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Wireless device hochfahren</listitem>
+</slide>
+<slide>
+<header size="20" fgcolor="#22FF22"> 3.3 AP Setup</header>
+<text></text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> Chipsatz</listitem>
+<text> http://www.seattlewireless.net/index.cgi/HardwareComparison</text>
+<text> Prism: HostAP http://hostap.epitest.fi</text>
+<text> Lucent: HermesAP http://hunz.org/hermesap.html</text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> HostAP</listitem>
+<text> Treiber, der IEEE 802.11 management Funktionen am Host Computer uebernimmt</text>
+<text></text>
+<listitem size="20"> build:</listitem>
+<text> cp -a hostap/driver/* ./pcmcia-cs/</text>
+<text> jetzt wie bei pcmcia-cs</text>
+<text></text>
+<listitem size="20"> config:</listitem>
+<text> card Eintrag in /etc/pcmcia/hostap_cs.conf (cardctl info)</text>
+<text> iwconfig wlan0 essid "foobar" (default "test")</text>
+<text> iwconfig wlan0 channel X (zum setzen des channels) </text>
+<text></text>
+<listitem fgcolor="#ff00cc" size="20"> HermesAP</listitem>
+<text> Erweiterter Orinoco Treiber, der AP-Firmware benutzt</text>
+<text></text>
+<listitem size="20"> build: </listitem>
+<text> aus driver/orinoco-0.13b-hermesap-0.1a/ *.c *.h ins wireless dir von pcmcia-cs kopieren</text>
+<text> pcmcia-cs wie oben compilen</text>
+<text></text>
+<listitem size="20"> AP firmware extrahieren und laden:</listitem>
+<text> im firmware dir ./hfwget.sh ausfuehren</text>
+<text> dann firmware mit hfw/hfwload ethX firmware/T108580.hfw laden</text>
+<text></text>
+<listitem size="20"> config:</listitem>
+<text> ssid / wepkeys / channel setzen wie oben</text>
+<text> hidden mode mit iwpriv ethX hidden 1</text>
+<text></text>
</slide>
</slides>