]> git.sesse.net Git - vlc/commitdiff
Keep quiet, explanations will follow.
authorOlivier Teulière <ipkiss@videolan.org>
Tue, 18 Mar 2003 02:21:47 +0000 (02:21 +0000)
committerOlivier Teulière <ipkiss@videolan.org>
Tue, 18 Mar 2003 02:21:47 +0000 (02:21 +0000)
85 files changed:
configure.ac.in
modules/Makefile.am
modules/gui/skins/.cvsignore [new file with mode: 0644]
modules/gui/skins/Modules.am [new file with mode: 0644]
modules/gui/skins/controls/.cvsignore [new file with mode: 0644]
modules/gui/skins/controls/button.cpp [new file with mode: 0644]
modules/gui/skins/controls/button.h [new file with mode: 0644]
modules/gui/skins/controls/checkbox.cpp [new file with mode: 0644]
modules/gui/skins/controls/checkbox.h [new file with mode: 0644]
modules/gui/skins/controls/controls.h [new file with mode: 0644]
modules/gui/skins/controls/generic.cpp [new file with mode: 0644]
modules/gui/skins/controls/generic.h [new file with mode: 0644]
modules/gui/skins/controls/image.cpp [new file with mode: 0644]
modules/gui/skins/controls/image.h [new file with mode: 0644]
modules/gui/skins/controls/playlist.cpp [new file with mode: 0644]
modules/gui/skins/controls/playlist.h [new file with mode: 0644]
modules/gui/skins/controls/rectangle.cpp [new file with mode: 0644]
modules/gui/skins/controls/rectangle.h [new file with mode: 0644]
modules/gui/skins/controls/slider.cpp [new file with mode: 0644]
modules/gui/skins/controls/slider.h [new file with mode: 0644]
modules/gui/skins/controls/text.cpp [new file with mode: 0644]
modules/gui/skins/controls/text.h [new file with mode: 0644]
modules/gui/skins/os_api.h [new file with mode: 0644]
modules/gui/skins/os_bitmap.h [new file with mode: 0644]
modules/gui/skins/os_dialog.h [new file with mode: 0644]
modules/gui/skins/os_event.h [new file with mode: 0644]
modules/gui/skins/os_font.h [new file with mode: 0644]
modules/gui/skins/os_graphics.h [new file with mode: 0644]
modules/gui/skins/os_theme.h [new file with mode: 0644]
modules/gui/skins/os_window.h [new file with mode: 0644]
modules/gui/skins/parser/.cvsignore [new file with mode: 0644]
modules/gui/skins/parser/flex.c [new file with mode: 0644]
modules/gui/skins/parser/skin.act [new file with mode: 0644]
modules/gui/skins/parser/skin.c [new file with mode: 0644]
modules/gui/skins/parser/skin.dtd [new file with mode: 0644]
modules/gui/skins/parser/skin.h [new file with mode: 0644]
modules/gui/skins/parser/wrappers.cpp [new file with mode: 0644]
modules/gui/skins/parser/wrappers.h [new file with mode: 0644]
modules/gui/skins/src/.cvsignore [new file with mode: 0644]
modules/gui/skins/src/anchor.cpp [new file with mode: 0644]
modules/gui/skins/src/anchor.h [new file with mode: 0644]
modules/gui/skins/src/banks.cpp [new file with mode: 0644]
modules/gui/skins/src/banks.h [new file with mode: 0644]
modules/gui/skins/src/bezier.cpp [new file with mode: 0644]
modules/gui/skins/src/bezier.h [new file with mode: 0644]
modules/gui/skins/src/bitmap.cpp [new file with mode: 0644]
modules/gui/skins/src/bitmap.h [new file with mode: 0644]
modules/gui/skins/src/dialog.cpp [new file with mode: 0644]
modules/gui/skins/src/dialog.h [new file with mode: 0644]
modules/gui/skins/src/event.cpp [new file with mode: 0644]
modules/gui/skins/src/event.h [new file with mode: 0644]
modules/gui/skins/src/font.cpp [new file with mode: 0644]
modules/gui/skins/src/font.h [new file with mode: 0644]
modules/gui/skins/src/graphics.cpp [new file with mode: 0644]
modules/gui/skins/src/graphics.h [new file with mode: 0644]
modules/gui/skins/src/skin_common.h [new file with mode: 0644]
modules/gui/skins/src/skin_main.cpp [new file with mode: 0644]
modules/gui/skins/src/theme.cpp [new file with mode: 0644]
modules/gui/skins/src/theme.h [new file with mode: 0644]
modules/gui/skins/src/themeloader.cpp [new file with mode: 0644]
modules/gui/skins/src/themeloader.h [new file with mode: 0644]
modules/gui/skins/src/vlcproc.cpp [new file with mode: 0644]
modules/gui/skins/src/vlcproc.h [new file with mode: 0644]
modules/gui/skins/src/window.cpp [new file with mode: 0644]
modules/gui/skins/src/window.h [new file with mode: 0644]
modules/gui/skins/win32/.cvsignore [new file with mode: 0644]
modules/gui/skins/win32/win32_api.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_bitmap.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_bitmap.h [new file with mode: 0644]
modules/gui/skins/win32/win32_dialog.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_dialog.h [new file with mode: 0644]
modules/gui/skins/win32/win32_dragdrop.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_dragdrop.h [new file with mode: 0644]
modules/gui/skins/win32/win32_event.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_event.h [new file with mode: 0644]
modules/gui/skins/win32/win32_font.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_font.h [new file with mode: 0644]
modules/gui/skins/win32/win32_graphics.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_graphics.h [new file with mode: 0644]
modules/gui/skins/win32/win32_run.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_theme.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_theme.h [new file with mode: 0644]
modules/gui/skins/win32/win32_window.cpp [new file with mode: 0644]
modules/gui/skins/win32/win32_window.h [new file with mode: 0644]
toolbox

index 4f97cf1f245e430054f01b24cda35ed958f01b0d..7d741de967331a1da07fff0b455fe8a3892ed320 100644 (file)
@@ -1669,8 +1669,19 @@ dnl MP4 module
 dnl
 AC_CHECK_HEADERS(zlib.h, [
   LDFLAGS_mp4="${LDFLAGS_mp4} -lz"
+  LDFLAGS_skins="${LDFLAGS_skins} -lz"
 ] )
 
+
+dnl
+dnl skins module
+dnl
+AC_CHECK_HEADERS(libtar.h, [
+  LDFLAGS_skins="${LDFLAGS_skins} -ltar"
+] )
+
+
+
 dnl
 dnl  a52 AC3 decoder plugin
 dnl
@@ -2229,6 +2240,19 @@ then
     PLUGINS="${PLUGINS} beos"
 fi
 
+dnl
+dnl Skins module
+dnl
+AC_ARG_ENABLE(skins,
+  [  --enable-skins         Win32 skins module (default enabled on Win32)])
+if test "x${enable_skins}" != "xno"; then
+  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
+    PLUGINS="${PLUGINS} skins"
+    CPPFLAGS_skins="${CPPFLAGS_skins} -Imodules/gui/skins -Imodules/gui/skins/src -Imodules/gui/skins/win32 -Imodules/gui/skins/controls"
+    LDFLAGS_skins="${LDFLAGS_skins} -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32 -lmsimg32"
+  fi
+fi
+
 dnl
 dnl  Gtk+ module
 dnl
index a5170416a90a6969dc0a33b52519af2ac6e6fb32..0f70f23566a9d67ad53e1c8dde4a0d3e3d37afc9 100644 (file)
@@ -50,6 +50,7 @@ EXTRA_DIST = \
        gui/ncurses/Modules.am \
        gui/qnx/Modules.am \
        gui/qt/Modules.am \
+       gui/skins/Modules.am \
        gui/win32/Modules.am \
        gui/wxwindows/Modules.am \
        misc/Modules.am \
diff --git a/modules/gui/skins/.cvsignore b/modules/gui/skins/.cvsignore
new file mode 100644 (file)
index 0000000..84c4d6f
--- /dev/null
@@ -0,0 +1,6 @@
+.deps
+.dirstamp
+*.dll
+*.dylib
+*.sl
+*.so
diff --git a/modules/gui/skins/Modules.am b/modules/gui/skins/Modules.am
new file mode 100644 (file)
index 0000000..6d092fa
--- /dev/null
@@ -0,0 +1,85 @@
+SOURCES_skins = \
+       modules/gui/skins/os_api.h \
+       modules/gui/skins/os_bitmap.h \
+       modules/gui/skins/os_dialog.h \
+       modules/gui/skins/os_event.h \
+       modules/gui/skins/os_font.h \
+       modules/gui/skins/os_graphics.h \
+       modules/gui/skins/os_theme.h \
+       modules/gui/skins/os_window.h \
+       \
+       modules/gui/skins/controls/controls.h \
+       modules/gui/skins/controls/button.cpp \
+       modules/gui/skins/controls/button.h \
+       modules/gui/skins/controls/checkbox.cpp \
+       modules/gui/skins/controls/checkbox.h \
+       modules/gui/skins/controls/generic.cpp \
+       modules/gui/skins/controls/generic.h \
+       modules/gui/skins/controls/image.cpp \
+       modules/gui/skins/controls/image.h \
+       modules/gui/skins/controls/playlist.cpp \
+       modules/gui/skins/controls/playlist.h \
+       modules/gui/skins/controls/rectangle.cpp \
+       modules/gui/skins/controls/rectangle.h \
+       modules/gui/skins/controls/slider.cpp \
+       modules/gui/skins/controls/slider.h \
+       modules/gui/skins/controls/text.cpp \
+       modules/gui/skins/controls/text.h \
+       \
+       modules/gui/skins/parser/flex.c \
+       modules/gui/skins/parser/skin.h \
+       modules/gui/skins/parser/skin.c \
+       modules/gui/skins/parser/wrappers.h \
+       modules/gui/skins/parser/wrappers.cpp \
+       \
+       modules/gui/skins/src/anchor.cpp \
+       modules/gui/skins/src/anchor.h \
+       modules/gui/skins/src/banks.cpp \
+       modules/gui/skins/src/banks.h \
+       modules/gui/skins/src/bezier.cpp \
+       modules/gui/skins/src/bezier.h \
+       modules/gui/skins/src/bitmap.cpp \
+       modules/gui/skins/src/bitmap.h \
+       modules/gui/skins/src/dialog.cpp \
+       modules/gui/skins/src/dialog.h \
+       modules/gui/skins/src/event.cpp \
+       modules/gui/skins/src/event.h \
+       modules/gui/skins/src/font.cpp \
+       modules/gui/skins/src/font.h \
+       modules/gui/skins/src/graphics.cpp \
+       modules/gui/skins/src/graphics.h \
+       modules/gui/skins/src/skin_main.cpp \
+       modules/gui/skins/src/skin-common.h \
+       modules/gui/skins/src/theme.cpp \
+       modules/gui/skins/src/theme.h \
+       modules/gui/skins/src/themeloader.cpp \
+       modules/gui/skins/src/themeloader.h \
+       modules/gui/skins/src/vlcproc.cpp \
+       modules/gui/skins/src/vlcproc.h \
+       modules/gui/skins/src/window.cpp \
+       modules/gui/skins/src/window.h \
+       \
+       modules/gui/skins/win32/win32_api.cpp \
+       modules/gui/skins/win32/win32_bitmap.cpp \
+       modules/gui/skins/win32/win32_bitmap.h \
+       modules/gui/skins/win32/win32_dialog.cpp \
+       modules/gui/skins/win32/win32_dialog.h \
+       modules/gui/skins/win32/win32_dragdrop.cpp \
+       modules/gui/skins/win32/win32_dragdrop.h \
+       modules/gui/skins/win32/win32_event.cpp \
+       modules/gui/skins/win32/win32_event.h \
+       modules/gui/skins/win32/win32_font.cpp \
+       modules/gui/skins/win32/win32_font.h \
+       modules/gui/skins/win32/win32_graphics.cpp \
+       modules/gui/skins/win32/win32_graphics.h \
+       modules/gui/skins/win32/win32_run.cpp \
+       modules/gui/skins/win32/win32_theme.cpp \
+       modules/gui/skins/win32/win32_theme.h \
+       modules/gui/skins/win32/win32_window.cpp \
+       modules/gui/skins/win32/win32_window.h \
+       $(NULL)
+
+EXTRA_DIST += \
+       modules/gui/skins/parser/skin.dtd \
+       modules/gui/skins/parser/skin.act
+
diff --git a/modules/gui/skins/controls/.cvsignore b/modules/gui/skins/controls/.cvsignore
new file mode 100644 (file)
index 0000000..84c4d6f
--- /dev/null
@@ -0,0 +1,6 @@
+.deps
+.dirstamp
+*.dll
+*.dylib
+*.sl
+*.so
diff --git a/modules/gui/skins/controls/button.cpp b/modules/gui/skins/controls/button.cpp
new file mode 100644 (file)
index 0000000..bd1d929
--- /dev/null
@@ -0,0 +1,216 @@
+/*****************************************************************************
+ * button.cpp: Button control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: button.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "bitmap.h"
+#include "banks.h"
+#include "generic.h"
+#include "button.h"
+#include "event.h"
+#include "theme.h"
+#include "window.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// Control Button
+//---------------------------------------------------------------------------
+ControlButton::ControlButton( string id, bool visible, int x, int y, string Up,
+    string Down, string Disabled, string click, string tooltiptext, string help,
+    Window *Parent ) : GenericControl( id, visible, help, Parent )
+{
+    Left            = x;
+    Top             = y;
+    State           = 1;                   // 1 = up - 0 = down
+    Selected        = false;
+    Enabled         = true;
+    ClickActionName = click;
+    this->Up        = Up;
+    this->Down      = Down;
+    this->Disabled  = Disabled;
+
+    ToolTipText = tooltiptext;
+}
+//---------------------------------------------------------------------------
+ControlButton::~ControlButton()
+{
+}
+//---------------------------------------------------------------------------
+void ControlButton::Init()
+{
+    // Init bitmaps
+    Img = new (Bitmap*)[3];
+    Img[0] = p_intf->p_sys->p_theme->BmpBank->Get( Up );
+    Img[1] = p_intf->p_sys->p_theme->BmpBank->Get( Down );
+    if( Disabled == "none" )
+        Img[2] = p_intf->p_sys->p_theme->BmpBank->Get( Up );
+    else
+        Img[2] = p_intf->p_sys->p_theme->BmpBank->Get( Disabled );
+
+    // Get size of control
+    Img[0]->GetSize( Width, Height );
+
+    // Create script
+    ClickAction = new Action( p_intf, ClickActionName );
+}
+//---------------------------------------------------------------------------
+bool ControlButton::ProcessEvent( Event *evt )
+{
+    switch( evt->GetMessage() )
+    {
+        case CTRL_ENABLED:
+            Enable( (Event*)evt->GetParam1(), (bool)evt->GetParam2() );
+            break;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlButton::MoveRelative( int xOff, int yOff )
+{
+    Left += xOff;
+    Top  += yOff;
+}
+//---------------------------------------------------------------------------
+void ControlButton::Draw( int x, int y, int w, int h, Graphics *dest )
+{
+    if( !Visible )
+        return;
+
+    int xI, yI, wI, hI;
+    if( GetIntersectRgn( x,y,w,h,Left,Top,Width,Height, xI, yI, wI, hI ) )
+    {
+        // Button is in down state
+        if( State == 0 && Enabled )
+            Img[1]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
+
+        // Button is in up state
+        if( State == 1 && Enabled )
+            Img[0]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
+
+        // Button is disabled
+        if( !Enabled )
+            Img[2]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
+    }
+}
+//---------------------------------------------------------------------------
+bool ControlButton::MouseUp( int x, int y, int button )
+{
+    if( !Enabled )
+        return false;
+
+    if( Img[1]->Hit( x - Left, y - Top ) && button == 1 && Selected )
+    {
+        State = 1;
+        Selected = false;
+        ClickAction->SendEvent();
+        ParentWindow->Refresh( Left, Top, Width, Height );
+        return true;
+    }
+
+    if( button == 1 )
+        Selected = false;
+
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlButton::MouseDown( int x, int y, int button )
+{
+    if( !Enabled )
+        return false;
+
+    if( Img[0]->Hit( x - Left, y - Top ) && button == 1 )
+    {
+        State = 0;
+        Selected = true;
+        ParentWindow->Refresh( Left, Top, Width, Height );
+        return true;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlButton::MouseMove( int x, int y, int button )
+{
+    if( !Enabled || !Selected || !button )
+        return false;
+
+    if( MouseOver( x, y ) )
+    {
+        if( State == 1 )
+        {
+            State = 0;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+        }
+    }
+    else
+    {
+        if( State == 0 )
+        {
+            State = 1;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+        }
+    }
+    return true;
+}
+//---------------------------------------------------------------------------
+bool ControlButton::MouseOver( int x, int y )
+{
+    if( Img[1 - State]->Hit( x - Left, y - Top ) )
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+//---------------------------------------------------------------------------
+bool ControlButton::ToolTipTest( int x, int y )
+{
+    if( MouseOver( x, y ) && Enabled )
+    {
+        ParentWindow->ChangeToolTipText( ToolTipText );
+        return true;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlButton::Enable( Event *event, bool enabled )
+{
+    if( !ClickAction->MatchEvent( event, ACTION_MATCH_ONE ) )
+        return;
+
+    if( enabled != Enabled )
+    {
+        Enabled = enabled;
+        ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/controls/button.h b/modules/gui/skins/controls/button.h
new file mode 100644 (file)
index 0000000..39777db
--- /dev/null
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ * button.h: Button control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: button.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_BUTTON
+#define VLC_SKIN_CONTROL_BUTTON
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Action;
+class Graphics;
+class Window;
+
+//---------------------------------------------------------------------------
+class ControlButton : public GenericControl
+{
+    private:
+        // Image IDs
+        string      Up;
+        string      Down;
+        string      Disabled;
+
+        // Control behaviour
+        bool        Selected;
+        bool        Enabled;
+
+        // List of actions to execute when clicking
+        Action     *ClickAction;
+        string      ClickActionName;
+
+        // ToolTip text
+        string      ToolTipText;
+
+    public:
+        // Constructor
+        ControlButton( string id, bool visible, int x, int y, string Up,
+                       string Down, string Disabled, string click,
+                       string tooltiptext, string help, Window *Parent );
+
+        // Destructor
+        virtual ~ControlButton();
+
+        // Initializations
+        virtual void Init();
+        virtual bool ProcessEvent( Event *evt );
+
+        // Draw button
+        virtual void Draw( int x1, int y1, int x2, int y2, Graphics *dest );
+
+        // Mouse events
+        virtual bool MouseUp( int x, int y, int button );
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseMove( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+        virtual bool ToolTipTest( int x, int y );
+
+        // Translate control
+        virtual void MoveRelative( int xOff, int yOff );
+
+        // Enabling control
+        virtual void Enable( Event *event, bool enabled );
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/controls/checkbox.cpp b/modules/gui/skins/controls/checkbox.cpp
new file mode 100644 (file)
index 0000000..63c6918
--- /dev/null
@@ -0,0 +1,320 @@
+/*****************************************************************************
+ * checkbox.cpp: Checkbox control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: checkbox.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "bitmap.h"
+#include "banks.h"
+#include "generic.h"
+#include "checkbox.h"
+#include "event.h"
+#include "theme.h"
+#include "window.h"
+#include "skin_common.h"
+
+
+#include "os_event.h"
+#include "os_window.h"
+
+//---------------------------------------------------------------------------
+// Checkbox Button
+//---------------------------------------------------------------------------
+ControlCheckBox::ControlCheckBox( string id, bool visible, int x, int y,
+    string img1, string img2, string click1, string click2, string disabled1,
+    string disabled2, string action1, string action2, string tooltiptext1,
+    string tooltiptext2, string help,
+    Window *Parent ) : GenericControl( id, visible, help, Parent )
+{
+    Left             = x;
+    Top              = y;
+    State            = 1;                   // 1 = up - 0 = down
+    Selected         = false;
+    Act              = 1;
+    Enabled1         = true;
+    Enabled2         = true;
+    Img1             = img1;
+    Img2             = img2;
+    Click1           = click1;
+    Click2           = click2;
+    Disabled1        = disabled1;
+    Disabled2        = disabled2;
+    ClickActionName1 = action1;
+    ClickActionName2 = action2;
+    ToolTipText1     = tooltiptext1;
+    ToolTipText2     = tooltiptext2;
+}
+//---------------------------------------------------------------------------
+ControlCheckBox::~ControlCheckBox()
+{
+}
+//---------------------------------------------------------------------------
+void ControlCheckBox::Init()
+{
+    Img = new (Bitmap*)[6];
+
+    // Images for position 1
+    Img[0] = p_intf->p_sys->p_theme->BmpBank->Get( Img1 );
+    if( Click1 == "none" )
+        Img[1] = p_intf->p_sys->p_theme->BmpBank->Get( Img2 );
+    else
+        Img[1] = p_intf->p_sys->p_theme->BmpBank->Get( Click1 );
+
+    // Images for position 2
+    Img[2] = p_intf->p_sys->p_theme->BmpBank->Get( Img2 );
+    if( Click2 == "none" )
+        Img[3] = p_intf->p_sys->p_theme->BmpBank->Get( Img1 );
+    else
+        Img[3] = p_intf->p_sys->p_theme->BmpBank->Get( Click2 );
+
+    // Disabled images
+    if( Disabled1 == "none" )
+        Img[4] = p_intf->p_sys->p_theme->BmpBank->Get( Img1 );
+    else
+        Img[4] = p_intf->p_sys->p_theme->BmpBank->Get( Disabled1 );
+    if( Disabled2 == "none" )
+        Img[5] = p_intf->p_sys->p_theme->BmpBank->Get( Img2 );
+    else
+        Img[5] = p_intf->p_sys->p_theme->BmpBank->Get( Disabled2 );
+
+    // Get Size of control
+    Img[0]->GetSize( Width, Height );
+
+    // Create script
+    ClickAction1 = new Action( p_intf, ClickActionName1 );
+    ClickAction2 = new Action( p_intf, ClickActionName2 );
+
+}
+//---------------------------------------------------------------------------
+bool ControlCheckBox::ProcessEvent( Event *evt  )
+{
+    switch( evt->GetMessage() )
+    {
+        case CTRL_ENABLED:
+            Enable( (Event*)evt->GetParam1(), (bool)evt->GetParam2() );
+            break;
+        case CTRL_SYNCHRO:
+            if( ClickAction1->MatchEvent( (Event*)evt->GetParam1(),
+                ACTION_MATCH_ONE ) )
+            {
+                Act = 2;
+                ParentWindow->Refresh( Left, Top, Width, Height );
+            }
+            else if( ClickAction2->MatchEvent( (Event*)evt->GetParam1(),
+                ACTION_MATCH_ONE ) )
+            {
+                Act = 1;
+                ParentWindow->Refresh( Left, Top, Width, Height );
+            }
+            break;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlCheckBox::MoveRelative( int xOff, int yOff )
+{
+    Left += xOff;
+    Top  += yOff;
+}
+//---------------------------------------------------------------------------
+void ControlCheckBox::Draw( int x, int y, int w, int h, Graphics *dest )
+{
+    if( !Visible )
+        return;
+
+    int xI, yI, wI, hI;
+    if( GetIntersectRgn( x,y,w,h,Left,Top,Width,Height, xI, yI, wI, hI ) )
+    {
+        if( Act == 1 )
+        {
+            if( State == 1 && Enabled1 )
+                Img[0]->DrawBitmap( xI-Left,yI-Top,wI,hI,xI-x,yI-y,dest );
+            else if( State == 0 && Enabled1 )
+                Img[1]->DrawBitmap( xI-Left,yI-Top,wI,hI,xI-x,yI-y,dest );
+            else
+                Img[4]->DrawBitmap( xI-Left,yI-Top,wI,hI,xI-x,yI-y,dest );
+        }
+        else if( Act == 2 )
+        {
+            if( State == 1 && Enabled2 )
+                Img[2]->DrawBitmap( xI-Left,yI-Top,wI,hI,xI-x,yI-y,dest );
+            else if( State == 0 && Enabled2 )
+                Img[3]->DrawBitmap( xI-Left,yI-Top,wI,hI,xI-x,yI-y,dest );
+            else
+                Img[5]->DrawBitmap( xI-Left,yI-Top,wI,hI,xI-x,yI-y,dest );
+        }
+    }
+}
+//---------------------------------------------------------------------------
+bool ControlCheckBox::MouseUp( int x, int y, int button )
+{
+    // Test enabled
+    if( ( !Enabled1 && Act == 1 ) || ( !Enabled2 && Act == 2 ) )
+        return false;
+
+    if( button == 1 && Selected )
+    {
+        if( Act == 1 && Img[1]->Hit( x - Left, y - Top ) )
+        {
+            State    = 1;
+            Selected = false;
+            Act      = 2;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+            ClickAction1->SendEvent();
+            return true;
+        }
+        else if( Act == 2 && Img[3]->Hit( x - Left, y - Top ) )
+        {
+            State    = 1;
+            Selected = false;
+            Act      = 1;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+            ClickAction2->SendEvent();
+            return true;
+        }
+    }
+    Selected = false;
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlCheckBox::MouseDown( int x, int y, int button )
+{
+    // Test enabled
+    if( ( !Enabled1 && Act == 1 ) || ( !Enabled2 && Act == 2 ) )
+        return false;
+
+    if( button == 1 )
+    {
+        if( Act == 1 && Img[0]->Hit( x - Left, y - Top ) )
+        {
+            State    = 0;
+            Selected = true;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+            return true;
+        }
+        else if( Act == 2 && Img[2]->Hit( x - Left, y - Top ) )
+        {
+            State    = 0;
+            Selected = true;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+            return true;
+        }
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlCheckBox::MouseMove( int x, int y, int button )
+{
+    // Test enabled
+    if( !Selected || !button )
+        return false;
+
+    if( ( !Enabled1 && Act == 1 ) || ( !Enabled2 && Act == 2 ) )
+        return false;
+
+    if( Act == 1 )
+    {
+        if( State == 1 && Img[0]->Hit( x - Left, y - Top ) )
+        {
+            State = 0;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+        }
+        else if( State == 0 && !Img[1]->Hit( x - Left, y - Top ) )
+        {
+            State = 1;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+        }
+    }
+    else if( Act == 2 )
+    {
+        if( State == 1 && Img[2]->Hit( x - Left, y - Top ) )
+        {
+            State = 0;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+        }
+        else if( State == 0 && !Img[3]->Hit( x - Left, y - Top ) )
+        {
+            State = 1;
+            ParentWindow->Refresh( Left, Top, Width, Height );
+        }
+    }
+    return true;
+}
+//---------------------------------------------------------------------------
+bool ControlCheckBox::MouseOver( int x, int y )
+{
+    if( Act == 1 )
+    {
+        if( Img[1 - State]->Hit( x - Left, y - Top ) )
+            return true;
+    }
+    else if( Act == 2 )
+    {
+        if( Img[3 - State]->Hit( x - Left, y - Top ) )
+            return true;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlCheckBox::ToolTipTest( int x, int y )
+{
+    if( Act == 1 && MouseOver( x, y ) && Enabled1 )
+    {
+        ParentWindow->ChangeToolTipText( ToolTipText1 );
+        return true;
+    }
+    else if( Act == 2 && MouseOver( x, y ) && Enabled2 )
+    {
+        ParentWindow->ChangeToolTipText( ToolTipText2 );
+        return true;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlCheckBox::Enable( Event *event, bool enabled )
+{
+    if( enabled != !Enabled1 &&
+        ClickAction1->MatchEvent( event, ACTION_MATCH_ONE ) )
+    {
+        Enabled1 = enabled;
+        if( Act == 1 )
+            ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+
+
+
+    else if( enabled != !Enabled2 &&
+        ClickAction2->MatchEvent( event, ACTION_MATCH_ONE ) )
+    {
+        Enabled2 = enabled;
+        if( Act == 2 )
+            ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/controls/checkbox.h b/modules/gui/skins/controls/checkbox.h
new file mode 100644 (file)
index 0000000..73c6c6e
--- /dev/null
@@ -0,0 +1,100 @@
+/*****************************************************************************
+ * checkbox.h: Checkbox control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: checkbox.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_CHECKBOX
+#define VLC_SKIN_CONTROL_CHECKBOX
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Action;
+class Graphics;
+class Window;
+
+//---------------------------------------------------------------------------
+class ControlCheckBox : public GenericControl
+{
+    private:
+        // Image IDs
+        string Img1;
+        string Img2;
+        string Click1;
+        string Click2;
+        string Disabled1;
+        string Disabled2;
+
+        // Behaviour
+        bool Enabled1;
+        bool Enabled2;
+        bool Selected;
+
+        // List of actions to execute when clicking
+        int      Act;
+        Action  *ClickAction1;
+        string   ClickActionName1;
+        Action  *ClickAction2;
+        string   ClickActionName2;
+
+        // ToolTip text
+        string      ToolTipText1;
+        string      ToolTipText2;
+
+    public:
+        // Constructor
+        ControlCheckBox( string id, bool visible, int x, int y, string img1,
+            string img2,  string click1, string click2, string disabled1,
+            string disabled2, string action1, string action2,
+            string tooltiptext1, string tooltiptext2, string help,
+            Window *Parent );
+
+        // Destructor
+        virtual ~ControlCheckBox();
+
+        // initialization
+        virtual void Init();
+        virtual bool ProcessEvent( Event *evt );
+
+        // Draw button
+        virtual void Draw( int x1, int y1, int x2, int y2, Graphics *dest );
+
+        // Mouse events
+        virtual bool MouseUp( int x, int y, int button );
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseMove( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+        virtual bool ToolTipTest( int x, int y );
+
+        // Translate control
+        virtual void MoveRelative( int xOff, int yOff );
+
+        // Enabling control
+        virtual void Enable( Event *event, bool enabled );
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/controls/controls.h b/modules/gui/skins/controls/controls.h
new file mode 100644 (file)
index 0000000..b71b2d6
--- /dev/null
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * controls.h:
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: controls.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#include "generic.h"
+#include "button.h"
+#include "checkbox.h"
+#include "image.h"
+#include "slider.h"
+#include "playlist.h"
+#include "text.h"
diff --git a/modules/gui/skins/controls/generic.cpp b/modules/gui/skins/controls/generic.cpp
new file mode 100644 (file)
index 0000000..c23a878
--- /dev/null
@@ -0,0 +1,226 @@
+/*****************************************************************************
+ * generic.cpp: Generic control, parent of the others
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: generic.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "bitmap.h"
+#include "os_bitmap.h"
+#include "banks.h"
+#include "graphics.h"
+#include "os_graphics.h"
+#include "event.h"
+#include "generic.h"
+#include "window.h"
+#include "theme.h"
+#include "skin_common.h"
+
+
+//---------------------------------------------------------------------------
+// Generic Control
+//---------------------------------------------------------------------------
+GenericControl::GenericControl( string id, bool visible, string help,
+                                Window *Parent )
+{
+    ID      = id;
+    Visible = visible;
+    Help    = help;
+    ParentWindow = Parent;
+    Img     = NULL;
+    p_intf  = Parent->GetIntf();
+}
+//---------------------------------------------------------------------------
+GenericControl::~GenericControl()
+{
+    if( Img != NULL )
+        delete Img;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::GenericProcessEvent( Event *evt )
+{
+    switch( evt->GetMessage() )
+    {
+        case CTRL_ID_VISIBLE:
+            if( (GenericControl *)evt->GetParam1() == this )
+            {
+                if( ( evt->GetParam2() == 0 && Visible ) ||
+                    ( evt->GetParam2() == 1 && !Visible ) ||
+                    ( evt->GetParam2() == 2 ) )
+                {
+                    Visible = !Visible;
+                    ParentWindow->Refresh( Left, Top, Width, Height );
+                }
+            }
+            return false;
+
+        case CTRL_ID_MOVE:
+            if( (GenericControl *)evt->GetParam1() == this )
+            {
+                int x = evt->GetParam2() & 0x7FFF;
+                int y = evt->GetParam2() >> 16 & 0x7FFF;
+                if( evt->GetParam2() & 0x8000 )
+                    x = -x;
+                if( evt->GetParam2() >> 16 & 0x8000 )
+                    y = -y;
+                MoveRelative( x, y );
+                ParentWindow->ReSize();
+                ParentWindow->RefreshAll();
+            }
+            return false;
+
+        default:
+            return ProcessEvent( evt );
+    }
+
+}
+//---------------------------------------------------------------------------
+bool GenericControl::IsID( string id )
+{
+    if( ID == "none" || ID != id )
+    {
+        return false;
+    }
+    else
+    {
+        return true;
+    }
+}
+//---------------------------------------------------------------------------
+void GenericControl::Init()
+{
+}
+//---------------------------------------------------------------------------
+bool GenericControl::ProcessEvent( Event *evt )
+{
+    return false;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::MouseUp( int x, int y, int button )
+{
+    return false;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::MouseDown( int x, int y, int button )
+{
+    return false;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::MouseMove( int x, int y, int button )
+{
+    return false;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::MouseOver( int x, int y )
+{
+    return false;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::MouseDblClick( int x, int y, int button )
+{
+    return false;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::SendNewHelpText()
+{
+    if( Help != "" )
+    {
+        p_intf->p_sys->p_theme->EvtBank->Get( "help" )
+            ->PostTextMessage( Help );
+        return true;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool GenericControl::ToolTipTest( int x, int y )
+{
+    return false;
+}
+//---------------------------------------------------------------------------
+void GenericControl::Enable( Event *event, bool enabled )
+{
+}
+//---------------------------------------------------------------------------
+bool GenericControl::GetIntersectRgn( int x1, int y1, int w1, int h1, int x2,
+    int y2, int w2, int h2, int &x, int &y, int &w, int &h )
+{
+    if( x1 < x2 )       {x = x2;}      else {x = x1;}
+    if( y1 < y2 )       {y = y2;}      else {y = y1;}
+    if( x1+w1 < x2+w2 ) {w = x1+w1-x;} else {w = x2+w2-x;}
+    if( y1+h1 < y2+h2 ) {h = y1+h1-y;} else {h = y2+h2-y;}
+    return (w > 0 && h > 0);
+}
+//---------------------------------------------------------------------------
+void GenericControl::Move( int left, int top )
+{
+    MoveRelative( left - Left, top - Top );
+}
+//---------------------------------------------------------------------------
+void GenericControl::MoveRelative( int xOff, int yOff )
+{
+    Left += xOff;
+    Top  += yOff;
+}
+//---------------------------------------------------------------------------
+Region *GenericControl::CreateRegionFromBmp( Bitmap *bmp, int MoveX, int MoveY )
+{
+    // Initialization
+        Region *Buffer;
+        int w, h;
+        int x = 0, y = 0, x_first = 0;
+        bmp->GetSize( w, h );
+
+        Buffer = (Region *)new OSRegion;
+
+    // Parse bitmap
+        for( y = 0; y < h; y++ )
+        {
+            for( x = 0; x < w; x++ )
+            {
+
+                if( bmp->GetBmpPixel( x, y ) == bmp->GetAlphaColor() )
+                {
+                    if( x_first != x )
+                    {
+                        Buffer->AddRectangle( x_first + MoveX, y + MoveY,
+                                              x + MoveX, y + 1 + MoveY );
+                    }
+                    x_first = x + 1;
+                }
+            }
+            if( x_first != w )
+            {
+                Buffer->AddRectangle( x_first + MoveX, y + MoveY,
+                                        w + MoveX, y + 1 + MoveY );
+            }
+            x_first = 0;
+        }
+    // End of parsing
+    return Buffer;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/controls/generic.h b/modules/gui/skins/controls/generic.h
new file mode 100644 (file)
index 0000000..87fb05b
--- /dev/null
@@ -0,0 +1,106 @@
+/*****************************************************************************
+ * generic.h: Generic control, parent of the others
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: generic.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_GENERIC
+#define VLC_SKIN_CONTROL_GENERIC
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Window;
+class Bitmap;
+class Graphics;
+class Region;
+class Event;
+
+//---------------------------------------------------------------------------
+// Generic control class
+//---------------------------------------------------------------------------
+class GenericControl               // This is the generic control class
+{
+    protected:
+        Window * ParentWindow;
+        bool     Visible;
+        string   ID;
+        string   Help;
+        intf_thread_t *p_intf;
+
+    private:
+    public:
+        // Constructor
+        GenericControl( string id, bool visible, string help, Window *Parent );
+
+        // Destructor
+        virtual ~GenericControl();
+
+        // initializations
+        virtual void Init();
+        bool GenericProcessEvent( Event *evt );
+        virtual bool ProcessEvent( Event *evt );
+
+        // Draw the control into the destination DC
+        virtual void Draw( int x, int y, int w, int h, Graphics *dest ) = 0;
+
+        // Simulate a mouse action on control at coordinates x/y
+        virtual bool MouseUp( int x, int y, int button );
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseMove( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+        virtual bool MouseDblClick( int x, int y, int button );
+        virtual bool ToolTipTest( int x, int y );
+        virtual bool SendNewHelpText();
+
+        // Move control
+        void Move( int left, int top );
+        virtual void MoveRelative( int xOff, int yOff );
+
+        // Get two rectangle regions and return intersection
+        bool GetIntersectRgn( int x1, int y1, int w1, int h1, int x2,
+            int y2, int w2, int h2, int &x, int &y, int &w, int &h );
+
+        // Create a region from a bitmap with transcolor as empty region
+        Region *CreateRegionFromBmp( Bitmap *bmp, int MoveX, int MoveY );
+        int Left;               // Left offset of the control
+        int Top;                // Top offset of the control
+        int Width;              // Width of the control
+        int Height;             // Height of the control
+        int State;              // Used to special state of the control
+                                // (for button, sets whether down or up)
+        Bitmap **Img;           // Array of bitmap used to draw control
+
+        // Enabling control
+        virtual void Enable( Event *event, bool enabled );
+
+        // Found if ID matches
+        bool IsID( string id );
+};
+//---------------------------------------------------------------------------
+
+
+#endif
diff --git a/modules/gui/skins/controls/image.cpp b/modules/gui/skins/controls/image.cpp
new file mode 100644 (file)
index 0000000..5e7b01a
--- /dev/null
@@ -0,0 +1,124 @@
+/*****************************************************************************
+ * image.cpp: Image control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: image.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "bitmap.h"
+#include "banks.h"
+#include "generic.h"
+#include "image.h"
+#include "event.h"
+#include "theme.h"
+#include "window.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// Control Image
+//---------------------------------------------------------------------------
+ControlImage::ControlImage( string id, bool visible, int x, int y, string img,
+    string event, string help, Window *Parent )
+    : GenericControl( id, visible, help, Parent )
+{
+    Left                = x;
+    Top                 = y;
+    MouseDownActionName = event;
+    Enabled             = true;
+    Bg                  = img;
+}
+//---------------------------------------------------------------------------
+ControlImage::~ControlImage()
+{
+}
+//---------------------------------------------------------------------------
+void ControlImage::Init()
+{
+    Img    = new (Bitmap*)[1];
+    Img[0] = p_intf->p_sys->p_theme->BmpBank->Get( Bg );
+    Img[0]->GetSize( Width, Height );
+
+    // Create script
+    MouseDownAction = new Action( p_intf, MouseDownActionName );
+
+}
+//---------------------------------------------------------------------------
+bool ControlImage::ProcessEvent( Event *evt  )
+{
+
+    switch( evt->GetMessage() )
+    {
+        case CTRL_ENABLED:
+            Enable( (Event*)evt->GetParam1(), (bool)evt->GetParam2() );
+            break;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlImage::Draw( int x, int y, int w, int h, Graphics *dest )
+{
+    if( !Visible )
+        return;
+
+    int xI, yI, wI, hI;
+    if( GetIntersectRgn(x, y, w, h, Left, Top, Width, Height, xI, yI, wI, hI ) )
+        Img[0]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
+
+}
+//---------------------------------------------------------------------------
+bool ControlImage::MouseDown( int x, int y, int button )
+{
+    if( !Enabled || !Img[0]->Hit( x - Left, y - Top ) || button != 1 ||
+        !MouseDownAction->SendEvent() )
+        return false;
+    return true;
+}
+//---------------------------------------------------------------------------
+bool ControlImage::MouseOver( int x, int y )
+{
+    if( Img[0]->Hit( x - Left, y - Top ) )
+        return true;
+    else
+        return false;
+}
+//---------------------------------------------------------------------------
+void ControlImage::Enable( Event *event, bool enabled )
+{
+    if( !MouseDownAction->MatchEvent( event, ACTION_MATCH_ONE ) )
+        return;
+
+    if( enabled != !Enabled )
+    {
+        Enabled = enabled;
+        ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+
+}
+//---------------------------------------------------------------------------
+
+
diff --git a/modules/gui/skins/controls/image.h b/modules/gui/skins/controls/image.h
new file mode 100644 (file)
index 0000000..baf8f3f
--- /dev/null
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * image.h: Image control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: image.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_IMAGE
+#define VLC_SKIN_CONTROL_IMAGE
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Action;
+class Graphics;
+class Window;
+
+//---------------------------------------------------------------------------
+class ControlImage : public GenericControl
+{
+    private:
+        // Image ID
+        string Bg;
+
+        // Behaviour
+        bool Enabled;
+
+        // List of actions to execute when clicking
+        Action  *MouseDownAction;
+        string   MouseDownActionName;
+
+    public:
+        // Constructor
+        ControlImage( string id, bool visible, int x, int y, string img,
+            string event, string help, Window *Parent);
+
+        // Destructor
+        virtual ~ControlImage();
+
+        // initialization
+        virtual void Init();
+        virtual bool ProcessEvent( Event *evt );
+
+        //Draw image
+        virtual void Draw( int x, int y, int w, int h, Graphics *dest );
+
+        // Mouse events
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+
+        // Enabling control
+        virtual void Enable( Event *event, bool enabled );
+
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/controls/playlist.cpp b/modules/gui/skins/controls/playlist.cpp
new file mode 100644 (file)
index 0000000..cc740ef
--- /dev/null
@@ -0,0 +1,516 @@
+/*****************************************************************************
+ * playlist.cpp: Playlist control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: playlist.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- GENERAL ---------------------------------------------------------------
+#include <math.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "bitmap.h"
+#include "banks.h"
+#include "bezier.h"
+#include "graphics.h"
+#include "os_graphics.h"
+#include "font.h"
+#include "os_font.h"
+#include "generic.h"
+#include "slider.h"
+#include "playlist.h"
+#include "event.h"
+#include "theme.h"
+#include "window.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// Control Playlist
+//---------------------------------------------------------------------------
+ControlPlayList::ControlPlayList( string id, bool visible, int width,
+    int infowidth, string font, string playfont, int selcolor, double *ptx,
+    double *pty, int nb, bool longfilename, string help, Window *Parent )
+    : GenericControl( id, visible, help, Parent )
+{
+    Left          = 0;
+    Top           = 0;
+    Column        = 1;
+    Line          = 1;
+    Margin        = 1;
+    Enabled       = true;
+    FontName      = font;
+    PlayFontName  = playfont;
+
+    // Text zone
+    CaseWidth    = width;
+    InfoWidth    = infowidth;
+    NumWidth     = 0;
+    FileWidth    = 0;
+    CaseHeight   = 1;
+    NumOfItems   = 0;
+    SelectColor  = selcolor;
+    TextCurve    = new Bezier( ptx, pty, nb, BEZIER_PTS_Y );
+    LongFileName = longfilename;
+
+    // Scroll
+    StartIndex  = 0;
+}
+//---------------------------------------------------------------------------
+ControlPlayList::~ControlPlayList()
+{
+    if( PlayList != NULL )
+    {
+        vlc_object_release( PlayList );
+    }
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::Init()
+{
+    int i, j, h;
+    int *x, *y;
+
+    // Font & events
+    UpdateEvent = p_intf->p_sys->p_theme->EvtBank->Get( "playlist_refresh" );
+    TextFont    = p_intf->p_sys->p_theme->FntBank->Get( FontName );
+    if( PlayFontName == "none" )
+        PlayFont = p_intf->p_sys->p_theme->FntBank->Get( FontName );
+    else
+        PlayFont = p_intf->p_sys->p_theme->FntBank->Get( PlayFontName );
+
+    TextFont->GetSize( "lp", h, CaseHeight );
+
+    // Get bitmap from list
+    Img = NULL;
+
+    // Get points for Text curve
+    h  = TextCurve->GetNumOfDifferentPoints();
+    x  = new int[h + 1];
+    y  = new int[h + 1];
+    TextCurve->GetDifferentPoints( x, y, 0, 0 );
+
+    // Get top of first point
+    TextCurve->GetPoint( 0, i, TextTop );
+
+    // Set number of lines
+    Line = 0;
+    for( i = 0; i < h; i++ )
+    {
+        if( ( Line + 1 ) * CaseHeight < y[i] - TextTop )
+            Line++;
+    }
+    CaseLeft     = new int[Line];
+    CaseRight    = new int[Line];
+    CaseTextLeft = new int[Line];
+    for( i = 0; i < Line; i++ )
+    {
+        CaseLeft[i]     = x[i * CaseHeight];
+        CaseTextLeft[i] = x[i * CaseHeight];
+        for( j = 1; j < CaseHeight; j++ )
+        {
+            if( x[i * CaseHeight + j] < CaseLeft[i] )
+                CaseLeft[i] = x[i * CaseHeight + j];
+            if( x[i * CaseHeight + j] > CaseTextLeft[i] )
+                CaseTextLeft[i] = x[i * CaseHeight + j];
+        }
+        CaseRight[i] = CaseTextLeft[i] + CaseWidth;
+    }
+
+    // Get size of text zone
+    TextHeight = Line * CaseHeight;
+    TextLeft   = CaseLeft[0];
+    TextWidth  = CaseRight[0];
+    for( i = 1; i < Line; i++ )
+    {
+        if( CaseLeft[i] < TextLeft )
+            TextLeft = CaseLeft[i];
+        if( CaseRight[i] > TextWidth )
+            TextWidth = CaseRight[i];
+    }
+    TextWidth -= TextLeft;
+
+    // Set Text Clipping Region
+    TextClipRgn = (Region *)new OSRegion;
+    for( i = 0; i < Line; i++ )
+    {
+        for( j = 0; j < CaseHeight; j++ )
+        {
+            h = i * CaseHeight + j;
+            TextClipRgn->AddRectangle( x[h] - TextLeft, h, CaseWidth, 1 );
+        }
+    }
+
+    // Curve is no more needed so delete it
+    delete TextCurve;
+    delete[] x;
+    delete[] y;
+
+    // Get size of control
+    Left   = Slider->Left;
+    Top    = Slider->Top;
+    Width  = Slider->Left + Slider->Width;
+    Height = Slider->Top  + Slider->Height;
+    if( TextLeft < Left )
+        Left = TextLeft;
+    if( TextTop  < Top  )
+        Top  = TextTop;
+    if( TextLeft + TextWidth  > Width )
+        Width  = TextLeft + TextWidth;
+    if( TextTop + TextHeight > Height )
+        Height  = TextTop  + TextHeight;
+    Width  -= Left;
+    Height -= Top;
+
+    // Getting playlist
+    PlayList = (playlist_t *)
+        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+    if( PlayList == NULL )
+        msg_Err( p_intf, "cannot find a playlist object" );
+
+    Slider->Init();
+    Slider->Enable( p_intf->p_sys->p_theme->EvtBank->Get( "none" ), true );
+    RefreshList();
+}
+//---------------------------------------------------------------------------
+bool ControlPlayList::ProcessEvent( Event *evt )
+{
+    switch( evt->GetMessage() )
+    {
+        case CTRL_ENABLED:
+            Enable( (Event*)evt->GetParam1(), (bool)evt->GetParam2() );
+            break;
+
+        case CTRL_SYNCHRO:
+            if( UpdateEvent->IsEqual( (Event*)evt->GetParam1() ) )
+            {
+                RefreshList();
+                RefreshAll();
+            }
+            break;
+
+        case PLAYLIST_ID_DEL:
+            if( (GenericControl *)evt->GetParam1() == this )
+            {
+                for( int i = PlayList->i_size - 1; i >= 0; i-- )
+                {
+                    if( Select[i] && i != PlayList->i_index )
+                        playlist_Delete( PlayList, i );
+                }
+                RefreshAll();
+            }
+            break;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::RefreshList()
+{
+    if( NumOfItems != PlayList->i_size )
+    {
+        if( NumOfItems > 0 )
+            delete Select;
+        NumOfItems = PlayList->i_size;
+        if( PlayList->i_size > 0 )
+        {
+            Select = new bool[NumOfItems];
+            for( int i = 0; i < NumOfItems; i++ )
+                Select[i] = false;
+            int h;
+            sprintf( Num, " %i", NumOfItems + 1 );
+            TextFont->GetSize( Num, NumWidth, h);
+            FileWidth = CaseWidth - NumWidth - InfoWidth;
+        }
+
+        int Range = PlayList->i_size - Line * Column;
+        if( Range < 0 )
+            Range = 0;
+
+        Slider->ChangeSliderRange( Range );
+        StartIndex = Slider->GetCursorPosition();
+    }
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::RefreshAll()
+{
+    ParentWindow->Refresh( TextLeft, TextTop, TextWidth, TextHeight );
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::Draw( int x, int y, int w, int h, Graphics *dest )
+{
+    if( !Visible )
+        return;
+
+    int xI, yI, wI, hI;
+    // Slider Image
+    Slider->Draw( x, y, w, h, dest );
+
+    // TextZone
+    if( GetIntersectRgn( x, y, w, h, TextLeft, TextTop, TextWidth, TextHeight,
+                         xI, yI, wI, hI) )
+    {
+        // Change clipping region
+        Region *destClipRgn = (Region *)new OSRegion( 0, 0, w, h );
+        TextClipRgn->Move( TextLeft - x, TextTop - y );
+        dest->SetClipRegion( TextClipRgn );
+
+        // Draw each line
+        DrawAllCase( dest, x, y, wI, hI );
+
+        // Reset clipping region to old region
+        dest->SetClipRegion( destClipRgn );
+        delete destClipRgn;
+        TextClipRgn->Move( x - TextLeft, y - TextTop );
+    }
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::DrawAllCase( Graphics *dest, int x, int y, int w, int h )
+{
+    int i;
+    for( i = 0; i < PlayList->i_size - StartIndex && i < Line * Column; i++ )
+    {
+        DrawCase( dest, i + StartIndex, x, y, w, h );
+    }
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::DrawCase( Graphics *dest, int i, int x, int y, int w,
+                                int h )
+{
+    // Test if case is in range
+    int j = i - StartIndex;
+    if( j < 0 || j >= Line * Column )
+        return;
+
+    // Draw background if selected
+    if( Select[i] )
+    {
+        dest->DrawRect(
+            CaseLeft[j] - x,
+            TextTop + j * CaseHeight - y,
+            CaseRight[j] - CaseLeft[j],
+            CaseHeight,
+            SelectColor
+        );
+    }
+
+    // Choose font
+    Font *F;
+    if( PlayList->i_index == i )
+        F = PlayFont;
+    else
+        F = TextFont;
+
+    // Print number
+    sprintf( Num, "%i", i + 1 );
+    F->Print( dest,
+        Num,
+        CaseTextLeft[j] - x, TextTop + j * CaseHeight - y,
+        NumWidth - Margin, CaseHeight, DT_RIGHT );
+
+    // Print name
+    F->Print( dest,
+        GetFileName( i ),
+        NumWidth + Margin + CaseTextLeft[j] - x,
+        TextTop + j * CaseHeight - y,
+        FileWidth - 2 * Margin, CaseHeight, DT_LEFT );
+
+    // Print info
+    F->Print( dest,
+        "no info",
+        NumWidth + FileWidth + Margin + CaseTextLeft[j] - x,
+        TextTop + j * CaseHeight - y,
+        InfoWidth - Margin, CaseHeight, DT_CENTER );
+}
+//---------------------------------------------------------------------------
+char * ControlPlayList::GetFileName( int i )
+{
+    if( LongFileName )
+    {
+        return PlayList->pp_items[i]->psz_name;
+    }
+    else
+    {
+        string f = PlayList->pp_items[i]->psz_name;
+        int pos  = f.rfind( DIRECTORY_SEPARATOR, f.size() );
+        return PlayList->pp_items[i]->psz_name + pos + 1;
+    }
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::MoveRelative( int xOff, int yOff )
+{
+    Slider->MoveRelative( xOff, yOff );
+    Left     += xOff;
+    Top      += yOff;
+    TextLeft += xOff;
+    TextTop  += yOff;
+    for( int i = 1; i < Line; i++ )
+    {
+        CaseLeft[i]     += xOff;
+        CaseTextLeft[i] += xOff;
+        CaseRight[i]    += xOff;
+    }
+}
+//---------------------------------------------------------------------------
+double ControlPlayList::Dist( int x1, int y1, int x2, int y2 )
+{
+    return sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
+}
+//---------------------------------------------------------------------------
+bool ControlPlayList::MouseDown( int x, int y, int button )
+{
+    if( !Enabled )
+        return false;
+
+    // If hit into slider
+    if( Slider->MouseDown( x, y, button ) )
+    {
+        int New = Slider->GetCursorPosition();
+        if( New != StartIndex )
+        {
+            StartIndex = New;
+            ParentWindow->Refresh( TextLeft,TextTop,TextWidth,TextHeight );
+        }
+        return true;
+    }
+
+    if( !TextClipRgn->Hit( x - TextLeft, y - TextTop ) )
+        return false;
+
+    // If hit in a case
+    int i, j;
+    for( i = 0; i < PlayList->i_size - StartIndex && i < Line * Column; i++)
+    {
+        if( x >= CaseLeft[i] && x <= CaseRight[i] && y >= TextTop +
+            i * CaseHeight  && y < TextTop + (i + 1) * CaseHeight )
+        {
+            for( j = 0; j < NumOfItems; j++ )
+            {
+                if( j == i + StartIndex )
+                    Select[j] = !Select[j];
+            }
+            RefreshAll();
+            return true;
+        }
+    }
+
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlPlayList::MouseUp( int x, int y, int button )
+{
+    if( !Enabled )
+        return false;
+
+    // If hit into slider
+    if( Slider->MouseUp( x, y, button ) )
+        return true;
+
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlPlayList::MouseMove( int x, int y, int button )
+{
+    if( !Enabled || !button )
+        return false;
+
+    // If hit into slider
+    if( Slider->MouseMove( x, y, button ) )
+    {
+        int New = Slider->GetCursorPosition();
+        if( New != StartIndex )
+        {
+            StartIndex = New;
+            RefreshAll();
+        }
+        return true;
+    }
+
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlPlayList::MouseOver( int x, int y )
+{
+    if( TextClipRgn->Hit( x - Left, y - Top ) || Slider->MouseOver( x, y ) )
+        return true;
+    else
+        return false;
+}
+//---------------------------------------------------------------------------
+bool ControlPlayList::MouseDblClick( int x, int y, int button )
+{
+    if( !Enabled || button != 1 )
+        return false;
+
+    int i;
+
+    if( !TextClipRgn->Hit( x - TextLeft, y - TextTop ) )
+        return false;
+
+    for( i = 0; i < PlayList->i_size - StartIndex && i < Line * Column; i++ )
+    {
+        if( x >= CaseLeft[i] && x <= CaseRight[i] && y >=
+            TextTop + i * CaseHeight  && y < TextTop + (i + 1) * CaseHeight )
+        {
+            playlist_Goto( PlayList, i + StartIndex );
+            OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)false );
+            return true;
+        }
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlPlayList::ToolTipTest( int x, int y )
+{
+    if( !Enabled )
+        return false;
+
+    int i, w, h;
+    for( i = 0; i < PlayList->i_size - StartIndex && i < Line * Column; i++ )
+    {
+        if( x >= CaseLeft[i] && x <= CaseRight[i] && y >=
+            TextTop + i * CaseHeight  && y < TextTop + (i + 1) * CaseHeight )
+        {
+            TextFont->GetSize( PlayList->pp_items[i + StartIndex]->psz_name, w,
+                               h );
+            if( w > FileWidth )
+            {
+                ParentWindow->ChangeToolTipText(
+                    (string)PlayList->pp_items[i + StartIndex]->psz_name );
+                return true;
+            }
+        }
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlPlayList::InitSliderCurve( double *ptx, double *pty, int nb,
+                                       string scroll_up, string scroll_down )
+{
+    Slider = new ControlSlider( "none", true, "none", scroll_up, scroll_down,
+        ptx, pty, nb, "none", "", ParentWindow );
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/controls/playlist.h b/modules/gui/skins/controls/playlist.h
new file mode 100644 (file)
index 0000000..632f507
--- /dev/null
@@ -0,0 +1,131 @@
+/*****************************************************************************
+ * playlist.h: Playlist control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: playlist.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_PLAYLIST
+#define VLC_SKIN_CONTROL_PLAYLIST
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Event;
+class Graphics;
+class Window;
+class Font;
+class Bezier;
+class Region;
+
+//---------------------------------------------------------------------------
+#define MAX_PLAYLIST_SIZE 7
+
+//---------------------------------------------------------------------------
+class ControlPlayList : public GenericControl
+{
+    private:
+        Event      *UpdateEvent;
+        Font       *TextFont;
+        Font       *PlayFont;
+        string      FontName;
+        string      PlayFontName;
+        bool        Enabled;
+        playlist_t *PlayList;
+
+        // Scroll slider
+        ControlSlider *Slider;
+        int StartIndex;
+
+        // Playlist text zone
+        int Margin;
+        int Column;
+        int Line;
+        int CaseHeight;
+
+        int CaseWidth;
+        int NumWidth;
+        int FileWidth;
+        int InfoWidth;
+        char Num[MAX_PLAYLIST_SIZE];
+
+        int *CaseRight;
+        int *CaseLeft;
+        int *CaseTextLeft;
+        int TextLeft;
+        int TextTop;
+        int TextHeight;
+        int TextWidth;
+        Bezier *TextCurve;
+        Region *TextClipRgn;
+
+        int  NumOfItems;
+        int  SelectColor;
+        bool *Select;
+
+        bool LongFileName;
+        char * GetFileName( int i );
+
+        // Calculate distance between two points
+        double Dist( int x1, int y1, int x2, int y2 );
+
+        // Text functions
+        void DrawAllCase( Graphics *dest, int x, int y, int w, int h );
+        void DrawCase( Graphics *dest, int i, int x, int y, int w, int h );
+        void RefreshList();
+        void RefreshAll();
+
+    public:
+        // Constructor
+        ControlPlayList( string id, bool visible, int width, int infowidth,
+                         string font, string playfont, int selcolor,
+                         double *ptx, double *pty, int nb, bool longfilename,
+                         string help, Window *Parent );
+
+        // Destructor
+        virtual ~ControlPlayList();
+
+        // initialization
+        virtual void Init();
+        virtual bool ProcessEvent( Event *evt );
+        void InitSliderCurve( double *ptx, double *pty, int nb,
+                              string scroll_up, string scroll_down );
+
+        // Draw control
+        virtual void Draw( int x, int y, int w, int h, Graphics *dest );
+
+        // Mouse events
+        virtual bool MouseUp( int x, int y, int button );
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseMove( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+        virtual bool MouseDblClick( int x, int y, int button );
+        virtual bool ToolTipTest( int x, int y );
+
+        // Translate control
+        virtual void MoveRelative( int xOff, int yOff );
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/controls/rectangle.cpp b/modules/gui/skins/controls/rectangle.cpp
new file mode 100644 (file)
index 0000000..c144ded
--- /dev/null
@@ -0,0 +1,124 @@
+/*****************************************************************************
+ * image.cpp: Image control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: rectangle.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "graphics.h"
+#include "bitmap.h"
+#include "banks.h"
+#include "generic.h"
+#include "rectangle.h"
+#include "event.h"
+#include "theme.h"
+#include "window.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// Control Image
+//---------------------------------------------------------------------------
+ControlRectangle::ControlRectangle( string id, bool visible, int x, int y,
+    int w, int h, int color, string event, string help, Window *Parent )
+    : GenericControl( id, visible, help, Parent )
+{
+    Left                = x;
+    Top                 = y;
+    Width               = w;
+    Height              = h;
+    MouseDownActionName = event;
+    Enabled             = true;
+    Color               = OSAPI_GetNonTransparentColor( color );
+}
+//---------------------------------------------------------------------------
+ControlRectangle::~ControlRectangle()
+{
+}
+//---------------------------------------------------------------------------
+void ControlRectangle::Init()
+{
+    // Create script
+    MouseDownAction = new Action( p_intf, MouseDownActionName );
+}
+//---------------------------------------------------------------------------
+bool ControlRectangle::ProcessEvent( Event *evt  )
+{
+
+    switch( evt->GetMessage() )
+    {
+        case CTRL_ENABLED:
+            Enable( (Event*)evt->GetParam1(), (bool)evt->GetParam2() );
+            break;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlRectangle::Draw( int x, int y, int w, int h, Graphics *dest )
+{
+    if( !Visible )
+        return;
+
+    int xI, yI, wI, hI;
+    if( GetIntersectRgn(x, y, w, h, Left, Top, Width, Height, xI, yI, wI, hI ) )
+    {
+        dest->DrawRect( xI - x,  yI - y, wI, hI, Color );
+    }
+}
+//---------------------------------------------------------------------------
+bool ControlRectangle::MouseDown( int x, int y, int button )
+{
+    if( !Enabled || !MouseOver( x, y ) || button != 1 ||
+        !MouseDownAction->SendEvent() )
+        return false;
+    return true;
+}
+//---------------------------------------------------------------------------
+bool ControlRectangle::MouseOver( int x, int y )
+{
+    if( x >= Left && x <= Left + Width && y >= Top && y <= Top + Height )
+        return true;
+    else
+        return false;
+}
+//---------------------------------------------------------------------------
+void ControlRectangle::Enable( Event *event, bool enabled )
+{
+    if( !MouseDownAction->MatchEvent( event, ACTION_MATCH_ONE ) )
+        return;
+
+    if( enabled != !Enabled )
+    {
+        Enabled = enabled;
+        ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+
+}
+//---------------------------------------------------------------------------
+
+
diff --git a/modules/gui/skins/controls/rectangle.h b/modules/gui/skins/controls/rectangle.h
new file mode 100644 (file)
index 0000000..9b6d49a
--- /dev/null
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * image.h: Image control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: rectangle.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_RECTANGLE
+#define VLC_SKIN_CONTROL_RECTANGLE
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Action;
+class Graphics;
+class Window;
+
+//---------------------------------------------------------------------------
+class ControlRectangle : public GenericControl
+{
+    private:
+        // Background color
+        int Color;
+
+        // Behaviour
+        bool Enabled;
+
+        // List of actions to execute when clicking
+        Action  *MouseDownAction;
+        string   MouseDownActionName;
+
+    public:
+        // Constructor
+        ControlRectangle( string id, bool visible, int x, int y, int w, int h,
+            int color, string event, string help, Window *Parent);
+
+        // Destructor
+        virtual ~ControlRectangle();
+
+        // initialization
+        virtual void Init();
+        virtual bool ProcessEvent( Event *evt );
+
+        //Draw image
+        virtual void Draw( int x, int y, int w, int h, Graphics *dest );
+
+        // Mouse events
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+
+        // Enabling control
+        virtual void Enable( Event *event, bool enabled );
+
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/controls/slider.cpp b/modules/gui/skins/controls/slider.cpp
new file mode 100644 (file)
index 0000000..c3f5b05
--- /dev/null
@@ -0,0 +1,389 @@
+/*****************************************************************************
+ * slider.cpp: Slider control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: slider.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- GENERAL ---------------------------------------------------------------
+#include <math.h>
+#include <stdio.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "bitmap.h"
+#include "bezier.h"
+#include "banks.h"
+#include "graphics.h"
+#include "os_graphics.h"
+#include "generic.h"
+#include "slider.h"
+#include "event.h"
+#include "theme.h"
+#include "window.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// Control Slider
+//---------------------------------------------------------------------------
+ControlSlider::ControlSlider( string id, bool visible, string type,
+    string cursorUp, string cursorDown, double *ptx, double *pty, int nb,
+    string tooltiptext, string help, Window *Parent )
+    : GenericControl( id, visible, help, Parent )
+{
+    Type             = type;
+    Left             = 0;
+    Top              = 0;
+    State            = 1;
+    Value            = 0;
+    Selected         = false;
+    Enabled          = false;
+    this->cursorUp   = cursorUp;
+    this->cursorDown = cursorDown;
+    Curve            = new Bezier( ptx, pty, nb );
+    UpdateEvent      = NULL;
+    SliderRange      = SLIDER_RANGE;
+    LastRefreshTime  = OSAPI_GetTime();
+
+    // Tool tip text
+    BaseToolTipText = tooltiptext;
+    FullToolTipText = BaseToolTipText;
+}
+//---------------------------------------------------------------------------
+ControlSlider::~ControlSlider()
+{
+    delete[] CursorX;
+    delete[] CursorY;
+    DeleteObject( HitRgn );
+}
+//---------------------------------------------------------------------------
+void ControlSlider::Init()
+{
+    int i;
+    // Get bitmap from list
+    Img    = new (Bitmap*)[2];
+    Img[0] = p_intf->p_sys->p_theme->BmpBank->Get( cursorUp );
+    Img[1] = p_intf->p_sys->p_theme->BmpBank->Get( cursorDown );
+
+    // Get images sizes
+    Img[0]->GetSize( CWidth, CHeight );
+
+    // Computing slider curve : get points
+    MaxValue = Curve->GetNumOfDifferentPoints();
+    CursorX  = new int[MaxValue + 1];
+    CursorY  = new int[MaxValue + 1];
+    Curve->GetDifferentPoints( CursorX, CursorY, -CWidth / 2, -CHeight / 2 );
+
+        // Search for size value
+        Left   = CursorX[0];
+        Top    = CursorY[0];
+        Width  = CursorX[0];
+        Height = CursorY[0];
+        for( i = 1; i <= MaxValue; i++ )
+        {
+            if( CursorX[i] < Left )
+                Left = CursorX[i];
+            if( CursorY[i] < Top )
+                Top  = CursorY[i];
+            if( CursorX[i] > Width )
+                Width = CursorX[i];
+            if( CursorY[i] > Height )
+                Height  = CursorY[i];
+        }
+        Width  += CWidth  - Left;
+        Height += CHeight - Top;
+
+        // Curve is no more needed so delete it
+        delete Curve;
+
+    // Create Hit Region
+    HitRgn = (Region *)new OSRegion;
+
+    // Create slider hit region and move cursor inside control
+    for( i = 0; i <= MaxValue; i++ )
+    {
+        HitRgn->AddElipse( CursorX[i], CursorY[i], CWidth, CHeight );
+        CursorX[i] -= Left;
+        CursorY[i] -= Top;
+    }
+
+    // Select type of slider
+    if( Type == "time" )
+    {
+        Enabled = false;
+        UpdateEvent = p_intf->p_sys->p_theme->EvtBank->Get( "time" );
+    }
+    else if( Type == "volume" )
+    {
+        Enabled = true;
+        UpdateEvent = p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" );
+    }
+    else
+    {
+        Enabled = false;
+        UpdateEvent = p_intf->p_sys->p_theme->EvtBank->Get( "none" );
+    }
+}
+//---------------------------------------------------------------------------
+bool ControlSlider::ProcessEvent( Event *evt )
+{
+    unsigned int msg = evt->GetMessage();
+    unsigned int p1  = evt->GetParam1();
+    int          p2  = evt->GetParam2();
+
+    switch( msg )
+    {
+        case CTRL_ENABLED:
+            Enable( (Event*)p1, (bool)p2 );
+            return true;
+
+        case CTRL_SET_SLIDER:
+            if( UpdateEvent->IsEqual( (Event*)p1 ) )
+            {
+                SetCursorPosition( (long)p2 );
+            }
+            return true;
+
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlSlider::MoveRelative( int xOff, int yOff )
+{
+    Left += xOff;
+    Top  += yOff;
+    HitRgn->Move( xOff, yOff );
+}
+//---------------------------------------------------------------------------
+void ControlSlider::SetCursorPosition( long Pos )
+{
+    if( Pos < 0 )
+        Pos = 0;
+    if( Pos > SliderRange )
+        Pos = SliderRange;
+
+    if( !Selected )
+    {
+        if( SliderRange == 0 )
+            MoveCursor( 0 );
+        else
+            MoveCursor( Pos * MaxValue / SliderRange );
+    }
+}
+//---------------------------------------------------------------------------
+long ControlSlider::GetCursorPosition()
+{
+    return SliderRange * Value / MaxValue;
+}
+//---------------------------------------------------------------------------
+void ControlSlider::MoveCursor( int newValue )
+{
+    int X, Y, W, H;
+    int OldValue = Value;
+    Value = newValue;
+    if( OldValue != Value )
+    {
+        X = (CursorX[Value] > CursorX[OldValue])
+            ? Left + CursorX[OldValue] : Left + CursorX[Value];
+        Y = (CursorY[Value] > CursorY[OldValue])
+            ? Top  + CursorY[OldValue] : Top  + CursorY[Value];
+        W = (CursorX[Value] > CursorX[OldValue])
+            ? CursorX[Value] - CursorX[OldValue] + CWidth
+            : CursorX[OldValue] - CursorX[Value] + CWidth;
+        H = (CursorY[Value] > CursorY[OldValue])
+            ? CursorY[Value] - CursorY[OldValue] + CHeight
+            : CursorY[OldValue] - CursorY[Value] + CHeight;
+        if( 2 * CWidth * CHeight < W * H )
+        {
+            ParentWindow->Refresh( Left + CursorX[OldValue],
+                Top + CursorY[OldValue], CWidth, CHeight );
+            ParentWindow->Refresh( Left + CursorX[Value],
+                Top + CursorY[Value], CWidth, CHeight );
+        }
+        else
+        {
+            ParentWindow->Refresh( X, Y, W, H );
+        }
+
+        // Change tooltip
+        if( BaseToolTipText != "none" )
+        {
+            char *percent = new char[6];
+            sprintf( percent, "%i %%", Value * 100 / MaxValue );
+            FullToolTipText = BaseToolTipText + " - " + (string)percent;
+            delete[] percent;
+        }
+    }
+}
+//---------------------------------------------------------------------------
+void ControlSlider::Draw( int x, int y, int w, int h, Graphics *dest )
+{
+    if( !Visible )
+        return;
+
+    int xI, yI, wI, hI;
+
+    if( GetIntersectRgn( x, y, w, h, Left+CursorX[Value], Top+CursorY[Value],
+                         CWidth, CHeight, xI, yI, wI, hI ) )
+    {
+        Img[1 - State]->DrawBitmap( xI - Left - CursorX[Value],
+            yI - Top - CursorY[Value], wI, hI, xI - x, yI - y, dest );
+    }
+}
+//---------------------------------------------------------------------------
+bool ControlSlider::MouseUp( int x, int y, int button )
+{
+    State = 1;
+    if( Enabled && Selected )
+    {
+        Selected = false;
+        ParentWindow->Refresh( Left + CursorX[Value],
+            Top + CursorY[Value], CWidth, CHeight );
+        UpdateEvent->SetParam2( GetCursorPosition() );
+        UpdateEvent->SendEvent();
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlSlider::MouseDown( int x, int y, int button )
+{
+    if( !Enabled )
+        return false;
+
+    // If hit into cursor or indide active slider region
+    if( HitRgn->Hit( x, y ) && button == 1 )
+    {
+        State = 0;
+        Selected = true;
+        MoveCursor( FindNearestPoint( x, y ) );
+        UpdateEvent->SetParam2( GetCursorPosition() );
+        UpdateEvent->SendEvent();
+        return true;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlSlider::MouseMove( int x, int y, int button )
+{
+    if( !Enabled || !Selected || !button )
+        return false;
+
+    MoveCursor( FindNearestPoint( x, y ) );
+
+    // Refresh value if time ellapsed since last refresh is more than 200 ms
+    int time = OSAPI_GetTime();
+    if( time > LastRefreshTime + 250 )
+    {
+        UpdateEvent->SetParam2( GetCursorPosition() );
+        UpdateEvent->SendEvent();
+        LastRefreshTime = time;
+    }
+    return true;
+}
+//---------------------------------------------------------------------------
+bool ControlSlider::MouseOver( int x, int y )
+{
+    if( HitRgn->Hit( x, y ) )
+        return true;
+    else
+        return false;
+}
+//---------------------------------------------------------------------------
+bool ControlSlider::ToolTipTest( int x, int y )
+{
+    if( MouseOver( x, y ) )
+    {
+        if( BaseToolTipText == "none" )
+        {
+            ParentWindow->ChangeToolTipText( BaseToolTipText );
+        }
+        else
+        {
+            ParentWindow->ChangeToolTipText( FullToolTipText );
+        }
+        return true;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlSlider::ChangeSliderRange( int NewRange )
+{
+    if( NewRange == SliderRange )
+        return;
+
+    SliderRange = NewRange;
+
+    int Pos = GetCursorPosition();
+    SetCursorPosition( Pos );
+
+}
+//---------------------------------------------------------------------------
+void ControlSlider::Enable( Event *event, bool enabled )
+{
+    if( !UpdateEvent->IsEqual( event ) )
+        return;
+
+    if( enabled && !Enabled )
+    {
+        Enabled = true;
+        ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+    else if( !enabled && Enabled )
+    {
+        Enabled = false;
+        ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+}
+//---------------------------------------------------------------------------
+int ControlSlider::FindNearestPoint( int x, int y )
+{
+    int i, wx, wy;
+    double D;
+    double minD = 50;
+    int RefValue = Value;
+    // Move point inside control
+    OSAPI_GetMousePos( x, y );              // This is used to avoid bug with
+                                            // negative values
+    ParentWindow->GetPos( wx, wy );
+    x += -wx - Left - CWidth  / 2;
+    y += -wy - Top  - CHeight / 2;
+
+    // Search nearest point
+    for( i = 0; i <= MaxValue; i++ )
+    {
+        D = sqrt( ( CursorX[i] - x ) * ( CursorX[i] - x ) +
+                  ( CursorY[i] - y ) * ( CursorY[i] - y ) );
+        if( D < minD )
+        {
+            minD = D;
+            RefValue = i;
+        }
+    }
+    return RefValue;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/controls/slider.h b/modules/gui/skins/controls/slider.h
new file mode 100644 (file)
index 0000000..ef6e726
--- /dev/null
@@ -0,0 +1,114 @@
+/*****************************************************************************
+ * slider.h: Slider control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: slider.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_SLIDER
+#define VLC_SKIN_CONTROL_SLIDER
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Event;
+class Graphics;
+class Window;
+class Bezier;
+class Region;
+
+//---------------------------------------------------------------------------
+class ControlSlider : public GenericControl
+{
+    private:
+        string Type;
+        string cursorUp;
+        string cursorDown;
+        Bezier *Curve;
+        bool Selected;
+        Event *UpdateEvent;
+        bool Enabled;       // Is the button active
+
+        // Cursor properties
+        int CWidth;         // Width of cursor
+        int CHeight;        // Height of cursor
+        int * CursorX;      // Array of x coordinates of slider points
+        int * CursorY;      // Array of y coordinates of slider points
+        Region *HitRgn;     // Active region for mouse events
+        int LastRefreshTime;
+
+        // Slider properties
+        int SliderRange;    // Should stay to SLIDER_RANGE
+        int MaxValue;       // Maximum value of the slider
+        int Value;          // Value of slider
+
+        // ToolTip text
+        string BaseToolTipText;
+        string FullToolTipText;
+
+        int FindNearestPoint( int x, int y );
+
+        // Move cursor (wether SLIDER_MAX in skin_common.h)
+        void MoveCursor( int newValue );
+
+
+    public:
+        // Constructor
+        ControlSlider( string id, bool visible, string type, string cursorUp,
+            string cursorDown, double *ptx, double *pty, int nb,
+            string tooltiptext, string help, Window *Parent );
+
+        // Destructor
+        virtual ~ControlSlider();
+
+        // initialization
+        virtual void Init();
+        virtual bool ProcessEvent( Event *evt );
+
+        // Draw control
+        virtual void Draw( int x, int y, int w, int h, Graphics *dest );
+
+        // Mouse events
+        virtual bool MouseUp( int x, int y, int button );
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseMove( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+        virtual bool ToolTipTest( int x, int y );
+
+        // Slider calls
+        void SetCursorPosition( long Pos );
+        long GetCursorPosition();
+
+        // Enabling control
+        virtual void Enable( Event *event, bool enabled );
+
+        // Translate control
+        virtual void MoveRelative( int xOff, int yOff );
+
+        // Change SliderRange (do not use if not sure)
+        void ChangeSliderRange( int NewRange );
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/controls/text.cpp b/modules/gui/skins/controls/text.cpp
new file mode 100644 (file)
index 0000000..07dc3ac
--- /dev/null
@@ -0,0 +1,386 @@
+/*****************************************************************************
+ * text.cpp: Text control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: text.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "bitmap.h"
+#include "banks.h"
+#include "graphics.h"
+#include "os_graphics.h"
+#include "font.h"
+#include "generic.h"
+#include "text.h"
+#include "event.h"
+#include "theme.h"
+#include "window.h"
+#include "os_window.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// Scrolling : one for each OS
+//---------------------------------------------------------------------------
+
+    //-----------------------------------------------------------------------
+    // Win32 methods
+    //-----------------------------------------------------------------------
+    #if defined( WIN32 )
+    void CALLBACK ScrollingTextTimer( HWND hwnd, UINT uMsg, UINT_PTR idEvent,
+        DWORD dwTime )
+    {
+        if( (ControlText *)idEvent != NULL
+            && !( (ControlText *)idEvent )->GetSelected() )
+        {
+            ( (ControlText *)idEvent )->DoScroll();
+        }
+
+    }
+    //-----------------------------------------------------------------------
+    void ControlText::StartScrolling()
+    {
+        SetTimer( ( (Win32Window *)ParentWindow )->GetHandle(), (UINT_PTR)this,
+                  100, (TIMERPROC)ScrollingTextTimer );
+    }
+    //-----------------------------------------------------------------------
+    void ControlText::StopScrolling()
+    {
+        KillTimer( ( (Win32Window *)ParentWindow )->GetHandle(),
+                   (UINT_PTR)this );
+    }
+    //-----------------------------------------------------------------------
+
+
+    #endif
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// CONTROL TEXT
+//---------------------------------------------------------------------------
+ControlText::ControlText( string id, bool visible, int x, int y, string text,
+    string font, int align, int width, string display, bool scroll,
+    int scrollspace, string help, Window *Parent )
+    : GenericControl( id, visible, help, Parent )
+{
+    InitLeft         = x;
+    Top              = y;
+    InitWidth        = width;
+    FontName         = font;
+    Text             = text;
+    Align            = align;
+    Selected         = false;
+
+    // Scrolling parameters
+    InitScroll       = scroll;
+    Scroll           = false;
+    ScrollSpace      = scrollspace;
+    PauseScroll      = false;
+
+    // Initialize display
+    if( display != "none" )
+    {
+        int begin = 0;
+        int pos = display.find( ';', 0 );
+        while( pos > 0 )
+        {
+            DisplayList.push_back( display.substr( begin, pos - begin ) );
+            begin = pos + 1;
+            pos = display.find( ';', begin );
+        }
+        DisplayList.push_back(
+            display.substr( begin, display.size() - begin ) );
+        Display = DisplayList.begin();
+    }
+
+}
+//---------------------------------------------------------------------------
+ControlText::~ControlText()
+{
+    if( TextClipRgn != NULL )
+        delete TextClipRgn;
+    TextWidth = 0;
+    SetScrolling();
+}
+//---------------------------------------------------------------------------
+void ControlText::Init()
+{
+    TextFont     = p_intf->p_sys->p_theme->FntBank->Get( FontName );
+
+    // Init clipping region
+    TextClipRgn = NULL;
+
+    // Get size of control
+    SetSize();
+    SetScrolling();
+}
+//---------------------------------------------------------------------------
+void ControlText::SetScrolling()
+{
+    if( !Scroll && TextWidth > Width )
+    {
+        if( InitScroll )
+        {
+            Scroll = true;
+            StartScrolling();
+        }
+    }
+    else if( Scroll && TextWidth <= Width )
+    {
+        StopScrolling();
+        Scroll = false;
+    }
+}
+//---------------------------------------------------------------------------
+void ControlText::SetSize()
+{
+    // Get size parameters
+    int w, h;
+    TextFont->GetSize( Text, w, h );
+    TextWidth = w;
+
+    // Get width if not set
+    if( InitWidth <= 0 )
+        Width  = w;
+    else
+        Width  = InitWidth;
+
+    // Set height
+    Height = h;
+
+    // Set position wether alignment
+    if( Align == DT_CENTER )
+    {
+        Left     = InitLeft - Width / 2;
+        TextLeft = InitLeft - TextWidth / 2;
+    }
+    else if( Align == DT_RIGHT )
+    {
+        Left     = InitLeft - Width;
+        TextLeft = InitLeft - TextWidth;
+    }
+    else
+    {
+        Left     = InitLeft;
+        TextLeft = InitLeft;
+    }
+
+    // Create clipping region
+    if( TextClipRgn != NULL )
+        delete TextClipRgn;
+
+    TextClipRgn = (Region *)new OSRegion( Left, Top, Width, Height );
+
+}
+//---------------------------------------------------------------------------
+bool ControlText::ProcessEvent( Event *evt )
+{
+    unsigned int msg = evt->GetMessage();
+    unsigned int p1  = evt->GetParam1();
+    long         p2  = evt->GetParam2();
+
+    switch( msg )
+    {
+        case CTRL_SET_TEXT:
+            if( DisplayList.size() > 0 )
+            {
+                if( p_intf->p_sys->p_theme->EvtBank->Get( (*Display) )
+                    ->IsEqual( (Event*)p1 ) )
+                {
+                    SetText( (char *)p2 );
+                }
+            }
+            break;
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+void ControlText::Draw( int x, int y, int w, int h, Graphics *dest )
+{
+    if( !Visible )
+        return;
+
+    // Test if control is in refresh zone
+    int xI, yI, wI, hI;
+    if( !GetIntersectRgn( x,y,w,h, Left,Top,Width,Height, xI,yI,wI,hI) )
+        return;
+
+    // Change clipping region
+    TextClipRgn->Move( -x, -y );
+    dest->SetClipRegion( TextClipRgn );
+
+    // Draw text
+    if( TextWidth <= Width || !Scroll )
+    {
+        TextFont->Print( dest, Text, Left - x, Top - y, Width, Height, Align );
+    }
+    else
+    {
+        if( TextLeft > Left + ScrollSpace )
+        {
+            TextFont->Print( dest, Text, TextLeft - x, Top - y,
+                         TextWidth, Height, Align );
+            TextFont->Print( dest, Text, TextLeft - x - TextWidth - ScrollSpace,
+                         Top - y, TextWidth, Height, Align );
+        }
+        else if( TextLeft + TextWidth + ScrollSpace < Left + Width )
+        {
+            TextFont->Print( dest, Text, TextLeft - x, Top - y,
+                         TextWidth, Height, Align );
+            TextFont->Print( dest, Text, TextLeft - x + TextWidth + ScrollSpace,
+                         Top - y, TextWidth, Height, Align );
+        }
+        else
+        {
+            TextFont->Print( dest, Text, TextLeft - x, Top - y,
+                         TextWidth, Height, Align );
+        }
+    }
+
+    // Reset clipping region to old region
+    Region *destClipRgn = (Region *)new OSRegion( 0, 0, w, h );
+    dest->SetClipRegion( destClipRgn );
+    delete destClipRgn;
+    TextClipRgn->Move( x, y );
+}
+//---------------------------------------------------------------------------
+void ControlText::SetText( const string newText )
+{
+    if( Text != newText )
+    {
+        Selected = false;
+        Text     = newText;
+        SetSize();
+        SetScrolling();
+        ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+}
+//---------------------------------------------------------------------------
+void ControlText::DoScroll()
+{
+    if( !PauseScroll )
+    {
+        TextLeft -= 2;
+        if( TextLeft + TextWidth < Left )
+            TextLeft += TextWidth + ScrollSpace;
+
+        ParentWindow->Refresh( Left, Top, Width, Height );
+    }
+}
+//---------------------------------------------------------------------------
+void ControlText::MoveRelative( int xOff, int yOff )
+{
+    InitLeft += xOff;
+    Top      += yOff;
+    SetSize();
+}
+//---------------------------------------------------------------------------
+bool ControlText::MouseUp( int x, int y, int button )
+{
+    Selected = false;
+    if( MouseOver( x, y ) && button == 1 )
+    {
+        if( DisplayList.size() > 1 || TextWidth > Width )
+            return true;
+    }
+    return false;
+
+}
+//---------------------------------------------------------------------------
+bool ControlText::MouseDown( int x, int y, int button )
+{
+    if( MouseOver( x, y ) && button == 1 )
+    {
+        if( TextWidth > Width )
+        {
+            PauseScroll = !PauseScroll;
+            OSAPI_GetMousePos( MouseX, MouseY );
+            SelectedX = MouseX;
+            Selected = true;
+            return true;
+        }
+        else if( DisplayList.size() > 1 )
+        {
+            return true;
+        }
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlText::MouseMove( int x, int y, int button )
+{
+    if( Selected && button == 1 )
+    {
+        OSAPI_GetMousePos( MouseX, MouseY );
+
+        if( MouseX != SelectedX )
+        {
+            TextLeft += MouseX - SelectedX;
+            SelectedX = MouseX;
+
+            while( TextLeft + TextWidth < Left )
+                TextLeft += TextWidth + ScrollSpace;
+
+            while( TextLeft > Left + ScrollSpace )
+                TextLeft -= TextWidth + ScrollSpace;
+
+            ParentWindow->Refresh( Left, Top, Width, Height );
+        }
+    }
+    return false;
+}
+//---------------------------------------------------------------------------
+bool ControlText::MouseOver( int x, int y )
+{
+    if( x >= Left && x < Left + Width && y >= Top && y < Top + Height )
+        return true;
+    else
+        return false;
+}
+//---------------------------------------------------------------------------
+bool ControlText::MouseDblClick( int x, int y, int button )
+{
+    Selected = false;
+    if( x >= Left && x < Left + Width && y >= Top && y < Top + Height
+        && button == 1 && DisplayList.size() > 1 )
+    {
+        Display++;
+        if( Display == DisplayList.end() )
+            Display = DisplayList.begin();
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/controls/text.h b/modules/gui/skins/controls/text.h
new file mode 100644 (file)
index 0000000..ec4d4b1
--- /dev/null
@@ -0,0 +1,114 @@
+/*****************************************************************************
+ * text.h: Text control
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: text.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_CONTROL_TEXT
+#define VLC_SKIN_CONTROL_TEXT
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Event;
+class BitmapBank;
+class Graphics;
+class Window;
+class Region;
+class Font;
+
+//---------------------------------------------------------------------------
+class ControlText : public GenericControl
+{
+    private:
+        // Scrolling parameters
+        bool     Scroll;
+        int      TextWidth;
+        int      TextLeft;
+        int      ScrollSpace;
+        bool     Selected;
+        int      SelectedX;
+        int      MouseX;
+        int      MouseY;
+        bool     PauseScroll;
+
+        // Initial parameters
+        bool     InitScroll;
+        int      InitLeft;
+        int      InitWidth;
+
+        // General parameters
+        string   Text;
+        int      Align;
+        Font    *TextFont;
+        string   FontName;
+        list<string> DisplayList;
+        list<string>::const_iterator Display;
+        Region   *TextClipRgn;
+
+        // Internal methods
+        void SetSize();
+        void SetScrolling();
+        void StartScrolling();
+        void StopScrolling();
+
+    public:
+        // Constructor
+        ControlText( string id, bool visible, int x, int y, string text,
+            string font, int align, int width, string display,
+            bool scroll, int scrollspace, string help,  Window *Parent );
+
+        // initialization
+        virtual void Init();
+        virtual bool ProcessEvent( Event *evt );
+
+        // Destructor
+        ~ControlText();
+
+        // Draw control
+        virtual void Draw( int x, int y, int w, int h, Graphics *dest );
+
+        // Mouse events
+        virtual bool MouseUp( int x, int y, int button );
+        virtual bool MouseDown( int x, int y, int button );
+        virtual bool MouseMove( int x, int y, int button );
+        virtual bool MouseOver( int x, int y );
+        virtual bool MouseDblClick( int x, int y, int button );
+
+        // Move control
+        virtual void MoveRelative( int xOff, int yOff );
+
+        // Set text
+        void SetText( const string newText );
+
+        // Keep on scrolling
+        void DoScroll();
+
+        // To avoid auto scrolling when manual scrolling
+        bool GetSelected() { return Selected; };
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/os_api.h b/modules/gui/skins/os_api.h
new file mode 100644 (file)
index 0000000..09318b8
--- /dev/null
@@ -0,0 +1,84 @@
+/*****************************************************************************
+ * os_api.h: Wrapper for some os-specific functions
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_api.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_API
+#define VLC_SKIN_API
+
+#if defined( WIN32 )
+    #define DIRECTORY_SEPARATOR '\\'
+#endif
+
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+class Window;
+
+//---------------------------------------------------------------------------
+// Event API
+//---------------------------------------------------------------------------
+// This functions send a message to the interface message stack
+// First argument is the destination window (NULL is broadcasting)
+// Second argument is the name of the message (see event.h)
+// Other parameters are the arguments of message
+// Send message is supposed to treat the message directly and should not be
+// used if possible
+void OSAPI_SendMessage( Window *win, unsigned int message, unsigned int param1,
+                        long param2 );
+void OSAPI_PostMessage( Window *win, unsigned int message, unsigned int param1,
+                        long param2 );
+
+//---------------------------------------------------------------------------
+// Graphic API
+//---------------------------------------------------------------------------
+// This function get a color and return the correspounding color regarding
+// color resolution. If it is black, it should return the nearest non black
+// color
+int  OSAPI_GetNonTransparentColor( int c );
+
+// This function get the size in pixel of the screen
+void OSAPI_GetScreenSize( int &w, int &h );
+
+//---------------------------------------------------------------------------
+// General
+//---------------------------------------------------------------------------
+// This function get the position in pixel of the mouse cursor position
+void OSAPI_GetMousePos( int &x, int &y );
+
+// This function returns the Title of the specified window
+string OSAPI_GetWindowTitle( Window *win );
+
+// This functions removes a directory and all its contents
+bool OSAPI_RmDir( string Path );
+
+// This function returns a time in millisecond whose reference should be fixed
+int  OSAPI_GetTime();
+
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/os_bitmap.h b/modules/gui/skins/os_bitmap.h
new file mode 100644 (file)
index 0000000..2477c32
--- /dev/null
@@ -0,0 +1,32 @@
+/*****************************************************************************
+ * os_bitmap.h: Wrapper for the Bitmap class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_bitmap.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#if defined( WIN32 )
+    #include "win32_bitmap.h"
+    #define OSBitmap Win32Bitmap
+#endif
+
+
diff --git a/modules/gui/skins/os_dialog.h b/modules/gui/skins/os_dialog.h
new file mode 100644 (file)
index 0000000..c031be7
--- /dev/null
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * os_dialog.h: Wrapper for the common dialogs
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_dialog.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#if defined( WIN32 )
+    #include "win32_dialog.h"
+    #define OSOpenFileDialog Win32OpenFileDialog
+    #define OSLogWindow Win32LogWindow
+#endif
+
+
+
diff --git a/modules/gui/skins/os_event.h b/modules/gui/skins/os_event.h
new file mode 100644 (file)
index 0000000..6a404ee
--- /dev/null
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * os_event.h: Wrapper for the Event class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_event.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#if defined( WIN32 )
+    #include "win32_event.h"
+    #define OSEvent Win32Event
+#endif
+
diff --git a/modules/gui/skins/os_font.h b/modules/gui/skins/os_font.h
new file mode 100644 (file)
index 0000000..be37b3c
--- /dev/null
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * os_font.h: Wrapper for the OSFont class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_font.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#if defined( WIN32 )
+    #include "win32_font.h"
+    #define OSFont Win32Font
+#endif
diff --git a/modules/gui/skins/os_graphics.h b/modules/gui/skins/os_graphics.h
new file mode 100644 (file)
index 0000000..3c8229e
--- /dev/null
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ * os_graphics.h: Wrapper for the Graphics and Region classes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_graphics.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#if defined( WIN32 )
+    #include "win32_graphics.h"
+
+    #define SRC_COPY   SRCCOPY
+    #define SRC_AND    SRCAND
+    #define OSGraphics Win32Graphics
+    #define OSRegion   Win32Region
+
+#endif
+
diff --git a/modules/gui/skins/os_theme.h b/modules/gui/skins/os_theme.h
new file mode 100644 (file)
index 0000000..4cece17
--- /dev/null
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ * os_theme.h: Wrapper for the OSTheme class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_theme.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#if defined( WIN32 )
+    #include "win32_theme.h"
+    #define OSTheme Win32Theme
+#endif
diff --git a/modules/gui/skins/os_window.h b/modules/gui/skins/os_window.h
new file mode 100644 (file)
index 0000000..c75d813
--- /dev/null
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * os_window.h: Wrapper for the OSWindow class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: os_window.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#if defined( WIN32 )
+    #include "win32_dragdrop.h"
+    #include "win32_window.h"
+    #define OSWindow Win32Window
+#endif
diff --git a/modules/gui/skins/parser/.cvsignore b/modules/gui/skins/parser/.cvsignore
new file mode 100644 (file)
index 0000000..2d722b2
--- /dev/null
@@ -0,0 +1,7 @@
+.deps
+.dirstamp
+*.dll
+*.dylib
+*.sl
+*.so
+*.l
diff --git a/modules/gui/skins/parser/flex.c b/modules/gui/skins/parser/flex.c
new file mode 100644 (file)
index 0000000..ef00650
--- /dev/null
@@ -0,0 +1,6908 @@
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header: /root/vlc-cvs/modules/gui/skins/parser/flex.c,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+#include <stdio.h>
+#include <errno.h>
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#ifndef _WIN32
+#include <unistd.h>
+#else
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+#endif
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else  /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator).  This
+ * avoids problems with code like:
+ *
+ *     if ( condition_holds )
+ *             yyless( 5 );
+ *     else
+ *             do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+               *yy_cp = yy_hold_char; \
+               YY_RESTORE_YY_MORE_OFFSET \
+               yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+               } \
+       while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+       {
+       FILE *yy_input_file;
+
+       char *yy_ch_buf;                /* input buffer */
+       char *yy_buf_pos;               /* current position in input buffer */
+
+       /* Size of input buffer in bytes, not including room for EOB
+        * characters.
+        */
+       yy_size_t yy_buf_size;
+
+       /* Number of characters read into yy_ch_buf, not including EOB
+        * characters.
+        */
+       int yy_n_chars;
+
+       /* Whether we "own" the buffer - i.e., we know we created it,
+        * and can realloc() it to grow it, and should free() it to
+        * delete it.
+        */
+       int yy_is_our_buffer;
+
+       /* Whether this is an "interactive" input source; if so, and
+        * if we're using stdio for input, then we want to use getc()
+        * instead of fread(), to make sure we stop fetching input after
+        * each newline.
+        */
+       int yy_is_interactive;
+
+       /* Whether we're considered to be at the beginning of a line.
+        * If so, '^' rules will be active on the next match, otherwise
+        * not.
+        */
+       int yy_at_bol;
+
+       /* Whether to try to fill the input buffer when we reach the
+        * end of it.
+        */
+       int yy_fill_buffer;
+
+       int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+       /* When an EOF's been seen but there's still some text to process
+        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+        * shouldn't try reading from the input source any more.  We might
+        * still have a bunch of tokens to match, though, because of
+        * possible backing-up.
+        *
+        * When we actually see the EOF, we change the status to "new"
+        * (via yyrestart()), so that the user can continue scanning by
+        * just pointing yyin at a new input file.
+        */
+#define YY_BUFFER_EOF_PENDING 2
+       };
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars;         /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1;                /* whether we need to initialize */
+static int yy_start = 0;       /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
+YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+       { \
+       if ( ! yy_current_buffer ) \
+               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+       yy_current_buffer->yy_is_interactive = is_interactive; \
+       }
+
+#define yy_set_bol(at_bol) \
+       { \
+       if ( ! yy_current_buffer ) \
+               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+       yy_current_buffer->yy_at_bol = at_bol; \
+       }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+
+#define yywrap() 1
+#define YY_SKIP_YYWRAP
+typedef unsigned char YY_CHAR;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+typedef int yy_state_type;
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+       yytext_ptr = yy_bp; \
+       yyleng = (int) (yy_cp - yy_bp); \
+       yy_hold_char = *yy_cp; \
+       *yy_cp = '\0'; \
+       yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 392
+#define YY_END_OF_BUFFER 393
+static yyconst short int yy_accept[2442] =
+    {   0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  393,  391,
+       29,   10,   10,   29,   29,  370,   10,  370,    5,    6,
+        5,    8,    9,    8,  386,  378,  379,  387,  384,  387,
+      385,  390,  378,  379,  390,  392,  392,   37,   10,   37,
+       37,   37,   35,   37,   37,  392,   41,   10,   41,  392,
+       41,  392,   51,   10,   51,   51,   51,   49,   51,   51,
+       51,   55,   10,   55,  392,   65,   10,   65,   65,   65,
+       63,   65,   65,   65,   69,   10,   69,  392,   87,   10,
+
+       87,   87,   87,   85,   87,   87,   87,   87,   87,   87,
+       91,   10,   91,  103,   10,  103,  103,  103,  101,  103,
+      103,  103,  103,  107,   10,  107,  392,  127,   10,  127,
+      127,  127,  125,  127,  127,  127,  127,  127,  127,  127,
+      127,  392,  131,   10,  131,  139,   10,  139,  139,  139,
+      137,  139,  139,  392,  143,   10,  143,  143,  392,  155,
+       10,  155,  155,  155,  153,  155,  155,  155,  155,  159,
+       10,  159,  392,  177,   10,  177,  177,  177,  175,  177,
+      177,  177,  177,  177,  177,  181,   10,  181,  392,  203,
+       10,  203,  203,  203,  201,  203,  203,  203,  203,  203,
+
+      203,  203,  203,  207,   10,  207,  392,  231,   10,  231,
+      231,  231,  229,  231,  231,  231,  231,  231,  231,  231,
+      231,  231,  235,   10,  235,  392,  269,   10,  269,  269,
+      269,  267,  269,  269,  269,  269,  269,  269,  269,  269,
+      269,  273,   10,  273,  392,  299,   10,  299,  299,  299,
+      297,  299,  299,  299,  299,  299,  299,  299,  299,  299,
+      299,  303,   10,  303,  392,  331,   10,  331,  331,  331,
+      329,  331,  331,  331,  331,  331,  331,  331,  331,  331,
+      331,  331,  335,   10,  335,  392,  365,   10,  365,  365,
+      365,  363,  365,  365,  365,  365,  365,  365,  365,  365,
+
+      365,  365,  365,  365,  369,   10,  369,  386,  378,  379,
+      387,  387,  386,   10,    0,    2,    2,    0,    4,    7,
+      381,  380,    0,    0,    0,    0,    0,  389,    0,   36,
+       38,   38,   38,    0,    0,    0,    0,    0,    0,   50,
+       52,   52,   52,   52,    0,   64,   66,   66,   66,   66,
+        0,   86,   88,   88,   88,   88,   88,   88,   88,   88,
+        0,  102,  104,  104,  104,  104,  104,    0,  126,  128,
+      128,  128,  128,  128,  128,  128,    0,    0,    0,    0,
+        0,    0,  138,  140,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  154,  156,  156,
+
+      156,    0,    0,    0,    0,    0,  176,  178,  178,  178,
+      178,  178,  178,    0,    0,    0,    0,    0,  202,  204,
+      204,    0,    0,  204,  204,  204,  204,    0,    0,    0,
+        0,    0,    0,    0,  230,  232,  232,  232,  232,  232,
+      232,  232,  232,  232,    0,    0,    0,    0,    0,    0,
+      268,  270,  270,  270,  270,  270,  270,  270,  270,  270,
+        0,    0,    0,    0,    0,  298,  300,  300,  300,  300,
+      300,  300,  300,  300,  300,  300,    0,    0,    0,    0,
+        0,  330,  332,  332,  332,  332,  332,  332,  332,  332,
+      332,  332,    0,    0,    0,    0,    0,  364,  366,  366,
+
+      366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    3,    0,    0,    0,    0,    0,    0,    0,  388,
+        0,   38,   38,    0,    0,    0,    0,    0,    0,    0,
+       52,   52,    0,    0,    0,    0,   66,    0,    0,   66,
+        0,    0,   88,   88,    0,    0,   88,   88,   88,   88,
+        0,    0,  104,  104,  104,  104,    0,    0,  128,  128,
+      128,    0,    0,  128,  128,    0,  114,  113,    0,  116,
+      115,    0,    0,    0,    0,  134,  133,    0,  136,  135,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+      156,  156,    0,  146,  145,    0,  148,  147,    0,    0,
+      178,    0,    0,  178,  178,  178,    0,  166,  165,    0,
+      168,  167,    0,    0,  204,    0,  194,  193,  204,    0,
+        0,  204,  204,    0,  192,  191,    0,  188,  187,    0,
+      190,  189,    0,    0,  232,  232,  232,    0,    0,  232,
+      232,    0,    0,  232,    0,  214,  213,    0,  216,  215,
+        0,    0,  270,  270,  270,    0,    0,  270,  270,  270,
+      270,    0,  242,  241,    0,  244,  243,    0,    0,  300,
+      300,  300,    0,    0,  300,  300,  300,    0,    0,  300,
+        0,  280,  279,    0,  282,  281,    0,    0,  332,  332,
+
+      332,  332,    0,    0,  332,  332,  332,  332,    0,  310,
+      309,    0,  312,  311,    0,    0,  366,  366,  366,    0,
+        0,  366,  366,  366,  366,  366,  366,  366,    0,  342,
+      341,    0,  344,  343,    0,    0,    0,  383,    0,   28,
+        1,    0,    0,  376,    0,    0,    0,  373,  372,    0,
+        0,    0,    0,   38,    0,    0,    0,   40,    0,    0,
+        0,    0,    0,   52,   52,    0,   44,   43,    0,    0,
+       54,    0,   66,    0,   58,   57,    0,    0,    0,    0,
+       68,    0,   88,   88,    0,   72,   71,   88,   88,   88,
+       88,    0,    0,   90,    0,  104,  104,  104,  104,    0,
+
+        0,  106,    0,  128,  128,  128,    0,  110,  109,  128,
+      128,    0,    0,    0,  130,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  142,    0,  156,  156,
+        0,    0,  158,    0,  178,    0,  162,  161,  178,  178,
+      178,    0,    0,  180,    0,  204,  204,    0,  184,  183,
+      204,  204,    0,    0,  206,    0,  232,  232,  232,    0,
+      210,  209,  232,  232,    0,  218,  217,  232,    0,    0,
+      234,    0,  270,  270,  270,    0,  238,  237,  270,  270,
+      270,  270,  270,    0,    0,  272,    0,    0,    0,  300,
+      300,    0,  276,  275,    0,    0,  300,  300,    0,  286,
+
+      285,  300,    0,    0,  302,    0,  332,  332,  332,  332,
+        0,  306,  305,  332,  332,  332,  332,    0,    0,  334,
+        0,    0,    0,  366,  366,    0,  338,  337,  366,  366,
+        0,    0,  366,  366,  366,  366,    0,    0,  368,    0,
+        0,    0,    0,  377,  371,    0,    0,    0,    0,   34,
+       33,   38,    0,    0,    0,    0,   70,    0,   52,    0,
+        0,    0,   66,    0,   62,   61,    0,   88,    0,    0,
+       88,    0,    0,   88,   88,    0,  104,  104,    0,    0,
+      104,    0,  128,  128,  128,  128,  128,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  156,  156,
+
+        0,    0,    0,  178,  178,  178,    0,  204,    0,    0,
+      204,  204,    0,  232,    0,    0,    0,    0,  232,  232,
+      232,    0,  270,  270,    0,    0,    0,    0,    0,    0,
+      270,  270,  270,    0,    0,  290,  289,    0,    0,    0,
+        0,    0,  292,  291,  300,    0,    0,  300,    0,  332,
+      332,    0,    0,    0,    0,  332,    0,    0,  332,  332,
+        0,    0,  356,  355,    0,    0,    0,    0,  366,  366,
+        0,  358,  357,  366,  366,  366,  366,    0,    0,    0,
+        0,    0,   12,    0,  374,  375,   30,   38,    0,    0,
+        0,   56,   70,    0,   52,    0,   46,   45,    0,    0,
+
+        0,    0,    0,    0,    0,   74,   73,   88,    0,   76,
+       75,   88,   88,    0,  104,    0,    0,    0,   94,   93,
+      104,    0,    0,    0,  128,  128,  128,  128,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  156,
+        0,    0,    0,    0,  174,  173,    0,    0,  178,  178,
+        0,    0,    0,    0,  200,  199,  204,  204,    0,  232,
+        0,  220,  219,    0,  228,  227,  232,  232,  232,    0,
+      270,  270,    0,  266,  265,    0,  246,  245,    0,  250,
+      249,  270,  270,  270,    0,    0,  288,  287,    0,  296,
+      295,  300,    0,  284,  283,  300,    0,    0,    0,  332,
+
+        0,  316,  315,    0,  328,  327,  332,    0,  314,  313,
+      332,    0,    0,    0,    0,  350,  349,    0,  360,  359,
+      366,  366,  366,  366,  366,    0,    0,    0,    0,    0,
+        0,   11,   30,    0,    0,    0,    0,   42,   56,  108,
+       52,    0,    0,   60,   59,    0,    0,   78,   77,    0,
+        0,   88,    0,    0,    0,   89,    0,    0,    0,   98,
+       97,  104,    0,    0,  120,  119,  128,  128,  128,  128,
+        0,    0,  144,    0,    0,    0,    0,    0,    0,    0,
+        0,  156,    0,  152,  151,    0,    0,  170,  169,  178,
+      178,    0,    0,  196,  195,  204,  204,    0,  232,  232,
+
+      232,  232,    0,  270,  270,  270,  270,  270,    0,  300,
+      300,    0,    0,  318,  317,  332,    0,    0,  332,  332,
+        0,  320,  319,    0,  366,  366,  366,  366,  366,    0,
+      346,  345,    0,    0,    0,    0,    0,   32,   31,    0,
+        0,   39,   42,  108,   52,    0,    0,   67,    0,   82,
+       81,   88,    0,   80,   79,    0,   96,   95,    0,    0,
+        0,  128,  128,  128,    0,    0,    0,    0,  144,    0,
+        0,    0,    0,    0,    0,    0,    0,  156,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  232,
+        0,    0,  232,    0,    0,    0,  270,  270,  270,  270,
+
+      270,    0,    0,    0,  300,    0,    0,    0,    0,    0,
+        0,  324,  323,  332,    0,    0,    0,  366,  366,  366,
+      366,    0,    0,    0,    0,    0,    0,    0,   52,    0,
+       53,   88,    0,  100,   99,    0,    0,    0,    0,    0,
+      128,    0,  112,  111,    0,    0,  129,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  157,    0,
+      172,  171,    0,  164,  163,    0,    0,  198,  197,    0,
+      186,  185,    0,    0,    0,    0,  224,  223,  232,    0,
+      212,  211,    0,  270,  270,  270,  270,    0,    0,    0,
+        0,  270,    0,  240,  239,    0,  300,    0,  278,  277,
+
+        0,    0,  322,  321,  332,    0,  308,  307,    0,  366,
+      366,    0,    0,    0,    0,    0,  340,  339,    0,  382,
+        0,    0,   92,   52,    0,    0,    0,    0,  124,  123,
+        0,  118,  117,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,  150,  149,    0,    0,    0,
+      222,  221,  232,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  258,  257,    0,  260,  259,  270,    0,
+      300,    0,  332,    0,    0,    0,  366,    0,  352,  351,
+        0,  354,  353,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,   92,    0,    0,    0,
+
+       84,   83,    0,    0,  122,  121,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  232,    0,    0,
+      248,  247,    0,  252,  251,    0,  254,  253,    0,  256,
+      255,  270,    0,  300,    0,  332,    0,    0,  348,  347,
+      366,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   48,   47,
+        0,  105,    0,    0,    0,    0,    0,    0,    0,  304,
+        0,    0,    0,    0,    0,    0,  270,  270,    0,    0,
+        0,    0,    0,    0,    0,  366,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,  132,    0,    0,  160,    0,    0,    0,  304,
+        0,    0,    0,    0,  226,  225,    0,    0,    0,    0,
+        0,    0,    0,  294,  293,    0,    0,  326,  325,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  132,
+      208,    0,  160,    0,    0,  274,    0,    0,    0,    0,
+        0,  262,  261,    0,  264,  263,    0,    0,    0,  333,
+        0,  362,  361,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  208,    0,    0,    0,  274,    0,  141,    0,  179,
+
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  236,  336,    0,    0,    0,  233,    0,    0,
+      301,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,  236,  336,
+      182,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  182,
+        0,    0,  271,    0,  367,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  205,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,   16,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,   14,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   17,    0,    0,
+
+        0,    0,   18,    0,   22,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,   21,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   19,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,   27,    0,    0,    0,
+        0,   20,    0,   23,    0,    0,    0,    0,    0,    0,
+       13,    0,    0,    0,    0,    0,    0,    0,   25,    0,
+        0,    0,    0,    0,   24,    0,   26,    0,    0,   15,
+        0
+    } ;
+
+static yyconst int yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    2,    4,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    5,    6,    7,    1,    1,    8,    9,    1,
+        1,    1,    1,    1,   10,   11,   12,   13,   14,   15,
+       13,   13,   13,   13,   13,   13,   13,   16,   17,   18,
+       19,   20,   21,    1,   22,   23,   24,   25,   26,   27,
+       28,   16,   29,   16,   16,   30,   31,   16,   32,   33,
+       16,   34,   35,   36,   16,   16,   37,   16,   38,   16,
+       39,    1,   40,    1,   16,    1,   41,   42,   43,   44,
+
+       45,   46,   47,   48,   49,   16,   50,   51,   52,   53,
+       54,   55,   56,   57,   58,   59,   60,   61,   62,   63,
+       64,   65,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst int yy_meta[66] =
+    {   0,
+        1,    2,    2,    2,    1,    1,    1,    1,    1,    3,
+        3,    1,    4,    4,    4,    5,    6,    1,    7,    8,
+        1,    9,    9,    9,    9,    9,    9,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    1,    1,
+        9,    9,    9,    9,    9,    9,    5,    5,    5,    5,
+        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
+        5,    5,    5,    5,    5
+    } ;
+
+static yyconst short int yy_base[2604] =
+    {   0,
+        0,    0,    0,    3,    6,    9,   12,   29,   16,   19,
+       14,   17,   33,   36,   49,   55,   45,   61,   66,   72,
+      101,  153,   75,   78,  121,  124,  127,  130,  133,  173,
+      176,  179,  182,  185,  205,  254,  225,  229,  232,  235,
+      303,  353,  274,  278,  281,  284,  403,    0,  323,  326,
+      329,  332,  468,  530,  373,  376,  379,  382,  592,    0,
+      488,  492,  496,  499,  550,  554,  657,  721,  558,  561,
+      677,  680,  683,  686,  689,  741,  744,  747,  785,  849,
+      750,  753,  805,  808,  913,    0,  811,  814,  817,  869,
+      978,    0,  872,  875,  878,  881, 1043,    0, 1107, 1110,
+
+     1113, 1116, 1134,    0, 1198, 1201, 1204, 1207, 1225,    0,
+     1289, 1292, 1295, 1298, 1316,    0, 1380, 1383, 1386, 1389,
+     1407,    0, 1471, 1474, 1477, 1480, 1482, 1493, 7255, 8049,
+     8049,   84,   95,   29,   41, 8049,  238,   51, 8049, 8049,
+     7244, 8049, 8049, 7231, 8049, 7246, 7246, 1480, 8049, 8049,
+     8049, 8049, 7242, 7242, 7204, 8049, 1483, 8049,  287, 7221,
+        0,  499, 8049, 7186, 7198, 1488, 8049,  335, 1502, 1489,
+      506,  561, 8049,  385, 7216,    0,  507, 8049, 7184, 7185,
+     7187, 8049,  520,  568,  689, 8049,  583, 7210,    0,  569,
+     8049, 7168, 7182, 7180, 8049,  709,  697,  753, 8049,  773,
+
+     7204,    0,  695, 8049, 7167, 7166,  655, 7170, 7163, 7170,
+     8049,  779,  758, 8049,  834, 7194,    0,  698, 8049, 7151,
+     7158, 7168, 7161, 8049,  841,  886, 1497, 8049,  898, 7185,
+        0,  825, 8049, 7153, 7144, 7159, 7155, 7142, 7146, 1538,
+     1541,  887, 8049, 1119, 1525, 8049, 1210, 7174,    0,  826,
+     8049, 1545, 1548, 1563, 8049, 1301, 7179, 1549, 1550, 8049,
+     1392, 7162,    0,  889, 8049, 7124, 7139, 1571, 1574, 8049,
+     1577, 1583, 1584, 8049, 1598, 7155,    0, 1548, 8049, 7129,
+       39, 7120, 7119, 1604, 1607, 8049, 1612, 1607, 1612, 8049,
+     1618, 7147,    0, 1561, 8049, 7112, 1628, 7117, 7107, 7110,
+
+     1632, 1635, 1638, 8049, 1641, 1643, 1644, 8049, 1656, 7134,
+        0, 1645, 8049,   17, 7108, 7108, 7094, 7092, 7090, 7091,
+     1659, 1666, 8049, 1672, 1667, 1666, 8049, 1678, 7119,    0,
+     1672, 8049, 7087, 7084, 7087,   48, 7078, 7072, 7076, 1692,
+     1695, 8049, 1698, 1698, 1686, 8049, 1702, 7104,    0, 1687,
+     8049, 7077, 7064, 7072, 7068, 7054,  451, 7055, 7056, 1713,
+     1720, 8049, 1723, 1708, 1707, 8049, 1731, 7084,    0, 1725,
+     8049, 7052, 7049, 7043, 7051, 7047, 7047, 7044, 7035, 7034,
+     1734, 1738, 8049, 1745, 1739, 1740, 8049, 1752, 7062,    0,
+     1745, 8049, 6765, 6752, 6760,   94, 6750, 6746, 6751, 6756,
+
+     6751, 6750, 1760, 1765, 8049, 1768, 1753, 8049, 6793, 6793,
+     1745, 6790, 6754, 1773,   18, 6725, 8049, 6777, 6765, 8049,
+     8049, 8049, 1767,   91, 6725, 6719, 6699, 6734, 6705, 8049,
+        0, 6704, 6703, 6692, 6685, 6671, 6657, 6663, 6666, 8049,
+        0, 6641, 6636, 1785, 6661, 8049,    0, 6632, 1791, 6594,
+     6627, 8049,    0, 6600, 6597, 1795, 6607, 6574, 6590, 6582,
+     6602, 8049,    0, 6566, 6579, 6560, 6569, 6572, 8049,    0,
+     6551, 6560, 6556, 1803, 6533, 6531, 1809, 1814, 1822, 1829,
+     6534, 6548, 8049,    0, 1840, 1843, 1851, 1854, 6530, 6518,
+       41, 6525, 6515, 6520, 6511, 6515, 6523, 8049,    0, 6497,
+
+     6490, 1862, 1865, 1873, 1876, 6506, 8049,    0, 6476, 1884,
+     6485, 6478, 6462, 1887, 1891, 1905, 1908, 6489, 8049,    0,
+     6458, 1916, 1919, 6457, 1927, 6456, 6436, 1930, 1934, 1948,
+     1951, 1959, 1962, 6459, 8049,    0, 6433, 6428, 6437, 1970,
+     6444, 6431, 1973, 6422, 1977, 1981, 1991, 1995, 6449, 6423,
+     8049,    0, 6420, 6408, 6410, 2003, 6413, 6405, 6392, 6387,
+     2009, 2012, 2021, 2027, 6414, 8049,    0, 6375, 6368, 6353,
+     2035, 6355, 6342, 6330, 2039, 6312, 2042, 2046, 2060, 2063,
+     6334, 8049,    0, 6318, 6308, 6311, 6312, 2071, 6304, 6282,
+     6278, 6291, 2074, 2078, 2092, 2095, 6297, 8049,    0, 6274,
+
+     6273, 6260, 2103, 6264, 6256, 6263, 6262, 6251, 6233, 6234,
+     2106, 2110, 2124, 2127, 6237, 6230, 6248, 6246, 6246,  170,
+     6199, 8049, 2124,    0, 6195, 6185, 6221, 6218, 6180, 8049,
+     6182, 2142, 2145, 6181, 2148, 2151, 6165, 6178, 6168, 6160,
+     6154, 6156, 2154, 2163, 2172, 2175, 6141, 2178, 2181, 2198,
+     2201, 2205, 6139, 6130, 2208, 2226, 6137, 6136, 6128, 6120,
+     2211, 2216, 6118, 6115, 6116, 6087, 2235, 2238, 6074, 6063,
+     6064, 2241, 2244, 6050, 6045, 2259, 8049, 8049, 2269, 8049,
+     8049, 6039, 2277, 2280, 2285, 8049, 8049, 2299, 8049, 8049,
+     6048, 6027, 6040, 6041, 6038, 6035, 6026, 6009, 2307, 2310,
+
+     6008, 6007, 2313, 8049, 8049, 2322, 8049, 8049, 2330, 2333,
+     5998, 2336, 2339, 6004, 5997, 5998, 2354, 8049, 8049, 2363,
+     8049, 8049, 2371, 2374, 5991, 2378, 8049, 8049, 5988, 2386,
+     2393, 5991, 5991, 2404, 8049, 8049, 2412, 8049, 8049, 2421,
+     8049, 8049, 2429, 2432, 5985, 5972, 5968, 2435, 2438, 5967,
+     5966, 2453, 2456, 5966, 2464, 8049, 8049, 2472, 8049, 8049,
+     2480, 2483, 5971, 5971, 5952, 2486, 2489,  135, 5930, 5929,
+     5927, 2504, 8049, 8049, 2512, 8049, 8049, 2520, 2524, 2527,
+     2530, 2533, 2551, 2554, 2562, 2565, 2572, 2575, 2583, 2593,
+     2596, 8049, 8049, 2604, 8049, 8049, 2616, 2619, 5922, 5912,
+
+     5901, 5895, 2622, 2625, 5895, 5888, 5893, 5882, 2641, 8049,
+     8049, 2649, 8049, 8049, 2657, 2660, 2663, 2669, 2672, 2681,
+     2690, 2699, 2704, 2707, 2710, 2713, 2717, 2731, 2735, 8049,
+     8049, 2743, 8049, 8049, 2755, 2758, 5913, 8049, 5915, 8049,
+     8049,  175, 5883, 8049, 5915, 5906, 5864, 8049, 8049, 5855,
+     5861, 2761, 2767, 5866, 5845, 2779, 2782, 8049, 2785, 5843,
+     5840, 5829, 5843, 5844, 2789, 2792, 8049, 8049, 2808, 2811,
+     8049, 2814, 5815, 2817, 8049, 8049, 2833, 2836, 2844, 2847,
+     8049, 2851, 5815, 2855, 2859, 8049, 8049, 5822, 2873, 5812,
+     5818, 2877, 2880, 8049, 2883, 5810, 5808, 2886, 5817, 2891,
+
+     2904, 8049, 2910, 5805, 5793, 5777, 2913, 8049, 8049, 5793,
+     5786, 5768, 2923, 2929, 8049, 2936, 5770, 5757, 5772, 5750,
+     5714, 5716, 5704, 5686, 2942, 2948, 8049, 2955, 5687, 5678,
+     2961, 2967, 8049, 2970, 2974, 2982, 8049, 8049, 2992, 2995,
+     2998, 3001, 3016, 8049, 3021, 5616, 3024, 3029, 8049, 8049,
+     5606, 5611, 3043, 3046, 8049, 3049, 5561, 3052, 3055, 3073,
+     8049, 8049, 5537, 5524, 3081, 8049, 8049, 5531, 3091, 3094,
+     8049, 3097, 5518, 5516, 3100, 3103, 8049, 8049, 3118, 3121,
+     5479, 5461, 5463, 3124, 3127, 8049, 3130, 3139, 3151, 3159,
+     3162, 3165, 8049, 8049, 3180, 3183, 3191, 3194, 3198, 8049,
+
+     8049, 3212, 3215, 3218, 8049, 3221, 5437, 5426, 3224, 3230,
+     3242, 8049, 8049, 5423, 3253, 5405, 5396, 3256, 3259, 8049,
+     3262, 3265, 3271, 3283, 3286, 3289, 8049, 8049, 3297, 3304,
+     3307, 3311, 3325, 3328, 3332, 3335, 3338, 3353, 8049, 3358,
+     5417, 1783, 3364, 8049, 8049, 5409, 5399, 5335, 3384, 8049,
+     8049, 5270, 5280, 3361, 5268, 5232, 3373, 5220, 5212, 3392,
+     3398, 3406, 3412, 3415, 8049, 8049, 3425, 3430, 3433, 3437,
+     3451, 3457, 3460, 3469, 3477, 3480, 5181, 3483, 3487, 3495,
+     5174, 3505, 3508, 3511, 3514, 3519, 3539, 5136, 3542, 5110,
+     5104, 5071, 5057, 5059, 5030, 5025, 5031, 3545, 4974, 3548,
+
+     3551, 3557, 3571, 3579, 3589, 3592, 3598, 3603, 3610, 3617,
+     3631, 3634, 3637, 4934, 3644, 3652, 3662, 3666, 4922, 4914,
+     4907, 3674, 4888, 4861, 3680, 3684, 3698, 3701, 3709, 3712,
+     4851, 4844, 4824, 3720, 3723, 8049, 8049, 3732, 3735, 3743,
+     3746, 3755, 8049, 8049, 4819, 3763, 3766, 4807, 3774, 3777,
+     3781, 3784, 3789, 3802, 3805, 3813, 3821, 3824, 3832, 3835,
+     3839, 3843, 8049, 8049, 3853, 3859, 3867, 3871, 4781, 4762,
+     3885, 8049, 8049, 4739, 4741, 4738, 3893, 3897, 4720,  210,
+     4721, 3901, 8049, 4719, 8049, 8049, 3585, 3904, 4700, 3907,
+     4629, 3613, 3911, 4620, 4627, 3916, 8049, 8049, 3926, 3929,
+
+     3932, 3940, 3947, 3966, 3974, 8049, 8049, 3952, 3982, 8049,
+     8049, 3955, 3990, 3961, 3993, 3998, 4004, 4012, 8049, 8049,
+     4620, 4020, 4023, 4026, 4034, 4041, 4044, 4047, 4565, 4052,
+     4561, 4562, 4589, 4587, 4550, 4501, 4490, 4448, 4055, 4421,
+     4065, 4074, 4083, 4092, 8049, 8049, 4105, 4111, 4119, 4123,
+     4126, 4129, 4141, 4149, 8049, 8049, 4137, 4157, 4160, 4420,
+     4175, 8049, 8049, 4186, 8049, 8049, 4384, 4366, 4326, 4163,
+     4277, 4257, 4194, 8049, 8049, 4202, 8049, 8049, 4210, 8049,
+     8049, 4251, 4221, 4230, 4171, 4220, 8049, 8049, 4228, 8049,
+     8049, 4180, 4236, 8049, 8049, 4154, 4244, 4247, 4250, 4258,
+
+     4265, 8049, 8049, 4276, 8049, 8049, 4284, 4288, 8049, 8049,
+     4296, 4302, 4305, 4314, 4321, 8049, 8049, 4341, 8049, 8049,
+     4128, 4059, 4009, 3985, 3960, 4329, 4349, 4357, 3954,  464,
+      124, 8049, 4087, 4360, 4363, 3894, 4371, 4132, 4333, 4378,
+     3894, 4381, 4386, 8049, 8049, 4394, 4400, 8049, 8049, 4408,
+     4413, 4421, 4426, 4429, 4439, 8049, 4444, 4447, 4458, 8049,
+     8049, 4466, 4469, 4473, 8049, 8049, 4484, 4488, 4492, 4497,
+     3886, 4502, 4506, 3858, 3794, 3748, 3695, 3696, 3684, 3598,
+     4511, 3580, 4515, 8049, 8049, 4523, 4526, 8049, 8049, 4534,
+     4542, 4546, 4553, 8049, 8049, 4565, 4569, 4572, 3587, 4575,
+
+     3551, 4579, 4583, 3550, 3540,  283, 3475, 4587, 4593, 3470,
+     4598, 4606, 4618, 8049, 8049, 4626, 4629, 4635, 4647, 4650,
+     4653, 8049, 8049, 4668, 3465, 3430, 3409, 3341, 4671, 4674,
+     8049, 8049, 4683, 3326,  320,    3, 4689, 8049, 8049, 3276,
+     4697, 8049, 4702, 4705, 3224, 4708, 4711, 8049, 4717, 8049,
+     8049, 4731, 4734, 8049, 8049, 4742, 8049, 8049, 4750, 4753,
+     4761, 4764, 4768, 4771, 4775, 4782, 3225, 4793, 4796, 3137,
+     3096, 3085, 3009, 3016, 2962, 2956, 4799, 4802, 4805, 4813,
+     4820, 4832, 4835, 4843, 4850, 4853, 4862, 4868, 4876, 4880,
+     4883, 4886, 2876, 4901, 4904, 4912,  381,  511, 4915, 4922,
+
+     2811, 4925, 4936, 4944, 2752, 4947, 4950, 4958, 4965, 4968,
+     4977, 8049, 8049, 4985, 4988, 4991, 4999, 2706, 2645, 5006,
+     5009, 5012, 5018, 5030, 2647, 5033,  509, 2627, 2576, 5036,
+     8049, 5039, 5042, 8049, 8049, 5057, 5060, 5063, 5071, 5078,
+     5089, 5092, 8049, 8049, 2557, 5102, 8049, 2558, 2537, 2461,
+     2473, 2449, 2350, 2343, 5107, 5110, 5114, 5122, 8049, 5128,
+     8049, 8049, 5137, 8049, 8049, 5145, 5148, 8049, 8049, 5157,
+     8049, 8049, 5165, 5168, 5171, 5180, 8049, 8049, 2284, 5188,
+     8049, 8049, 5197, 5200, 5203, 5206, 5209, 5227, 5230, 5238,
+     5241, 2189, 5250, 8049, 8049, 5258, 2123, 5261, 8049, 8049,
+
+     5269, 5273, 8049, 8049, 5281, 5284, 8049, 8049, 5292, 5295,
+     2122, 5299, 5302, 5313, 5324, 5332, 8049, 8049, 5340, 8049,
+     5398,  539, 5343, 5346, 5350, 5353, 5369, 5372, 8049, 8049,
+     5381, 8049, 8049, 5389, 5401, 2086, 2059, 2037, 1946, 1948,
+     1976, 1900, 1902, 5392, 5434, 8049, 8049, 5426, 5448, 5451,
+     8049, 8049, 1880, 5459, 5462, 5467, 5480, 5485, 5494, 5498,
+     5506, 5512, 5520, 8049, 8049, 5528, 8049, 8049, 1837, 5536,
+     1732, 5539, 5542, 5545, 5548, 5560, 1731, 5568, 8049, 8049,
+     5576, 8049, 8049, 5586,  653, 1780, 1893,  329,  747,  299,
+      201, 1493,  250, 1789,  688, 1571, 5364, 5592, 5595, 5610,
+
+     8049, 8049, 5605, 5618, 8049, 8049, 1718, 1674, 1576, 1508,
+     1455, 1452, 1448, 1452, 5626, 5629, 5632, 5635, 5638, 5641,
+     8049, 8049, 5657, 8049, 8049, 5665, 8049, 8049, 5673, 8049,
+     8049,  563, 5681, 5685, 5688, 5691, 5696, 5703, 8049, 8049,
+     1357, 5711,   74,  496, 1497, 1538, 1479, 1607, 1633,  845,
+     1583, 1765, 1471, 1739, 1664, 1636, 1795, 5715, 8049, 8049,
+     5723, 8049, 1259, 1257, 1247, 1172, 1159, 1162, 1078, 5411,
+     5726, 5734, 5737, 5730, 5749, 5757, 5760, 5764, 5767, 5770,
+     5790, 5778, 5798, 5801, 5809, 5819, 5822, 1515,  349, 1842,
+     1807, 1885, 1819, 1949,  499,  758, 1950, 1574, 1968, 1831,
+
+     1882, 5828, 5551, 1076, 1067, 5837,  838,  782,  783, 5841,
+     5847, 5850, 5853, 5859, 8049, 8049, 5874, 5877, 5880, 5888,
+     5906, 5896, 5915, 8049, 8049, 5923, 5927, 8049, 8049, 5936,
+     5901, 5942, 5950, 1928, 2006, 1966,  229, 1816, 1997, 5955,
+     2012,  561, 2048, 2014,  749, 2015, 1999, 5959, 5962, 5970,
+     5981,  712, 5984,  663,  648, 5987, 5990, 5993, 5996, 5999,
+     6002, 8049, 8049, 6018, 8049, 8049, 6026, 6029, 6032, 8049,
+     6035, 8049, 8049, 6054, 1841, 1663, 1938,  178, 2031, 6057,
+     6061,  885, 1896, 2050, 2063, 2080, 6064, 2097, 6067, 6111,
+     6151, 6086,  442,  348,  291, 6095, 6101, 8049, 6104, 8049,
+
+     6123, 6142, 6145, 6172, 6175, 6180, 6183, 1106, 2140, 1770,
+     6202, 2104, 2142, 1884, 2068, 1109, 2082, 6205, 2169, 6194,
+     6240, 6280, 6098, 6131,  145, 6208, 6213, 8049, 6216, 6251,
+     8049, 6270, 6273, 6292, 2203, 1864,  744, 2150, 2051, 2173,
+     2231, 2072, 2213, 2234, 2196, 2239, 6302,  807, 6134, 6137,
+     6228, 6311, 6314, 6321, 2236, 2257, 2298, 1197, 2249, 2171,
+     1879, 2287, 1200, 2276, 2332, 2341, 2229, 2300, 2324, 6261,
+     6326, 6336, 8049, 6340, 8049, 2348, 2384, 2350, 2339, 2391,
+     2256,  813, 2372, 2392, 1288, 2402, 2397, 2428, 6345, 2408,
+     6348, 8049, 2433, 2443, 2460, 2451, 2479,  877, 2101, 2491,
+
+     2489, 2505, 2481, 2499, 1289, 6351, 2476, 1377, 1379, 2528,
+     2482, 2560, 2531, 6355, 2553, 2573, 2615, 2583, 6370, 2570,
+     2610, 1380, 2618, 2626, 2589, 2667, 6374, 6377, 6389, 6380,
+     2710, 2636, 2728, 6385, 6399, 2634, 2658, 6404, 6408, 6411,
+     2677, 6414, 6423, 2684, 2748, 6419, 2723, 2784, 6433, 2702,
+     6438, 2807, 6448, 6453, 6461, 6472, 2752, 2787, 2802, 2812,
+     2329, 2351, 2871, 2878, 2824, 6475, 2900, 2846, 2852, 1539,
+     6480, 2879, 2903, 2908, 2921, 2922, 6494, 2947, 2400, 2705,
+     2780, 2898, 2972, 6499, 3009, 2992, 2986, 2933, 2960, 2659,
+     3014, 3022, 2989, 3041, 3058, 3066, 3053, 6502, 3045, 3069,
+
+     3090, 2849, 2881, 3115, 6509, 6513, 3153, 2278, 3128, 3156,
+     6521, 3095, 3129, 3160, 3188, 3191, 3222, 3116, 3152, 2928,
+     3093, 3150, 2813, 3219, 3044, 3209, 6528, 3216, 3263, 3292,
+     3299, 6536, 3284, 3304, 3326, 3350, 3352, 3369, 3186, 3261,
+     3349, 3386, 3427, 2279, 2527, 3392, 3283, 3410, 3323, 6532,
+     3431, 3445, 3437, 3447, 3372, 3424, 3508, 3515, 3520, 3558,
+     3472, 3536, 6547, 3277, 3430, 3473, 3544, 6551, 3589, 3607,
+     3629, 6555, 3608, 3647, 3639, 3642, 3660, 3686, 3675, 3710,
+     3753, 3769, 6566, 3559, 6570, 3740, 3751, 3800, 3809, 6578,
+     3604, 3754, 6589, 3792, 3858, 3799, 3865, 3371, 3517, 3840,
+
+     3846, 3920, 4011, 4014, 4041, 6593, 3678, 3953, 3962, 3882,
+     4061, 3736, 3711, 3983, 4013, 3861, 3653, 6601, 3781, 3969,
+     4150, 4165, 4044, 4096, 4059, 4134, 4166, 4200, 4213, 4221,
+     4099, 4205, 6612, 4032, 4054, 3873, 3978, 6615, 4208, 4223,
+     6620, 4187, 4235, 4252, 4263, 4264, 3933, 4261, 3856, 4091,
+     4275, 4276, 4320, 4319, 4348, 4337, 4336, 4350, 6624, 4329,
+     4356, 6634, 6639, 8049, 4388, 4406, 6643, 6653, 4434, 4473,
+     4162, 4540, 6658, 4374, 4400, 4387, 4532, 6662, 6665, 4432,
+     4463, 4500, 4584, 4587, 4594, 6668, 8049, 4614, 4615, 4585,
+     4603, 6677, 4514, 4640, 4216, 4446, 6672, 8049, 4419, 4438,
+
+     6687, 6691, 8049, 6696, 8049, 4626, 4644, 4674, 4710, 4531,
+     4705, 4707, 4738, 4760, 4798, 4638, 4762, 4807, 4808, 4823,
+     4829, 4856, 4878, 6699, 8049, 4820, 4822, 4881, 4956, 4889,
+     4891, 4911, 4955, 4998, 5029, 4871, 4923, 5065, 5108, 4937,
+     5009, 4393, 4997, 5010, 5063, 5080, 5125, 5077, 5079, 5136,
+     5156, 5135, 5161, 5037, 5095, 5176, 5204, 5248, 5287, 6702,
+     5159, 5207, 5142, 5215, 5293, 5319, 5320, 5338, 5238, 5299,
+     5366, 5386, 5261, 5302, 4741, 5260, 6706, 8049, 5397, 5428,
+     5436, 5475, 5217, 5368, 5391, 5389, 5483, 5491, 5359, 5447,
+     5513, 5556, 6710, 5439, 5466, 5458, 5516, 6721, 6725, 5564,
+
+     5598, 5561, 5571, 5486, 5642, 6729, 8049, 6732, 5573, 5628,
+     6735, 8049, 6740, 8049, 5658, 5676, 5606, 5644, 6744, 6754,
+     8049, 5736, 5661, 5770, 5702, 5764, 5765, 6759, 8049, 6763,
+     6766, 5813, 5786, 6769, 8049, 6773, 8049, 6778, 6788, 8049,
+     8049, 6808, 6817, 6826, 6835, 6844, 6853, 6862, 6871, 6880,
+     6889, 6898, 6907, 6916, 6925, 6934, 6943, 6952, 6961, 6970,
+     6979, 6988, 6997, 7006, 7015, 7024, 7033, 7042, 7051, 7060,
+     7069, 7076, 7083, 7090, 7097, 7104, 7111, 7118, 7125, 7132,
+     7139, 7146, 7153, 7160, 7167, 7174, 7183, 7188, 7193, 7198,
+     7203, 7208, 7213, 7218, 7223, 7228, 7233, 7238, 7243, 7248,
+
+     7253, 7258, 7267, 7273, 7281, 7289, 7296, 7304, 7311, 7319,
+     7326, 7334, 7341, 7349, 7356, 7364, 7372, 7379, 7387, 7394,
+     7402, 7409, 7417, 7424, 7432, 7439, 7447, 7455, 7463, 7470,
+     7478, 7486, 7494, 7503, 7509, 7516, 7524, 7531, 7539, 7546,
+     7554, 7561, 7569, 7576, 7584, 7591, 7599, 7607, 7614, 7622,
+     7630, 7638, 7645, 7653, 7660, 7668, 7675, 7683, 7691, 7699,
+     7706, 7714, 7722, 7730, 7739, 7748, 7755, 7763, 7770, 7778,
+     7786, 7794, 7802, 7810, 7817, 7825, 7833, 7841, 7849, 7856,
+     7864, 7872, 7880, 7888, 7896, 7903, 7911, 7918, 7926, 7933,
+     7941, 7949, 7957, 7964, 7972, 7981, 7990, 7998, 8006, 8013,
+
+     8021, 8030, 8039
+    } ;
+
+static yyconst short int yy_def[2604] =
+    {   0,
+     2442, 2442, 2443, 2443, 2443, 2443, 2444, 2444, 2445, 2445,
+     2446, 2446, 2447, 2447, 2447, 2447, 2448, 2448, 2449, 2449,
+     2450, 2450, 2449, 2449, 2451, 2451, 2449, 2449, 2451, 2451,
+     2451, 2451, 2449, 2449, 2452, 2452, 2453, 2453, 2449, 2449,
+     2454, 2454, 2455, 2455, 2449, 2449, 2441,   47, 2456, 2456,
+     2449, 2449, 2457, 2457, 2458, 2458, 2449, 2449, 2441,   59,
+     2449, 2449, 2459, 2459, 2449, 2449, 2460, 2460, 2449, 2449,
+     2449, 2449, 2461, 2461, 2461, 2461, 2449, 2449, 2462, 2462,
+     2463, 2463, 2449, 2449, 2441,   85, 2464, 2464, 2449, 2449,
+     2441,   91, 2465, 2465, 2449, 2449, 2441,   97, 2466, 2466,
+
+     2449, 2449, 2441,  103, 2467, 2467, 2449, 2449, 2441,  109,
+     2468, 2468, 2449, 2449, 2441,  115, 2469, 2469, 2449, 2449,
+     2441,  121, 2449, 2449, 2470, 2470, 2471, 2471, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2472, 2441, 2441, 2472, 2472, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2473, 2441, 2441, 2473, 2473,
+     2473, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2474, 2441,
+     2441, 2474, 2474, 2474, 2441, 2441, 2441, 2441, 2441, 2441,
+
+     2441, 2475, 2441, 2441, 2475, 2475, 2475, 2475, 2475, 2475,
+     2441, 2441, 2441, 2441, 2441, 2441, 2476, 2441, 2441, 2476,
+     2476, 2476, 2476, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2477, 2441, 2441, 2477, 2477, 2477, 2477, 2477, 2477, 2477,
+     2477, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2478, 2441,
+     2441, 2478, 2478, 2441, 2441, 2441,  254, 2441, 2441, 2441,
+     2441, 2441, 2479, 2441, 2441, 2479, 2479, 2479, 2479, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2480, 2441, 2441, 2480,
+     2480, 2480, 2480, 2480, 2480, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2481, 2441, 2441, 2481, 2481, 2481, 2481, 2481,
+
+     2481, 2481, 2481, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2482, 2441, 2441, 2482, 2482, 2482, 2482, 2482, 2482, 2482,
+     2482, 2482, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2483,
+     2441, 2441, 2483, 2483, 2483, 2483, 2483, 2483, 2483, 2483,
+     2483, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2484, 2441,
+     2441, 2484, 2484, 2484, 2484, 2484, 2484, 2484, 2484, 2484,
+     2484, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2485, 2441,
+     2441, 2485, 2485, 2485, 2485, 2485, 2485, 2485, 2485, 2485,
+     2485, 2485, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2486,
+     2441, 2441, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486,
+
+     2486, 2486, 2486, 2486, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2487, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2472, 2472, 2472, 2441, 2488, 2441, 2441, 2441, 2441, 2441,
+     2473, 2473, 2473, 2473, 2489, 2441, 2474, 2474, 2474, 2474,
+     2490, 2441, 2475, 2475, 2475, 2475, 2475, 2475, 2475, 2475,
+     2491, 2441, 2476, 2476, 2476, 2476, 2476, 2492, 2441, 2477,
+     2477, 2477, 2477, 2477, 2477, 2477, 2441, 2441, 2441, 2441,
+     2441, 2493, 2441, 2478, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2494, 2441, 2479, 2479,
+
+     2479, 2441, 2441, 2441, 2441, 2495, 2441, 2480, 2480, 2480,
+     2480, 2480, 2480, 2441, 2441, 2441, 2441, 2496, 2441, 2481,
+     2481, 2441, 2441, 2481, 2481, 2481, 2481, 2441, 2441, 2441,
+     2441, 2441, 2441, 2497, 2441, 2482, 2482, 2482, 2482, 2482,
+     2482, 2482, 2482, 2482, 2441, 2441, 2441, 2441, 2498, 2441,
+     2441, 2483, 2483, 2483, 2483, 2483, 2483, 2483, 2483, 2483,
+     2441, 2441, 2441, 2441, 2499, 2441, 2484, 2484, 2484, 2484,
+     2484, 2484, 2484, 2484, 2484, 2484, 2441, 2441, 2441, 2441,
+     2500, 2441, 2485, 2485, 2485, 2485, 2485, 2485, 2485, 2485,
+     2485, 2485, 2441, 2441, 2441, 2441, 2501, 2441, 2486, 2486,
+
+     2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486, 2486,
+     2441, 2441, 2441, 2441, 2502, 2441, 2441, 2503, 2441, 2503,
+     2441, 2441, 2441, 2504, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2505, 2505, 2441, 2506, 2506, 2441, 2441, 2441, 2441,
+     2507, 2507, 2441, 2441, 2508, 2508, 2509, 2441, 2441, 2509,
+     2510, 2510, 2511, 2511, 2441, 2441, 2511, 2511, 2511, 2511,
+     2512, 2512, 2513, 2513, 2513, 2513, 2514, 2514, 2515, 2515,
+     2515, 2441, 2441, 2515, 2515, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2516, 2516, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2517, 2517,
+
+     2518, 2518, 2441, 2441, 2441, 2441, 2441, 2441, 2519, 2519,
+     2520, 2441, 2441, 2520, 2520, 2520, 2441, 2441, 2441, 2441,
+     2441, 2441, 2521, 2521, 2522, 2441, 2441, 2441, 2522, 2441,
+     2441, 2522, 2522, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2523, 2523, 2524, 2524, 2524, 2441, 2441, 2524,
+     2524, 2441, 2441, 2524, 2441, 2441, 2441, 2441, 2441, 2441,
+     2525, 2525, 2526, 2526, 2526, 2441, 2441, 2526, 2526, 2526,
+     2526, 2441, 2441, 2441, 2441, 2441, 2441, 2527, 2527, 2528,
+     2528, 2528, 2441, 2441, 2528, 2528, 2528, 2441, 2441, 2528,
+     2441, 2441, 2441, 2441, 2441, 2441, 2529, 2529, 2530, 2530,
+
+     2530, 2530, 2441, 2441, 2530, 2530, 2530, 2530, 2441, 2441,
+     2441, 2441, 2441, 2441, 2531, 2531, 2532, 2532, 2532, 2441,
+     2441, 2532, 2532, 2532, 2532, 2532, 2532, 2532, 2441, 2441,
+     2441, 2441, 2441, 2441, 2533, 2533, 2441, 2441, 2534, 2441,
+     2441, 2534, 2441, 2441, 2535, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2536, 2441, 2441, 2537, 2441, 2537, 2441,
+     2441, 2441, 2441, 2538, 2538, 2441, 2441, 2441, 2441, 2539,
+     2441, 2539, 2540, 2441, 2441, 2441, 2441, 2441, 2441, 2541,
+     2441, 2541, 2542, 2542, 2441, 2441, 2441, 2542, 2542, 2542,
+     2542, 2441, 2543, 2441, 2543, 2544, 2544, 2544, 2544, 2441,
+
+     2545, 2441, 2545, 2546, 2546, 2546, 2441, 2441, 2441, 2546,
+     2546, 2441, 2441, 2547, 2441, 2547, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2548, 2441, 2548, 2549, 2549,
+     2441, 2550, 2441, 2550, 2551, 2441, 2441, 2441, 2551, 2551,
+     2551, 2441, 2552, 2441, 2552, 2553, 2553, 2441, 2441, 2441,
+     2553, 2553, 2441, 2554, 2441, 2554, 2555, 2555, 2555, 2441,
+     2441, 2441, 2555, 2555, 2441, 2441, 2441, 2555, 2441, 2556,
+     2441, 2556, 2557, 2557, 2557, 2441, 2441, 2441, 2557, 2557,
+     2557, 2557, 2557, 2441, 2558, 2441, 2558, 2441, 2441, 2559,
+     2559, 2441, 2441, 2441, 2441, 2441, 2559, 2559, 2441, 2441,
+
+     2441, 2559, 2441, 2560, 2441, 2560, 2561, 2561, 2561, 2561,
+     2441, 2441, 2441, 2561, 2561, 2561, 2561, 2441, 2562, 2441,
+     2562, 2441, 2441, 2563, 2563, 2441, 2441, 2441, 2563, 2563,
+     2441, 2441, 2563, 2563, 2563, 2563, 2441, 2564, 2441, 2564,
+     2441, 2565, 2566, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2567, 2441, 2568, 2441, 2441, 2441, 2441, 2569, 2441,
+     2441, 2570, 2571, 2441, 2441, 2441, 2572, 2573, 2441, 2441,
+     2573, 2441, 2441, 2573, 2573, 2574, 2575, 2575, 2441, 2441,
+     2575, 2576, 2577, 2577, 2577, 2577, 2577, 2441, 2578, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2579, 2580, 2580,
+
+     2581, 2441, 2441, 2582, 2582, 2582, 2583, 2584, 2441, 2441,
+     2584, 2584, 2585, 2586, 2441, 2441, 2441, 2441, 2586, 2586,
+     2586, 2587, 2588, 2588, 2441, 2441, 2441, 2441, 2441, 2441,
+     2588, 2588, 2588, 2589, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2590, 2441, 2441, 2590, 2591, 2592,
+     2592, 2441, 2441, 2441, 2441, 2592, 2441, 2441, 2592, 2592,
+     2593, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2594, 2594,
+     2441, 2441, 2441, 2594, 2594, 2594, 2594, 2595, 2441, 2596,
+     2597, 2597, 2441, 2597, 2441, 2441, 2441, 2598, 2441, 2599,
+     2441, 2441, 2441, 2441, 2600, 2441, 2441, 2441, 2601, 2441,
+
+     2441, 2572, 2441, 2441, 2441, 2441, 2441, 2573, 2441, 2441,
+     2441, 2573, 2573, 2574, 2575, 2441, 2441, 2441, 2441, 2441,
+     2575, 2576, 2441, 2441, 2577, 2577, 2577, 2577, 2441, 2578,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2579, 2580,
+     2441, 2441, 2581, 2441, 2441, 2441, 2441, 2441, 2582, 2582,
+     2583, 2441, 2441, 2441, 2441, 2441, 2584, 2584, 2585, 2586,
+     2441, 2441, 2441, 2441, 2441, 2441, 2586, 2586, 2586, 2587,
+     2588, 2588, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2588, 2588, 2588, 2589, 2441, 2441, 2441, 2441, 2441,
+     2441, 2590, 2441, 2441, 2441, 2590, 2591, 2441, 2441, 2592,
+
+     2441, 2441, 2441, 2441, 2441, 2441, 2592, 2441, 2441, 2441,
+     2592, 2441, 2441, 2593, 2441, 2441, 2441, 2441, 2441, 2441,
+     2594, 2594, 2594, 2594, 2594, 2441, 2441, 2595, 2441, 2596,
+     2597, 2441, 2441, 2441, 2441, 2441, 2599, 2441, 2441, 2441,
+     2600, 2601, 2441, 2441, 2441, 2572, 2441, 2441, 2441, 2441,
+     2441, 2573, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2575, 2576, 2441, 2441, 2441, 2577, 2577, 2577, 2577,
+     2441, 2578, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2579, 2580, 2441, 2441, 2441, 2581, 2441, 2441, 2441, 2582,
+     2582, 2583, 2441, 2441, 2441, 2584, 2584, 2585, 2586, 2586,
+
+     2586, 2586, 2587, 2588, 2588, 2588, 2588, 2588, 2589, 2590,
+     2590, 2591, 2441, 2441, 2441, 2592, 2441, 2441, 2592, 2592,
+     2441, 2441, 2441, 2593, 2594, 2594, 2594, 2594, 2594, 2441,
+     2441, 2441, 2595, 2441, 2596, 2597, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2600, 2601, 2441, 2441, 2441, 2441,
+     2441, 2573, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2576, 2577, 2577, 2577, 2441, 2441, 2441, 2578, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2579, 2580, 2581, 2441,
+     2441, 2441, 2441, 2583, 2441, 2441, 2441, 2441, 2585, 2586,
+     2441, 2441, 2586, 2441, 2441, 2587, 2588, 2588, 2588, 2588,
+
+     2588, 2441, 2441, 2589, 2590, 2441, 2441, 2591, 2441, 2441,
+     2441, 2441, 2441, 2592, 2441, 2441, 2593, 2594, 2594, 2594,
+     2594, 2441, 2441, 2595, 2441, 2596, 2597, 2441, 2600, 2441,
+     2441, 2573, 2441, 2441, 2441, 2576, 2441, 2441, 2441, 2441,
+     2577, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2579, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2583, 2441, 2441, 2441, 2441,
+     2441, 2441, 2585, 2441, 2441, 2441, 2441, 2441, 2586, 2441,
+     2441, 2441, 2587, 2588, 2588, 2588, 2588, 2441, 2441, 2441,
+     2441, 2588, 2441, 2441, 2441, 2589, 2590, 2441, 2441, 2441,
+
+     2591, 2441, 2441, 2441, 2592, 2441, 2441, 2441, 2593, 2594,
+     2594, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2595, 2441,
+     2596, 2597, 2441, 2600, 2441, 2441, 2576, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2579, 2441, 2441, 2441, 2583, 2585, 2441,
+     2441, 2441, 2586, 2587, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2588, 2589,
+     2590, 2591, 2592, 2593, 2441, 2441, 2594, 2441, 2441, 2441,
+     2441, 2441, 2441, 2595, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2597, 2441, 2441, 2441, 2441,
+
+     2441, 2441, 2576, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2579, 2583, 2585, 2586, 2587, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2588, 2589, 2590, 2591, 2592, 2593, 2441, 2441, 2441,
+     2594, 2595, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2597, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2579, 2583, 2585, 2441, 2441, 2587, 2588, 2588, 2589, 2441,
+     2441, 2591, 2441, 2441, 2593, 2594, 2595, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+
+     2596, 2597, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2579, 2583, 2585, 2441, 2441, 2441, 2587, 2441, 2441, 2441,
+     2441, 2589, 2441, 2441, 2441, 2591, 2441, 2441, 2441, 2593,
+     2441, 2441, 2595, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2597, 2597, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2579, 2583, 2585, 2587,
+     2441, 2441, 2441, 2441, 2441, 2441, 2589, 2591, 2441, 2441,
+     2441, 2441, 2441, 2595, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2597, 2602,
+     2603, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+
+     2585, 2587, 2589, 2591, 2595, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2602, 2603, 2441, 2441, 2441, 2585, 2441, 2441, 2589, 2441,
+     2441, 2595, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2597, 2441, 2441,
+     2441, 2585, 2589, 2595, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2441,
+     2585, 2441, 2441, 2441, 2441, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2441, 2441, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2441, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2441, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2441, 2596, 2596,
+
+     2596, 2596, 2441, 2596, 2441, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2441, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2441, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+
+     2596, 2596, 2596, 2596, 2596, 2596, 2441, 2596, 2596, 2596,
+     2596, 2441, 2596, 2441, 2596, 2596, 2596, 2596, 2596, 2596,
+     2441, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2441, 2596,
+     2596, 2596, 2596, 2596, 2441, 2596, 2441, 2596, 2596, 2441,
+        0, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+
+     2441, 2441, 2441
+    } ;
+
+static yyconst short int yy_nxt[8115] =
+    {   0,
+     2441,  132,  133,  132,  132,  133,  132,  132,  133,  132,
+      132,  133,  132,  137,  133,  137,  143,  134,  140,  143,
+      134,  140, 1183,  135, 2441,  141,  135,  619,  141,  138,
+      137,  133,  137,  415,  144,  146,  147,  144,  146,  147,
+      148,  149,  620,  148,  149,  415,  138,  153,  154,  416,
+      150,  146,  147,  150,  151,  418,  148,  146,  147, 1527,
+      151,  417,  148,  153,  154,  537,  150,  133,  133,  133,
+      538,  417,  150,  133,  133,  133,  133,  133,  133,  133,
+      133,  133,  510,  157,  155,  414,  414,  414,  693,  157,
+      511,  556,  166,  840,  682,  166,  414,  414,  414,  557,
+
+      155,  158,  159,  133,  159,  158,  158,  158,  158,  158,
+      158,  158,  160,  158,  158,  158, 1788,  158,  162,  158,
+      163,  158,  168,  133,  168,  168,  133,  168,  133,  133,
+      133,  133,  133,  133,  168,  133,  168,  603,  169,  158,
+      158,  169,  625, 1183,  170,  626,  604,  170,  979,  980,
+      169,  164,  165,  158,  159,  133,  159,  158,  158,  158,
+      158,  158,  158,  158,  160,  158,  158,  158, 1436,  158,
+      162,  158,  163,  158,  168,  133,  168,  168,  133,  168,
+      168,  133,  168,  133,  133,  133,  133,  133,  133,  840,
+      169,  158,  158,  171,  840, 1951,  171,  840, 1042,  172,
+
+     1909,  842,  172,  164,  165,  173,  174,  133,  174,  173,
+      173,  173,  173,  173,  173,  173,  175,  173,  173,  173,
+      840,  173,  177,  173,  178,  173,  183,  133,  183,  840,
+      183,  133,  183,  133,  133,  133,  133,  133,  133,  414,
+      414,  414,  184,  173,  173,  179,  184, 1330,  840,  185,
+      180, 1751,  185,  181,  173,  174,  133,  174,  173,  173,
+      173,  173,  173,  173,  173,  175,  173,  173,  173,  840,
+      173,  177,  173,  178,  173,  196,  133,  196, 1878,  196,
+      133,  196,  133,  133,  133,  133,  133,  133,  414,  414,
+      414,  197,  173,  173,  179,  197, 1499, 1500,  198,  180,
+
+     1753,  198,  181,  186,  187,  133,  187,  186,  186,  186,
+      186,  186,  186,  186,  188,  186,  186,  186,  840,  186,
+      190,  186,  191,  186,  212,  133,  212,  212,  133,  212,
+      133,  133,  133,  133,  133,  133,  414,  414,  414,  840,
+      213,  186,  186,  213, 1925, 1526,  166,  192,  840,  166,
+     1750,  193,  194,  186,  187,  133,  187,  186,  186,  186,
+      186,  186,  186,  186,  188,  186,  186,  186,  840,  186,
+      190,  186,  191,  186,  225,  133,  225,  225,  133,  225,
+      133,  133,  133,  133,  133,  133,  414,  414,  414, 1748,
+      226,  186,  186,  226, 1584, 1585,  227,  192, 1924,  227,
+
+     1835,  193,  194,  199,  200,  133,  200,  199,  199,  199,
+      199,  199,  199,  199,  201,  199,  199,  199,  202,  199,
+      203,  199,  204,  199,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  202,
+      202,  199,  199,  202,  202,  205,  202,  202,  206,  202,
+      202,  207,  202,  202,  202,  202,  202,  202,  202,  202,
+      208,  202,  209,  202,  210,  202,  202,  202,  214,  215,
+      133,  215,  214,  214,  214,  214,  214,  214,  214,  216,
+      214,  214,  214,  840,  214,  218,  214,  219,  214,  133,
+      133,  133, 1923,  133,  133,  133, 1435,  244,  133,  244,
+
+      244,  133,  244,  418,  573,  242,  214,  214,  220,  242,
+      418,  418,  221,  245,  574,  840,  245,  435,  840,  417,
+      222,  414,  414,  414, 1586, 1587,  417,  417, 1183,  223,
+      214,  215,  133,  215,  214,  214,  214,  214,  214,  214,
+      214,  216,  214,  214,  214, 1841,  214,  218,  214,  219,
+      214,  133,  133,  133, 1789,  133,  133,  133, 1183,  133,
+      133,  133,  133,  133,  133,  418, 1622,  242,  214,  214,
+      220,  242,  418,  418,  221,  254, 1777, 1778,  254,  445,
+      840,  417,  222,  436,  414,  414,  414, 1696,  417,  417,
+     1883,  223,  228,  229,  133,  229,  228,  228,  228,  228,
+
+      228,  228,  228,  230,  228,  228,  228,  231,  228,  232,
+      228,  233,  228,  231,  231,  231,  231,  231,  231,  231,
+      231,  231,  231,  231,  231,  231,  231,  231,  231,  231,
+      228,  228,  234,  231,  231,  235,  231,  236,  231,  231,
+      237,  231,  231,  238,  231,  231,  231,  231,  231,  231,
+      231,  231,  239,  231,  240,  241,  231,  246,  247,  133,
+      247,  246,  246,  246,  246,  246,  246,  246,  248,  246,
+      246,  246,  840,  246,  250,  246,  251,  246,  133,  133,
+      133,  133,  133,  133,  256,  133,  256,  256,  133,  256,
+      256,  133,  256,  418,  254,  246,  246,  254,  456,  418,
+
+      257,  418,  418,  257, 1895, 1743,  258,  840,  451,  417,
+      414,  414,  414,  457,  437,  417, 1894,  417,  417,  252,
+      253,  246,  247,  133,  247,  246,  246,  246,  246,  246,
+      246,  246,  248,  246,  246,  246, 1756,  246,  250,  246,
+      251,  246,  256,  133,  256,  133,  133,  133,  133,  133,
+      133,  271,  133,  271,  271,  133,  271,  418,  258,  246,
+      246,  259,  418,  840,  259, 1893,  840,  272,  840,  461,
+      272, 1959, 1886,  417,  414,  414,  414,  840,  417,  438,
+      414,  414,  414,  252,  253,  260,  261,  133,  261,  260,
+      260,  260,  260,  260,  260,  260,  262,  260,  260,  260,
+
+     1749,  260,  264,  260,  265,  260,  133,  133,  133,  133,
+      133,  133,  287,  133,  287,  287,  133,  287,  133,  133,
+      133, 1842,  273,  260,  260,  273, 1183, 1184,  288,  418,
+      418,  288,  840, 1856,  289,  414,  414,  414, 1999,  266,
+     1855,  267,  414,  414,  414,  417,  417,  268,  269,  260,
+      261,  133,  261,  260,  260,  260,  260,  260,  260,  260,
+      262,  260,  260,  260,  840,  260,  264,  260,  265,  260,
+      133,  133,  133,  305,  133,  305,  305,  133,  305,  133,
+      133,  133,  133,  133,  133, 1795,  289,  260,  260,  306,
+      418,  418,  306,  418, 1854,  307,  840,  468,  307,  414,
+
+      414,  414, 2013,  266,  840,  267,  417,  417, 1913,  417,
+      481,  268,  269,  274,  275,  133,  275,  274,  274,  274,
+      274,  274,  274,  274,  276,  274,  274,  274,  277,  274,
+      278,  274,  279,  274,  277,  277,  277,  277,  277,  277,
+      277,  277,  277,  277,  277,  277,  277,  277,  277,  277,
+      277,  274,  274,  277,  277,  277,  277,  277,  277,  277,
+      280,  281,  277,  277,  277,  277,  282,  277,  277,  277,
+      277,  277,  277,  283,  277,  284,  285,  277,  290,  291,
+      133,  291,  290,  290,  290,  290,  290,  290,  290,  292,
+      290,  290,  290,  293,  290,  294,  290,  295,  290,  293,
+
+      293,  293,  293,  293,  293,  293,  293,  293,  293,  293,
+      293,  293,  293,  293,  293,  293,  290,  290,  293,  293,
+      296,  293,  293,  293,  293,  297,  298,  293,  293,  293,
+      293,  299,  293,  293,  293,  293,  293,  293,  300,  301,
+      302,  303,  293,  308,  309,  133,  309,  308,  308,  308,
+      308,  308,  308,  308,  310,  308,  308,  308,  311,  308,
+      312,  308,  313,  308,  311,  311,  311,  311,  311,  311,
+      311,  311,  311,  311,  311,  311,  311,  311,  311,  311,
+      311,  308,  308,  311,  311,  311,  314,  311,  311,  311,
+      315,  316,  311,  311,  311,  311,  317,  311,  311,  311,
+
+      311,  318,  319,  320,  311,  321,  322,  311,  324,  133,
+      324,  324,  133,  324,  133,  133,  133,  133,  133,  133,
+      414,  414,  414, 1852,  325,  840, 1851,  325,  840, 1935,
+      326, 1809, 1943,  326,  327,  328,  133,  328,  327,  327,
+      327,  327,  327,  327,  327,  329,  327,  327,  327,  330,
+      327,  331,  327,  332,  327,  330,  330,  330,  330,  330,
+      330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
+      330,  330,  327,  327,  330,  330,  333,  334,  330,  330,
+      330,  335,  336,  330,  330,  330,  330,  337,  330,  330,
+      330,  330,  338,  330,  339,  330,  340,  341,  330,  343,
+
+      133,  343,  343,  133,  343,  133,  133,  133,  133,  133,
+      133,  414,  414,  414, 1808,  344,  840, 1807,  344,  840,
+     1979,  345, 1806, 1984,  345,  346,  347,  133,  347,  346,
+      346,  346,  346,  346,  346,  346,  348,  346,  346,  346,
+      349,  346,  350,  346,  351,  346,  349,  349,  349,  349,
+      349,  349,  349,  349,  349,  349,  349,  349,  349,  349,
+      349,  349,  349,  346,  346,  352,  349,  349,  353,  349,
+      349,  349,  354,  355,  349,  349,  349,  349,  356,  349,
+      349,  349,  349,  357,  358,  359,  349,  360,  361,  349,
+      363,  133,  363,  363,  133,  363,  133,  133,  133,  133,
+
+      133,  133,  414,  414,  414, 1805,  364,  840,  840,  364,
+     1804, 2002,  365, 1803, 2020,  365,  366,  367,  133,  367,
+      366,  366,  366,  366,  366,  366,  366,  368,  366,  366,
+      366,  369,  366,  370,  366,  371,  366,  369,  369,  369,
+      369,  369,  369,  369,  369,  369,  369,  369,  369,  369,
+      369,  369,  369,  369,  366,  366,  372,  369,  369,  373,
+      369,  374,  369,  375,  376,  369,  369,  369,  369,  369,
+      369,  369,  369,  377,  378,  369,  379,  380,  381,  382,
+      369,  384,  133,  384,  384,  133,  384,  133,  133,  133,
+      133,  133,  133,  414,  414,  414,  840,  385,  840,  840,
+
+      385, 1786, 2023,  386, 2024, 2037,  386,  387,  388,  133,
+      388,  387,  387,  387,  387,  387,  387,  387,  389,  387,
+      387,  387,  390,  387,  391,  387,  392,  387,  390,  390,
+      390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
+      390,  390,  390,  390,  390,  387,  387,  393,  390,  390,
+      390,  390,  394,  390,  395,  396,  390,  397,  390,  390,
+      398,  399,  390,  390,  400,  390,  390,  401,  402,  403,
+      404,  390,  133,  133,  133,  133,  133,  133,  406,  133,
+      406,  406,  133,  406,  409,  410,  423,  418,  345,  411,
+      840,  345,  418,  418,  407,  409,  410,  407,  840,  412,
+
+      411,  418, 1770,  417, 1769, 1768,  418, 1767,  417,  417,
+      412,  436,  840,  435,  437,  438,  840,  417,  429, 1798,
+      424,  413,  417,  434,  436,  439,  425,  437,  438,  418,
+      426, 1792,  413,  439,  840,  427,  482, 1752,  439,  477,
+      477,  477,  479,  479,  479,  417,  485,  485,  485,  487,
+      487,  487,  418,  418,  418, 1790,  478,  840,  840,  480,
+      497, 1766, 1834,  486, 2090,  418,  488,  418,  417,  417,
+      417,  489,  502,  502,  502,  504,  504,  504,  414,  414,
+      414,  417, 1791,  417,  489,  490,  491,  418,  418,  503,
+     1183,  492,  505,  840,  506,  493,  494,  495,  496,  414,
+
+      414,  414,  840,  417,  417,  514,  514,  514,  516,  516,
+      516,  418,  492,  414,  414,  414,  418, 1844,  518,  414,
+      414,  414,  515, 1796, 1757,  517,  840,  417, 1765,  522,
+      522,  522,  417,  528,  528,  528,  530,  530,  530,  532,
+      532,  532,  414,  414,  414,  494,  523,  418,  418,  418,
+      529, 1793,  840,  531,  534,  840,  533,  414,  414,  414,
+      545,  545,  545,  417,  417,  417,  490,  547,  547,  547,
+      418,  418,  524,  414,  414,  414,  418,  546,  549,  414,
+      414,  414,  840,  840,  548, 1794,  417,  417, 1801,  550,
+      418,  418,  417,  561,  561,  561,  563,  563,  563,  414,
+
+      414,  414,  418,  414,  414,  414,  417,  417, 1800,  565,
+      562,  418,  418,  564,  577,  577,  577, 1907,  417,  581,
+      495,  579,  579,  579,  414,  414,  414,  417,  417,  418,
+     1764,  578,  414,  414,  414,  593,  593,  593,  580,  595,
+      595,  595,  496,  418,  418,  417,  414,  414,  414,  418,
+      597,  423,  594,  414,  414,  414,  596,  418,  840,  417,
+      417,  611,  611,  611,  615,  417,  613,  613,  613,  414,
+      414,  414,  493,  417,  414,  414,  414, 1763,  612,  623,
+      623,  623, 1741,  614,  840,  424,  643,  643,  643,  840,
+     1734,  425,  648,  648,  648,  426,  655,  655,  655,  840,
+
+      427, 1799,  840,  644,  672,  672,  672, 1797,  840,  649,
+      477,  477,  477,  656, 1183,  676,  676,  676, 1180,  677,
+     1937,  673,  678,  479,  479,  479,  840,  478, 1744,  624,
+      679,  679,  679, 1754,  680,  840, 1755,  681,  840, 1745,
+      480,  485,  485,  485,  685,  685,  685, 1802,  686, 1837,
+      840,  687,  487,  487,  487,  688,  688,  688,  486,  689,
+      840,  840,  690,  502,  502,  502,  703,  703,  703,  488,
+      704, 1839, 1879,  705,  504,  504,  504,  706,  706,  706,
+      503,  707, 1846,  840,  708,  712,  712,  712,  514,  514,
+      514,  505,  717,  717,  717, 1732,  718, 1906,  840,  719,
+
+     1836,  840,  713,  840,  840,  515,  516,  516,  516,  720,
+      720,  720,  840,  721, 1982,  840,  722,  522,  522,  522,
+      726,  726,  726,  517,  727, 1847, 1958,  728,  730,  730,
+      730,  528,  528,  528,  523,  734,  734,  734, 1718,  735,
+     1746, 1941,  736, 1838, 1914,  731, 1747,  840,  529,  530,
+      530,  530,  737,  737,  737, 1714,  738,  840, 1713,  739,
+      532,  532,  532,  740,  740,  740,  531,  741,  840,  840,
+      742,  748,  748,  748,  752,  752,  752,  533,  545,  545,
+      545, 1875,  755,  755,  755,  840,  756,  840,  749,  757,
+     1908,  753,  547,  547,  547,  546,  758,  758,  758, 1712,
+
+      759, 1711, 1710,  760,  766,  766,  766, 1840, 1843,  548,
+      561,  561,  561,  772,  772,  772,  840,  773,  840, 1877,
+      774,  767,  563,  563,  563,  840, 1845,  562,  775,  775,
+      775,  840,  776,  840,  840,  777,  783,  783,  783,  564,
+      788,  788,  788,  577,  577,  577, 1876,  791,  791,  791,
+      840,  792, 1888,  784,  793, 1880, 1882,  789, 1885, 1887,
+      578,  579,  579,  579,  794,  794,  794,  840,  795,  840,
+      840,  796,  803,  803,  803,  593,  593,  593,  580,  809,
+      809,  809,  840,  810, 1910, 1961,  811,  840, 1884,  804,
+     1709,  840,  594,  595,  595,  595,  812,  812,  812,  840,
+
+      813,  840, 1915,  814,  820,  820,  820,  611,  611,  611,
+      596,  829,  829,  829, 1942,  830,  840, 1708,  831, 1916,
+      840,  821, 1964,  840,  612,  613,  613,  613,  832,  832,
+      832, 2014,  833, 1917, 1944,  834,  623,  623,  623, 1707,
+      844, 1939,  614,  852,  852,  852, 2441, 2441, 2441,  856,
+      856,  856,  856,  856,  856,  643,  643,  643, 1920,  840,
+      853,  840, 1677, 2441,  866,  866,  866,  858,  867,  840,
+      858,  868,  644,  869,  869,  869,  869,  869,  869,  648,
+      648,  648,  874,  874,  874, 1671,  875, 1960,  840,  876,
+      840,  871,  840, 1936,  871, 1940,  649,  854,  859,  877,
+
+      877,  877,  879,  879,  879, 1981,  879,  879,  879,  655,
+      655,  655,  892,  892,  892,  840,  878,  892,  892,  892,
+      881, 1946,  840,  872,  881, 1962,  656,  885,  885,  885,
+      894,  886,  840, 1967,  887,  894,  900,  900,  900,  900,
+      900,  900,  672,  672,  672,  907,  907,  907,  840,  908,
+      840, 1669,  909,  840,  902,  840, 1957,  902,  840,  673,
+      676,  676,  676, 1988,  677,  882, 1965,  678,  840,  895,
+      679,  679,  679, 1976,  680,  840,  840,  681,  913,  913,
+      913,  913,  913,  913, 1968,  903,  685,  685,  685, 1963,
+      686, 1998, 1966,  687, 1977,  840,  915,  840,  840,  915,
+
+      688,  688,  688, 2129,  689, 1980,  840,  690,  925,  925,
+      925,  925,  925,  925,  703,  703,  703,  840,  704,  840,
+     1985,  705, 2166,  706,  706,  706,  927,  707,  916,  927,
+      708,  931,  931,  931,  931,  931,  931,  712,  712,  712,
+      936,  936,  936,  840,  937, 1983, 1653,  938,  840,  933,
+     1978,  840,  933, 1989,  713,  717,  717,  717,  840,  718,
+      840, 1990,  719,  928,  720,  720,  720,  840,  721,  840,
+      840,  722,  942,  942,  942,  942,  942,  942, 2081,  726,
+      726,  726, 1993,  727, 1986,  934,  728,  730,  730,  730,
+      944,  840, 1996,  944,  948,  948,  948, 1987,  949, 1643,
+
+     2082,  950, 1642,  840,  731,  734,  734,  734, 1995,  735,
+      840,  840,  736,  737,  737,  737,  840,  738, 1994,  840,
+      739,  840,  740,  740,  740,  945,  741,  840, 2000,  742,
+      953,  953,  953,  953,  953,  953,  748,  748,  748,  960,
+      960,  960, 2007,  961, 1997, 2001,  962,  840,  955, 2100,
+     2004,  955,  840,  749,  752,  752,  752,  965,  965,  965,
+     2003,  966,  840, 2005,  967,  755,  755,  755, 2008,  756,
+      840,  753,  757,  758,  758,  758,  956,  759, 2009,  840,
+      760,  969,  969,  969,  969,  969,  969,  766,  766,  766,
+      976,  976,  976, 1641,  977,  840, 1640,  978,  840,  971,
+
+      840,  840,  971, 2011,  767,  772,  772,  772,  840,  773,
+      840, 2022,  774,  775,  775,  775, 2010,  776,  840, 1639,
+      777,  984,  984,  984,  840,  984,  984,  984,  988,  988,
+      988, 2441, 2441, 2441, 2441, 2441, 2441, 2018, 2012,  986,
+     2026, 2016,  972,  986, 2015,  989,  840,  840, 2441, 2019,
+      840, 2441,  783,  783,  783,  992,  992,  992, 2017,  993,
+     1638, 2028,  994,  995,  995,  995, 2441, 2441, 2441,  784,
+     2167,  987,  840, 2441, 2441, 2441,  788,  788,  788,  840,
+      996, 2025,  990, 2441,  999,  999,  999,  991, 1000,  840,
+     2441, 1001,  840,  789, 2441, 2441, 2441,  791,  791,  791,
+
+     2035,  792,  840, 2030,  793,  794,  794,  794,  840,  795,
+     1637, 2441,  796, 1636, 2027,  997,  998, 1003, 1003, 1003,
+     1003, 1003, 1003,  803,  803,  803, 1011, 1011, 1011,  840,
+     1012, 2031, 1624, 1013,  840, 1005, 2033,  840, 1005, 2040,
+      804, 1002,  809,  809,  809,  840,  810, 2036, 2038,  811,
+      812,  812,  812,  840,  813,  840, 2039,  814, 1018, 1018,
+     1018, 1018, 1018, 1018, 1022, 1022, 1022, 2032, 2052, 1006,
+     2441, 2441, 2441, 2441, 2441, 2441, 1020,  840,  840, 1020,
+     1623, 1023,  820,  820,  820, 1620,  840, 2441, 2053, 2111,
+     2441, 1026, 1026, 1026, 2048, 1027,  840, 1611, 1028,  821,
+
+     2441, 2441, 2441,  840, 1021, 2441, 2441, 2441, 1031, 1031,
+     1031, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441,  840, 2441, 2041,  840, 1032, 1025, 1024, 2441,  840,
+     2057, 2441, 2441, 2441, 2441, 2441,  829,  829,  829, 2067,
+      830, 2061,  840,  831,  832,  832,  832,  840,  833, 2441,
+     1030,  834, 1029, 1610, 2101, 1034, 1037, 1037, 1037, 1037,
+     1037, 1037,  852,  852,  852, 1035, 2047,  840, 1049, 1049,
+     1049,  840, 1050, 1033, 1039, 1051, 2064, 1039, 2049,  853,
+      856,  856,  856,  856,  856,  856,  856,  856,  856, 1036,
+     1060, 1060, 1060,  866,  866,  866, 1597,  867,  858,  840,
+
+      868,  858, 2077,  840,  858, 2062,  840, 1061, 1040,  869,
+      869,  869,  869,  869,  869,  869,  869,  869,  874,  874,
+      874,  840,  875, 2144, 2078,  876,  840,  871, 2102, 1054,
+      871,  840,  840,  871,  877,  877,  877, 1064, 1064, 1064,
+     2065, 1065, 2070,  840, 1066,  879,  879,  879,  879,  879,
+      879,  878,  879,  879,  879, 1592, 1069, 1069, 1069, 2079,
+      885,  885,  885,  881,  886,  840,  881,  887,  840, 2080,
+      881,  840, 1062, 1070, 1072, 1072, 1072, 2085,  892,  892,
+      892,  892,  892,  892,  892,  892,  892, 1079, 1079, 1079,
+      840, 1073,  900,  900,  900, 1067,  894,  840,  840,  894,
+
+      840, 2123,  894, 2088, 1080,  900,  900,  900, 2083, 2089,
+      902,  900,  900,  900,  907,  907,  907,  840,  908,  840,
+     1579,  909,  840,  902,  913,  913,  913,  840, 2084,  902,
+      913,  913,  913, 2124, 2087, 1076, 2093,  913,  913,  913,
+      840,  840,  915,  925,  925,  925, 2103,  840,  915,  925,
+      925,  925,  840, 2141, 1082,  915,  925,  925,  925, 2097,
+     2094,  927,  931,  931,  931, 2095,  840,  927,  931,  931,
+      931,  931,  931,  931,  927, 1102, 1102, 1102, 2096,  840,
+      933, 2099, 2109,  936,  936,  936,  933,  937, 1089,  933,
+      938,  840, 1103, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+
+     2441, 2441,  942,  942,  942,  840, 2104, 1098,  840, 2110,
+     2441,  840, 1101, 2441, 1554, 1553, 2441,  942,  942,  942,
+      944, 2108,  942,  942,  942, 1109, 1109, 1109,  840, 2107,
+      948,  948,  948,  840,  949,  944, 1104,  950, 2114, 1106,
+      944,  840, 1110, 1105,  953,  953,  953,  953,  953,  953,
+      953,  953,  953, 1115, 1115, 1115, 1117, 1117, 1117, 2106,
+      840, 1107,  955,  840,  840,  955, 1552, 1551,  955, 2146,
+     1116, 2112,  840, 1118,  960,  960,  960,  840,  961, 2113,
+     2120,  962,  965,  965,  965,  840,  966, 2118,  840,  967,
+     2115, 1113,  969,  969,  969,  969,  969,  969,  969,  969,
+
+      969, 1125, 1125, 1125,  976,  976,  976, 2116,  977,  840,
+      971,  978,  840,  971,  840, 2117,  971, 2121, 1126, 1127,
+     1127, 1127, 1129, 1129, 1129,  984,  984,  984,  984,  984,
+      984,  984,  984,  984,  840,  840, 1128, 1550, 2122, 1130,
+      988,  988,  988,  986, 2133, 2142,  986,  840,  840,  986,
+     2125, 2139, 1135, 1135, 1135, 1122, 1136,  989, 1549, 1137,
+     1138, 1138, 1138, 1140, 1140, 1140,  992,  992,  992,  840,
+      993,  840,  840,  994, 1134,  840, 2130, 1139, 2134,  840,
+     1141,  995,  995,  995, 1142, 1142, 1142, 2128, 1143, 2140,
+     1548, 1144, 2441, 2441, 2441, 1146, 1146, 1146,  996,  999,
+
+      999,  999, 2143, 1000, 2131,  840, 1001,  840, 2135, 2441,
+      840, 2161, 1147, 2441, 2441, 2441, 1003, 1003, 1003, 1003,
+     1003, 1003, 1003, 1003, 1003, 1152, 1152, 1152,  840, 2145,
+     2441, 1154, 1154, 1154, 1005,  840, 2136, 1005,  840, 2137,
+     1005,  840, 1153, 1011, 1011, 1011, 2147, 1012, 1155, 1145,
+     1013, 2149, 1545, 1148, 1157, 1157, 1157, 1018, 1018, 1018,
+     1018, 1018, 1018, 1018, 1018, 1018, 1022, 1022, 1022, 1149,
+     2138, 1158, 1162, 1162, 1162, 1020, 1163, 1529, 1020, 1164,
+      840, 1020,  840, 1023, 1165, 1165, 1165, 1167, 1167, 1167,
+     1026, 1026, 1026, 2150, 1027, 2162,  840, 1028, 2441, 2441,
+
+     2441, 1166,  840,  840, 1168, 2441, 2441, 2441, 1031, 1031,
+     1031,  840, 1171, 1171, 1171, 2441, 1172, 2169,  840, 1173,
+     2186, 1528, 2441,  840, 1161, 1032, 2441, 2441, 2441, 2441,
+     2441, 2441, 2155, 2441, 2441, 2441, 2441, 2441, 2441, 1037,
+     1037, 1037,  840, 2441, 2151,  840, 2441, 1525, 2171, 1170,
+     2441, 2152, 2156, 2441, 1037, 1037, 1037, 1039, 1169, 1037,
+     1037, 1037,  856,  856,  856, 1182, 1182, 1182,  840,  840,
+     1174,  840, 1039, 1176, 1193, 1193, 1193, 1039, 2157, 2163,
+      858, 1175, 1177, 1183, 1184, 1049, 1049, 1049,  840, 1050,
+      840,  840, 1051, 1060, 1060, 1060, 2164, 1521, 1178, 1196,
+
+     1196, 1196, 2158, 1197, 2159,  840, 1198,  869,  869,  869,
+     1061,  840, 1190, 1200, 1200, 1200, 1064, 1064, 1064, 2223,
+     1065, 2160, 2168, 1066, 2177,  871,  879,  879,  879,  840,
+     1201, 1203, 1203, 1203, 1069, 1069, 1069, 2165, 1205, 1205,
+     1205, 2173, 1206,  840,  881, 1207,  840, 2170, 1204,  840,
+      840, 1070, 2441, 2441, 2441, 2174,  840, 1199, 1072, 1072,
+     1072, 1209, 1209, 1209,  840, 1210,  840, 1520, 1211, 2441,
+     2441, 2441, 2441, 2187, 1519, 1073, 2178, 1202, 2441, 2441,
+     2441,  892,  892,  892, 1216, 1216, 1216, 2441, 1079, 1079,
+     1079,  840,  840, 1208, 2175, 2441, 1218, 1218, 1218,  894,
+
+     1219, 1217, 2183, 1220, 2176, 1080,  900,  900,  900, 1223,
+     1223, 1223, 2441, 2441, 2441, 2441, 2441, 2441, 2179, 1212,
+     2441, 2441, 2441, 1518,  902, 2180, 1224,  840, 1505, 2441,
+     2181, 2188, 2441, 1501,  840, 1213,  840, 2441, 1214,  840,
+     2441, 2441, 2441,  913,  913,  913,  925,  925,  925, 1241,
+     1241, 1241,  931,  931,  931,  840, 1222, 2441, 1102, 1102,
+     1102,  915, 1226,  840,  927, 2224, 1242, 1225, 2182, 1227,
+      933, 2184, 1244, 1244, 1244, 1103, 1245,  840,  840, 1246,
+     1247, 1247, 1247, 1498, 2207, 1230, 1333, 1333, 1333, 1228,
+     2441, 2441, 2441, 2441, 2441, 2441, 1497, 1248, 1243,  942,
+
+      942,  942, 2189, 1239, 1252, 1252, 1252, 2441,  840, 1493,
+     2441, 1109, 1109, 1109, 1339, 1339, 1339,  944, 1254, 1254,
+     1254, 1253, 1255,  840, 2191, 1256,  840,  840, 1110, 2216,
+     1490, 1249, 2441, 2441, 2441, 2441, 2441, 2441,  953,  953,
+      953, 2192, 1250, 1478, 1251, 1115, 1115, 1115,  840, 2441,
+     1476, 2196, 2441, 1261, 1261, 1261,  955, 1262,  840, 2193,
+     1263,  840, 1116, 1117, 1117, 1117,  840, 1264, 1264, 1264,
+     2200, 1265,  840, 1257, 1266,  969,  969,  969, 2242,  840,
+     1118, 1125, 1125, 1125, 1258, 1273, 1273, 1273, 2198, 1274,
+     2197, 2199, 1275,  971,  840, 1259, 2201,  840, 1126, 1127,
+
+     1127, 1127, 1276, 1276, 1276,  840, 1277, 1475, 2233, 1278,
+     1129, 1129, 1129, 1279, 1279, 1279, 1128, 1280, 2202, 2238,
+     1281,  984,  984,  984, 1135, 1135, 1135, 1130, 1136,  840,
+      840, 1137, 1270, 1138, 1138, 1138, 1286, 1286, 1286,  986,
+     1287, 2238, 1474, 1288, 1140, 1140, 1140, 1289, 1289, 1289,
+     1139, 1290, 1473, 2203, 1291,  840, 1142, 1142, 1142,  840,
+     1143, 1141, 1285, 1144, 1146, 1146, 1146, 1293, 1293, 1293,
+      840, 1294,  840,  840, 1295, 1003, 1003, 1003, 1298, 1298,
+     1298, 1147, 2441, 2441, 2441, 1152, 1152, 1152,  840, 2217,
+     1301, 1301, 1301, 1005, 1302, 1299, 2204, 1303, 2210, 2441,
+
+      840, 1472, 1153, 1154, 1154, 1154, 1304, 1304, 1304, 2211,
+     1305,  840, 2205, 1306, 2441, 2441, 2441, 1297,  840,  840,
+     1155, 1300, 1157, 1157, 1157, 1308, 1308, 1308,  840, 1309,
+     2245, 2441, 1310, 2441, 2441, 2441, 1312, 1312, 1312, 1158,
+     1018, 1018, 1018, 2212, 1162, 1162, 1162, 1471, 1163, 2219,
+     2441, 1164, 2213, 1313, 1165, 1165, 1165, 2221, 1020,  840,
+     1315, 1315, 1315, 1307, 1316,  840, 2274, 1317, 1167, 1167,
+     1167, 1166, 1318, 1318, 1318,  840, 1319,  840, 2262, 1320,
+      840, 1470, 1311, 2225,  840, 1168, 1171, 1171, 1171, 2226,
+     1172, 2241,  840, 1173, 1326, 1326, 1326, 1314, 1037, 1037,
+
+     1037,  840, 1182, 1182, 1182, 1334, 1334, 1334,  856,  856,
+      856, 1327, 1193, 1193, 1193, 2220, 1039, 1196, 1196, 1196,
+     1183, 1197, 1335, 2222, 1198, 2236,  858,  869,  869,  869,
+     1200, 1200, 1200, 1343, 1343, 1343, 1467, 1344, 2273,  840,
+     1345,  879,  879,  879, 1445,  871, 1440, 1201, 1203, 1203,
+     1203, 1337,  840, 1350, 1350, 1350, 2441, 2441, 2441,  881,
+     1328, 1331, 1355, 1355, 1355, 1204, 1342, 1347, 1347, 1347,
+     1351, 1348,  840, 2441, 1349, 1205, 1205, 1205, 2227, 1206,
+     1356,  840, 1207, 1209, 1209, 1209, 2262, 1210,  840, 1434,
+     1211, 1353, 1353, 1353, 1357, 1357, 1357,  840, 1346, 1216,
+
+     1216, 1216,  840, 1352, 1429, 1359, 1359, 1359, 1354, 1360,
+     2234, 1358, 1361, 1218, 1218, 1218, 1217, 1219, 2246, 2235,
+     1220,  900,  900,  900, 1223, 1223, 1223, 1364, 1364, 1364,
+      840, 1365,  840,  840, 1366, 2441, 2441, 2441, 1428,  902,
+     2239, 1224, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441,  840, 2441,  913,  913,  913,  925,  925,  925, 2441,
+      840, 1427, 2441,  840, 1363, 2441, 1241, 1241, 1241, 2228,
+     2240,  915, 2229,  840,  927, 1383, 1383, 1383,  840, 1384,
+      840, 2260, 1385, 1242,  931,  931,  931, 1367, 1333, 1333,
+     1333, 1370, 1368, 1244, 1244, 1244, 2249, 1245, 1369, 2230,
+
+     1246, 2275,  933, 2261, 2237, 1372, 1247, 1247, 1247, 1426,
+      840, 1381, 1387, 1387, 1387,  840, 1388, 2251,  840, 1389,
+     2441, 2441, 2441, 1248, 2441, 2441, 2441,  942,  942,  942,
+     1252, 1252, 1252, 1443, 1443, 1443, 1386, 2441, 2441, 2441,
+     2441, 2441, 1393, 1393, 1393,  944, 1394, 1253, 2250, 1395,
+     1254, 1254, 1254,  840, 1255, 2441, 2257, 1256, 2441, 2441,
+     2441,  953,  953,  953,  969,  969,  969, 1391, 1390,  840,
+     1392, 1425,  984,  984,  984, 2441, 1261, 1261, 1261,  955,
+     1262,  840,  971, 1263,  840,  840, 1396, 1264, 1264, 1264,
+      986, 1265, 2252, 2247, 1266, 1273, 1273, 1273, 1411, 1274,
+
+     1398, 1397, 1275, 1276, 1276, 1276,  840, 1277, 2248, 2253,
+     1278, 1279, 1279, 1279, 2295, 1280, 1403, 2268, 1281,  840,
+     1409, 1286, 1286, 1286,  840, 1287, 2320,  840, 1288, 1289,
+     1289, 1289,  840, 1290, 1410,  840, 1291, 1293, 1293, 1293,
+      840, 1294,  840, 2254, 1295, 1003, 1003, 1003, 1298, 1298,
+     1298, 1413, 1413, 1413,  840, 1414, 2255, 2265, 1415, 2441,
+     2441, 2441, 2258, 1005, 2256, 1299, 1301, 1301, 1301, 2273,
+     1302,  840, 2266, 1303, 1408, 1407, 2441, 1304, 1304, 1304,
+      840, 1305,  840,  840, 1306, 1417, 1417, 1417, 1412, 1308,
+     1308, 1308, 2269, 1309,  840,  840, 1310, 2441, 2441, 2441,
+
+     1406, 1405, 1418, 1312, 1312, 1312, 1421, 1421, 1421, 2270,
+     1422, 2271, 2272, 1423, 2441, 1018, 1018, 1018, 2276, 2277,
+     1313, 1416, 1315, 1315, 1315, 2278, 1316, 2278, 1404, 1317,
+     1326, 1326, 1326, 1020, 1339, 1339, 1339, 1424,  840,  840,
+     1420, 1419, 1318, 1318, 1318, 2279, 1319, 1327,  840, 1320,
+     1430, 1430, 1430, 2279, 1431,  840,  840, 1432, 1037, 1037,
+     1037, 1334, 1334, 1334, 1437, 1437, 1437,  840, 1438,  840,
+     1402, 1439, 1441, 1441, 1441,  840, 1039, 2284, 1335, 1444,
+     1444, 1444,  869,  869,  869, 2280, 1433, 1343, 1343, 1343,
+     1442, 1344, 2301,  840, 1345, 1447, 1447, 1447, 2360, 2281,
+
+      871, 1347, 1347, 1347, 2285, 1348,  840,  840, 1349, 1350,
+     1350, 1350,  840, 1448, 1449, 1449, 1449, 2299, 1450,  840,
+     1401, 1451, 2441, 2441, 2441,  840, 1351, 1353, 1353, 1353,
+     1453, 1453, 1453, 1400, 1454, 1446, 2288, 1455,  840, 2441,
+     1355, 1355, 1355, 2300, 1354, 1357, 1357, 1357, 1456, 1456,
+     1456,  840, 1457,  840, 2289, 1458, 2321,  840, 1356, 1359,
+     1359, 1359, 1358, 1360, 1399,  840, 1361, 1459, 1459, 1459,
+      900,  900,  900, 1452, 1364, 1364, 1364, 2322, 1365, 1382,
+     2306, 1366,  840, 2293, 1460, 2441, 2441, 2441,  902, 2441,
+     2441, 2441,  840, 2441, 2441, 2441, 2323, 1461, 1465, 1465,
+
+     1465, 1380, 2441,  913,  913,  913, 2441, 1469, 1469, 1469,
+     2441, 2307,  925,  925,  925, 1466, 1383, 1383, 1383,  840,
+     1384,  915, 2294, 1385,  931,  931,  931, 1387, 1387, 1387,
+      927, 1388, 1463,  840, 1389, 1480, 1480, 1480, 1462, 1464,
+     2301, 2330,  933, 1482, 1482, 1482, 1379,  942,  942,  942,
+      840,  840, 1481, 1378, 1393, 1393, 1393, 2308, 1394,  840,
+     1483, 1395, 2318, 1468, 1477,  944, 1485, 1485, 1485, 1484,
+     1487, 1487, 1487,  953,  953,  953, 1491, 1491, 1491, 1479,
+     1494, 1494, 1494, 1486,  969,  969,  969, 1488, 1502, 1502,
+     1502,  955, 2296, 1492,  984,  984,  984, 1495, 1377, 1506,
+
+     1506, 1506,  971,  840,  840, 1503,  840, 1003, 1003, 1003,
+     1376, 1375,  986,  840, 1374, 1504, 1507, 1373, 1371, 1413,
+     1413, 1413,  840, 1414, 1489, 1005, 1415, 1509, 1509, 1509,
+     1417, 1417, 1417,  840,  840, 1496, 1511, 1511, 1511, 2310,
+     1512, 2309, 2314, 1513, 1510,  840, 2311, 1418, 2441, 2441,
+     2441, 1515, 1515, 1515, 1421, 1421, 1421,  840, 1422,  840,
+     2315, 1423, 1508,  840, 1362, 2441, 2312, 2313, 1516, 1018,
+     1018, 1018, 1522, 1522, 1522, 1430, 1430, 1430, 2326, 1431,
+     1341, 1340, 1432, 1338, 1037, 1037, 1037, 1020, 2319, 1523,
+     1437, 1437, 1437,  840, 1438, 2336, 2327, 1439, 1441, 1441,
+
+     1441, 1514, 1039, 1443, 1443, 1443, 1444, 1444, 1444, 1530,
+     1530, 1530, 1447, 1447, 1447, 2331, 1442, 2332, 1449, 1449,
+     1449, 1517, 1450, 2328,  840, 1451,  840, 1531, 1336,  840,
+     1448, 1524, 2441, 2441, 2441, 1453, 1453, 1453, 1332, 1454,
+     1183, 1329, 1455, 1456, 1456, 1456, 2393, 1457, 2333, 2441,
+     1458, 1459, 1459, 1459, 1533, 1533, 1533,  840, 1534, 2329,
+      840, 1535,  900,  900,  900, 1537, 1537, 1537, 1460, 1539,
+     1539, 1539, 2441, 2441, 2441, 1532, 1465, 1465, 1465,  840,
+      902,  840, 1538, 1542, 1542, 1542, 1540, 1543, 1325, 2441,
+     1544, 1324, 1323, 1466, 1546, 1546, 1546, 1469, 1469, 1469,
+
+      925,  925,  925, 1556, 1556, 1556, 1558, 1558, 1558, 2334,
+     1322, 1541, 1547, 1536, 1480, 1480, 1480,  840,  927, 2337,
+     1557, 1560, 1560, 1560, 1559, 1561,  840,  840, 1562, 1321,
+     2344, 1481, 2345, 1482, 1482, 1482, 1563, 1563, 1563,  840,
+     1564,  840,  840, 1565,  942,  942,  942, 2335,  840, 1555,
+     1483, 1485, 1485, 1485, 1567, 1567, 1567, 1296, 1568, 2338,
+     2339, 1569,  944, 1487, 1487, 1487, 2340, 1292, 1486, 1570,
+     1570, 1570, 2341, 1571, 1284,  840, 1572,  953,  953,  953,
+     1488, 1574, 1574, 1574, 1491, 1491, 1491, 1576, 1576, 1576,
+      840, 1577, 1283, 1282, 1578,  955, 1566,  840, 1575, 2342,
+
+      840, 1492, 1494, 1494, 1494, 1580, 1580, 1580,  840, 1581,
+      840, 1272, 1582,  969,  969,  969, 1588, 1588, 1588, 1495,
+     2354, 2343, 1573, 1590, 1590, 1590, 1502, 1502, 1502, 2346,
+      840,  971, 2348, 1589, 2349, 1583, 1271, 1593, 1593, 1593,
+     1591, 1594,  840, 1503, 1595,  984,  984,  984, 1506, 1506,
+     1506, 1598, 1598, 1598, 2350, 1599,  840, 1269, 1600, 1003,
+     1003, 1003, 1268,  986, 1267, 1507, 1509, 1509, 1509, 1602,
+     1602, 1602, 2355, 1603,  840,  840, 1604, 1005, 1511, 1511,
+     1511, 1601, 1512, 1510, 1260, 1513, 2441, 2441, 2441, 1515,
+     1515, 1515, 1606, 1606, 1606, 2358, 1607, 1596, 2351, 1608,
+
+     1018, 1018, 1018, 2441, 2347, 2360, 1516, 1612, 1612, 1612,
+     1614, 1614, 1614, 1522, 1522, 1522,  840,  840, 1020, 1616,
+     1616, 1616, 1240, 1617, 1613, 1605, 1618, 1615,  840,  840,
+     1523, 1037, 1037, 1037, 1621, 1621, 1621, 1530, 1530, 1530,
+     1625, 1625, 1625, 1533, 1533, 1533, 2352, 1534,  840, 1039,
+     1535, 1609,  840, 2361, 1238, 1531,  840, 1626,  900,  900,
+      900, 1537, 1537, 1537, 1628, 1628, 1628, 2359, 1629, 1237,
+     1236, 1630, 1539, 1539, 1539, 2356,  902, 2353, 1538, 1631,
+     1631, 1631,  840, 1632,  840, 2371, 1633, 1619, 1235, 1540,
+     1634, 1634, 1634, 1542, 1542, 1542,  840, 1543,  840,  840,
+
+     1544, 1234, 1627, 1546, 1546, 1546, 2362, 1635,  925,  925,
+      925, 1556, 1556, 1556,  840, 1645, 1645, 1645, 2357, 1646,
+     1233, 1547, 1647, 1558, 1558, 1558,  927,  840, 1557, 1560,
+     1560, 1560, 2363, 1561, 1644, 2365, 1562, 2366, 1563, 1563,
+     1563, 1559, 1564, 2372,  840, 1565,  942,  942,  942, 1567,
+     1567, 1567, 2381, 1568,  840,  840, 1569, 1232, 1570, 1570,
+     1570,  840, 1571, 1231,  944, 1572,  953,  953,  953, 1574,
+     1574, 1574, 1650, 1650, 1650,  840, 1651, 2364,  840, 1652,
+      840, 1576, 1576, 1576,  955, 1577, 1575, 2369, 1578, 1580,
+     1580, 1580, 1229, 1581, 2367,  840, 1582, 1648,  969,  969,
+
+      969, 1655, 1655, 1655, 1657, 1657, 1657, 1659, 1659, 1659,
+     1661, 1661, 1661, 2370, 2368, 1649,  971, 2379, 1656, 2373,
+     1221, 1658, 2398,  840, 1660, 2382,  840, 1662, 1588, 1588,
+     1588, 1663, 1663, 1663,  840, 1664,  840, 1215, 1665, 1590,
+     1590, 1590, 1666, 1666, 1666, 1589, 1667, 2374, 2387, 1668,
+     1654, 1593, 1593, 1593, 1195, 1594, 1591,  840, 1595,  984,
+      984,  984, 1598, 1598, 1598, 2380, 1599,  840, 2393, 1600,
+     1003, 1003, 1003, 1194, 1602, 1602, 1602,  986, 1603,  840,
+      840, 1604, 2441, 2441, 2441, 1606, 1606, 1606, 1005, 1607,
+     1192, 2375, 1608, 1018, 1018, 1018, 1675, 1675, 1675, 2441,
+
+     1612, 1612, 1612, 1678, 1678, 1678,  840, 1679, 1191, 2388,
+     1680, 1020,  840, 1676, 1614, 1614, 1614, 1613,  840, 2391,
+     1670,  840, 1672, 1673, 1189, 1681, 1681, 1681, 1188, 1682,
+     2376, 1615, 1683, 1616, 1616, 1616, 2383, 1617,  840,  840,
+     1618, 1037, 1037, 1037, 1697, 1697, 1697, 1698, 1698, 1698,
+     1674, 1625, 1625, 1625, 1700, 1700, 1700,  840, 1701, 1039,
+     2392, 1702, 2384, 2385, 1699, 1697, 1697, 1697, 1626, 2402,
+      900,  900,  900, 1628, 1628, 1628, 2398, 1629,  840, 1187,
+     1630, 2386, 1631, 1631, 1631,  840, 1632,  840,  902, 1633,
+     1634, 1634, 1634,  925,  925,  925, 2399, 2399, 1684, 1621,
+
+     1621, 1621, 1704, 1704, 1704,  840, 1705, 1635,  840, 1706,
+      840,  927, 1810, 1810, 1810, 1186,  840,  840, 2389, 1685,
+     1686, 1687, 1703, 1688, 1689, 1185, 1690,  942,  942,  942,
+     1691, 1692, 1693, 1694, 1695, 1645, 1645, 1645, 2390, 1646,
+     2394, 1179, 1647, 1160, 2408,  944, 1159,  840, 1715,  953,
+      953,  953, 1650, 1650, 1650,  840, 1651, 2403,  840, 1652,
+      969,  969,  969, 1655, 1655, 1655,  840,  955, 1720, 1720,
+     1720, 2395, 1721, 1156, 2408, 1722, 1151,  840,  971, 2396,
+     1656, 1657, 1657, 1657, 1716,  840, 1723, 1723, 1723, 1150,
+     1724, 2419, 1717, 1725,  840, 1659, 1659, 1659, 1658, 1726,
+
+     1726, 1726,  840, 1727, 1133,  840, 1728, 1661, 1661, 1661,
+      840, 1719, 1660, 1729, 1729, 1729, 2409, 1730, 2397, 1132,
+     1731, 1663, 1663, 1663, 1662, 1664, 2400, 1131, 1665, 1666,
+     1666, 1666,  840, 1667, 2401,  840, 1668,  984,  984,  984,
+     1003, 1003, 1003, 2441, 2441, 2441, 1018, 1018, 1018, 1675,
+     1675, 1675, 1850, 1850, 1850,  986, 2404, 1124, 1005, 1733,
+     2441, 1738, 1738, 1738, 1020, 1739, 1676, 1123, 1740, 1678,
+     1678, 1678, 1121, 1679, 2410,  840, 1680, 1681, 1681, 1681,
+      840, 1682, 1120,  840, 1683, 1119, 1736, 1037, 1037, 1037,
+      840, 1735,  840, 1698, 1698, 1698, 1758, 1758, 1758, 2405,
+
+     1759, 1737, 1114, 1760, 2417, 1039, 1761, 1761, 1761, 1742,
+     1699, 1700, 1700, 1700, 2418, 1701, 2422,  840, 1702, 1704,
+     1704, 1704, 2415, 1705, 1762,  840, 1706,  925,  925,  925,
+      942,  942,  942,  953,  953,  953, 1774, 1774, 1774,  969,
+      969,  969, 1720, 1720, 1720,  927, 1721,  840,  944, 1722,
+     2419,  955, 1112, 1775, 1111, 1773, 2416,  971, 1723, 1723,
+     1723,  840, 1724,  840, 2426, 1725, 1726, 1726, 1726, 2430,
+     1727, 2423, 1108, 1728, 1729, 1729, 1729,  840, 1730, 1771,
+      840, 1731,  984,  984,  984, 1772, 1780, 1780, 1780, 1003,
+     1003, 1003, 1783, 1783, 1783,  840, 1776, 1018, 1018, 1018,
+
+      986, 2424, 2427, 1781, 1738, 1738, 1738, 1005, 1739, 1784,
+     2431, 1740, 1037, 1037, 1037, 1020, 1758, 1758, 1758, 2425,
+     1759,  840, 1100, 1760, 1761, 1761, 1761,  925,  925,  925,
+     1039, 1774, 1774, 1774, 1779,  942,  942,  942,  953,  953,
+      953, 2430, 1762, 1099, 1097,  927, 1782, 1096, 1775, 1785,
+     1814, 1814, 1814,  944, 1815,  840,  955, 1816,  969,  969,
+      969, 1818, 1818, 1818, 1787, 1820, 1820, 1820,  984,  984,
+      984, 1780, 1780, 1780, 1095, 2431,  971, 1094, 1819, 1003,
+     1003, 1003, 1821,  840,  840, 1811,  986, 1812, 1781,  840,
+     1813, 1823, 1823, 1823, 2438, 1824, 1093, 1005, 1825, 1783,
+
+     1783, 1783, 1827, 1827, 1827,  840, 1828, 2432, 2433, 1829,
+     1018, 1018, 1018, 1817, 1092, 1091, 1784, 1090, 2438, 1822,
+     1831, 1831, 1831, 1037, 1037, 1037, 1088, 1087, 1020, 1848,
+     1848, 1848,  840, 1086, 1826, 1085, 1084, 1832, 1853, 1853,
+     1853, 1039, 1810, 1810, 1810, 1083, 1849, 1183,  925,  925,
+      925,  942,  942,  942,  953,  953,  953, 1081, 1078, 1830,
+     1814, 1814, 1814, 1077, 1815, 1075,  927, 1816, 1074,  944,
+     1071, 1068,  955, 1063, 1833,  969,  969,  969, 1818, 1818,
+     1818, 1861, 1861, 1861, 1059, 1862, 1058, 1057, 1863, 1820,
+     1820, 1820, 1056,  971, 1055, 1819, 1053,  984,  984,  984,
+
+     1858, 1857, 1831, 1831, 1831, 1859, 1821, 1864, 1864, 1864,
+     1052, 1865, 1048, 1047, 1866,  986, 1823, 1823, 1823, 1832,
+     1824, 1046, 1045, 1825, 1003, 1003, 1003, 1860, 1827, 1827,
+     1827, 1044, 1828, 1043,  840, 1829, 1041, 1869, 1869, 1869,
+     1017, 1016, 1005, 1871, 1871, 1871, 1015, 1872, 1014, 1010,
+     1873, 1037, 1037, 1037, 1867, 1870, 1881, 1881, 1881, 1009,
+     1848, 1848, 1848, 1889, 1889, 1889, 1008, 1890, 1007, 1039,
+     1891, 1850, 1850, 1850,  840,  983, 1868, 1849, 1183,  982,
+      981, 1183, 1892, 1892, 1892, 1853, 1853, 1853, 1896, 1896,
+     1896, 1897, 1897, 1897, 1899, 1899, 1899,  953,  953,  953,
+
+      969,  969,  969, 1861, 1861, 1861,  975, 1862, 1874, 1898,
+     1863,  974, 1900,  973,  968,  955,  964,  963,  971, 1864,
+     1864, 1864,  959, 1865,  958,  957, 1866,  984,  984,  984,
+     1003, 1003, 1003, 1869, 1869, 1869, 1871, 1871, 1871,  952,
+     1872,  951,  947, 1873,  946,  986,  941,  940, 1005, 1902,
+      939, 1870,  935,  930, 1901, 1037, 1037, 1037, 1911, 1911,
+     1911,  929, 1881, 1881, 1881, 1918, 1918, 1918, 1889, 1889,
+     1889,  924, 1890, 1039,  923, 1891,  840,  922,  921, 1904,
+      840,  920, 1903,  840,  919,  918, 1183, 1892, 1892, 1892,
+      917,  912, 1919,  911,  910, 1912, 1896, 1896, 1896, 1949,
+
+     1949, 1949, 1897, 1897, 1897, 1899, 1899, 1899,  906,  905,
+     1905, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
+     1898,  904, 1181, 1900,  953,  953,  953, 1181, 1181, 1181,
+     1183, 1181, 1950, 1950, 1950, 1949, 1949, 1949, 1950, 1950,
+     1950,  899,  955, 1927, 1927, 1927,  984,  984,  984, 1181,
+     1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
+      898, 1928, 1181,  897,  986,  896,  891, 1181, 1181, 1181,
+     1183, 1181,  890, 1930, 1930, 1930, 1037, 1037, 1037, 1926,
+      889, 1933, 1933, 1933, 1934, 1934, 1934,  888,  884, 1181,
+     1181, 1931,  883,  873, 1039, 1947, 1947, 1947, 1929,  840,
+
+      865,  864,  840, 1911, 1911, 1911, 1918, 1918, 1918,  953,
+      953,  953,  863,  840, 1927, 1927, 1927,  984,  984,  984,
+      862,  840,  861,  860,  840,  855,  851,  955, 1932, 1970,
+     1970, 1970, 1928,  850,  849,  986, 1938,  848,  847, 1945,
+     1181, 1181, 1181, 1181, 1181, 1948, 1181, 1181, 1181,  846,
+      843, 1181, 1930, 1930, 1930,  841, 1181, 1181, 1181, 1183,
+     1181, 1952, 1970, 1970, 1970,  840, 1953,  838,  837,  836,
+     1931, 1037, 1037, 1037, 1933, 1933, 1933,  828, 1181, 1181,
+     1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1948, 1039,
+      827, 1181,  840, 1934, 1934, 1934, 1181, 1181, 1181, 1183,
+
+     1181,  826,  825, 1947, 1947, 1947,  824, 1955,  823,  822,
+      819,  840,  953,  953,  953, 1972, 1972, 1972, 1181, 1181,
+     1954,  840, 1974, 1974, 1974,  818, 1956, 1991, 1991, 1991,
+      955,  817,  816, 1973,  808,  807, 1969, 1972, 1972, 1972,
+     1975, 1974, 1974, 1974,  806, 1992, 2006, 2006, 2006, 1991,
+     1991, 1991, 2006, 2006, 2006, 1973, 2029, 2029, 2029, 1975,
+      805, 1971,  802,  801,  840,  800,  799, 1992,  798,  790,
+      840, 2034, 2034, 2034,  840, 2042, 2042, 2042, 2043, 2043,
+     2043, 2046, 2046, 2046,  787, 2021, 2034, 2034, 2034,  840,
+     2029, 2029, 2029,  840, 2044,  786,  840, 2045,  785,  840,
+
+     2051, 2051, 2051,  782,  840, 2054, 2054, 2054,  840, 2055,
+     2055, 2055, 2056, 2056, 2056, 2042, 2042, 2042,  840, 2050,
+     2046, 2046, 2046,  840, 2043, 2043, 2043,  840, 2059,  781,
+      840, 2060,  780,  840, 2066, 2066, 2066,  779,  840, 2051,
+     2051, 2051,  840, 2068,  771,  770, 2069,  769, 2058, 2071,
+     2071, 2071,  840, 2063, 2054, 2054, 2054,  840, 2072,  768,
+      765, 2073, 2055, 2055, 2055,  764, 2074,  840,  763, 2075,
+      693,  762,  840, 2056, 2056, 2056, 2066, 2066, 2066,  754,
+      840, 2071, 2071, 2071,  751, 2091,  750,  747, 2092,  746,
+      745,  840,  744,  733,  840, 2098, 2098, 2098,  732,  840,
+
+     2105, 2105, 2105, 2098, 2098, 2098, 2076,  729,  725, 2086,
+     2105, 2105, 2105,  840, 2127, 2127, 2127,  724,  840,  716,
+      715,  840, 2132, 2132, 2132,  714,  711,  710,  840, 2127,
+     2127, 2127,  840, 2172, 2172, 2172, 2119, 2132, 2132, 2132,
+      840, 2153,  702, 2126, 2154,  701,  700,  840, 2185, 2185,
+     2185,  840, 2190, 2190, 2190,  840, 2172, 2172, 2172,  698,
+     2194,  697, 2148, 2195,  696,  695,  840, 2206, 2206, 2206,
+      840, 2185, 2185, 2185,  840, 2208,  694,  692, 2209, 2190,
+     2190, 2190,  691, 2214,  684,  840, 2215,  682,  675,  840,
+     2218, 2218, 2218,  674, 2206, 2206, 2206,  840, 2231,  671,
+
+      670, 2232, 2218, 2218, 2218,  669, 2243,  668,  840, 2244,
+      666,  665,  840, 2259, 2259, 2259, 2263, 2263, 2263,  664,
+      840, 2267, 2267, 2267,  663, 2259, 2259, 2259,  662, 2282,
+      660,  840, 2283,  659, 2264, 2286, 2286, 2286,  658,  840,
+     2263, 2263, 2263,  840, 2267, 2267, 2267,  657, 2290,  654,
+      653, 2291,  652, 2287, 2292, 2292, 2292,  650, 2264, 2297,
+     2297, 2297,  840, 2302, 2302, 2302, 2304, 2304, 2304, 2286,
+     2286, 2286,  840, 2297, 2297, 2297,  647, 2298, 2292, 2292,
+     2292, 2303, 2316,  646, 2305, 2317,  642, 2287, 2324, 2324,
+     2324, 2298, 2302, 2302, 2302,  641,  840, 2304, 2304, 2304,
+
+     2324, 2324, 2324, 2377, 2377, 2377, 2325, 2377, 2377, 2377,
+     2303, 2406, 2406, 2406,  640, 2305,  639,  638, 2325,  637,
+      636, 2378, 2411, 2411, 2411, 2378, 2413, 2413, 2413, 2407,
+     2406, 2406, 2406, 2420, 2420, 2420, 2411, 2411, 2411,  634,
+     2412, 2413, 2413, 2413, 2414, 2428, 2428, 2428, 2407,  633,
+      632, 2421,  631,  630, 2412, 2420, 2420, 2420,  629, 2414,
+     2428, 2428, 2428, 2429, 2434, 2434, 2434, 2436, 2436, 2436,
+     2434, 2434, 2434, 2421, 2436, 2436, 2436,  628, 2429, 2439,
+     2439, 2439, 2435,  627,  622, 2437,  619,  621, 2435, 2439,
+     2439, 2439, 2437,  617,  616,  422,  421, 2440,  610,  609,
+
+      608,  607,  606,  605,  602,  601,  600, 2440,  130,  130,
+      130,  130,  130,  130,  130,  130,  130,  131,  131,  131,
+      131,  131,  131,  131,  131,  131,  136,  136,  136,  136,
+      136,  136,  136,  136,  136,  139,  139,  139,  139,  139,
+      139,  139,  139,  139,  142,  142,  142,  142,  142,  142,
+      142,  142,  142,  145,  145,  145,  145,  145,  145,  145,
+      145,  145,  152,  152,  152,  152,  152,  152,  152,  152,
+      152,  156,  156,  156,  156,  156,  156,  156,  156,  156,
+      161,  161,  161,  161,  161,  161,  161,  161,  161,  167,
+      167,  167,  167,  167,  167,  167,  167,  167,  176,  176,
+
+      176,  176,  176,  176,  176,  176,  176,  182,  182,  182,
+      182,  182,  182,  182,  182,  182,  189,  189,  189,  189,
+      189,  189,  189,  189,  189,  195,  195,  195,  195,  195,
+      195,  195,  195,  195,  211,  211,  211,  211,  211,  211,
+      211,  211,  211,  217,  217,  217,  217,  217,  217,  217,
+      217,  217,  224,  224,  224,  224,  224,  224,  224,  224,
+      224,  243,  243,  243,  243,  243,  243,  243,  243,  243,
+      249,  249,  249,  249,  249,  249,  249,  249,  249,  255,
+      255,  255,  255,  255,  255,  255,  255,  255,  263,  263,
+      263,  263,  263,  263,  263,  263,  263,  270,  270,  270,
+
+      270,  270,  270,  270,  270,  270,  286,  286,  286,  286,
+      286,  286,  286,  286,  286,  304,  304,  304,  304,  304,
+      304,  304,  304,  304,  323,  323,  323,  323,  323,  323,
+      323,  323,  323,  342,  342,  342,  342,  342,  342,  342,
+      342,  342,  362,  362,  362,  362,  362,  362,  362,  362,
+      362,  383,  383,  383,  383,  383,  383,  383,  383,  383,
+      405,  405,  405,  405,  405,  405,  405,  405,  405,  408,
+      408,  408,  408,  408,  408,  408,  408,  408,  431,  431,
+      431,  598,  592,  591,  431,  441,  441,  441,  590,  589,
+      588,  441,  447,  447,  447,  587,  586,  585,  447,  453,
+
+      453,  453,  584,  582,  576,  453,  463,  463,  463,  575,
+      572,  571,  463,  470,  470,  470,  570,  569,  568,  470,
+      484,  484,  484,  566,  560,  559,  484,  499,  499,  499,
+      558,  555,  554,  499,  508,  508,  508,  553,  551,  544,
+      508,  520,  520,  520,  543,  542,  541,  520,  536,  536,
+      536,  540,  539,  535,  536,  552,  552,  552,  527,  526,
+      525,  552,  567,  567,  567,  521,  519,  513,  567,  583,
+      583,  583,  512,  509,  507,  583,  599,  599,  599,  501,
+      500,  498,  599,  618,  618,  618,  618,  618,  618,  618,
+      497,  618,  635,  483,  476,  475,  635,  645,  474,  473,
+
+      472,  645,  651,  471,  469,  467,  651,  661,  466,  465,
+      464,  661,  667,  462,  460,  459,  667,  683,  458,  455,
+      454,  683,  699,  452,  450,  449,  699,  709,  448,  446,
+      444,  709,  723,  443,  442,  440,  723,  743,  433,  432,
+      430,  743,  761,  428,  422,  421,  761,  778,  422,  421,
+      420,  778,  797,  419, 2441, 2441,  797,  815, 2441, 2441,
+     2441,  815,  835, 2441, 2441, 2441,  835,  839,  839,  839,
+      839,  839,  839,  839,  839,  839,  845, 2441, 2441, 2441,
+     2441,  845,  431,  431,  431,  431, 2441,  431, 2441,  431,
+      857,  857,  857,  857, 2441, 2441,  857,  857,  441,  441,
+
+      441, 2441, 2441, 2441,  441,  870,  870,  870,  870, 2441,
+     2441,  870,  870,  447,  447,  447, 2441, 2441, 2441,  447,
+      880,  880,  880,  880, 2441, 2441,  880,  880,  453,  453,
+      453, 2441, 2441, 2441,  453,  893,  893,  893,  893, 2441,
+     2441,  893,  893,  463,  463,  463, 2441, 2441, 2441,  463,
+      901,  901,  901,  901, 2441, 2441,  901,  901,  470,  470,
+      470, 2441, 2441, 2441,  470,  914,  914,  914,  914, 2441,
+     2441,  914,  914,  926,  926,  926,  926, 2441, 2441,  926,
+      926,  499,  499,  499, 2441, 2441, 2441,  499,  932,  932,
+      932,  932, 2441, 2441,  932,  932,  508,  508,  508, 2441,
+
+     2441, 2441,  508,  943,  943,  943,  943, 2441, 2441,  943,
+      943,  520,  520,  520, 2441, 2441, 2441,  520,  954,  954,
+      954,  954, 2441, 2441,  954,  954,  536,  536,  536, 2441,
+     2441, 2441,  536,  970,  970,  970,  970, 2441, 2441,  970,
+      970,  552,  552,  552, 2441, 2441, 2441,  552,  985,  985,
+      985,  985, 2441, 2441,  985,  985,  567,  567,  567,  567,
+     2441,  567, 2441,  567, 1004, 1004, 1004, 1004, 2441, 2441,
+     1004, 1004,  583,  583,  583, 2441, 2441, 2441,  583, 1019,
+     1019, 1019, 1019, 2441, 2441, 1019, 1019,  599,  599,  599,
+      599, 2441,  599, 2441,  599, 1038, 1038, 1038, 1038, 2441,
+
+     2441, 1038, 1038,  839,  839,  839,  839,  839,  839,  839,
+      839,  839,  845, 2441,  845, 2441, 2441,  845,  431,  431,
+      431, 2441, 2441, 2441,  431,  857,  857,  857,  857, 2441,
+     2441,  857,  857,  441,  441,  441, 2441, 2441, 2441,  441,
+      870,  870,  870,  870, 2441, 2441,  870,  870,  447,  447,
+      447, 2441, 2441, 2441,  447,  880,  880,  880,  880, 2441,
+     2441,  880,  880,  453,  453,  453, 2441, 2441, 2441,  453,
+      893,  893,  893,  893, 2441, 2441,  893,  893,  463,  463,
+      463, 2441, 2441, 2441,  463,  901,  901,  901,  901, 2441,
+     2441,  901,  901,  470,  470,  470, 2441, 2441, 2441,  470,
+
+      914,  914,  914,  914, 2441, 2441,  914,  914,  926,  926,
+      926,  926, 2441, 2441,  926,  926,  499,  499,  499, 2441,
+     2441, 2441,  499,  932,  932,  932,  932, 2441, 2441,  932,
+      932,  508,  508,  508,  508, 2441,  508, 2441,  508,  943,
+      943,  943,  943, 2441, 2441,  943,  943,  520,  520,  520,
+     2441, 2441, 2441,  520,  954,  954,  954,  954, 2441, 2441,
+      954,  954,  536,  536,  536, 2441, 2441, 2441,  536,  970,
+      970,  970,  970, 2441, 2441,  970,  970,  552,  552,  552,
+     2441, 2441, 2441,  552,  985,  985,  985,  985, 2441, 2441,
+      985,  985,  567,  567,  567,  567, 2441,  567, 2441,  567,
+
+     1004, 1004, 1004, 1004, 2441, 2441, 1004, 1004,  583,  583,
+      583, 2441, 2441, 2441,  583, 1019, 1019, 1019, 1019, 2441,
+     2441, 1019, 1019,  599,  599,  599,  599, 2441,  599, 2441,
+      599, 1038, 1038, 1038, 1038, 2441, 2441, 1038, 1038,  839,
+      839,  839,  839,  839,  839,  839,  839,  839, 1181, 1181,
+     1181, 1181, 1181, 1181, 1181, 1181, 1181,  431,  431,  431,
+     2441, 2441, 2441,  431,  857,  857,  857,  857, 2441, 2441,
+      857,  857,  441,  441,  441, 2441, 2441, 2441,  441,  870,
+      870,  870,  870, 2441, 2441,  870,  870,  447,  447,  447,
+      447, 2441,  447, 2441,  447,  880,  880,  880,  880, 2441,
+
+     2441,  880,  880,  453,  453,  453,  453, 2441,  453, 2441,
+      453,  893,  893,  893,  893, 2441, 2441,  893,  893,  463,
+      463,  463, 2441, 2441, 2441,  463,  901,  901,  901,  901,
+     2441, 2441,  901,  901,  470,  470,  470,  470, 2441,  470,
+     2441,  470,  914,  914,  914,  914, 2441, 2441,  914,  914,
+      926,  926,  926,  926, 2441, 2441,  926,  926,  499,  499,
+      499, 2441, 2441, 2441,  499,  932,  932,  932,  932, 2441,
+     2441,  932,  932,  508,  508,  508,  508, 2441,  508, 2441,
+      508,  943,  943,  943,  943, 2441, 2441,  943,  943,  520,
+      520,  520,  520, 2441,  520, 2441,  520,  954,  954,  954,
+
+      954, 2441, 2441,  954,  954,  536,  536,  536, 2441, 2441,
+     2441,  536,  970,  970,  970,  970, 2441, 2441,  970,  970,
+      552,  552,  552, 2441, 2441, 2441,  552,  985,  985,  985,
+      985, 2441, 2441,  985,  985,  567,  567,  567, 2441, 2441,
+     2441,  567, 1004, 1004, 1004, 1004, 2441, 2441, 1004, 1004,
+      583,  583,  583,  583, 2441,  583, 2441,  583, 1019, 1019,
+     1019, 1019, 2441, 2441, 1019, 1019,  599,  599,  599, 2441,
+     2441, 2441,  599, 1038, 1038, 1038, 1038, 2441, 2441, 1038,
+     1038,  839,  839,  839,  839,  839,  839,  839,  839,  839,
+     1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,  431,
+
+      431,  431,  431, 2441,  431, 2441,  431,  857,  857,  857,
+      857, 2441, 2441,  857,  857,  441,  441,  441, 2441, 2441,
+     2441,  441,  870,  870,  870,  870, 2441, 2441,  870,  870,
+     1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921, 1922,
+     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922,  129, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441
+    } ;
+
+static yyconst short int yy_chk[8115] =
+    {   0,
+        0,    3,    3,    3,    4,    4,    4,    5,    5,    5,
+        6,    6,    6,    7,    7,    7,   11,    3,    9,   12,
+        4,   10, 1436,    5,    0,    9,    6,  415,   10,    7,
+        8,    8,    8,  134,   11,   13,   13,   12,   14,   14,
+       13,   13,  415,   14,   14,  135,    8,   17,   17,  134,
+       13,   15,   15,   14,   15,  138,   15,   16,   16, 1436,
+       16,  135,   16,   18,   18,  314,   15,   19,   19,   19,
+      314,  138,   16,   20,   20,   20,   23,   23,   23,   24,
+       24,   24,  281,   19,   17,  132,  132,  132,  491,   20,
+      281,  336,   23, 1743,  491,   24,  133,  133,  133,  336,
+
+       18,   21,   21,   21,   21,   21,   21,   21,   21,   21,
+       21,   21,   21,   21,   21,   21, 1743,   21,   21,   21,
+       21,   21,   25,   25,   25,   26,   26,   26,   27,   27,
+       27,   28,   28,   28,   29,   29,   29,  396,   25,   21,
+       21,   26,  424, 1331,   27,  424,  396,   28,  768,  768,
+       29,   21,   21,   22,   22,   22,   22,   22,   22,   22,
+       22,   22,   22,   22,   22,   22,   22,   22, 1331,   22,
+       22,   22,   22,   22,   30,   30,   30,   31,   31,   31,
+       32,   32,   32,   33,   33,   33,   34,   34,   34,  620,
+       30,   22,   22,   31,  842, 1925,   32, 1878,  842,   33,
+
+     1878,  620,   34,   22,   22,   35,   35,   35,   35,   35,
+       35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
+     1691,   35,   35,   35,   35,   35,   37,   37,   37, 1180,
+       38,   38,   38,   39,   39,   39,   40,   40,   40,  137,
+      137,  137,   37,   35,   35,   35,   38, 1180, 1837,   39,
+       35, 1691,   40,   35,   36,   36,   36,   36,   36,   36,
+       36,   36,   36,   36,   36,   36,   36,   36,   36, 1693,
+       36,   36,   36,   36,   36,   43,   43,   43, 1837,   44,
+       44,   44,   45,   45,   45,   46,   46,   46,  159,  159,
+      159,   43,   36,   36,   36,   44, 1406, 1406,   45,   36,
+
+     1693,   46,   36,   41,   41,   41,   41,   41,   41,   41,
+       41,   41,   41,   41,   41,   41,   41,   41, 1690,   41,
+       41,   41,   41,   41,   49,   49,   49,   50,   50,   50,
+       51,   51,   51,   52,   52,   52,  168,  168,  168, 1435,
+       49,   41,   41,   50, 1895, 1435,   51,   41, 1688,   52,
+     1690,   41,   41,   42,   42,   42,   42,   42,   42,   42,
+       42,   42,   42,   42,   42,   42,   42,   42, 1789,   42,
+       42,   42,   42,   42,   55,   55,   55,   56,   56,   56,
+       57,   57,   57,   58,   58,   58,  174,  174,  174, 1688,
+       55,   42,   42,   56, 1497, 1497,   57,   42, 1894,   58,
+
+     1789,   42,   42,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
+       47,   47,   47,   47,   47,   47,   47,   47,   53,   53,
+       53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
+       53,   53,   53, 1330,   53,   53,   53,   53,   53,   61,
+       61,   61, 1893,   62,   62,   62, 1330,   63,   63,   63,
+
+       64,   64,   64,  162,  357,   61,   53,   53,   53,   62,
+      171,  177,   53,   63,  357, 1744,   64,  171, 1795,  162,
+       53,  183,  183,  183, 1498, 1498,  171,  177, 1527,   53,
+       54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
+       54,   54,   54,   54,   54, 1795,   54,   54,   54,   54,
+       54,   65,   65,   65, 1744,   66,   66,   66, 1622,   69,
+       69,   69,   70,   70,   70,  172, 1527,   65,   54,   54,
+       54,   66,  184,  190,   54,   69, 1732, 1732,   70,  184,
+     1842,  172,   54,  172,  187,  187,  187, 1622,  184,  190,
+     1842,   54,   59,   59,   59,   59,   59,   59,   59,   59,
+
+       59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
+       59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
+       59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
+       59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
+       59,   59,   59,   59,   59,   59,   59,   59,   59,   59,
+       59,   59,   59,   59,   59,   59,   59,   67,   67,   67,
+       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
+       67,   67, 1685,   67,   67,   67,   67,   67,   71,   71,
+       71,   72,   72,   72,   73,   73,   73,   74,   74,   74,
+       75,   75,   75,  185,   71,   67,   67,   72,  207,  203,
+
+       73,  197,  218,   74, 1855, 1685,   75, 1695,  197,  185,
+      196,  196,  196,  207,  185,  203, 1854,  197,  218,   67,
+       67,   68,   68,   68,   68,   68,   68,   68,   68,   68,
+       68,   68,   68,   68,   68,   68, 1695,   68,   68,   68,
+       68,   68,   76,   76,   76,   77,   77,   77,   78,   78,
+       78,   81,   81,   81,   82,   82,   82,  198,   76,   68,
+       68,   77,  213, 1937,   78, 1852, 1689,   81, 1845,  213,
+       82, 1937, 1845,  198,  200,  200,  200, 1796,  213,  198,
+      212,  212,  212,   68,   68,   79,   79,   79,   79,   79,
+       79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
+
+     1689,   79,   79,   79,   79,   79,   83,   83,   83,   84,
+       84,   84,   87,   87,   87,   88,   88,   88,   89,   89,
+       89, 1796,   83,   79,   79,   84, 1948, 1948,   87,  232,
+      250,   88, 1982, 1809,   89,  215,  215,  215, 1982,   79,
+     1808,   79,  225,  225,  225,  232,  250,   79,   79,   80,
+       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
+       80,   80,   80,   80, 1750,   80,   80,   80,   80,   80,
+       90,   90,   90,   93,   93,   93,   94,   94,   94,   95,
+       95,   95,   96,   96,   96, 1750,   90,   80,   80,   93,
+      226,  242,   94,  264, 1807,   95, 1998,  226,   96,  229,
+
+      229,  229, 1998,   80, 1882,   80,  226,  242, 1882,  264,
+      242,   80,   80,   85,   85,   85,   85,   85,   85,   85,
+       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
+       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
+       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
+       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
+       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
+       85,   85,   85,   85,   85,   85,   85,   85,   91,   91,
+       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
+       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
+
+       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
+       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
+       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
+       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
+       91,   91,   91,   97,   97,   97,   97,   97,   97,   97,
+       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
+       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
+       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
+       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
+       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
+
+       97,   97,   97,   97,   97,   97,   97,   97,   99,   99,
+       99,  100,  100,  100,  101,  101,  101,  102,  102,  102,
+      244,  244,  244, 1805,   99, 1908, 1804,  100, 1916, 1908,
+      101, 1769, 1916,  102,  103,  103,  103,  103,  103,  103,
+      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
+      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
+      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
+      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
+      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
+      103,  103,  103,  103,  103,  103,  103,  103,  103,  105,
+
+      105,  105,  106,  106,  106,  107,  107,  107,  108,  108,
+      108,  247,  247,  247, 1768,  105, 1958, 1767,  106, 1963,
+     1958,  107, 1766, 1963,  108,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
+      111,  111,  111,  112,  112,  112,  113,  113,  113,  114,
+
+      114,  114,  256,  256,  256, 1765,  111, 1985, 2005,  112,
+     1764, 1985,  113, 1763, 2005,  114,  115,  115,  115,  115,
+      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115,  115,  115,  115,  115,  115,  115,  115,
+      115,  117,  117,  117,  118,  118,  118,  119,  119,  119,
+      120,  120,  120,  261,  261,  261, 2008,  117, 2009, 2022,
+
+      118, 1741, 2008,  119, 2009, 2022,  120,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  121,  121,  121,  121,  121,  121,  121,  121,
+      121,  121,  123,  123,  123,  124,  124,  124,  125,  125,
+      125,  126,  126,  126,  127,  127,  148,  157,  123,  127,
+     1753,  124,  166,  170,  125,  128,  128,  126, 1747,  127,
+
+      128,  227, 1714,  157, 1713, 1712,  169, 1711,  166,  170,
+      128,  170, 1692,  169,  170,  170, 1745,  227,  157, 1753,
+      148,  127,  169,  166,  169,  170,  148,  169,  169,  245,
+      148, 1747,  128,  227, 1788,  148,  245, 1692,  169,  240,
+      240,  240,  241,  241,  241,  245,  252,  252,  252,  253,
+      253,  253,  278,  258,  259, 1745,  240, 1746, 2070,  241,
+      258, 1710, 1788,  252, 2070,  294,  253,  254,  278,  258,
+      259,  259,  268,  268,  268,  269,  269,  269,  271,  271,
+      271,  294, 1746,  254,  254,  254,  254,  272,  273,  268,
+     1696,  254,  269, 1798,  272,  254,  254,  254,  254,  275,
+
+      275,  275, 1751,  272,  273,  284,  284,  284,  285,  285,
+      285,  288,  273,  287,  287,  287,  289, 1798,  288,  291,
+      291,  291,  284, 1751, 1696,  285, 1748,  288, 1709,  297,
+      297,  297,  289,  301,  301,  301,  302,  302,  302,  303,
+      303,  303,  305,  305,  305,  289,  297,  306,  307,  312,
+      301, 1748, 1749,  302,  306, 1756,  303,  309,  309,  309,
+      321,  321,  321,  306,  307,  312,  307,  322,  322,  322,
+      326,  325,  297,  324,  324,  324,  331,  321,  325,  328,
+      328,  328, 1876, 1755,  322, 1749,  326,  325, 1756,  326,
+      345,  350,  331,  340,  340,  340,  341,  341,  341,  343,
+
+      343,  343,  344,  347,  347,  347,  345,  350, 1755,  344,
+      340,  365,  364,  341,  360,  360,  360, 1876,  344,  364,
+      345,  361,  361,  361,  363,  363,  363,  365,  364,  370,
+     1708,  360,  367,  367,  367,  381,  381,  381,  361,  382,
+      382,  382,  365,  385,  386,  370,  384,  384,  384,  391,
+      385,  411,  381,  388,  388,  388,  382,  407, 1754,  385,
+      386,  403,  403,  403,  407,  391,  404,  404,  404,  406,
+      406,  406,  386,  407,  414,  414,  414, 1707,  403,  423,
+      423,  423, 1677,  404, 1752,  411,  444,  444,  444, 1910,
+     1671,  411,  449,  449,  449,  411,  456,  456,  456, 1686,
+
+      411, 1754, 1042,  444,  474,  474,  474, 1752, 1694,  449,
+      477,  477,  477,  456, 1757,  478,  478,  478, 1042,  478,
+     1910,  474,  478,  479,  479,  479, 1791,  477, 1686,  423,
+      480,  480,  480, 1694,  480, 1838, 1694,  480, 1793, 1686,
+      479,  485,  485,  485,  486,  486,  486, 1757,  486, 1791,
+     1800,  486,  487,  487,  487,  488,  488,  488,  485,  488,
+     1875, 1790,  488,  502,  502,  502,  503,  503,  503,  487,
+      503, 1793, 1838,  503,  504,  504,  504,  505,  505,  505,
+      502,  505, 1800, 1936,  505,  510,  510,  510,  514,  514,
+      514,  504,  515,  515,  515, 1669,  515, 1875, 1961,  515,
+
+     1790, 1801,  510, 1914, 1792,  514,  516,  516,  516,  517,
+      517,  517, 1687,  517, 1961, 1883,  517,  522,  522,  522,
+      523,  523,  523,  516,  523, 1801, 1936,  523,  525,  525,
+      525,  528,  528,  528,  522,  529,  529,  529, 1653,  529,
+     1687, 1914,  529, 1792, 1883,  525, 1687, 1834,  528,  530,
+      530,  530,  531,  531,  531, 1643,  531, 1877, 1642,  531,
+      532,  532,  532,  533,  533,  533,  530,  533, 1794, 1797,
+      533,  540,  540,  540,  543,  543,  543,  532,  545,  545,
+      545, 1834,  546,  546,  546, 1836,  546, 1799,  540,  546,
+     1877,  543,  547,  547,  547,  545,  548,  548,  548, 1641,
+
+      548, 1640, 1639,  548,  556,  556,  556, 1794, 1797,  547,
+      561,  561,  561,  562,  562,  562, 1839,  562, 1847, 1836,
+      562,  556,  563,  563,  563, 1835, 1799,  561,  564,  564,
+      564, 1841,  564, 1844, 1846,  564,  571,  571,  571,  563,
+      575,  575,  575,  577,  577,  577, 1835,  578,  578,  578,
+     1879,  578, 1847,  571,  578, 1839, 1841,  575, 1844, 1846,
+      577,  579,  579,  579,  580,  580,  580, 1843,  580, 1884,
+     1939,  580,  588,  588,  588,  593,  593,  593,  579,  594,
+      594,  594, 1885,  594, 1879, 1939,  594, 1915, 1843,  588,
+     1638, 1942,  593,  595,  595,  595,  596,  596,  596, 1886,
+
+      596, 1917, 1884,  596,  603,  603,  603,  611,  611,  611,
+      595,  612,  612,  612, 1915,  612, 1888, 1637,  612, 1885,
+     1999,  603, 1942, 1912,  611,  613,  613,  613,  614,  614,
+      614, 1999,  614, 1886, 1917,  614,  623,  623,  623, 1636,
+      623, 1912,  613,  632,  632,  632,  633,  633,  633,  635,
+      635,  635,  636,  636,  636,  643,  643,  643, 1888, 1909,
+      632, 1913, 1611,  633,  644,  644,  644,  635,  644, 1938,
+      636,  644,  643,  645,  645,  645,  646,  646,  646,  648,
+      648,  648,  649,  649,  649, 1597,  649, 1938, 1919,  649,
+     1960,  645, 1940, 1909,  646, 1913,  648,  633,  636,  650,
+
+      650,  650,  651,  651,  651, 1960,  652,  652,  652,  655,
+      655,  655,  661,  661,  661, 1945,  650,  662,  662,  662,
+      651, 1919, 1935,  646,  652, 1940,  655,  656,  656,  656,
+      661,  656, 1943, 1945,  656,  662,  667,  667,  667,  668,
+      668,  668,  672,  672,  672,  673,  673,  673, 1967,  673,
+     1941, 1592,  673, 1944,  667, 1955, 1935,  668, 1946,  672,
+      676,  676,  676, 1967,  676,  652, 1943,  676, 1959,  662,
+      679,  679,  679, 1955,  679, 1981, 1956,  679,  683,  683,
+      683,  684,  684,  684, 1946,  668,  685,  685,  685, 1941,
+      685, 1981, 1944,  685, 1956, 1964,  683, 2108, 2144,  684,
+
+      688,  688,  688, 2108,  688, 1959, 1962,  688,  699,  699,
+      699,  700,  700,  700,  703,  703,  703, 1957,  703, 1968,
+     1964,  703, 2144,  706,  706,  706,  699,  706,  684,  700,
+      706,  709,  709,  709,  710,  710,  710,  712,  712,  712,
+      713,  713,  713, 1969,  713, 1962, 1579,  713, 2061,  709,
+     1957, 1965,  710, 1968,  712,  717,  717,  717, 1979,  717,
+     1966, 1969,  717,  700,  720,  720,  720, 1976,  720, 1978,
+     2062,  720,  723,  723,  723,  724,  724,  724, 2061,  726,
+      726,  726, 1976,  726, 1965,  710,  726,  730,  730,  730,
+      723, 1983, 1979,  724,  731,  731,  731, 1966,  731, 1554,
+
+     2062,  731, 1553, 1977,  730,  734,  734,  734, 1978,  734,
+     1980, 1984,  734,  737,  737,  737, 1987,  737, 1977, 2079,
+      737, 1986,  740,  740,  740,  724,  740, 1990, 1983,  740,
+      743,  743,  743,  744,  744,  744,  748,  748,  748,  749,
+      749,  749, 1990,  749, 1980, 1984,  749, 1988,  743, 2079,
+     1987,  744, 1993,  748,  752,  752,  752,  753,  753,  753,
+     1986,  753, 1994, 1988,  753,  755,  755,  755, 1993,  755,
+     1996,  752,  755,  758,  758,  758,  744,  758, 1994, 1995,
+      758,  761,  761,  761,  762,  762,  762,  766,  766,  766,
+      767,  767,  767, 1552,  767, 2007, 1551,  767, 1997,  761,
+
+     2003, 2011,  762, 1996,  766,  772,  772,  772, 2001,  772,
+     2000, 2007,  772,  775,  775,  775, 1995,  775, 2004, 1550,
+      775,  778,  778,  778, 2002,  779,  779,  779,  780,  780,
+      780,  781,  781,  781,  782,  782,  782, 2003, 1997,  778,
+     2011, 2001,  762,  779, 2000,  780, 2145, 2010,  781, 2004,
+     2013,  782,  783,  783,  783,  784,  784,  784, 2002,  784,
+     1549, 2013,  784,  785,  785,  785,  786,  786,  786,  783,
+     2145,  779, 2015,  787,  787,  787,  788,  788,  788, 2012,
+      785, 2010,  781,  786,  789,  789,  789,  782,  789, 2020,
+      787,  789, 2016,  788,  790,  790,  790,  791,  791,  791,
+
+     2020,  791, 2018, 2015,  791,  794,  794,  794, 2025,  794,
+     1548,  790,  794, 1545, 2012,  786,  787,  797,  797,  797,
+      798,  798,  798,  803,  803,  803,  804,  804,  804, 2021,
+      804, 2016, 1529,  804, 2017,  797, 2018, 2023,  798, 2025,
+      803,  790,  809,  809,  809, 2024,  809, 2021, 2023,  809,
+      812,  812,  812, 2036,  812, 2032, 2024,  812,  815,  815,
+      815,  816,  816,  816,  817,  817,  817, 2017, 2036,  798,
+      818,  818,  818,  819,  819,  819,  815, 2037, 2090,  816,
+     1528,  817,  820,  820,  820, 1525, 2026,  818, 2037, 2090,
+      819,  821,  821,  821, 2032,  821, 2041, 1519,  821,  820,
+
+      822,  822,  822, 2044,  816,  823,  823,  823,  824,  824,
+      824,  825,  825,  825,  826,  826,  826,  822,  827,  827,
+      827, 2050,  823, 2026, 2080,  824,  819,  818,  825, 2031,
+     2041,  826,  828,  828,  828,  827,  829,  829,  829, 2050,
+      829, 2044, 2047,  829,  832,  832,  832, 2033,  832,  828,
+      823,  832,  822, 1518, 2080,  826,  835,  835,  835,  836,
+      836,  836,  852,  852,  852,  827, 2031, 2045,  853,  853,
+      853, 2057,  853,  825,  835,  853, 2047,  836, 2033,  852,
+      856,  856,  856,  857,  857,  857,  859,  859,  859,  828,
+      865,  865,  865,  866,  866,  866, 1505,  866,  856, 2081,
+
+      866,  857, 2057, 2048,  859, 2045, 2058,  865,  836,  869,
+      869,  869,  870,  870,  870,  872,  872,  872,  874,  874,
+      874, 2059,  874, 2123, 2058,  874, 2052,  869, 2081,  859,
+      870, 2060, 2123,  872,  877,  877,  877,  878,  878,  878,
+     2048,  878, 2052, 2065,  878,  879,  879,  879,  880,  880,
+      880,  877,  882,  882,  882, 1501,  884,  884,  884, 2059,
+      885,  885,  885,  879,  885, 2068,  880,  885, 2102, 2060,
+      882, 2069,  872,  884,  889,  889,  889, 2065,  892,  892,
+      892,  893,  893,  893,  895,  895,  895,  898,  898,  898,
+     2063,  889,  900,  900,  900,  882,  892, 2064, 2072,  893,
+
+     2103, 2102,  895, 2068,  898,  901,  901,  901, 2063, 2069,
+      900,  903,  903,  903,  907,  907,  907, 2082,  907, 2067,
+     1493,  907, 2073,  901,  913,  913,  913, 2074, 2064,  903,
+      914,  914,  914, 2103, 2067,  895, 2072,  916,  916,  916,
+     2075, 2076,  913,  925,  925,  925, 2082, 2120,  914,  926,
+      926,  926, 2088, 2120,  903,  916,  928,  928,  928, 2076,
+     2073,  925,  931,  931,  931, 2074, 2078,  926,  932,  932,
+      932,  934,  934,  934,  928,  935,  935,  935, 2075, 2089,
+      931, 2078, 2088,  936,  936,  936,  932,  936,  916,  934,
+      936, 2083,  935,  939,  939,  939,  940,  940,  940,  941,
+
+      941,  941,  942,  942,  942, 2087, 2083,  928, 2093, 2089,
+      939, 2086,  934,  940, 1476, 1475,  941,  943,  943,  943,
+      942, 2087,  945,  945,  945,  947,  947,  947, 2085, 2086,
+      948,  948,  948, 2091,  948,  943,  939,  948, 2093,  941,
+      945, 2092,  947,  940,  953,  953,  953,  954,  954,  954,
+      956,  956,  956,  958,  958,  958,  959,  959,  959, 2085,
+     2094,  945,  953, 2125, 2099,  954, 1474, 1473,  956, 2125,
+      958, 2091, 2097,  959,  960,  960,  960, 2095,  960, 2092,
+     2099,  960,  965,  965,  965, 2096,  965, 2097, 2100,  965,
+     2094,  956,  969,  969,  969,  970,  970,  970,  972,  972,
+
+      972,  975,  975,  975,  976,  976,  976, 2095,  976, 2101,
+      969,  976, 2121,  970, 2112, 2096,  972, 2100,  975,  979,
+      979,  979,  980,  980,  980,  984,  984,  984,  985,  985,
+      985,  987,  987,  987, 2104, 2118,  979, 1472, 2101,  980,
+      988,  988,  988,  984, 2112, 2121,  985, 2109, 2113,  987,
+     2104, 2118,  989,  989,  989,  972,  989,  988, 1471,  989,
+      990,  990,  990,  991,  991,  991,  992,  992,  992, 2122,
+      992, 2119, 2107,  992,  987, 2110, 2109,  990, 2113, 2114,
+      991,  995,  995,  995,  996,  996,  996, 2107,  996, 2119,
+     1470,  996,  997,  997,  997,  998,  998,  998,  995,  999,
+
+      999,  999, 2122,  999, 2110, 2139,  999, 2115, 2114,  997,
+     2116, 2139,  998, 1002, 1002, 1002, 1003, 1003, 1003, 1004,
+     1004, 1004, 1006, 1006, 1006, 1009, 1009, 1009, 2126, 2124,
+     1002, 1010, 1010, 1010, 1003, 2128, 2115, 1004, 2124, 2116,
+     1006, 2117, 1009, 1011, 1011, 1011, 2126, 1011, 1010,  997,
+     1011, 2128, 1467, 1002, 1015, 1015, 1015, 1018, 1018, 1018,
+     1019, 1019, 1019, 1021, 1021, 1021, 1022, 1022, 1022, 1006,
+     2117, 1015, 1023, 1023, 1023, 1018, 1023, 1445, 1019, 1023,
+     2140, 1021, 2129, 1022, 1024, 1024, 1024, 1025, 1025, 1025,
+     1026, 1026, 1026, 2129, 1026, 2140, 2164, 1026, 1029, 1029,
+
+     1029, 1024, 2147, 2133, 1025, 1030, 1030, 1030, 1031, 1031,
+     1031, 2130, 1032, 1032, 1032, 1029, 1032, 2147, 2131, 1032,
+     2164, 1440, 1030, 2134, 1021, 1031, 1033, 1033, 1033, 1034,
+     1034, 1034, 2133, 1035, 1035, 1035, 1036, 1036, 1036, 1037,
+     1037, 1037, 2149, 1033, 2130, 2135, 1034, 1434, 2149, 1030,
+     1035, 2131, 2134, 1036, 1038, 1038, 1038, 1037, 1029, 1040,
+     1040, 1040, 1054, 1054, 1054, 1043, 1043, 1043, 2141, 2136,
+     1033, 2137, 1038, 1035, 1057, 1057, 1057, 1040, 2135, 2141,
+     1054, 1034, 1036, 1043, 1043, 1049, 1049, 1049, 2138, 1049,
+     2198, 2155, 1049, 1060, 1060, 1060, 2142, 1428, 1040, 1061,
+
+     1061, 1061, 2136, 1061, 2137, 2142, 1061, 1062, 1062, 1062,
+     1060, 2146, 1054, 1063, 1063, 1063, 1064, 1064, 1064, 2198,
+     1064, 2138, 2146, 1064, 2155, 1062, 1067, 1067, 1067, 2148,
+     1063, 1068, 1068, 1068, 1069, 1069, 1069, 2143, 1070, 1070,
+     1070, 2151, 1070, 2156, 1067, 1070, 2143, 2148, 1068, 2165,
+     2151, 1069, 1071, 1071, 1071, 2152, 2153, 1062, 1072, 1072,
+     1072, 1073, 1073, 1073, 2152, 1073, 2154, 1427, 1073, 1071,
+     1074, 1074, 1074, 2165, 1426, 1072, 2156, 1067, 1075, 1075,
+     1075, 1076, 1076, 1076, 1078, 1078, 1078, 1074, 1079, 1079,
+     1079, 2161, 2166, 1071, 2153, 1075, 1080, 1080, 1080, 1076,
+
+     1080, 1078, 2161, 1080, 2154, 1079, 1082, 1082, 1082, 1083,
+     1083, 1083, 1084, 1084, 1084, 1085, 1085, 1085, 2157, 1074,
+     1086, 1086, 1086, 1425, 1082, 2158, 1083, 2157, 1410, 1084,
+     2159, 2166, 1085, 1407, 2158, 1075, 2199, 1086, 1076, 2159,
+     1087, 1087, 1087, 1089, 1089, 1089, 1098, 1098, 1098, 1100,
+     1100, 1100, 1101, 1101, 1101, 2162, 1082, 1087, 1102, 1102,
+     1102, 1089, 1085, 2167, 1098, 2199, 1100, 1084, 2160, 1086,
+     1101, 2162, 1103, 1103, 1103, 1102, 1103, 2160, 2184, 1103,
+     1104, 1104, 1104, 1405, 2184, 1089, 1187, 1187, 1187, 1087,
+     1105, 1105, 1105, 1106, 1106, 1106, 1404, 1104, 1101, 1107,
+
+     1107, 1107, 2167, 1098, 1108, 1108, 1108, 1105, 2169, 1401,
+     1106, 1109, 1109, 1109, 1192, 1192, 1192, 1107, 1110, 1110,
+     1110, 1108, 1110, 2191, 2169, 1110, 2170, 2173, 1109, 2191,
+     1399, 1105, 1111, 1111, 1111, 1112, 1112, 1112, 1113, 1113,
+     1113, 2170, 1106, 1382, 1107, 1115, 1115, 1115, 2171, 1111,
+     1380, 2173, 1112, 1116, 1116, 1116, 1113, 1116, 2175, 2171,
+     1116, 2176, 1115, 1117, 1117, 1117, 2174, 1118, 1118, 1118,
+     2177, 1118, 2217, 1111, 1118, 1122, 1122, 1122, 2217, 2177,
+     1117, 1125, 1125, 1125, 1112, 1126, 1126, 1126, 2175, 1126,
+     2174, 2176, 1126, 1122, 2179, 1113, 2178, 2207, 1125, 1127,
+
+     1127, 1127, 1128, 1128, 1128, 2178, 1128, 1379, 2207, 1128,
+     1129, 1129, 1129, 1130, 1130, 1130, 1127, 1130, 2179, 2213,
+     1130, 1134, 1134, 1134, 1135, 1135, 1135, 1129, 1135, 2180,
+     2213, 1135, 1122, 1138, 1138, 1138, 1139, 1139, 1139, 1134,
+     1139, 2212, 1378, 1139, 1140, 1140, 1140, 1141, 1141, 1141,
+     1138, 1141, 1377, 2180, 1141, 2212, 1142, 1142, 1142, 2186,
+     1142, 1140, 1134, 1142, 1146, 1146, 1146, 1147, 1147, 1147,
+     2187, 1147, 2181, 2192, 1147, 1149, 1149, 1149, 1150, 1150,
+     1150, 1146, 1151, 1151, 1151, 1152, 1152, 1152, 2182, 2192,
+     1153, 1153, 1153, 1149, 1153, 1150, 2181, 1153, 2186, 1151,
+
+     2219, 1376, 1152, 1154, 1154, 1154, 1155, 1155, 1155, 2187,
+     1155, 2194, 2182, 1155, 1156, 1156, 1156, 1149, 2196, 2188,
+     1154, 1151, 1157, 1157, 1157, 1158, 1158, 1158, 2189, 1158,
+     2219, 1156, 1158, 1159, 1159, 1159, 1160, 1160, 1160, 1157,
+     1161, 1161, 1161, 2188, 1162, 1162, 1162, 1375, 1162, 2194,
+     1159, 1162, 2189, 1160, 1165, 1165, 1165, 2196, 1161, 2200,
+     1166, 1166, 1166, 1156, 1166, 2201, 2249, 1166, 1167, 1167,
+     1167, 1165, 1168, 1168, 1168, 2249, 1168, 2195, 2236, 1168,
+     2216, 1374, 1159, 2200, 2197, 1167, 1171, 1171, 1171, 2201,
+     1171, 2216, 2236, 1171, 1177, 1177, 1177, 1161, 1178, 1178,
+
+     1178, 2210, 1182, 1182, 1182, 1188, 1188, 1188, 1190, 1190,
+     1190, 1177, 1193, 1193, 1193, 2195, 1178, 1196, 1196, 1196,
+     1182, 1196, 1188, 2197, 1196, 2210, 1190, 1199, 1199, 1199,
+     1200, 1200, 1200, 1201, 1201, 1201, 1371, 1201, 2247, 2202,
+     1201, 1202, 1202, 1202, 1341, 1199, 1336, 1200, 1203, 1203,
+     1203, 1190, 2247, 1208, 1208, 1208, 1212, 1212, 1212, 1202,
+     1178, 1182, 1214, 1214, 1214, 1203, 1199, 1204, 1204, 1204,
+     1208, 1204, 2208, 1212, 1204, 1205, 1205, 1205, 2202, 1205,
+     1214, 2209, 1205, 1209, 1209, 1209, 2237, 1209, 2220, 1329,
+     1209, 1213, 1213, 1213, 1215, 1215, 1215, 2237, 1202, 1216,
+
+     1216, 1216, 2214, 1212, 1325, 1217, 1217, 1217, 1213, 1217,
+     2208, 1215, 1217, 1218, 1218, 1218, 1216, 1218, 2220, 2209,
+     1218, 1222, 1222, 1222, 1223, 1223, 1223, 1224, 1224, 1224,
+     2203, 1224, 2215, 2204, 1224, 1225, 1225, 1225, 1324, 1222,
+     2214, 1223, 1226, 1226, 1226, 1227, 1227, 1227, 1228, 1228,
+     1228, 2234, 1225, 1230, 1230, 1230, 1239, 1239, 1239, 1226,
+     2205, 1323, 1227, 2223, 1222, 1228, 1241, 1241, 1241, 2203,
+     2215, 1230, 2204, 2235, 1239, 1242, 1242, 1242, 2225, 1242,
+     2211, 2234, 1242, 1241, 1243, 1243, 1243, 1225, 1333, 1333,
+     1333, 1228, 1226, 1244, 1244, 1244, 2223, 1244, 1227, 2205,
+
+     1244, 2250, 1243, 2235, 2211, 1230, 1247, 1247, 1247, 1322,
+     2250, 1239, 1248, 1248, 1248, 2224, 1248, 2225, 2231, 1248,
+     1249, 1249, 1249, 1247, 1250, 1250, 1250, 1251, 1251, 1251,
+     1252, 1252, 1252, 1338, 1338, 1338, 1243, 1249, 1257, 1257,
+     1257, 1250, 1253, 1253, 1253, 1251, 1253, 1252, 2224, 1253,
+     1254, 1254, 1254, 2226, 1254, 1257, 2231, 1254, 1258, 1258,
+     1258, 1259, 1259, 1259, 1270, 1270, 1270, 1250, 1249, 2221,
+     1251, 1321, 1285, 1285, 1285, 1258, 1261, 1261, 1261, 1259,
+     1261, 2271, 1270, 1261, 2222, 2227, 1257, 1264, 1264, 1264,
+     1285, 1264, 2226, 2221, 1264, 1273, 1273, 1273, 1296, 1273,
+
+     1259, 1258, 1273, 1276, 1276, 1276, 2242, 1276, 2222, 2227,
+     1276, 1279, 1279, 1279, 2271, 1279, 1270, 2242, 1279, 2228,
+     1285, 1286, 1286, 1286, 2232, 1286, 2295, 2239, 1286, 1289,
+     1289, 1289, 2229, 1289, 1292, 2295, 1289, 1293, 1293, 1293,
+     2230, 1293, 2240, 2228, 1293, 1297, 1297, 1297, 1298, 1298,
+     1298, 1299, 1299, 1299, 2243, 1299, 2229, 2239, 1299, 1300,
+     1300, 1300, 2232, 1297, 2230, 1298, 1301, 1301, 1301, 2248,
+     1301, 2244, 2240, 1301, 1284, 1283, 1300, 1304, 1304, 1304,
+     2248, 1304, 2245, 2246, 1304, 1307, 1307, 1307, 1297, 1308,
+     1308, 1308, 2243, 1308, 2251, 2252, 1308, 1311, 1311, 1311,
+
+     1282, 1272, 1307, 1312, 1312, 1312, 1313, 1313, 1313, 2244,
+     1313, 2245, 2246, 1313, 1311, 1314, 1314, 1314, 2251, 2252,
+     1312, 1300, 1315, 1315, 1315, 2253, 1315, 2254, 1271, 1315,
+     1326, 1326, 1326, 1314, 1339, 1339, 1339, 1314, 2254, 2253,
+     1311, 1307, 1318, 1318, 1318, 2256, 1318, 1326, 2260, 1318,
+     1327, 1327, 1327, 2255, 1327, 2257, 2256, 1327, 1328, 1328,
+     1328, 1334, 1334, 1334, 1335, 1335, 1335, 2255, 1335, 2258,
+     1269, 1335, 1337, 1337, 1337, 2261, 1328, 2260, 1334, 1340,
+     1340, 1340, 1342, 1342, 1342, 2257, 1328, 1343, 1343, 1343,
+     1337, 1343, 2276, 2274, 1343, 1346, 1346, 1346, 2342, 2258,
+
+     1342, 1347, 1347, 1347, 2261, 1347, 2276, 2265, 1347, 1350,
+     1350, 1350, 2342, 1346, 1351, 1351, 1351, 2274, 1351, 2275,
+     1268, 1351, 1352, 1352, 1352, 2266, 1350, 1353, 1353, 1353,
+     1354, 1354, 1354, 1267, 1354, 1342, 2265, 1354, 2299, 1352,
+     1355, 1355, 1355, 2275, 1353, 1357, 1357, 1357, 1358, 1358,
+     1358, 2280, 1358, 2269, 2266, 1358, 2296, 2300, 1355, 1359,
+     1359, 1359, 1357, 1359, 1260, 2296, 1359, 1362, 1362, 1362,
+     1363, 1363, 1363, 1352, 1364, 1364, 1364, 2299, 1364, 1240,
+     2280, 1364, 2281, 2269, 1362, 1367, 1367, 1367, 1363, 1368,
+     1368, 1368, 2270, 1369, 1369, 1369, 2300, 1363, 1370, 1370,
+
+     1370, 1238, 1367, 1372, 1372, 1372, 1368, 1373, 1373, 1373,
+     1369, 2281, 1381, 1381, 1381, 1370, 1383, 1383, 1383, 2282,
+     1383, 1372, 2270, 1383, 1386, 1386, 1386, 1387, 1387, 1387,
+     1381, 1387, 1368, 2293, 1387, 1390, 1390, 1390, 1367, 1369,
+     2277, 2310, 1386, 1391, 1391, 1391, 1237, 1392, 1392, 1392,
+     2310, 2277, 1390, 1236, 1393, 1393, 1393, 2282, 1393, 2272,
+     1391, 1393, 2293, 1372, 1381, 1392, 1396, 1396, 1396, 1392,
+     1397, 1397, 1397, 1398, 1398, 1398, 1400, 1400, 1400, 1386,
+     1402, 1402, 1402, 1396, 1403, 1403, 1403, 1397, 1408, 1408,
+     1408, 1398, 2272, 1400, 1409, 1409, 1409, 1402, 1235, 1411,
+
+     1411, 1411, 1403, 2283, 2290, 1408, 2284, 1412, 1412, 1412,
+     1234, 1233, 1409, 2285, 1232, 1409, 1411, 1231, 1229, 1413,
+     1413, 1413, 2291, 1413, 1398, 1412, 1413, 1416, 1416, 1416,
+     1417, 1417, 1417, 2288, 2289, 1403, 1418, 1418, 1418, 2284,
+     1418, 2283, 2290, 1418, 1416, 2306, 2285, 1417, 1419, 1419,
+     1419, 1420, 1420, 1420, 1421, 1421, 1421, 2316, 1421, 2294,
+     2291, 1421, 1412, 2307, 1221, 1419, 2288, 2289, 1420, 1424,
+     1424, 1424, 1429, 1429, 1429, 1430, 1430, 1430, 2306, 1430,
+     1195, 1194, 1430, 1191, 1433, 1433, 1433, 1424, 2294, 1429,
+     1437, 1437, 1437, 2308, 1437, 2316, 2307, 1437, 1441, 1441,
+
+     1441, 1419, 1433, 1443, 1443, 1443, 1444, 1444, 1444, 1446,
+     1446, 1446, 1447, 1447, 1447, 2311, 1441, 2312, 1449, 1449,
+     1449, 1424, 1449, 2308, 2311, 1449, 2312, 1446, 1189, 2309,
+     1447, 1433, 1452, 1452, 1452, 1453, 1453, 1453, 1184, 1453,
+     1181, 1179, 1453, 1456, 1456, 1456, 2375, 1456, 2313, 1452,
+     1456, 1459, 1459, 1459, 1460, 1460, 1460, 2313, 1460, 2309,
+     2375, 1460, 1461, 1461, 1461, 1462, 1462, 1462, 1459, 1463,
+     1463, 1463, 1464, 1464, 1464, 1452, 1465, 1465, 1465, 2314,
+     1461, 2317, 1462, 1466, 1466, 1466, 1463, 1466, 1176, 1464,
+     1466, 1175, 1174, 1465, 1468, 1468, 1468, 1469, 1469, 1469,
+
+     1477, 1477, 1477, 1478, 1478, 1478, 1479, 1479, 1479, 2314,
+     1170, 1464, 1468, 1461, 1480, 1480, 1480, 2315, 1477, 2317,
+     1478, 1481, 1481, 1481, 1479, 1481, 2318, 2319, 1481, 1169,
+     2326, 1480, 2327, 1482, 1482, 1482, 1483, 1483, 1483, 2326,
+     1483, 2327, 2320, 1483, 1484, 1484, 1484, 2315, 2321, 1477,
+     1482, 1485, 1485, 1485, 1486, 1486, 1486, 1148, 1486, 2318,
+     2319, 1486, 1484, 1487, 1487, 1487, 2320, 1145, 1485, 1488,
+     1488, 1488, 2321, 1488, 1133, 2322, 1488, 1489, 1489, 1489,
+     1487, 1490, 1490, 1490, 1491, 1491, 1491, 1492, 1492, 1492,
+     2336, 1492, 1132, 1131, 1492, 1489, 1484, 2323, 1490, 2322,
+
+     2328, 1491, 1494, 1494, 1494, 1495, 1495, 1495, 2330, 1495,
+     2331, 1124, 1495, 1496, 1496, 1496, 1499, 1499, 1499, 1494,
+     2336, 2323, 1489, 1500, 1500, 1500, 1502, 1502, 1502, 2328,
+     2332, 1496, 2330, 1499, 2331, 1496, 1123, 1503, 1503, 1503,
+     1500, 1503, 2337, 1502, 1503, 1504, 1504, 1504, 1506, 1506,
+     1506, 1507, 1507, 1507, 2332, 1507, 2340, 1121, 1507, 1508,
+     1508, 1508, 1120, 1504, 1119, 1506, 1509, 1509, 1509, 1510,
+     1510, 1510, 2337, 1510, 2333, 2329, 1510, 1508, 1511, 1511,
+     1511, 1508, 1511, 1509, 1114, 1511, 1514, 1514, 1514, 1515,
+     1515, 1515, 1516, 1516, 1516, 2340, 1516, 1504, 2333, 1516,
+
+     1517, 1517, 1517, 1514, 2329, 2343, 1515, 1520, 1520, 1520,
+     1521, 1521, 1521, 1522, 1522, 1522, 2343, 2334, 1517, 1523,
+     1523, 1523, 1099, 1523, 1520, 1514, 1523, 1521, 2341, 2344,
+     1522, 1524, 1524, 1524, 1526, 1526, 1526, 1530, 1530, 1530,
+     1532, 1532, 1532, 1533, 1533, 1533, 2334, 1533, 2335, 1524,
+     1533, 1517, 1526, 2344, 1097, 1530, 2354, 1532, 1536, 1536,
+     1536, 1537, 1537, 1537, 1538, 1538, 1538, 2341, 1538, 1096,
+     1095, 1538, 1539, 1539, 1539, 2338, 1536, 2335, 1537, 1540,
+     1540, 1540, 2345, 1540, 2338, 2354, 1540, 1524, 1094, 1539,
+     1541, 1541, 1541, 1542, 1542, 1542, 2348, 1542, 2349, 2346,
+
+     1542, 1093, 1536, 1546, 1546, 1546, 2345, 1541, 1555, 1555,
+     1555, 1556, 1556, 1556, 2355, 1557, 1557, 1557, 2339, 1557,
+     1092, 1546, 1557, 1558, 1558, 1558, 1555, 2339, 1556, 1560,
+     1560, 1560, 2346, 1560, 1555, 2348, 1560, 2349, 1563, 1563,
+     1563, 1558, 1563, 2355, 2347, 1563, 1566, 1566, 1566, 1567,
+     1567, 1567, 2363, 1567, 2352, 2350, 1567, 1091, 1570, 1570,
+     1570, 2363, 1570, 1090, 1566, 1570, 1573, 1573, 1573, 1574,
+     1574, 1574, 1575, 1575, 1575, 2351, 1575, 2347, 2361, 1575,
+     2353, 1576, 1576, 1576, 1573, 1576, 1574, 2352, 1576, 1580,
+     1580, 1580, 1088, 1580, 2350, 2356, 1580, 1566, 1583, 1583,
+
+     1583, 1584, 1584, 1584, 1585, 1585, 1585, 1586, 1586, 1586,
+     1587, 1587, 1587, 2353, 2351, 1573, 1583, 2361, 1584, 2356,
+     1081, 1585, 2383, 2357, 1586, 2364, 2362, 1587, 1588, 1588,
+     1588, 1589, 1589, 1589, 2364, 1589, 2383, 1077, 1589, 1590,
+     1590, 1590, 1591, 1591, 1591, 1588, 1591, 2357, 2369, 1591,
+     1583, 1593, 1593, 1593, 1059, 1593, 1590, 2369, 1593, 1596,
+     1596, 1596, 1598, 1598, 1598, 2362, 1598, 2358, 2376, 1598,
+     1601, 1601, 1601, 1058, 1602, 1602, 1602, 1596, 1602, 2376,
+     2373, 1602, 1605, 1605, 1605, 1606, 1606, 1606, 1601, 1606,
+     1056, 2358, 1606, 1609, 1609, 1609, 1610, 1610, 1610, 1605,
+
+     1612, 1612, 1612, 1613, 1613, 1613, 2359, 1613, 1055, 2370,
+     1613, 1609, 2365, 1610, 1614, 1614, 1614, 1612, 2370, 2373,
+     1596, 2374, 1601, 1605, 1053, 1615, 1615, 1615, 1052, 1615,
+     2359, 1614, 1615, 1616, 1616, 1616, 2365, 1616, 2366, 2367,
+     1616, 1619, 1619, 1619, 1623, 1623, 1623, 1624, 1624, 1624,
+     1609, 1625, 1625, 1625, 1626, 1626, 1626, 2368, 1626, 1619,
+     2374, 1626, 2366, 2367, 1624, 1697, 1697, 1697, 1625, 2389,
+     1627, 1627, 1627, 1628, 1628, 1628, 2384, 1628, 2389, 1048,
+     1628, 2368, 1631, 1631, 1631, 2371, 1631, 2384, 1627, 1631,
+     1634, 1634, 1634, 1644, 1644, 1644, 2385, 2386, 1619, 1621,
+
+     1621, 1621, 1635, 1635, 1635, 2372, 1635, 1634, 2386, 1635,
+     2385, 1644, 1770, 1770, 1770, 1047, 2379, 1621, 2371, 1621,
+     1621, 1621, 1627, 1621, 1621, 1046, 1621, 1648, 1648, 1648,
+     1621, 1621, 1621, 1621, 1621, 1645, 1645, 1645, 2372, 1645,
+     2379, 1041, 1645, 1017, 2394, 1648, 1016, 2380, 1644, 1649,
+     1649, 1649, 1650, 1650, 1650, 2381, 1650, 2390, 2394, 1650,
+     1654, 1654, 1654, 1655, 1655, 1655, 2390, 1649, 1656, 1656,
+     1656, 2380, 1656, 1014, 2395, 1656, 1008, 2396, 1654, 2381,
+     1655, 1657, 1657, 1657, 1648, 2395, 1658, 1658, 1658, 1007,
+     1658, 2404, 1649, 1658, 2382, 1659, 1659, 1659, 1657, 1660,
+
+     1660, 1660, 2387, 1660,  983, 2404, 1660, 1661, 1661, 1661,
+     2388, 1654, 1659, 1662, 1662, 1662, 2396, 1662, 2382,  982,
+     1662, 1663, 1663, 1663, 1661, 1663, 2387,  981, 1663, 1666,
+     1666, 1666, 2391, 1666, 2388, 2397, 1666, 1670, 1670, 1670,
+     1672, 1672, 1672, 1673, 1673, 1673, 1674, 1674, 1674, 1675,
+     1675, 1675, 1803, 1803, 1803, 1670, 2391,  974, 1672, 1670,
+     1673, 1676, 1676, 1676, 1674, 1676, 1675,  973, 1676, 1678,
+     1678, 1678,  968, 1678, 2397, 2392, 1678, 1681, 1681, 1681,
+     2402, 1681,  964, 2400, 1681,  963, 1673, 1684, 1684, 1684,
+     2403, 1672, 2409, 1698, 1698, 1698, 1699, 1699, 1699, 2392,
+
+     1699, 1674,  957, 1699, 2402, 1684, 1703, 1703, 1703, 1684,
+     1698, 1700, 1700, 1700, 2403, 1700, 2409, 2401, 1700, 1704,
+     1704, 1704, 2400, 1704, 1703, 2417, 1704, 1715, 1715, 1715,
+     1716, 1716, 1716, 1717, 1717, 1717, 1718, 1718, 1718, 1719,
+     1719, 1719, 1720, 1720, 1720, 1715, 1720, 2410, 1716, 1720,
+     2405, 1717,  952, 1718,  951, 1717, 2401, 1719, 1723, 1723,
+     1723, 2405, 1723, 2418, 2417, 1723, 1726, 1726, 1726, 2423,
+     1726, 2410,  946, 1726, 1729, 1729, 1729, 2415, 1729, 1715,
+     2423, 1729, 1733, 1733, 1733, 1716, 1734, 1734, 1734, 1735,
+     1735, 1735, 1736, 1736, 1736, 2416, 1719, 1737, 1737, 1737,
+
+     1733, 2415, 2418, 1734, 1738, 1738, 1738, 1735, 1738, 1736,
+     2425, 1738, 1742, 1742, 1742, 1737, 1758, 1758, 1758, 2416,
+     1758, 2425,  930, 1758, 1761, 1761, 1761, 1771, 1771, 1771,
+     1742, 1774, 1774, 1774, 1733, 1772, 1772, 1772, 1773, 1773,
+     1773, 2422, 1761,  929,  924, 1771, 1735,  923, 1774, 1737,
+     1775, 1775, 1775, 1772, 1775, 2422, 1773, 1775, 1776, 1776,
+     1776, 1777, 1777, 1777, 1742, 1778, 1778, 1778, 1779, 1779,
+     1779, 1780, 1780, 1780,  922, 2424, 1776,  921, 1777, 1782,
+     1782, 1782, 1778, 2426, 2427, 1771, 1779, 1772, 1780, 2424,
+     1773, 1781, 1781, 1781, 2433, 1781,  920, 1782, 1781, 1783,
+
+     1783, 1783, 1784, 1784, 1784, 2433, 1784, 2426, 2427, 1784,
+     1785, 1785, 1785, 1776,  919,  918, 1783,  917, 2432, 1779,
+     1786, 1786, 1786, 1787, 1787, 1787,  912,  911, 1785, 1802,
+     1802, 1802, 2432,  910, 1782,  906,  905, 1786, 1806, 1806,
+     1806, 1787, 1810, 1810, 1810,  904, 1802, 1802, 1811, 1811,
+     1811, 1812, 1812, 1812, 1813, 1813, 1813,  899,  897, 1785,
+     1814, 1814, 1814,  896, 1814,  891, 1811, 1814,  890, 1812,
+      888,  883, 1813,  873, 1787, 1817, 1817, 1817, 1818, 1818,
+     1818, 1819, 1819, 1819,  864, 1819,  863,  862, 1819, 1820,
+     1820, 1820,  861, 1817,  860, 1818,  855, 1822, 1822, 1822,
+
+     1812, 1811, 1831, 1831, 1831, 1813, 1820, 1821, 1821, 1821,
+      854, 1821,  851,  850, 1821, 1822, 1823, 1823, 1823, 1831,
+     1823,  847,  846, 1823, 1826, 1826, 1826, 1817, 1827, 1827,
+     1827,  845, 1827,  843,  839, 1827,  837, 1830, 1830, 1830,
+      808,  807, 1826, 1832, 1832, 1832,  806, 1832,  805,  802,
+     1832, 1833, 1833, 1833, 1822, 1830, 1840, 1840, 1840,  801,
+     1848, 1848, 1848, 1849, 1849, 1849,  800, 1849,  799, 1833,
+     1849, 1850, 1850, 1850, 1840,  771, 1826, 1848, 1848,  770,
+      769, 1849, 1851, 1851, 1851, 1853, 1853, 1853, 1856, 1856,
+     1856, 1857, 1857, 1857, 1858, 1858, 1858, 1859, 1859, 1859,
+
+     1860, 1860, 1860, 1861, 1861, 1861,  765, 1861, 1833, 1857,
+     1861,  764, 1858,  763,  754, 1859,  751,  750, 1860, 1864,
+     1864, 1864,  747, 1864,  746,  745, 1864, 1867, 1867, 1867,
+     1868, 1868, 1868, 1869, 1869, 1869, 1871, 1871, 1871,  733,
+     1871,  732,  729, 1871,  725, 1867,  716,  715, 1868, 1860,
+      714, 1869,  711,  702, 1859, 1874, 1874, 1874, 1880, 1880,
+     1880,  701, 1881, 1881, 1881, 1887, 1887, 1887, 1889, 1889,
+     1889,  698, 1889, 1874,  697, 1889, 1880,  696,  695, 1868,
+     1881,  694, 1867, 1887,  693,  692, 1889, 1892, 1892, 1892,
+      691,  682, 1887,  675,  674, 1881, 1896, 1896, 1896, 1923,
+
+     1923, 1923, 1897, 1897, 1897, 1899, 1899, 1899,  671,  670,
+     1874, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890, 1890,
+     1897,  669, 1890, 1899, 1901, 1901, 1901, 1890, 1890, 1890,
+     1890, 1890, 1924, 1924, 1924, 1949, 1949, 1949, 1950, 1950,
+     1950,  666, 1901, 1902, 1902, 1902, 1903, 1903, 1903, 1890,
+     1890, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891, 1891,
+      665, 1902, 1891,  664, 1903,  663,  660, 1891, 1891, 1891,
+     1891, 1891,  659, 1904, 1904, 1904, 1905, 1905, 1905, 1901,
+      658, 1906, 1906, 1906, 1907, 1907, 1907,  657,  654, 1891,
+     1891, 1904,  653,  647, 1905, 1920, 1920, 1920, 1903, 1906,
+
+      642,  641, 1907, 1911, 1911, 1911, 1918, 1918, 1918, 1926,
+     1926, 1926,  640, 1920, 1927, 1927, 1927, 1929, 1929, 1929,
+      639, 1911,  638,  637, 1918,  634,  631, 1926, 1905, 1951,
+     1951, 1951, 1927,  629,  628, 1929, 1911,  627,  626, 1918,
+     1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921,  625,
+      621, 1921, 1930, 1930, 1930,  619, 1921, 1921, 1921, 1921,
+     1921, 1926, 1970, 1970, 1970,  618, 1929,  617,  616,  615,
+     1930, 1932, 1932, 1932, 1933, 1933, 1933,  610, 1921, 1921,
+     1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1922, 1932,
+      609, 1922, 1933, 1934, 1934, 1934, 1922, 1922, 1922, 1922,
+
+     1922,  608,  607, 1947, 1947, 1947,  606, 1933,  605,  604,
+      602, 1934, 1952, 1952, 1952, 1953, 1953, 1953, 1922, 1922,
+     1932, 1947, 1954, 1954, 1954,  601, 1934, 1971, 1971, 1971,
+     1952,  600,  597, 1953,  592,  591, 1947, 1972, 1972, 1972,
+     1954, 1974, 1974, 1974,  590, 1971, 1989, 1989, 1989, 1991,
+     1991, 1991, 2006, 2006, 2006, 1972, 2014, 2014, 2014, 1974,
+      589, 1952,  587,  586, 1989,  585,  584, 1991,  581,  576,
+     2006, 2019, 2019, 2019, 2014, 2027, 2027, 2027, 2028, 2028,
+     2028, 2030, 2030, 2030,  574, 2006, 2034, 2034, 2034, 2019,
+     2029, 2029, 2029, 2027, 2029,  573, 2028, 2029,  572, 2030,
+
+     2035, 2035, 2035,  570, 2034, 2038, 2038, 2038, 2029, 2039,
+     2039, 2039, 2040, 2040, 2040, 2042, 2042, 2042, 2035, 2034,
+     2046, 2046, 2046, 2038, 2043, 2043, 2043, 2039, 2043,  569,
+     2040, 2043,  568, 2042, 2049, 2049, 2049,  565, 2046, 2051,
+     2051, 2051, 2043, 2051,  560,  559, 2051,  558, 2042, 2053,
+     2053, 2053, 2049, 2046, 2054, 2054, 2054, 2051, 2054,  557,
+      555, 2054, 2055, 2055, 2055,  554, 2055, 2053,  553, 2055,
+      550,  549, 2054, 2056, 2056, 2056, 2066, 2066, 2066,  544,
+     2055, 2071, 2071, 2071,  542, 2071,  541,  539, 2071,  538,
+      537, 2056,  534,  527, 2066, 2077, 2077, 2077,  526, 2071,
+
+     2084, 2084, 2084, 2098, 2098, 2098, 2056,  524,  521, 2066,
+     2105, 2105, 2105, 2077, 2106, 2106, 2106,  518, 2084,  513,
+      512, 2098, 2111, 2111, 2111,  511,  509,  506, 2105, 2127,
+     2127, 2127, 2106, 2150, 2150, 2150, 2098, 2132, 2132, 2132,
+     2111, 2132,  501, 2105, 2132,  500,  497, 2127, 2163, 2163,
+     2163, 2150, 2168, 2168, 2168, 2132, 2172, 2172, 2172,  496,
+     2172,  495, 2127, 2172,  494,  493, 2163, 2183, 2183, 2183,
+     2168, 2185, 2185, 2185, 2172, 2185,  492,  490, 2185, 2190,
+     2190, 2190,  489, 2190,  482, 2183, 2190,  481,  476, 2185,
+     2193, 2193, 2193,  475, 2206, 2206, 2206, 2190, 2206,  473,
+
+      472, 2206, 2218, 2218, 2218,  471, 2218,  468, 2193, 2218,
+      467,  466, 2206, 2233, 2233, 2233, 2238, 2238, 2238,  465,
+     2218, 2241, 2241, 2241,  464, 2259, 2259, 2259,  461, 2259,
+      460, 2233, 2259,  459, 2238, 2262, 2262, 2262,  458, 2241,
+     2263, 2263, 2263, 2259, 2267, 2267, 2267,  457, 2267,  455,
+      454, 2267,  451, 2262, 2268, 2268, 2268,  450, 2263, 2273,
+     2273, 2273, 2267, 2278, 2278, 2278, 2279, 2279, 2279, 2286,
+     2286, 2286, 2268, 2297, 2297, 2297,  448, 2273, 2292, 2292,
+     2292, 2278, 2292,  445, 2279, 2292,  443, 2286, 2301, 2301,
+     2301, 2297, 2302, 2302, 2302,  442, 2292, 2304, 2304, 2304,
+
+     2324, 2324, 2324, 2360, 2360, 2360, 2301, 2377, 2377, 2377,
+     2302, 2393, 2393, 2393,  439, 2304,  438,  437, 2324,  436,
+      435, 2360, 2398, 2398, 2398, 2377, 2399, 2399, 2399, 2393,
+     2406, 2406, 2406, 2408, 2408, 2408, 2411, 2411, 2411,  434,
+     2398, 2413, 2413, 2413, 2399, 2419, 2419, 2419, 2406,  433,
+      432, 2408,  429,  428, 2411, 2420, 2420, 2420,  427, 2413,
+     2428, 2428, 2428, 2419, 2430, 2430, 2430, 2431, 2431, 2431,
+     2434, 2434, 2434, 2420, 2436, 2436, 2436,  426, 2428, 2438,
+     2438, 2438, 2430,  425,  419, 2431,  418,  416, 2434, 2439,
+     2439, 2439, 2436,  413,  412,  410,  409, 2438,  402,  401,
+
+      400,  399,  398,  397,  395,  394,  393, 2439, 2442, 2442,
+     2442, 2442, 2442, 2442, 2442, 2442, 2442, 2443, 2443, 2443,
+     2443, 2443, 2443, 2443, 2443, 2443, 2444, 2444, 2444, 2444,
+     2444, 2444, 2444, 2444, 2444, 2445, 2445, 2445, 2445, 2445,
+     2445, 2445, 2445, 2445, 2446, 2446, 2446, 2446, 2446, 2446,
+     2446, 2446, 2446, 2447, 2447, 2447, 2447, 2447, 2447, 2447,
+     2447, 2447, 2448, 2448, 2448, 2448, 2448, 2448, 2448, 2448,
+     2448, 2449, 2449, 2449, 2449, 2449, 2449, 2449, 2449, 2449,
+     2450, 2450, 2450, 2450, 2450, 2450, 2450, 2450, 2450, 2451,
+     2451, 2451, 2451, 2451, 2451, 2451, 2451, 2451, 2452, 2452,
+
+     2452, 2452, 2452, 2452, 2452, 2452, 2452, 2453, 2453, 2453,
+     2453, 2453, 2453, 2453, 2453, 2453, 2454, 2454, 2454, 2454,
+     2454, 2454, 2454, 2454, 2454, 2455, 2455, 2455, 2455, 2455,
+     2455, 2455, 2455, 2455, 2456, 2456, 2456, 2456, 2456, 2456,
+     2456, 2456, 2456, 2457, 2457, 2457, 2457, 2457, 2457, 2457,
+     2457, 2457, 2458, 2458, 2458, 2458, 2458, 2458, 2458, 2458,
+     2458, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459, 2459,
+     2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2460, 2461,
+     2461, 2461, 2461, 2461, 2461, 2461, 2461, 2461, 2462, 2462,
+     2462, 2462, 2462, 2462, 2462, 2462, 2462, 2463, 2463, 2463,
+
+     2463, 2463, 2463, 2463, 2463, 2463, 2464, 2464, 2464, 2464,
+     2464, 2464, 2464, 2464, 2464, 2465, 2465, 2465, 2465, 2465,
+     2465, 2465, 2465, 2465, 2466, 2466, 2466, 2466, 2466, 2466,
+     2466, 2466, 2466, 2467, 2467, 2467, 2467, 2467, 2467, 2467,
+     2467, 2467, 2468, 2468, 2468, 2468, 2468, 2468, 2468, 2468,
+     2468, 2469, 2469, 2469, 2469, 2469, 2469, 2469, 2469, 2469,
+     2470, 2470, 2470, 2470, 2470, 2470, 2470, 2470, 2470, 2471,
+     2471, 2471, 2471, 2471, 2471, 2471, 2471, 2471, 2472, 2472,
+     2472,  389,  380,  379, 2472, 2473, 2473, 2473,  378,  377,
+      376, 2473, 2474, 2474, 2474,  375,  374,  373, 2474, 2475,
+
+     2475, 2475,  372,  368,  359, 2475, 2476, 2476, 2476,  358,
+      356,  355, 2476, 2477, 2477, 2477,  354,  353,  352, 2477,
+     2478, 2478, 2478,  348,  339,  338, 2478, 2479, 2479, 2479,
+      337,  335,  334, 2479, 2480, 2480, 2480,  333,  329,  320,
+     2480, 2481, 2481, 2481,  319,  318,  317, 2481, 2482, 2482,
+     2482,  316,  315,  310, 2482, 2483, 2483, 2483,  300,  299,
+      298, 2483, 2484, 2484, 2484,  296,  292,  283, 2484, 2485,
+     2485, 2485,  282,  280,  276, 2485, 2486, 2486, 2486,  267,
+      266,  262, 2486, 2487, 2487, 2487, 2487, 2487, 2487, 2487,
+      257, 2487, 2488,  248,  239,  238, 2488, 2489,  237,  236,
+
+      235, 2489, 2490,  234,  230,  223, 2490, 2491,  222,  221,
+      220, 2491, 2492,  216,  210,  209, 2492, 2493,  208,  206,
+      205, 2493, 2494,  201,  194,  193, 2494, 2495,  192,  188,
+      181, 2495, 2496,  180,  179,  175, 2496, 2497,  165,  164,
+      160, 2497, 2498,  155,  154,  153, 2498, 2499,  147,  146,
+      144, 2499, 2500,  141,  129,    0, 2500, 2501,    0,    0,
+        0, 2501, 2502,    0,    0,    0, 2502, 2503, 2503, 2503,
+     2503, 2503, 2503, 2503, 2503, 2503, 2504,    0,    0,    0,
+        0, 2504, 2505, 2505, 2505, 2505,    0, 2505,    0, 2505,
+     2506, 2506, 2506, 2506,    0,    0, 2506, 2506, 2507, 2507,
+
+     2507,    0,    0,    0, 2507, 2508, 2508, 2508, 2508,    0,
+        0, 2508, 2508, 2509, 2509, 2509,    0,    0,    0, 2509,
+     2510, 2510, 2510, 2510,    0,    0, 2510, 2510, 2511, 2511,
+     2511,    0,    0,    0, 2511, 2512, 2512, 2512, 2512,    0,
+        0, 2512, 2512, 2513, 2513, 2513,    0,    0,    0, 2513,
+     2514, 2514, 2514, 2514,    0,    0, 2514, 2514, 2515, 2515,
+     2515,    0,    0,    0, 2515, 2516, 2516, 2516, 2516,    0,
+        0, 2516, 2516, 2517, 2517, 2517, 2517,    0,    0, 2517,
+     2517, 2518, 2518, 2518,    0,    0,    0, 2518, 2519, 2519,
+     2519, 2519,    0,    0, 2519, 2519, 2520, 2520, 2520,    0,
+
+        0,    0, 2520, 2521, 2521, 2521, 2521,    0,    0, 2521,
+     2521, 2522, 2522, 2522,    0,    0,    0, 2522, 2523, 2523,
+     2523, 2523,    0,    0, 2523, 2523, 2524, 2524, 2524,    0,
+        0,    0, 2524, 2525, 2525, 2525, 2525,    0,    0, 2525,
+     2525, 2526, 2526, 2526,    0,    0,    0, 2526, 2527, 2527,
+     2527, 2527,    0,    0, 2527, 2527, 2528, 2528, 2528, 2528,
+        0, 2528,    0, 2528, 2529, 2529, 2529, 2529,    0,    0,
+     2529, 2529, 2530, 2530, 2530,    0,    0,    0, 2530, 2531,
+     2531, 2531, 2531,    0,    0, 2531, 2531, 2532, 2532, 2532,
+     2532,    0, 2532,    0, 2532, 2533, 2533, 2533, 2533,    0,
+
+        0, 2533, 2533, 2534, 2534, 2534, 2534, 2534, 2534, 2534,
+     2534, 2534, 2535,    0, 2535,    0,    0, 2535, 2536, 2536,
+     2536,    0,    0,    0, 2536, 2537, 2537, 2537, 2537,    0,
+        0, 2537, 2537, 2538, 2538, 2538,    0,    0,    0, 2538,
+     2539, 2539, 2539, 2539,    0,    0, 2539, 2539, 2540, 2540,
+     2540,    0,    0,    0, 2540, 2541, 2541, 2541, 2541,    0,
+        0, 2541, 2541, 2542, 2542, 2542,    0,    0,    0, 2542,
+     2543, 2543, 2543, 2543,    0,    0, 2543, 2543, 2544, 2544,
+     2544,    0,    0,    0, 2544, 2545, 2545, 2545, 2545,    0,
+        0, 2545, 2545, 2546, 2546, 2546,    0,    0,    0, 2546,
+
+     2547, 2547, 2547, 2547,    0,    0, 2547, 2547, 2548, 2548,
+     2548, 2548,    0,    0, 2548, 2548, 2549, 2549, 2549,    0,
+        0,    0, 2549, 2550, 2550, 2550, 2550,    0,    0, 2550,
+     2550, 2551, 2551, 2551, 2551,    0, 2551,    0, 2551, 2552,
+     2552, 2552, 2552,    0,    0, 2552, 2552, 2553, 2553, 2553,
+        0,    0,    0, 2553, 2554, 2554, 2554, 2554,    0,    0,
+     2554, 2554, 2555, 2555, 2555,    0,    0,    0, 2555, 2556,
+     2556, 2556, 2556,    0,    0, 2556, 2556, 2557, 2557, 2557,
+        0,    0,    0, 2557, 2558, 2558, 2558, 2558,    0,    0,
+     2558, 2558, 2559, 2559, 2559, 2559,    0, 2559,    0, 2559,
+
+     2560, 2560, 2560, 2560,    0,    0, 2560, 2560, 2561, 2561,
+     2561,    0,    0,    0, 2561, 2562, 2562, 2562, 2562,    0,
+        0, 2562, 2562, 2563, 2563, 2563, 2563,    0, 2563,    0,
+     2563, 2564, 2564, 2564, 2564,    0,    0, 2564, 2564, 2565,
+     2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2566, 2566,
+     2566, 2566, 2566, 2566, 2566, 2566, 2566, 2567, 2567, 2567,
+        0,    0,    0, 2567, 2568, 2568, 2568, 2568,    0,    0,
+     2568, 2568, 2569, 2569, 2569,    0,    0,    0, 2569, 2570,
+     2570, 2570, 2570,    0,    0, 2570, 2570, 2571, 2571, 2571,
+     2571,    0, 2571,    0, 2571, 2572, 2572, 2572, 2572,    0,
+
+        0, 2572, 2572, 2573, 2573, 2573, 2573,    0, 2573,    0,
+     2573, 2574, 2574, 2574, 2574,    0,    0, 2574, 2574, 2575,
+     2575, 2575,    0,    0,    0, 2575, 2576, 2576, 2576, 2576,
+        0,    0, 2576, 2576, 2577, 2577, 2577, 2577,    0, 2577,
+        0, 2577, 2578, 2578, 2578, 2578,    0,    0, 2578, 2578,
+     2579, 2579, 2579, 2579,    0,    0, 2579, 2579, 2580, 2580,
+     2580,    0,    0,    0, 2580, 2581, 2581, 2581, 2581,    0,
+        0, 2581, 2581, 2582, 2582, 2582, 2582,    0, 2582,    0,
+     2582, 2583, 2583, 2583, 2583,    0,    0, 2583, 2583, 2584,
+     2584, 2584, 2584,    0, 2584,    0, 2584, 2585, 2585, 2585,
+
+     2585,    0,    0, 2585, 2585, 2586, 2586, 2586,    0,    0,
+        0, 2586, 2587, 2587, 2587, 2587,    0,    0, 2587, 2587,
+     2588, 2588, 2588,    0,    0,    0, 2588, 2589, 2589, 2589,
+     2589,    0,    0, 2589, 2589, 2590, 2590, 2590,    0,    0,
+        0, 2590, 2591, 2591, 2591, 2591,    0,    0, 2591, 2591,
+     2592, 2592, 2592, 2592,    0, 2592,    0, 2592, 2593, 2593,
+     2593, 2593,    0,    0, 2593, 2593, 2594, 2594, 2594,    0,
+        0,    0, 2594, 2595, 2595, 2595, 2595,    0,    0, 2595,
+     2595, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596,
+     2597, 2597, 2597, 2597, 2597, 2597, 2597, 2597, 2597, 2598,
+
+     2598, 2598, 2598,    0, 2598,    0, 2598, 2599, 2599, 2599,
+     2599,    0,    0, 2599, 2599, 2600, 2600, 2600,    0,    0,
+        0, 2600, 2601, 2601, 2601, 2601,    0,    0, 2601, 2601,
+     2602, 2602, 2602, 2602, 2602, 2602, 2602, 2602, 2602, 2603,
+     2603, 2603, 2603, 2603, 2603, 2603, 2603, 2603, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+
+     2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441, 2441,
+     2441, 2441, 2441, 2441
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#define INITIAL 0
+/* Validating XML processor for skin.dtd (Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp).
+ * Generated 2003/03/18 03:18:31.
+ *
+ * This program was generated with the FleXML XML processor generator,
+ * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
+ * Copyright © 1999 Kristoffer Rose.  All rights reserved.
+ *
+ * You can redistribute and/or modify this program provided the following
+ * two conditions hold:
+ *
+ * 1. The program is distributed WITHOUT ANY WARRANTY from the author of
+ *    FleXML; without even the implied warranty of MERCHANTABILITY or
+ *    FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * 2. The program distribution conditions do not in any way affect the
+ *    distribution conditions of the FleXML system used to generate this
+ *    file or any version of FleXML derived from that system.
+ *
+ * Notice that these are explicit rights granted to you for files
+ * generated by the FleXML system.  For your rights in connection with
+ * the FleXML system itself please consult the GNU General Public License.
+ */
+
+/* Version strings. */
+const char rcs_flexml_skeleton[] =
+ "$" "Id: skel,v 1.16 1999/12/09 04:01:51 krisrose Exp $";
+const char rcs_flexml[] =
+ "$" "Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp $";
+const char rcs_skin_dtd[] =
+ "$" "Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp $";
+
+/* ANSI headers. */
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <stdarg.h>
+#include <ctype.h>
+
+/* Generated definitions. */
+#define FLEXML_BUFFERSTACKSIZE 100000
+
+/* XML processor api. */
+#include "skin.h"
+
+/* FleXML-provided data. */
+char* pcdata;
+AT_TextControl_display A_TextControl_display;
+AT_SliderControl_x A_SliderControl_x;
+AT_ButtonControl_onclick A_ButtonControl_onclick;
+AT_RectangleControl_color A_RectangleControl_color;
+AT_SliderControl_y A_SliderControl_y;
+AT_ButtonControl_id A_ButtonControl_id;
+AT_Window_movealpha A_Window_movealpha;
+AT_SliderControl_down A_SliderControl_down;
+AT_ButtonControl_down A_ButtonControl_down;
+AT_CheckBoxControl_disabled1 A_CheckBoxControl_disabled1;
+AT_CheckBoxControl_disabled2 A_CheckBoxControl_disabled2;
+AT_Font_underline A_Font_underline;
+AT_ButtonControl_visible A_ButtonControl_visible;
+AT_TextControl_scroll A_TextControl_scroll;
+AT_SliderControl_id A_SliderControl_id;
+AT_CheckBoxControl_x A_CheckBoxControl_x;
+AT_Window_alpha A_Window_alpha;
+AT_TextControl_x A_TextControl_x;
+AT_CheckBoxControl_y A_CheckBoxControl_y;
+AT_Window_id A_Window_id;
+AT_TextControl_y A_TextControl_y;
+AT_RectangleControl_onclick A_RectangleControl_onclick;
+AT_Theme_magnet A_Theme_magnet;
+AT_TextControl_font A_TextControl_font;
+AT_PlayListControl_selcolor A_PlayListControl_selcolor;
+AT_Anchor_x A_Anchor_x;
+AT_Anchor_y A_Anchor_y;
+AT_ButtonControl_up A_ButtonControl_up;
+AT_RectangleControl_visible A_RectangleControl_visible;
+AT_SliderControl_type A_SliderControl_type;
+AT_CheckBoxControl_id A_CheckBoxControl_id;
+AT_Anchor_priority A_Anchor_priority;
+AT_PlayListControl_visible A_PlayListControl_visible;
+AT_Bitmap_alphacolor A_Bitmap_alphacolor;
+AT_ImageControl_onclick A_ImageControl_onclick;
+AT_PlayListControl_x A_PlayListControl_x;
+AT_PlayListControl_y A_PlayListControl_y;
+AT_ImageControl_image A_ImageControl_image;
+AT_ThemeInfo_name A_ThemeInfo_name;
+AT_TextControl_width A_TextControl_width;
+AT_PlayListControl_id A_PlayListControl_id;
+AT_Bitmap_id A_Bitmap_id;
+AT_Font_italic A_Font_italic;
+AT_PlayListControl_ord A_PlayListControl_ord;
+AT_ButtonControl_disabled A_ButtonControl_disabled;
+AT_SliderControl_up A_SliderControl_up;
+AT_ImageControl_x A_ImageControl_x;
+AT_ControlGroup_x A_ControlGroup_x;
+AT_PlayListControl_infowidth A_PlayListControl_infowidth;
+AT_ImageControl_y A_ImageControl_y;
+AT_ControlGroup_y A_ControlGroup_y;
+AT_PlayListControl_longfilename A_PlayListControl_longfilename;
+AT_PlayListControl_abs A_PlayListControl_abs;
+AT_ImageControl_visible A_ImageControl_visible;
+AT_Theme_log A_Theme_log;
+AT_PlayListControl_width A_PlayListControl_width;
+AT_SliderControl_help A_SliderControl_help;
+AT_ButtonControl_help A_ButtonControl_help;
+AT_TextControl_scrollspace A_TextControl_scrollspace;
+AT_Font_font A_Font_font;
+AT_SliderControl_visible A_SliderControl_visible;
+AT_PlayListControl_playfont A_PlayListControl_playfont;
+AT_TextControl_text A_TextControl_text;
+AT_SliderControl_ord A_SliderControl_ord;
+AT_Window_visible A_Window_visible;
+AT_TextControl_align A_TextControl_align;
+AT_TextControl_id A_TextControl_id;
+AT_Window_x A_Window_x;
+AT_SliderControl_abs A_SliderControl_abs;
+AT_Window_y A_Window_y;
+AT_RectangleControl_help A_RectangleControl_help;
+AT_CheckBoxControl_img1 A_CheckBoxControl_img1;
+AT_CheckBoxControl_img2 A_CheckBoxControl_img2;
+AT_ButtonControl_x A_ButtonControl_x;
+AT_ButtonControl_y A_ButtonControl_y;
+AT_Window_dragdrop A_Window_dragdrop;
+AT_ImageControl_help A_ImageControl_help;
+AT_PlayListControl_help A_PlayListControl_help;
+AT_Font_weight A_Font_weight;
+AT_ThemeInfo_author A_ThemeInfo_author;
+AT_CheckBoxControl_help A_CheckBoxControl_help;
+AT_TextControl_visible A_TextControl_visible;
+AT_ButtonControl_tooltiptext A_ButtonControl_tooltiptext;
+AT_Event_event A_Event_event;
+AT_RectangleControl_h A_RectangleControl_h;
+AT_ThemeInfo_webpage A_ThemeInfo_webpage;
+AT_CheckBoxControl_tooltiptext1 A_CheckBoxControl_tooltiptext1;
+AT_CheckBoxControl_tooltiptext2 A_CheckBoxControl_tooltiptext2;
+AT_ImageControl_id A_ImageControl_id;
+AT_CheckBoxControl_onclick1 A_CheckBoxControl_onclick1;
+AT_Font_size A_Font_size;
+AT_Bitmap_file A_Bitmap_file;
+AT_CheckBoxControl_onclick2 A_CheckBoxControl_onclick2;
+AT_Window_fadetime A_Window_fadetime;
+AT_Event_id A_Event_id;
+AT_Font_id A_Font_id;
+AT_CheckBoxControl_visible A_CheckBoxControl_visible;
+AT_Event_key A_Event_key;
+AT_ThemeInfo_email A_ThemeInfo_email;
+AT_Font_color A_Font_color;
+AT_RectangleControl_w A_RectangleControl_w;
+AT_SliderControl_tooltiptext A_SliderControl_tooltiptext;
+AT_RectangleControl_x A_RectangleControl_x;
+AT_RectangleControl_y A_RectangleControl_y;
+AT_CheckBoxControl_clickimg1 A_CheckBoxControl_clickimg1;
+AT_CheckBoxControl_clickimg2 A_CheckBoxControl_clickimg2;
+AT_Anchor_range A_Anchor_range;
+AT_PlayListControl_font A_PlayListControl_font;
+AT_TextControl_help A_TextControl_help;
+AT_RectangleControl_id A_RectangleControl_id;
+
+/* XML state. */
+#ifdef FLEX_DEBUG
+# define ENTER(state)  debug_enter(state,#state)
+# define LEAVE         debug_leave()
+# define SET(state)    debug_set(state,#state)
+  static void debug_enter(int, char*);
+  static void debug_leave(void);
+  static void debug_set(int, char*);
+#else
+# define ENTER(state)  (yy_push_state(state))
+# define LEAVE         (yy_pop_state())
+# define SET(state)    BEGIN(state)
+#endif
+
+/* Generic actions. */
+#define SKIP   /*skip*/
+#define SUCCEED        return 0
+
+#define FAIL   return fail
+static int fail(const char*, ...);
+
+/* Text buffer stack handling. */
+char bufferstack[FLEXML_BUFFERSTACKSIZE];
+char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE;
+typedef struct BufferLast_s {
+  struct BufferLast_s *old; char* saved; char new[1];
+} BufferLast;
+BufferLast* last = (BufferLast*)0;
+char* next = bufferstack;
+
+#define BUFFERSET(P)  (P = next)
+#define BUFFERPUTC(C) (assert(next<limit), *(next++) = (C))
+#define BUFFERDONE    (BUFFERPUTC('\0'))
+
+#define BUFFERLITERAL(C,P) bufferliteral(C,&(P),yytext)
+static void bufferliteral(char c, char** pp, char* text)
+{
+  char *s = strchr(text,c), *e = strrchr(text,c);
+  assert(s <= e); BUFFERSET(*pp);
+  while (++s<e) {
+    if (isspace(*s)) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
+    else BUFFERPUTC(*s);
+  } 
+  BUFFERDONE;
+}
+
+#ifdef FLEXML_HasMixed
+static void pushbuffer(char* p)
+{
+  BufferLast* l = (BufferLast*)next;
+  assert(next < limit);
+  l->old = last;
+  l->saved = p;
+  next = l->new;
+  last = l;
+}
+
+static char* popbuffer(void)
+{
+  BufferLast* l = last;
+  assert(last != (BufferLast*)0);
+  last = l->old;
+  next = (char*)l;
+  return l->saved;
+}
+#endif
+
+/* General internal entities are `unput' back onto the input stream... */
+#define ENTITYTEXT(T) \
+  { char *s = (T), *e = s+strlen(s);\
+    while (--e >= s) { unput(*e); }}
+/* Flex standard options. */
+#define YY_STACK_USED 1
+#define YY_NO_TOP_STATE 1
+#define YY_NO_INPUT 1
+/* Flex user-requested options. */
+#define YY_NO_UNPUT 1
+/* XML character classes (currently restricted to ASCII). */
+/* "Common syntactic structures." */
+/* "Names and Tokens." */
+/* Miscellaneous. */
+/* Parser states (flex `exclusive start conditions'):
+ *
+ * PROLOG      the XML prolog of the document before <?xml...>
+ * DOCTYPE     the XML prolog of the document after <?xml...>
+ * EPILOG      after the root element
+ * INCOMMENT   inside an XML comment <!--....-->
+ * INPI                inside an XML PI <?...?>
+ * VALUE1      inside a '...'-delimited literal
+ * VALUE2      inside a "..."-delimited literal
+ * CDATA       inside a <![CDATA[...]]> section.
+ * ROOT_<tag>  expect root element <tag>
+ * AL_<tag>    inside the attribute list for <tag>
+ * IN_<tag>    inside a <tag> with element contents (ready for end tag)
+ * IMPOSSIBLE  dummy to permit disabling rules; must be last
+ */
+#define PROLOG 1
+#define DOCTYPE 2
+#define EPILOG 3
+#define INCOMMENT 4
+#define INPI 5
+#define VALUE1 6
+#define VALUE2 7
+#define CDATA 8
+
+#define ROOT_Theme 9
+#define AL_Theme 10
+#define S_Theme 11
+#define S_Theme_1 12
+#define S_Theme_2 13
+#define S_Theme_3 14
+#define E_Theme 15
+
+#define ROOT_Bitmap 16
+#define AL_Bitmap 17
+#define E_Bitmap 18
+
+#define ROOT_Event 19
+#define AL_Event 20
+#define E_Event 21
+
+#define ROOT_Font 22
+#define AL_Font 23
+#define E_Font 24
+
+#define ROOT_ThemeInfo 25
+#define AL_ThemeInfo 26
+#define E_ThemeInfo 27
+
+#define ROOT_Window 28
+#define AL_Window 29
+#define S_Window 30
+#define E_Window 31
+
+#define ROOT_ControlGroup 32
+#define AL_ControlGroup 33
+#define S_ControlGroup 34
+#define S_ControlGroup_1 35
+#define S_ControlGroup_2 36
+#define E_ControlGroup 37
+
+#define ROOT_Anchor 38
+#define AL_Anchor 39
+#define E_Anchor 40
+
+#define ROOT_ImageControl 41
+#define AL_ImageControl 42
+#define E_ImageControl 43
+
+#define ROOT_RectangleControl 44
+#define AL_RectangleControl 45
+#define E_RectangleControl 46
+
+#define ROOT_ButtonControl 47
+#define AL_ButtonControl 48
+#define E_ButtonControl 49
+
+#define ROOT_CheckBoxControl 50
+#define AL_CheckBoxControl 51
+#define E_CheckBoxControl 52
+
+#define ROOT_SliderControl 53
+#define AL_SliderControl 54
+#define E_SliderControl 55
+
+#define ROOT_TextControl 56
+#define AL_TextControl 57
+#define E_TextControl 58
+
+#define ROOT_PlayListControl 59
+#define AL_PlayListControl 60
+#define S_PlayListControl 61
+#define E_PlayListControl 62
+
+#define IMPOSSIBLE 63
+
+/* State names. */
+char* statenames[IMPOSSIBLE];
+
+void FleXML_init(void)
+{
+  statenames[PROLOG] = NULL;
+  statenames[DOCTYPE] = NULL;
+  statenames[EPILOG] = NULL;
+  statenames[INCOMMENT] = NULL;
+  statenames[INPI] = NULL;
+  statenames[VALUE1] = NULL;
+  statenames[VALUE2] = NULL;
+  statenames[CDATA] = NULL;
+  statenames[ROOT_Theme] = NULL;
+  statenames[AL_Theme] = NULL;
+  statenames[S_Theme] = "Theme";
+  statenames[S_Theme_1] = "Theme";
+  statenames[S_Theme_2] = "Theme";
+  statenames[S_Theme_3] = "Theme";
+  statenames[E_Theme] = "Theme";
+  statenames[ROOT_Bitmap] = NULL;
+  statenames[AL_Bitmap] = NULL;
+  statenames[E_Bitmap] = "Bitmap";
+  statenames[ROOT_Event] = NULL;
+  statenames[AL_Event] = NULL;
+  statenames[E_Event] = "Event";
+  statenames[ROOT_Font] = NULL;
+  statenames[AL_Font] = NULL;
+  statenames[E_Font] = "Font";
+  statenames[ROOT_ThemeInfo] = NULL;
+  statenames[AL_ThemeInfo] = NULL;
+  statenames[E_ThemeInfo] = "ThemeInfo";
+  statenames[ROOT_Window] = NULL;
+  statenames[AL_Window] = NULL;
+  statenames[S_Window] = "Window";
+  statenames[E_Window] = "Window";
+  statenames[ROOT_ControlGroup] = NULL;
+  statenames[AL_ControlGroup] = NULL;
+  statenames[S_ControlGroup] = "ControlGroup";
+  statenames[S_ControlGroup_1] = "ControlGroup";
+  statenames[S_ControlGroup_2] = "ControlGroup";
+  statenames[E_ControlGroup] = "ControlGroup";
+  statenames[ROOT_Anchor] = NULL;
+  statenames[AL_Anchor] = NULL;
+  statenames[E_Anchor] = "Anchor";
+  statenames[ROOT_ImageControl] = NULL;
+  statenames[AL_ImageControl] = NULL;
+  statenames[E_ImageControl] = "ImageControl";
+  statenames[ROOT_RectangleControl] = NULL;
+  statenames[AL_RectangleControl] = NULL;
+  statenames[E_RectangleControl] = "RectangleControl";
+  statenames[ROOT_ButtonControl] = NULL;
+  statenames[AL_ButtonControl] = NULL;
+  statenames[E_ButtonControl] = "ButtonControl";
+  statenames[ROOT_CheckBoxControl] = NULL;
+  statenames[AL_CheckBoxControl] = NULL;
+  statenames[E_CheckBoxControl] = "CheckBoxControl";
+  statenames[ROOT_SliderControl] = NULL;
+  statenames[AL_SliderControl] = NULL;
+  statenames[E_SliderControl] = "SliderControl";
+  statenames[ROOT_TextControl] = NULL;
+  statenames[AL_TextControl] = NULL;
+  statenames[E_TextControl] = "TextControl";
+  statenames[ROOT_PlayListControl] = NULL;
+  statenames[AL_PlayListControl] = NULL;
+  statenames[S_PlayListControl] = "PlayListControl";
+  statenames[E_PlayListControl] = "PlayListControl";
+}
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst char * ));
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines.  This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+       if ( yy_current_buffer->yy_is_interactive ) \
+               { \
+               int c = '*', n; \
+               for ( n = 0; n < max_size && \
+                            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+                       buf[n] = (char) c; \
+               if ( c == '\n' ) \
+                       buf[n++] = (char) c; \
+               if ( c == EOF && ferror( yyin ) ) \
+                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
+               result = n; \
+               } \
+       else \
+               { \
+               errno=0; \
+               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+                       { \
+                       if( errno != EINTR) \
+                               { \
+                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
+                               break; \
+                               } \
+                       errno=0; \
+                       clearerr(yyin); \
+                       } \
+               }
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+       YY_USER_ACTION
+
+YY_DECL
+       {
+       register yy_state_type yy_current_state;
+       register char *yy_cp, *yy_bp;
+       register int yy_act;
+
+
+
+ /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */
+ SET(PROLOG); FleXML_init();
+
+ /* COMMENTS and PIs: handled uniformly for efficiency. */
+
+
+       if ( yy_init )
+               {
+               yy_init = 0;
+
+#ifdef YY_USER_INIT
+               YY_USER_INIT;
+#endif
+
+               if ( ! yy_start )
+                       yy_start = 1;   /* first start state */
+
+               if ( ! yyin )
+                       yyin = stdin;
+
+               if ( ! yyout )
+                       yyout = stdout;
+
+               if ( ! yy_current_buffer )
+                       yy_current_buffer =
+                               yy_create_buffer( yyin, YY_BUF_SIZE );
+
+               yy_load_buffer_state();
+               }
+
+       while ( 1 )             /* loops until end-of-file is reached */
+               {
+               yy_cp = yy_c_buf_p;
+
+               /* Support of yytext. */
+               *yy_cp = yy_hold_char;
+
+               /* yy_bp points to the position in yy_ch_buf of the start of
+                * the current run.
+                */
+               yy_bp = yy_cp;
+
+               yy_current_state = yy_start;
+yy_match:
+               do
+                       {
+                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+                       if ( yy_accept[yy_current_state] )
+                               {
+                               yy_last_accepting_state = yy_current_state;
+                               yy_last_accepting_cpos = yy_cp;
+                               }
+                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                               {
+                               yy_current_state = (int) yy_def[yy_current_state];
+                               if ( yy_current_state >= 2442 )
+                                       yy_c = yy_meta[(unsigned int) yy_c];
+                               }
+                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+                       ++yy_cp;
+                       }
+               while ( yy_current_state != 2441 );
+               yy_cp = yy_last_accepting_cpos;
+               yy_current_state = yy_last_accepting_state;
+
+yy_find_action:
+               yy_act = yy_accept[yy_current_state];
+
+               YY_DO_BEFORE_ACTION;
+
+
+do_action:     /* This label is used only to access EOF actions. */
+
+
+               switch ( yy_act )
+       { /* beginning of action switch */
+                       case 0: /* must back up */
+                       /* undo the effects of YY_DO_BEFORE_ACTION */
+                       *yy_cp = yy_hold_char;
+                       yy_cp = yy_last_accepting_cpos;
+                       yy_current_state = yy_last_accepting_state;
+                       goto yy_find_action;
+
+
+case 1:
+YY_RULE_SETUP
+ENTER(INCOMMENT);
+       YY_BREAK
+case 2:
+YY_RULE_SETUP
+ENTER(INPI);
+       YY_BREAK
+
+
+case 3:
+YY_RULE_SETUP
+LEAVE;
+       YY_BREAK
+case 4:
+case 5:
+case 6:
+YY_RULE_SETUP
+SKIP;
+       YY_BREAK
+case YY_STATE_EOF(INCOMMENT):
+FAIL("EOF in comment.");
+       YY_BREAK
+
+
+case 7:
+YY_RULE_SETUP
+LEAVE;
+       YY_BREAK
+case 8:
+case 9:
+YY_RULE_SETUP
+SKIP;
+       YY_BREAK
+case YY_STATE_EOF(INPI):
+FAIL("EOF in PI (processing instruction).");
+       YY_BREAK
+
+/* SPACES: skipped uniformly */
+case 10:
+YY_RULE_SETUP
+SKIP;
+       YY_BREAK
+/* PROLOG: determine root element and process it. */
+
+case 11:
+YY_RULE_SETUP
+SET(DOCTYPE);
+       YY_BREAK
+case 12:
+YY_RULE_SETUP
+FAIL("Bad declaration %s.",yytext);
+       YY_BREAK
+
+
+case 13:
+YY_RULE_SETUP
+SET(ROOT_ButtonControl);
+       YY_BREAK
+case 14:
+YY_RULE_SETUP
+SET(ROOT_Event);
+       YY_BREAK
+case 15:
+YY_RULE_SETUP
+SET(ROOT_RectangleControl);
+       YY_BREAK
+case 16:
+YY_RULE_SETUP
+SET(ROOT_Font);
+       YY_BREAK
+case 17:
+YY_RULE_SETUP
+SET(ROOT_Theme);
+       YY_BREAK
+case 18:
+YY_RULE_SETUP
+SET(ROOT_Anchor);
+       YY_BREAK
+case 19:
+YY_RULE_SETUP
+SET(ROOT_ThemeInfo);
+       YY_BREAK
+case 20:
+YY_RULE_SETUP
+SET(ROOT_ControlGroup);
+       YY_BREAK
+case 21:
+YY_RULE_SETUP
+SET(ROOT_Window);
+       YY_BREAK
+case 22:
+YY_RULE_SETUP
+SET(ROOT_Bitmap);
+       YY_BREAK
+case 23:
+YY_RULE_SETUP
+SET(ROOT_ImageControl);
+       YY_BREAK
+case 24:
+YY_RULE_SETUP
+SET(ROOT_CheckBoxControl);
+       YY_BREAK
+case 25:
+YY_RULE_SETUP
+SET(ROOT_SliderControl);
+       YY_BREAK
+case 26:
+YY_RULE_SETUP
+SET(ROOT_PlayListControl);
+       YY_BREAK
+case 27:
+YY_RULE_SETUP
+SET(ROOT_TextControl);
+       YY_BREAK
+case 28:
+YY_RULE_SETUP
+FAIL("Bad declaration %s.",yytext);
+       YY_BREAK
+case 29:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in prolog.", yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(PROLOG):
+case YY_STATE_EOF(DOCTYPE):
+FAIL("EOF in prolog.");
+       YY_BREAK
+
+/* RULES DERIVED FROM DTD. */
+/* <!--
+  *  *****************************************************************************
+  *  * skin.dtd: DTD for the VLC skins
+  *  *****************************************************************************
+  *  * Copyright (C) 2003 VideoLAN
+  *  * $Id: flex.c,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+  *  *
+  *  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+  *  *          Emmanuel Puig    <karibu@via.ecp.fr>
+  *  *
+  *  * 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,
+  *  * USA.
+  *  *****************************************************************************
+  * -->  */
+/*         magnet      CDATA   "9"
+  *         log         CDATA   "false"
+  *     >  */
+case 30:
+YY_RULE_SETUP
+{
+  A_Theme_magnet = "9";
+  A_Theme_log = "false";
+  ENTER(AL_Theme);
+}
+       YY_BREAK
+
+case 31:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Theme_magnet);
+       YY_BREAK
+case 32:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Theme_magnet);
+       YY_BREAK
+case 33:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Theme_log);
+       YY_BREAK
+case 34:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Theme_log);
+       YY_BREAK
+case 35:
+YY_RULE_SETUP
+{
+  LEAVE; STag_Theme(); pcdata = NULL; ENTER(S_Theme);
+ }
+       YY_BREAK
+case 36:
+YY_RULE_SETUP
+FAIL("`Theme' element cannot be empty.");
+       YY_BREAK
+case 37:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of Theme element.", yytext[0]);
+       YY_BREAK
+case 38:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `Theme' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_Theme):
+FAIL("EOF in attribute list of `Theme' element.");
+       YY_BREAK
+
+
+case 39:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_Theme();
+  switch (YY_START) {
+   case ROOT_Theme: SET(EPILOG); break;
+  }
+ }
+       YY_BREAK
+case 40:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</Theme>' expected.",yytext);
+       YY_BREAK
+case 41:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</Theme>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(S_Theme_1):
+case YY_STATE_EOF(E_Theme):
+case YY_STATE_EOF(S_Theme_3):
+FAIL("Premature EOF: `</Theme>' expected.");
+       YY_BREAK
+
+/* <!-- main elements -->  */
+/*         id          CDATA   #REQUIRED
+  *         file        CDATA   #REQUIRED
+  *         alphacolor  CDATA   #REQUIRED
+  *     >  */
+case 42:
+YY_RULE_SETUP
+{
+  A_Bitmap_id = NULL;
+  A_Bitmap_file = NULL;
+  A_Bitmap_alphacolor = NULL;
+  ENTER(AL_Bitmap);
+}
+       YY_BREAK
+
+case 43:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Bitmap_id);
+       YY_BREAK
+case 44:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Bitmap_id);
+       YY_BREAK
+case 45:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Bitmap_file);
+       YY_BREAK
+case 46:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Bitmap_file);
+       YY_BREAK
+case 47:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Bitmap_alphacolor);
+       YY_BREAK
+case 48:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Bitmap_alphacolor);
+       YY_BREAK
+case 49:
+YY_RULE_SETUP
+{
+  if (!A_Bitmap_id) FAIL("Required attribute `id' not set for `Bitmap' element.");
+  if (!A_Bitmap_file) FAIL("Required attribute `file' not set for `Bitmap' element.");
+  if (!A_Bitmap_alphacolor) FAIL("Required attribute `alphacolor' not set for `Bitmap' element.");
+  LEAVE; STag_Bitmap(); pcdata = NULL; ENTER(E_Bitmap);
+ }
+       YY_BREAK
+case 50:
+YY_RULE_SETUP
+{
+  if (!A_Bitmap_id) FAIL("Required attribute `id' not set for `Bitmap' element.");
+  if (!A_Bitmap_file) FAIL("Required attribute `file' not set for `Bitmap' element.");
+  if (!A_Bitmap_alphacolor) FAIL("Required attribute `alphacolor' not set for `Bitmap' element.");
+  LEAVE; STag_Bitmap(); pcdata = NULL; ETag_Bitmap();
+  switch (YY_START) {
+   case ROOT_Bitmap: SET(EPILOG); break;
+   case S_Theme_1: case S_Theme_2: case S_Theme_3: SET(S_Theme_3); break;
+  }
+ }
+       YY_BREAK
+case 51:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of Bitmap element.", yytext[0]);
+       YY_BREAK
+case 52:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `Bitmap' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_Bitmap):
+FAIL("EOF in attribute list of `Bitmap' element.");
+       YY_BREAK
+
+
+case 53:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_Bitmap();
+  switch (YY_START) {
+   case ROOT_Bitmap: SET(EPILOG); break;
+   case S_Theme_1: case S_Theme_2: case S_Theme_3: SET(S_Theme_3); break;
+  }
+ }
+       YY_BREAK
+case 54:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</Bitmap>' expected.",yytext);
+       YY_BREAK
+case 55:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</Bitmap>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_Bitmap):
+FAIL("Premature EOF: `</Bitmap>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   #REQUIRED
+  *         event       CDATA   #REQUIRED
+  *         key         CDATA   "none"
+  *     >  */
+case 56:
+YY_RULE_SETUP
+{
+  A_Event_id = NULL;
+  A_Event_event = NULL;
+  A_Event_key = "none";
+  ENTER(AL_Event);
+}
+       YY_BREAK
+
+case 57:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Event_id);
+       YY_BREAK
+case 58:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Event_id);
+       YY_BREAK
+case 59:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Event_event);
+       YY_BREAK
+case 60:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Event_event);
+       YY_BREAK
+case 61:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Event_key);
+       YY_BREAK
+case 62:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Event_key);
+       YY_BREAK
+case 63:
+YY_RULE_SETUP
+{
+  if (!A_Event_id) FAIL("Required attribute `id' not set for `Event' element.");
+  if (!A_Event_event) FAIL("Required attribute `event' not set for `Event' element.");
+  LEAVE; STag_Event(); pcdata = NULL; ENTER(E_Event);
+ }
+       YY_BREAK
+case 64:
+YY_RULE_SETUP
+{
+  if (!A_Event_id) FAIL("Required attribute `id' not set for `Event' element.");
+  if (!A_Event_event) FAIL("Required attribute `event' not set for `Event' element.");
+  LEAVE; STag_Event(); pcdata = NULL; ETag_Event();
+  switch (YY_START) {
+   case ROOT_Event: SET(EPILOG); break;
+   case S_Theme_1: case S_Theme_2: case S_Theme_3: SET(S_Theme_3); break;
+  }
+ }
+       YY_BREAK
+case 65:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of Event element.", yytext[0]);
+       YY_BREAK
+case 66:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `Event' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_Event):
+FAIL("EOF in attribute list of `Event' element.");
+       YY_BREAK
+
+
+case 67:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_Event();
+  switch (YY_START) {
+   case ROOT_Event: SET(EPILOG); break;
+   case S_Theme_1: case S_Theme_2: case S_Theme_3: SET(S_Theme_3); break;
+  }
+ }
+       YY_BREAK
+case 68:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</Event>' expected.",yytext);
+       YY_BREAK
+case 69:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</Event>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_Event):
+FAIL("Premature EOF: `</Event>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   "default"
+  *         font        CDATA   "arial"
+  *         size        CDATA   "12"
+  *         color       CDATA   "#000000"
+  *         weight      CDATA   "400"
+  *         italic      CDATA   "false"
+  *         underline   CDATA   "false"
+  *     >  */
+case 70:
+YY_RULE_SETUP
+{
+  A_Font_id = "default";
+  A_Font_font = "arial";
+  A_Font_size = "12";
+  A_Font_color = "#000000";
+  A_Font_weight = "400";
+  A_Font_italic = "false";
+  A_Font_underline = "false";
+  ENTER(AL_Font);
+}
+       YY_BREAK
+
+case 71:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Font_id);
+       YY_BREAK
+case 72:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Font_id);
+       YY_BREAK
+case 73:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Font_font);
+       YY_BREAK
+case 74:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Font_font);
+       YY_BREAK
+case 75:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Font_size);
+       YY_BREAK
+case 76:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Font_size);
+       YY_BREAK
+case 77:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Font_color);
+       YY_BREAK
+case 78:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Font_color);
+       YY_BREAK
+case 79:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Font_weight);
+       YY_BREAK
+case 80:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Font_weight);
+       YY_BREAK
+case 81:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Font_italic);
+       YY_BREAK
+case 82:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Font_italic);
+       YY_BREAK
+case 83:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Font_underline);
+       YY_BREAK
+case 84:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Font_underline);
+       YY_BREAK
+case 85:
+YY_RULE_SETUP
+{
+  LEAVE; STag_Font(); pcdata = NULL; ENTER(E_Font);
+ }
+       YY_BREAK
+case 86:
+YY_RULE_SETUP
+{
+  LEAVE; STag_Font(); pcdata = NULL; ETag_Font();
+  switch (YY_START) {
+   case ROOT_Font: SET(EPILOG); break;
+   case S_Theme_1: case S_Theme_2: case S_Theme_3: SET(S_Theme_3); break;
+  }
+ }
+       YY_BREAK
+case 87:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of Font element.", yytext[0]);
+       YY_BREAK
+case 88:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `Font' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_Font):
+FAIL("EOF in attribute list of `Font' element.");
+       YY_BREAK
+
+
+case 89:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_Font();
+  switch (YY_START) {
+   case ROOT_Font: SET(EPILOG); break;
+   case S_Theme_1: case S_Theme_2: case S_Theme_3: SET(S_Theme_3); break;
+  }
+ }
+       YY_BREAK
+case 90:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</Font>' expected.",yytext);
+       YY_BREAK
+case 91:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</Font>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_Font):
+FAIL("Premature EOF: `</Font>' expected.");
+       YY_BREAK
+
+/*         name        CDATA   #IMPLIED
+  *         author      CDATA   #IMPLIED
+  *         email       CDATA   #IMPLIED
+  *         webpage     CDATA   #IMPLIED
+  *     >  */
+case 92:
+YY_RULE_SETUP
+{
+  A_ThemeInfo_name = NULL;
+  A_ThemeInfo_author = NULL;
+  A_ThemeInfo_email = NULL;
+  A_ThemeInfo_webpage = NULL;
+  ENTER(AL_ThemeInfo);
+}
+       YY_BREAK
+
+case 93:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ThemeInfo_name);
+       YY_BREAK
+case 94:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ThemeInfo_name);
+       YY_BREAK
+case 95:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ThemeInfo_author);
+       YY_BREAK
+case 96:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ThemeInfo_author);
+       YY_BREAK
+case 97:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ThemeInfo_email);
+       YY_BREAK
+case 98:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ThemeInfo_email);
+       YY_BREAK
+case 99:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ThemeInfo_webpage);
+       YY_BREAK
+case 100:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ThemeInfo_webpage);
+       YY_BREAK
+case 101:
+YY_RULE_SETUP
+{
+  LEAVE; STag_ThemeInfo(); pcdata = NULL; ENTER(E_ThemeInfo);
+ }
+       YY_BREAK
+case 102:
+YY_RULE_SETUP
+{
+  LEAVE; STag_ThemeInfo(); pcdata = NULL; ETag_ThemeInfo();
+  switch (YY_START) {
+   case ROOT_ThemeInfo: SET(EPILOG); break;
+   case S_Theme: SET(S_Theme_1); break;
+  }
+ }
+       YY_BREAK
+case 103:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of ThemeInfo element.", yytext[0]);
+       YY_BREAK
+case 104:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `ThemeInfo' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_ThemeInfo):
+FAIL("EOF in attribute list of `ThemeInfo' element.");
+       YY_BREAK
+
+
+case 105:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_ThemeInfo();
+  switch (YY_START) {
+   case ROOT_ThemeInfo: SET(EPILOG); break;
+   case S_Theme: SET(S_Theme_1); break;
+  }
+ }
+       YY_BREAK
+case 106:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</ThemeInfo>' expected.",yytext);
+       YY_BREAK
+case 107:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</ThemeInfo>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_ThemeInfo):
+FAIL("Premature EOF: `</ThemeInfo>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   #REQUIRED
+  *         visible     CDATA   "true"
+  *         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         fadetime    CDATA   "500"
+  *         alpha       CDATA   "255"
+  *         movealpha   CDATA   "255"
+  *         dragdrop    CDATA   "true"
+  *     >  */
+case 108:
+YY_RULE_SETUP
+{
+  A_Window_id = NULL;
+  A_Window_visible = "true";
+  A_Window_x = "\0";
+  A_Window_y = "\0";
+  A_Window_fadetime = "500";
+  A_Window_alpha = "255";
+  A_Window_movealpha = "255";
+  A_Window_dragdrop = "true";
+  ENTER(AL_Window);
+}
+       YY_BREAK
+
+case 109:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_id);
+       YY_BREAK
+case 110:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_id);
+       YY_BREAK
+case 111:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_visible);
+       YY_BREAK
+case 112:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_visible);
+       YY_BREAK
+case 113:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_x);
+       YY_BREAK
+case 114:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_x);
+       YY_BREAK
+case 115:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_y);
+       YY_BREAK
+case 116:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_y);
+       YY_BREAK
+case 117:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_fadetime);
+       YY_BREAK
+case 118:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_fadetime);
+       YY_BREAK
+case 119:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_alpha);
+       YY_BREAK
+case 120:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_alpha);
+       YY_BREAK
+case 121:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_movealpha);
+       YY_BREAK
+case 122:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_movealpha);
+       YY_BREAK
+case 123:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Window_dragdrop);
+       YY_BREAK
+case 124:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Window_dragdrop);
+       YY_BREAK
+case 125:
+YY_RULE_SETUP
+{
+  if (!A_Window_id) FAIL("Required attribute `id' not set for `Window' element.");
+  LEAVE; STag_Window(); pcdata = NULL; ENTER(S_Window);
+ }
+       YY_BREAK
+case 126:
+YY_RULE_SETUP
+FAIL("`Window' element cannot be empty.");
+       YY_BREAK
+case 127:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of Window element.", yytext[0]);
+       YY_BREAK
+case 128:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `Window' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_Window):
+FAIL("EOF in attribute list of `Window' element.");
+       YY_BREAK
+
+
+case 129:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_Window();
+  switch (YY_START) {
+   case ROOT_Window: SET(EPILOG); break;
+   case S_Theme_1: case S_Theme_2: case S_Theme_3: SET(S_Theme_3); break;
+  }
+ }
+       YY_BREAK
+case 130:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</Window>' expected.",yytext);
+       YY_BREAK
+case 131:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</Window>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_Window):
+FAIL("Premature EOF: `</Window>' expected.");
+       YY_BREAK
+
+/*                         SliderControl|TextControl|CheckBoxControl|
+  *                         RectangleControl|Anchor)+>  */
+/*         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *     >  */
+case 132:
+YY_RULE_SETUP
+{
+  A_ControlGroup_x = "\0";
+  A_ControlGroup_y = "\0";
+  ENTER(AL_ControlGroup);
+}
+       YY_BREAK
+
+case 133:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ControlGroup_x);
+       YY_BREAK
+case 134:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ControlGroup_x);
+       YY_BREAK
+case 135:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ControlGroup_y);
+       YY_BREAK
+case 136:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ControlGroup_y);
+       YY_BREAK
+case 137:
+YY_RULE_SETUP
+{
+  LEAVE; STag_ControlGroup(); pcdata = NULL; ENTER(S_ControlGroup);
+ }
+       YY_BREAK
+case 138:
+YY_RULE_SETUP
+FAIL("`ControlGroup' element cannot be empty.");
+       YY_BREAK
+case 139:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of ControlGroup element.", yytext[0]);
+       YY_BREAK
+case 140:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `ControlGroup' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_ControlGroup):
+FAIL("EOF in attribute list of `ControlGroup' element.");
+       YY_BREAK
+
+
+case 141:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_ControlGroup();
+  switch (YY_START) {
+   case ROOT_ControlGroup: SET(EPILOG); break;
+   case S_Window: SET(E_Window); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 142:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</ControlGroup>' expected.",yytext);
+       YY_BREAK
+case 143:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</ControlGroup>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_ControlGroup):
+case YY_STATE_EOF(S_ControlGroup_2):
+FAIL("Premature EOF: `</ControlGroup>' expected.");
+       YY_BREAK
+
+/* <!-- Anchors -->  */
+/*         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         priority    CDATA   #REQUIRED
+  *         range       CDATA   "10"
+  *     >  */
+case 144:
+YY_RULE_SETUP
+{
+  A_Anchor_x = "\0";
+  A_Anchor_y = "\0";
+  A_Anchor_priority = NULL;
+  A_Anchor_range = "10";
+  ENTER(AL_Anchor);
+}
+       YY_BREAK
+
+case 145:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Anchor_x);
+       YY_BREAK
+case 146:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Anchor_x);
+       YY_BREAK
+case 147:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Anchor_y);
+       YY_BREAK
+case 148:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Anchor_y);
+       YY_BREAK
+case 149:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Anchor_priority);
+       YY_BREAK
+case 150:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Anchor_priority);
+       YY_BREAK
+case 151:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_Anchor_range);
+       YY_BREAK
+case 152:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_Anchor_range);
+       YY_BREAK
+case 153:
+YY_RULE_SETUP
+{
+  if (!A_Anchor_priority) FAIL("Required attribute `priority' not set for `Anchor' element.");
+  LEAVE; STag_Anchor(); pcdata = NULL; ENTER(E_Anchor);
+ }
+       YY_BREAK
+case 154:
+YY_RULE_SETUP
+{
+  if (!A_Anchor_priority) FAIL("Required attribute `priority' not set for `Anchor' element.");
+  LEAVE; STag_Anchor(); pcdata = NULL; ETag_Anchor();
+  switch (YY_START) {
+   case ROOT_Anchor: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 155:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of Anchor element.", yytext[0]);
+       YY_BREAK
+case 156:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `Anchor' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_Anchor):
+FAIL("EOF in attribute list of `Anchor' element.");
+       YY_BREAK
+
+
+case 157:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_Anchor();
+  switch (YY_START) {
+   case ROOT_Anchor: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 158:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</Anchor>' expected.",yytext);
+       YY_BREAK
+case 159:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</Anchor>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_Anchor):
+FAIL("Premature EOF: `</Anchor>' expected.");
+       YY_BREAK
+
+/* <!-- Controls -->  */
+/*         id          CDATA   "none"
+  *         visible     CDATA   "true"
+  *         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         image       CDATA   #REQUIRED
+  *         onclick     CDATA   "none"
+  *         help        CDATA   "\0"
+  *     >  */
+case 160:
+YY_RULE_SETUP
+{
+  A_ImageControl_id = "none";
+  A_ImageControl_visible = "true";
+  A_ImageControl_x = "\0";
+  A_ImageControl_y = "\0";
+  A_ImageControl_image = NULL;
+  A_ImageControl_onclick = "none";
+  A_ImageControl_help = "\0";
+  ENTER(AL_ImageControl);
+}
+       YY_BREAK
+
+case 161:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ImageControl_id);
+       YY_BREAK
+case 162:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ImageControl_id);
+       YY_BREAK
+case 163:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ImageControl_visible);
+       YY_BREAK
+case 164:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ImageControl_visible);
+       YY_BREAK
+case 165:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ImageControl_x);
+       YY_BREAK
+case 166:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ImageControl_x);
+       YY_BREAK
+case 167:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ImageControl_y);
+       YY_BREAK
+case 168:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ImageControl_y);
+       YY_BREAK
+case 169:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ImageControl_image);
+       YY_BREAK
+case 170:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ImageControl_image);
+       YY_BREAK
+case 171:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ImageControl_onclick);
+       YY_BREAK
+case 172:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ImageControl_onclick);
+       YY_BREAK
+case 173:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ImageControl_help);
+       YY_BREAK
+case 174:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ImageControl_help);
+       YY_BREAK
+case 175:
+YY_RULE_SETUP
+{
+  if (!A_ImageControl_image) FAIL("Required attribute `image' not set for `ImageControl' element.");
+  LEAVE; STag_ImageControl(); pcdata = NULL; ENTER(E_ImageControl);
+ }
+       YY_BREAK
+case 176:
+YY_RULE_SETUP
+{
+  if (!A_ImageControl_image) FAIL("Required attribute `image' not set for `ImageControl' element.");
+  LEAVE; STag_ImageControl(); pcdata = NULL; ETag_ImageControl();
+  switch (YY_START) {
+   case ROOT_ImageControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 177:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of ImageControl element.", yytext[0]);
+       YY_BREAK
+case 178:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `ImageControl' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_ImageControl):
+FAIL("EOF in attribute list of `ImageControl' element.");
+       YY_BREAK
+
+
+case 179:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_ImageControl();
+  switch (YY_START) {
+   case ROOT_ImageControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 180:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</ImageControl>' expected.",yytext);
+       YY_BREAK
+case 181:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</ImageControl>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_ImageControl):
+FAIL("Premature EOF: `</ImageControl>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   "none"
+  *         visible     CDATA   "true"
+  *         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         w           CDATA   "50"
+  *         h           CDATA   "50"
+  *         color       CDATA   "#C0C0C0"
+  *         onclick     CDATA   "none"
+  *         help        CDATA   "\0"
+  *     >  */
+case 182:
+YY_RULE_SETUP
+{
+  A_RectangleControl_id = "none";
+  A_RectangleControl_visible = "true";
+  A_RectangleControl_x = "\0";
+  A_RectangleControl_y = "\0";
+  A_RectangleControl_w = "50";
+  A_RectangleControl_h = "50";
+  A_RectangleControl_color = "#C0C0C0";
+  A_RectangleControl_onclick = "none";
+  A_RectangleControl_help = "\0";
+  ENTER(AL_RectangleControl);
+}
+       YY_BREAK
+
+case 183:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_id);
+       YY_BREAK
+case 184:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_id);
+       YY_BREAK
+case 185:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_visible);
+       YY_BREAK
+case 186:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_visible);
+       YY_BREAK
+case 187:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_x);
+       YY_BREAK
+case 188:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_x);
+       YY_BREAK
+case 189:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_y);
+       YY_BREAK
+case 190:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_y);
+       YY_BREAK
+case 191:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_w);
+       YY_BREAK
+case 192:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_w);
+       YY_BREAK
+case 193:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_h);
+       YY_BREAK
+case 194:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_h);
+       YY_BREAK
+case 195:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_color);
+       YY_BREAK
+case 196:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_color);
+       YY_BREAK
+case 197:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_onclick);
+       YY_BREAK
+case 198:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_onclick);
+       YY_BREAK
+case 199:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_RectangleControl_help);
+       YY_BREAK
+case 200:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_RectangleControl_help);
+       YY_BREAK
+case 201:
+YY_RULE_SETUP
+{
+  LEAVE; STag_RectangleControl(); pcdata = NULL; ENTER(E_RectangleControl);
+ }
+       YY_BREAK
+case 202:
+YY_RULE_SETUP
+{
+  LEAVE; STag_RectangleControl(); pcdata = NULL; ETag_RectangleControl();
+  switch (YY_START) {
+   case ROOT_RectangleControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 203:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of RectangleControl element.", yytext[0]);
+       YY_BREAK
+case 204:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `RectangleControl' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_RectangleControl):
+FAIL("EOF in attribute list of `RectangleControl' element.");
+       YY_BREAK
+
+
+case 205:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_RectangleControl();
+  switch (YY_START) {
+   case ROOT_RectangleControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 206:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</RectangleControl>' expected.",yytext);
+       YY_BREAK
+case 207:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</RectangleControl>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_RectangleControl):
+FAIL("Premature EOF: `</RectangleControl>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   "none"
+  *         visible     CDATA   "true"
+  *         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         up          CDATA   #REQUIRED
+  *         down        CDATA   #REQUIRED
+  *         disabled    CDATA   "none"
+  *         onclick     CDATA   "none"
+  *         tooltiptext CDATA   "none"
+  *         help        CDATA   "\0"
+  *     >  */
+case 208:
+YY_RULE_SETUP
+{
+  A_ButtonControl_id = "none";
+  A_ButtonControl_visible = "true";
+  A_ButtonControl_x = "\0";
+  A_ButtonControl_y = "\0";
+  A_ButtonControl_up = NULL;
+  A_ButtonControl_down = NULL;
+  A_ButtonControl_disabled = "none";
+  A_ButtonControl_onclick = "none";
+  A_ButtonControl_tooltiptext = "none";
+  A_ButtonControl_help = "\0";
+  ENTER(AL_ButtonControl);
+}
+       YY_BREAK
+
+case 209:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_id);
+       YY_BREAK
+case 210:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_id);
+       YY_BREAK
+case 211:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_visible);
+       YY_BREAK
+case 212:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_visible);
+       YY_BREAK
+case 213:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_x);
+       YY_BREAK
+case 214:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_x);
+       YY_BREAK
+case 215:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_y);
+       YY_BREAK
+case 216:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_y);
+       YY_BREAK
+case 217:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_up);
+       YY_BREAK
+case 218:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_up);
+       YY_BREAK
+case 219:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_down);
+       YY_BREAK
+case 220:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_down);
+       YY_BREAK
+case 221:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_disabled);
+       YY_BREAK
+case 222:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_disabled);
+       YY_BREAK
+case 223:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_onclick);
+       YY_BREAK
+case 224:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_onclick);
+       YY_BREAK
+case 225:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_tooltiptext);
+       YY_BREAK
+case 226:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_tooltiptext);
+       YY_BREAK
+case 227:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_ButtonControl_help);
+       YY_BREAK
+case 228:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_ButtonControl_help);
+       YY_BREAK
+case 229:
+YY_RULE_SETUP
+{
+  if (!A_ButtonControl_up) FAIL("Required attribute `up' not set for `ButtonControl' element.");
+  if (!A_ButtonControl_down) FAIL("Required attribute `down' not set for `ButtonControl' element.");
+  LEAVE; STag_ButtonControl(); pcdata = NULL; ENTER(E_ButtonControl);
+ }
+       YY_BREAK
+case 230:
+YY_RULE_SETUP
+{
+  if (!A_ButtonControl_up) FAIL("Required attribute `up' not set for `ButtonControl' element.");
+  if (!A_ButtonControl_down) FAIL("Required attribute `down' not set for `ButtonControl' element.");
+  LEAVE; STag_ButtonControl(); pcdata = NULL; ETag_ButtonControl();
+  switch (YY_START) {
+   case ROOT_ButtonControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 231:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of ButtonControl element.", yytext[0]);
+       YY_BREAK
+case 232:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `ButtonControl' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_ButtonControl):
+FAIL("EOF in attribute list of `ButtonControl' element.");
+       YY_BREAK
+
+
+case 233:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_ButtonControl();
+  switch (YY_START) {
+   case ROOT_ButtonControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 234:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</ButtonControl>' expected.",yytext);
+       YY_BREAK
+case 235:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</ButtonControl>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_ButtonControl):
+FAIL("Premature EOF: `</ButtonControl>' expected.");
+       YY_BREAK
+
+/*         id           CDATA   "none"
+  *         visible      CDATA   "true"
+  *         x            CDATA   "\0"
+  *         y            CDATA   "\0"
+  *         img1         CDATA   #REQUIRED
+  *         clickimg1    CDATA   "none"
+  *         img2         CDATA   #REQUIRED
+  *         clickimg2    CDATA   "none"
+  *         disabled1    CDATA   "none"
+  *         disabled2    CDATA   "none"
+  *         onclick1     CDATA   "none"
+  *         onclick2     CDATA   "none"
+  *         tooltiptext1 CDATA   "none"
+  *         tooltiptext2 CDATA   "none"
+  *         help         CDATA   "\0"
+  *     >  */
+case 236:
+YY_RULE_SETUP
+{
+  A_CheckBoxControl_id = "none";
+  A_CheckBoxControl_visible = "true";
+  A_CheckBoxControl_x = "\0";
+  A_CheckBoxControl_y = "\0";
+  A_CheckBoxControl_img1 = NULL;
+  A_CheckBoxControl_clickimg1 = "none";
+  A_CheckBoxControl_img2 = NULL;
+  A_CheckBoxControl_clickimg2 = "none";
+  A_CheckBoxControl_disabled1 = "none";
+  A_CheckBoxControl_disabled2 = "none";
+  A_CheckBoxControl_onclick1 = "none";
+  A_CheckBoxControl_onclick2 = "none";
+  A_CheckBoxControl_tooltiptext1 = "none";
+  A_CheckBoxControl_tooltiptext2 = "none";
+  A_CheckBoxControl_help = "\0";
+  ENTER(AL_CheckBoxControl);
+}
+       YY_BREAK
+
+case 237:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_id);
+       YY_BREAK
+case 238:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_id);
+       YY_BREAK
+case 239:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_visible);
+       YY_BREAK
+case 240:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_visible);
+       YY_BREAK
+case 241:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_x);
+       YY_BREAK
+case 242:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_x);
+       YY_BREAK
+case 243:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_y);
+       YY_BREAK
+case 244:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_y);
+       YY_BREAK
+case 245:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_img1);
+       YY_BREAK
+case 246:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_img1);
+       YY_BREAK
+case 247:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_clickimg1);
+       YY_BREAK
+case 248:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_clickimg1);
+       YY_BREAK
+case 249:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_img2);
+       YY_BREAK
+case 250:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_img2);
+       YY_BREAK
+case 251:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_clickimg2);
+       YY_BREAK
+case 252:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_clickimg2);
+       YY_BREAK
+case 253:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_disabled1);
+       YY_BREAK
+case 254:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_disabled1);
+       YY_BREAK
+case 255:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_disabled2);
+       YY_BREAK
+case 256:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_disabled2);
+       YY_BREAK
+case 257:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_onclick1);
+       YY_BREAK
+case 258:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_onclick1);
+       YY_BREAK
+case 259:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_onclick2);
+       YY_BREAK
+case 260:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_onclick2);
+       YY_BREAK
+case 261:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_tooltiptext1);
+       YY_BREAK
+case 262:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_tooltiptext1);
+       YY_BREAK
+case 263:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_tooltiptext2);
+       YY_BREAK
+case 264:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_tooltiptext2);
+       YY_BREAK
+case 265:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_CheckBoxControl_help);
+       YY_BREAK
+case 266:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_CheckBoxControl_help);
+       YY_BREAK
+case 267:
+YY_RULE_SETUP
+{
+  if (!A_CheckBoxControl_img1) FAIL("Required attribute `img1' not set for `CheckBoxControl' element.");
+  if (!A_CheckBoxControl_img2) FAIL("Required attribute `img2' not set for `CheckBoxControl' element.");
+  LEAVE; STag_CheckBoxControl(); pcdata = NULL; ENTER(E_CheckBoxControl);
+ }
+       YY_BREAK
+case 268:
+YY_RULE_SETUP
+{
+  if (!A_CheckBoxControl_img1) FAIL("Required attribute `img1' not set for `CheckBoxControl' element.");
+  if (!A_CheckBoxControl_img2) FAIL("Required attribute `img2' not set for `CheckBoxControl' element.");
+  LEAVE; STag_CheckBoxControl(); pcdata = NULL; ETag_CheckBoxControl();
+  switch (YY_START) {
+   case ROOT_CheckBoxControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 269:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of CheckBoxControl element.", yytext[0]);
+       YY_BREAK
+case 270:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `CheckBoxControl' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_CheckBoxControl):
+FAIL("EOF in attribute list of `CheckBoxControl' element.");
+       YY_BREAK
+
+
+case 271:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_CheckBoxControl();
+  switch (YY_START) {
+   case ROOT_CheckBoxControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 272:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</CheckBoxControl>' expected.",yytext);
+       YY_BREAK
+case 273:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</CheckBoxControl>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_CheckBoxControl):
+FAIL("Premature EOF: `</CheckBoxControl>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   "none"
+  *         visible     CDATA   "true"
+  *         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         type        CDATA   "time"
+  *         up          CDATA   #REQUIRED
+  *         down        CDATA   #REQUIRED
+  *         abs         CDATA   #REQUIRED
+  *         ord         CDATA   #REQUIRED
+  *         tooltiptext CDATA   "none"
+  *         help        CDATA   "\0"
+  *     >  */
+case 274:
+YY_RULE_SETUP
+{
+  A_SliderControl_id = "none";
+  A_SliderControl_visible = "true";
+  A_SliderControl_x = "\0";
+  A_SliderControl_y = "\0";
+  A_SliderControl_type = "time";
+  A_SliderControl_up = NULL;
+  A_SliderControl_down = NULL;
+  A_SliderControl_abs = NULL;
+  A_SliderControl_ord = NULL;
+  A_SliderControl_tooltiptext = "none";
+  A_SliderControl_help = "\0";
+  ENTER(AL_SliderControl);
+}
+       YY_BREAK
+
+case 275:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_id);
+       YY_BREAK
+case 276:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_id);
+       YY_BREAK
+case 277:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_visible);
+       YY_BREAK
+case 278:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_visible);
+       YY_BREAK
+case 279:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_x);
+       YY_BREAK
+case 280:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_x);
+       YY_BREAK
+case 281:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_y);
+       YY_BREAK
+case 282:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_y);
+       YY_BREAK
+case 283:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_type);
+       YY_BREAK
+case 284:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_type);
+       YY_BREAK
+case 285:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_up);
+       YY_BREAK
+case 286:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_up);
+       YY_BREAK
+case 287:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_down);
+       YY_BREAK
+case 288:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_down);
+       YY_BREAK
+case 289:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_abs);
+       YY_BREAK
+case 290:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_abs);
+       YY_BREAK
+case 291:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_ord);
+       YY_BREAK
+case 292:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_ord);
+       YY_BREAK
+case 293:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_tooltiptext);
+       YY_BREAK
+case 294:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_tooltiptext);
+       YY_BREAK
+case 295:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_SliderControl_help);
+       YY_BREAK
+case 296:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_SliderControl_help);
+       YY_BREAK
+case 297:
+YY_RULE_SETUP
+{
+  if (!A_SliderControl_up) FAIL("Required attribute `up' not set for `SliderControl' element.");
+  if (!A_SliderControl_down) FAIL("Required attribute `down' not set for `SliderControl' element.");
+  if (!A_SliderControl_abs) FAIL("Required attribute `abs' not set for `SliderControl' element.");
+  if (!A_SliderControl_ord) FAIL("Required attribute `ord' not set for `SliderControl' element.");
+  LEAVE; STag_SliderControl(); pcdata = NULL; ENTER(E_SliderControl);
+ }
+       YY_BREAK
+case 298:
+YY_RULE_SETUP
+{
+  if (!A_SliderControl_up) FAIL("Required attribute `up' not set for `SliderControl' element.");
+  if (!A_SliderControl_down) FAIL("Required attribute `down' not set for `SliderControl' element.");
+  if (!A_SliderControl_abs) FAIL("Required attribute `abs' not set for `SliderControl' element.");
+  if (!A_SliderControl_ord) FAIL("Required attribute `ord' not set for `SliderControl' element.");
+  LEAVE; STag_SliderControl(); pcdata = NULL; ETag_SliderControl();
+  switch (YY_START) {
+   case ROOT_SliderControl: SET(EPILOG); break;
+   case S_PlayListControl: SET(E_PlayListControl); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 299:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of SliderControl element.", yytext[0]);
+       YY_BREAK
+case 300:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `SliderControl' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_SliderControl):
+FAIL("EOF in attribute list of `SliderControl' element.");
+       YY_BREAK
+
+
+case 301:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_SliderControl();
+  switch (YY_START) {
+   case ROOT_SliderControl: SET(EPILOG); break;
+   case S_PlayListControl: SET(E_PlayListControl); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 302:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</SliderControl>' expected.",yytext);
+       YY_BREAK
+case 303:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</SliderControl>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_SliderControl):
+FAIL("Premature EOF: `</SliderControl>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   "none"
+  *         visible     CDATA   "true"
+  *         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         text        CDATA   ""
+  *         font        CDATA   #REQUIRED
+  *         align       CDATA   "left"
+  *         width       CDATA   "\0"
+  *         display     CDATA   "none"
+  *         scroll      CDATA   "true"
+  *         scrollspace CDATA   "20"
+  *         help        CDATA   "\0"
+  *     >  */
+case 304:
+YY_RULE_SETUP
+{
+  A_TextControl_id = "none";
+  A_TextControl_visible = "true";
+  A_TextControl_x = "\0";
+  A_TextControl_y = "\0";
+  A_TextControl_text = NULL;
+  A_TextControl_font = NULL;
+  A_TextControl_align = "left";
+  A_TextControl_width = "\0";
+  A_TextControl_display = "none";
+  A_TextControl_scroll = "true";
+  A_TextControl_scrollspace = "20";
+  A_TextControl_help = "\0";
+  ENTER(AL_TextControl);
+}
+       YY_BREAK
+
+case 305:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_id);
+       YY_BREAK
+case 306:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_id);
+       YY_BREAK
+case 307:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_visible);
+       YY_BREAK
+case 308:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_visible);
+       YY_BREAK
+case 309:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_x);
+       YY_BREAK
+case 310:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_x);
+       YY_BREAK
+case 311:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_y);
+       YY_BREAK
+case 312:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_y);
+       YY_BREAK
+case 313:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_text);
+       YY_BREAK
+case 314:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_text);
+       YY_BREAK
+case 315:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_font);
+       YY_BREAK
+case 316:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_font);
+       YY_BREAK
+case 317:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_align);
+       YY_BREAK
+case 318:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_align);
+       YY_BREAK
+case 319:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_width);
+       YY_BREAK
+case 320:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_width);
+       YY_BREAK
+case 321:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_display);
+       YY_BREAK
+case 322:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_display);
+       YY_BREAK
+case 323:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_scroll);
+       YY_BREAK
+case 324:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_scroll);
+       YY_BREAK
+case 325:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_scrollspace);
+       YY_BREAK
+case 326:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_scrollspace);
+       YY_BREAK
+case 327:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_TextControl_help);
+       YY_BREAK
+case 328:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_TextControl_help);
+       YY_BREAK
+case 329:
+YY_RULE_SETUP
+{
+  if (!A_TextControl_font) FAIL("Required attribute `font' not set for `TextControl' element.");
+  LEAVE; STag_TextControl(); pcdata = NULL; ENTER(E_TextControl);
+ }
+       YY_BREAK
+case 330:
+YY_RULE_SETUP
+{
+  if (!A_TextControl_font) FAIL("Required attribute `font' not set for `TextControl' element.");
+  LEAVE; STag_TextControl(); pcdata = NULL; ETag_TextControl();
+  switch (YY_START) {
+   case ROOT_TextControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 331:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of TextControl element.", yytext[0]);
+       YY_BREAK
+case 332:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `TextControl' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_TextControl):
+FAIL("EOF in attribute list of `TextControl' element.");
+       YY_BREAK
+
+
+case 333:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_TextControl();
+  switch (YY_START) {
+   case ROOT_TextControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 334:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</TextControl>' expected.",yytext);
+       YY_BREAK
+case 335:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</TextControl>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_TextControl):
+FAIL("Premature EOF: `</TextControl>' expected.");
+       YY_BREAK
+
+/*         id          CDATA   "none"
+  *         visible     CDATA   "true"
+  *         x           CDATA   "\0"
+  *         y           CDATA   "\0"
+  *         width       CDATA   "200"
+  *         infowidth   CDATA   "50"
+  *         font        CDATA   #REQUIRED
+  *         playfont    CDATA   "none"
+  *         selcolor    CDATA   "#0000FF"
+  *         abs         CDATA   #REQUIRED
+  *         ord         CDATA   #REQUIRED
+  *         help        CDATA   "\0"
+  *         longfilename CDATA   "false"
+  *     >  */
+case 336:
+YY_RULE_SETUP
+{
+  A_PlayListControl_id = "none";
+  A_PlayListControl_visible = "true";
+  A_PlayListControl_x = "\0";
+  A_PlayListControl_y = "\0";
+  A_PlayListControl_width = "200";
+  A_PlayListControl_infowidth = "50";
+  A_PlayListControl_font = NULL;
+  A_PlayListControl_playfont = "none";
+  A_PlayListControl_selcolor = "#0000FF";
+  A_PlayListControl_abs = NULL;
+  A_PlayListControl_ord = NULL;
+  A_PlayListControl_help = "\0";
+  A_PlayListControl_longfilename = "false";
+  ENTER(AL_PlayListControl);
+}
+       YY_BREAK
+
+case 337:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_id);
+       YY_BREAK
+case 338:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_id);
+       YY_BREAK
+case 339:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_visible);
+       YY_BREAK
+case 340:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_visible);
+       YY_BREAK
+case 341:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_x);
+       YY_BREAK
+case 342:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_x);
+       YY_BREAK
+case 343:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_y);
+       YY_BREAK
+case 344:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_y);
+       YY_BREAK
+case 345:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_width);
+       YY_BREAK
+case 346:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_width);
+       YY_BREAK
+case 347:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_infowidth);
+       YY_BREAK
+case 348:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_infowidth);
+       YY_BREAK
+case 349:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_font);
+       YY_BREAK
+case 350:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_font);
+       YY_BREAK
+case 351:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_playfont);
+       YY_BREAK
+case 352:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_playfont);
+       YY_BREAK
+case 353:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_selcolor);
+       YY_BREAK
+case 354:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_selcolor);
+       YY_BREAK
+case 355:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_abs);
+       YY_BREAK
+case 356:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_abs);
+       YY_BREAK
+case 357:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_ord);
+       YY_BREAK
+case 358:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_ord);
+       YY_BREAK
+case 359:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_help);
+       YY_BREAK
+case 360:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_help);
+       YY_BREAK
+case 361:
+YY_RULE_SETUP
+ENTER(VALUE1); BUFFERSET(A_PlayListControl_longfilename);
+       YY_BREAK
+case 362:
+YY_RULE_SETUP
+ENTER(VALUE2); BUFFERSET(A_PlayListControl_longfilename);
+       YY_BREAK
+case 363:
+YY_RULE_SETUP
+{
+  if (!A_PlayListControl_font) FAIL("Required attribute `font' not set for `PlayListControl' element.");
+  if (!A_PlayListControl_abs) FAIL("Required attribute `abs' not set for `PlayListControl' element.");
+  if (!A_PlayListControl_ord) FAIL("Required attribute `ord' not set for `PlayListControl' element.");
+  LEAVE; STag_PlayListControl(); pcdata = NULL; ENTER(S_PlayListControl);
+ }
+       YY_BREAK
+case 364:
+YY_RULE_SETUP
+FAIL("`PlayListControl' element cannot be empty.");
+       YY_BREAK
+case 365:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of PlayListControl element.", yytext[0]);
+       YY_BREAK
+case 366:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `PlayListControl' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_PlayListControl):
+FAIL("EOF in attribute list of `PlayListControl' element.");
+       YY_BREAK
+
+
+case 367:
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_PlayListControl();
+  switch (YY_START) {
+   case ROOT_PlayListControl: SET(EPILOG); break;
+   case S_ControlGroup_1: case S_ControlGroup_2: case S_ControlGroup: SET(S_ControlGroup_2); break;
+  }
+ }
+       YY_BREAK
+case 368:
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</PlayListControl>' expected.",yytext);
+       YY_BREAK
+case 369:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</PlayListControl>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_PlayListControl):
+FAIL("Premature EOF: `</PlayListControl>' expected.");
+       YY_BREAK
+
+/* EPILOG: after the root element. */
+
+case 370:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' after document.", yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(EPILOG):
+SUCCEED;
+       YY_BREAK
+
+/* CHARACTER DATA. */
+
+/* Non-defined standard entities... */
+case 371:
+YY_RULE_SETUP
+BUFFERPUTC('&');
+       YY_BREAK
+case 372:
+YY_RULE_SETUP
+BUFFERPUTC('<');
+       YY_BREAK
+case 373:
+YY_RULE_SETUP
+BUFFERPUTC('>');
+       YY_BREAK
+case 374:
+YY_RULE_SETUP
+BUFFERPUTC('\'');
+       YY_BREAK
+case 375:
+YY_RULE_SETUP
+BUFFERPUTC('"');
+       YY_BREAK
+/* Character entities. */
+case 376:
+YY_RULE_SETUP
+BUFFERPUTC((unsigned char)atoi(yytext+2));
+       YY_BREAK
+case 377:
+YY_RULE_SETUP
+BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
+       YY_BREAK
+
+
+case 378:
+case 379:
+case 380:
+case 381:
+YY_RULE_SETUP
+BUFFERPUTC('\n');
+       YY_BREAK
+
+
+case 382:
+YY_RULE_SETUP
+ENTER(CDATA);
+       YY_BREAK
+case 383:
+YY_RULE_SETUP
+FAIL("Unexpected `]]>' in character data.");
+       YY_BREAK
+
+
+case 384:
+YY_RULE_SETUP
+BUFFERDONE; LEAVE;
+       YY_BREAK
+case YY_STATE_EOF(VALUE1):
+FAIL("EOF in literal (\"'\" expected).");
+       YY_BREAK
+
+
+case 385:
+YY_RULE_SETUP
+BUFFERDONE; LEAVE;
+       YY_BREAK
+case YY_STATE_EOF(VALUE2):
+FAIL("EOF in literal (`\"' expected).");
+       YY_BREAK
+
+
+case 386:
+YY_RULE_SETUP
+BUFFERPUTC(yytext[0]);
+       YY_BREAK
+case 387:
+YY_RULE_SETUP
+FAIL("Spurious `%c' in character data.",yytext[0]);
+       YY_BREAK
+
+
+case 388:
+YY_RULE_SETUP
+LEAVE;
+       YY_BREAK
+case 389:
+YY_RULE_SETUP
+BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]);
+       YY_BREAK
+case 390:
+YY_RULE_SETUP
+BUFFERPUTC(yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(CDATA):
+FAIL("EOF in CDATA section.");
+       YY_BREAK
+
+/* Impossible rules to avoid warnings from flex(1). */
+
+case 391:
+YY_RULE_SETUP
+FAIL("The Impossible Happened: INITIAL or IMPOSSIBLE state entered?");
+       YY_BREAK
+
+case 392:
+YY_RULE_SETUP
+YY_FATAL_ERROR( "flex scanner jammed" );
+       YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(ROOT_Theme):
+case YY_STATE_EOF(S_Theme):
+case YY_STATE_EOF(S_Theme_2):
+case YY_STATE_EOF(ROOT_Bitmap):
+case YY_STATE_EOF(ROOT_Event):
+case YY_STATE_EOF(ROOT_Font):
+case YY_STATE_EOF(ROOT_ThemeInfo):
+case YY_STATE_EOF(ROOT_Window):
+case YY_STATE_EOF(S_Window):
+case YY_STATE_EOF(ROOT_ControlGroup):
+case YY_STATE_EOF(S_ControlGroup):
+case YY_STATE_EOF(S_ControlGroup_1):
+case YY_STATE_EOF(ROOT_Anchor):
+case YY_STATE_EOF(ROOT_ImageControl):
+case YY_STATE_EOF(ROOT_RectangleControl):
+case YY_STATE_EOF(ROOT_ButtonControl):
+case YY_STATE_EOF(ROOT_CheckBoxControl):
+case YY_STATE_EOF(ROOT_SliderControl):
+case YY_STATE_EOF(ROOT_TextControl):
+case YY_STATE_EOF(ROOT_PlayListControl):
+case YY_STATE_EOF(S_PlayListControl):
+case YY_STATE_EOF(IMPOSSIBLE):
+       yyterminate();
+
+       case YY_END_OF_BUFFER:
+               {
+               /* Amount of text matched not including the EOB char. */
+               int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
+
+               /* Undo the effects of YY_DO_BEFORE_ACTION. */
+               *yy_cp = yy_hold_char;
+               YY_RESTORE_YY_MORE_OFFSET
+
+               if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+                       {
+                       /* We're scanning a new file or input source.  It's
+                        * possible that this happened because the user
+                        * just pointed yyin at a new source and called
+                        * yylex().  If so, then we have to assure
+                        * consistency between yy_current_buffer and our
+                        * globals.  Here is the right place to do so, because
+                        * this is the first action (other than possibly a
+                        * back-up) that will match for the new input source.
+                        */
+                       yy_n_chars = yy_current_buffer->yy_n_chars;
+                       yy_current_buffer->yy_input_file = yyin;
+                       yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+                       }
+
+               /* Note that here we test for yy_c_buf_p "<=" to the position
+                * of the first EOB in the buffer, since yy_c_buf_p will
+                * already have been incremented past the NUL character
+                * (since all states make transitions on EOB to the
+                * end-of-buffer state).  Contrast this with the test
+                * in input().
+                */
+               if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+                       { /* This was really a NUL. */
+                       yy_state_type yy_next_state;
+
+                       yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+                       yy_current_state = yy_get_previous_state();
+
+                       /* Okay, we're now positioned to make the NUL
+                        * transition.  We couldn't have
+                        * yy_get_previous_state() go ahead and do it
+                        * for us because it doesn't know how to deal
+                        * with the possibility of jamming (and we don't
+                        * want to build jamming into it because then it
+                        * will run more slowly).
+                        */
+
+                       yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+                       yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+                       if ( yy_next_state )
+                               {
+                               /* Consume the NUL. */
+                               yy_cp = ++yy_c_buf_p;
+                               yy_current_state = yy_next_state;
+                               goto yy_match;
+                               }
+
+                       else
+                               {
+                               yy_cp = yy_last_accepting_cpos;
+                               yy_current_state = yy_last_accepting_state;
+                               goto yy_find_action;
+                               }
+                       }
+
+               else switch ( yy_get_next_buffer() )
+                       {
+                       case EOB_ACT_END_OF_FILE:
+                               {
+                               yy_did_buffer_switch_on_eof = 0;
+
+                               if ( yywrap() )
+                                       {
+                                       /* Note: because we've taken care in
+                                        * yy_get_next_buffer() to have set up
+                                        * yytext, we can now set up
+                                        * yy_c_buf_p so that if some total
+                                        * hoser (like flex itself) wants to
+                                        * call the scanner after we return the
+                                        * YY_NULL, it'll still work - another
+                                        * YY_NULL will get returned.
+                                        */
+                                       yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+                                       yy_act = YY_STATE_EOF(YY_START);
+                                       goto do_action;
+                                       }
+
+                               else
+                                       {
+                                       if ( ! yy_did_buffer_switch_on_eof )
+                                               YY_NEW_FILE;
+                                       }
+                               break;
+                               }
+
+                       case EOB_ACT_CONTINUE_SCAN:
+                               yy_c_buf_p =
+                                       yytext_ptr + yy_amount_of_matched_text;
+
+                               yy_current_state = yy_get_previous_state();
+
+                               yy_cp = yy_c_buf_p;
+                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               goto yy_match;
+
+                       case EOB_ACT_LAST_MATCH:
+                               yy_c_buf_p =
+                               &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+                               yy_current_state = yy_get_previous_state();
+
+                               yy_cp = yy_c_buf_p;
+                               yy_bp = yytext_ptr + YY_MORE_ADJ;
+                               goto yy_find_action;
+                       }
+               break;
+               }
+
+       default:
+               YY_FATAL_ERROR(
+                       "fatal flex scanner internal error--no action found" );
+       } /* end of action switch */
+               } /* end of scanning one token */
+       } /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *     EOB_ACT_LAST_MATCH -
+ *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *     EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+       {
+       register char *dest = yy_current_buffer->yy_ch_buf;
+       register char *source = yytext_ptr;
+       register int number_to_move, i;
+       int ret_val;
+
+       if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+               YY_FATAL_ERROR(
+               "fatal flex scanner internal error--end of buffer missed" );
+
+       if ( yy_current_buffer->yy_fill_buffer == 0 )
+               { /* Don't try to fill the buffer, so this is an EOF. */
+               if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+                       {
+                       /* We matched a single character, the EOB, so
+                        * treat this as a final EOF.
+                        */
+                       return EOB_ACT_END_OF_FILE;
+                       }
+
+               else
+                       {
+                       /* We matched some text prior to the EOB, first
+                        * process it.
+                        */
+                       return EOB_ACT_LAST_MATCH;
+                       }
+               }
+
+       /* Try to read more data. */
+
+       /* First move last chars to start of buffer. */
+       number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
+
+       for ( i = 0; i < number_to_move; ++i )
+               *(dest++) = *(source++);
+
+       if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+               /* don't do the read, it's not guaranteed to return an EOF,
+                * just force an EOF
+                */
+               yy_current_buffer->yy_n_chars = yy_n_chars = 0;
+
+       else
+               {
+               int num_to_read =
+                       yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+               while ( num_to_read <= 0 )
+                       { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+                       YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+                       /* just a shorter name for the current buffer */
+                       YY_BUFFER_STATE b = yy_current_buffer;
+
+                       int yy_c_buf_p_offset =
+                               (int) (yy_c_buf_p - b->yy_ch_buf);
+
+                       if ( b->yy_is_our_buffer )
+                               {
+                               int new_size = b->yy_buf_size * 2;
+
+                               if ( new_size <= 0 )
+                                       b->yy_buf_size += b->yy_buf_size / 8;
+                               else
+                                       b->yy_buf_size *= 2;
+
+                               b->yy_ch_buf = (char *)
+                                       /* Include room in for 2 EOB chars. */
+                                       yy_flex_realloc( (void *) b->yy_ch_buf,
+                                                        b->yy_buf_size + 2 );
+                               }
+                       else
+                               /* Can't grow it, we don't own it. */
+                               b->yy_ch_buf = 0;
+
+                       if ( ! b->yy_ch_buf )
+                               YY_FATAL_ERROR(
+                               "fatal error - scanner input buffer overflow" );
+
+                       yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+                       num_to_read = yy_current_buffer->yy_buf_size -
+                                               number_to_move - 1;
+#endif
+                       }
+
+               if ( num_to_read > YY_READ_BUF_SIZE )
+                       num_to_read = YY_READ_BUF_SIZE;
+
+               /* Read in more data. */
+               YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+                       yy_n_chars, num_to_read );
+
+               yy_current_buffer->yy_n_chars = yy_n_chars;
+               }
+
+       if ( yy_n_chars == 0 )
+               {
+               if ( number_to_move == YY_MORE_ADJ )
+                       {
+                       ret_val = EOB_ACT_END_OF_FILE;
+                       yyrestart( yyin );
+                       }
+
+               else
+                       {
+                       ret_val = EOB_ACT_LAST_MATCH;
+                       yy_current_buffer->yy_buffer_status =
+                               YY_BUFFER_EOF_PENDING;
+                       }
+               }
+
+       else
+               ret_val = EOB_ACT_CONTINUE_SCAN;
+
+       yy_n_chars += number_to_move;
+       yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+       yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+       yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
+
+       return ret_val;
+       }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+       {
+       register yy_state_type yy_current_state;
+       register char *yy_cp;
+
+       yy_current_state = yy_start;
+
+       for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+               {
+               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+               if ( yy_accept[yy_current_state] )
+                       {
+                       yy_last_accepting_state = yy_current_state;
+                       yy_last_accepting_cpos = yy_cp;
+                       }
+               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+                       {
+                       yy_current_state = (int) yy_def[yy_current_state];
+                       if ( yy_current_state >= 2442 )
+                               yy_c = yy_meta[(unsigned int) yy_c];
+                       }
+               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+               }
+
+       return yy_current_state;
+       }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *     next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+       {
+       register int yy_is_jam;
+       register char *yy_cp = yy_c_buf_p;
+
+       register YY_CHAR yy_c = 1;
+       if ( yy_accept[yy_current_state] )
+               {
+               yy_last_accepting_state = yy_current_state;
+               yy_last_accepting_cpos = yy_cp;
+               }
+       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+               {
+               yy_current_state = (int) yy_def[yy_current_state];
+               if ( yy_current_state >= 2442 )
+                       yy_c = yy_meta[(unsigned int) yy_c];
+               }
+       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+       yy_is_jam = (yy_current_state == 2441);
+
+       return yy_is_jam ? 0 : yy_current_state;
+       }
+
+
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+       {
+       register char *yy_cp = yy_c_buf_p;
+
+       /* undo effects of setting up yytext */
+       *yy_cp = yy_hold_char;
+
+       if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+               { /* need to shift things up to make room */
+               /* +2 for EOB chars. */
+               register int number_to_move = yy_n_chars + 2;
+               register char *dest = &yy_current_buffer->yy_ch_buf[
+                                       yy_current_buffer->yy_buf_size + 2];
+               register char *source =
+                               &yy_current_buffer->yy_ch_buf[number_to_move];
+
+               while ( source > yy_current_buffer->yy_ch_buf )
+                       *--dest = *--source;
+
+               yy_cp += (int) (dest - source);
+               yy_bp += (int) (dest - source);
+               yy_current_buffer->yy_n_chars =
+                       yy_n_chars = yy_current_buffer->yy_buf_size;
+
+               if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+                       YY_FATAL_ERROR( "flex scanner push-back overflow" );
+               }
+
+       *--yy_cp = (char) c;
+
+
+       yytext_ptr = yy_bp;
+       yy_hold_char = *yy_cp;
+       yy_c_buf_p = yy_cp;
+       }
+#endif /* ifndef YY_NO_UNPUT */
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+       {
+       int c;
+
+       *yy_c_buf_p = yy_hold_char;
+
+       if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+               {
+               /* yy_c_buf_p now points to the character we want to return.
+                * If this occurs *before* the EOB characters, then it's a
+                * valid NUL; if not, then we've hit the end of the buffer.
+                */
+               if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+                       /* This was really a NUL. */
+                       *yy_c_buf_p = '\0';
+
+               else
+                       { /* need more input */
+                       int offset = yy_c_buf_p - yytext_ptr;
+                       ++yy_c_buf_p;
+
+                       switch ( yy_get_next_buffer() )
+                               {
+                               case EOB_ACT_LAST_MATCH:
+                                       /* This happens because yy_g_n_b()
+                                        * sees that we've accumulated a
+                                        * token and flags that we need to
+                                        * try matching the token before
+                                        * proceeding.  But for input(),
+                                        * there's no matching to consider.
+                                        * So convert the EOB_ACT_LAST_MATCH
+                                        * to EOB_ACT_END_OF_FILE.
+                                        */
+
+                                       /* Reset buffer status. */
+                                       yyrestart( yyin );
+
+                                       /* fall through */
+
+                               case EOB_ACT_END_OF_FILE:
+                                       {
+                                       if ( yywrap() )
+                                               return EOF;
+
+                                       if ( ! yy_did_buffer_switch_on_eof )
+                                               YY_NEW_FILE;
+#ifdef __cplusplus
+                                       return yyinput();
+#else
+                                       return input();
+#endif
+                                       }
+
+                               case EOB_ACT_CONTINUE_SCAN:
+                                       yy_c_buf_p = yytext_ptr + offset;
+                                       break;
+                               }
+                       }
+               }
+
+       c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
+       *yy_c_buf_p = '\0';     /* preserve yytext */
+       yy_hold_char = *++yy_c_buf_p;
+
+
+       return c;
+       }
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+       {
+       if ( ! yy_current_buffer )
+               yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+       yy_init_buffer( yy_current_buffer, input_file );
+       yy_load_buffer_state();
+       }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+       {
+       if ( yy_current_buffer == new_buffer )
+               return;
+
+       if ( yy_current_buffer )
+               {
+               /* Flush out information for old buffer. */
+               *yy_c_buf_p = yy_hold_char;
+               yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+               yy_current_buffer->yy_n_chars = yy_n_chars;
+               }
+
+       yy_current_buffer = new_buffer;
+       yy_load_buffer_state();
+
+       /* We don't actually know whether we did this switch during
+        * EOF (yywrap()) processing, but the only time this flag
+        * is looked at is after yywrap() is called, so it's safe
+        * to go ahead and always set it.
+        */
+       yy_did_buffer_switch_on_eof = 1;
+       }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+       {
+       yy_n_chars = yy_current_buffer->yy_n_chars;
+       yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+       yyin = yy_current_buffer->yy_input_file;
+       yy_hold_char = *yy_c_buf_p;
+       }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+       {
+       YY_BUFFER_STATE b;
+
+       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+       b->yy_buf_size = size;
+
+       /* yy_ch_buf has to be 2 characters longer than the size given because
+        * we need to put in 2 end-of-buffer characters.
+        */
+       b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+       if ( ! b->yy_ch_buf )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+       b->yy_is_our_buffer = 1;
+
+       yy_init_buffer( b, file );
+
+       return b;
+       }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+       {
+       if ( ! b )
+               return;
+
+       if ( b == yy_current_buffer )
+               yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+       if ( b->yy_is_our_buffer )
+               yy_flex_free( (void *) b->yy_ch_buf );
+
+       yy_flex_free( (void *) b );
+       }
+
+
+#ifndef _WIN32
+#include <unistd.h>
+#else
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+
+       {
+       yy_flush_buffer( b );
+
+       b->yy_input_file = file;
+       b->yy_fill_buffer = 1;
+
+#if YY_ALWAYS_INTERACTIVE
+       b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+       b->yy_is_interactive = 0;
+#else
+       b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+       }
+
+
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+       {
+       if ( ! b )
+               return;
+
+       b->yy_n_chars = 0;
+
+       /* We always need two end-of-buffer characters.  The first causes
+        * a transition to the end-of-buffer state.  The second causes
+        * a jam in that state.
+        */
+       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+       b->yy_buf_pos = &b->yy_ch_buf[0];
+
+       b->yy_at_bol = 1;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       if ( b == yy_current_buffer )
+               yy_load_buffer_state();
+       }
+
+
+#ifndef YY_NO_SCAN_BUFFER
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+char *base;
+yy_size_t size;
+#endif
+       {
+       YY_BUFFER_STATE b;
+
+       if ( size < 2 ||
+            base[size-2] != YY_END_OF_BUFFER_CHAR ||
+            base[size-1] != YY_END_OF_BUFFER_CHAR )
+               /* They forgot to leave room for the EOB's. */
+               return 0;
+
+       b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+       if ( ! b )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
+       b->yy_buf_pos = b->yy_ch_buf = base;
+       b->yy_is_our_buffer = 0;
+       b->yy_input_file = 0;
+       b->yy_n_chars = b->yy_buf_size;
+       b->yy_is_interactive = 0;
+       b->yy_at_bol = 1;
+       b->yy_fill_buffer = 0;
+       b->yy_buffer_status = YY_BUFFER_NEW;
+
+       yy_switch_to_buffer( b );
+
+       return b;
+       }
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst char *yy_str;
+#endif
+       {
+       int len;
+       for ( len = 0; yy_str[len]; ++len )
+               ;
+
+       return yy_scan_bytes( yy_str, len );
+       }
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
+#else
+YY_BUFFER_STATE yy_scan_bytes( bytes, len )
+yyconst char *bytes;
+int len;
+#endif
+       {
+       YY_BUFFER_STATE b;
+       char *buf;
+       yy_size_t n;
+       int i;
+
+       /* Get memory for full buffer, including space for trailing EOB's. */
+       n = len + 2;
+       buf = (char *) yy_flex_alloc( n );
+       if ( ! buf )
+               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+       for ( i = 0; i < len; ++i )
+               buf[i] = bytes[i];
+
+       buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+       b = yy_scan_buffer( buf, n );
+       if ( ! b )
+               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+       /* It's okay to grow etc. this buffer, and we should throw it
+        * away when we're done.
+        */
+       b->yy_is_our_buffer = 1;
+
+       return b;
+       }
+#endif
+
+
+#ifndef YY_NO_PUSH_STATE
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+       {
+       if ( yy_start_stack_ptr >= yy_start_stack_depth )
+               {
+               yy_size_t new_size;
+
+               yy_start_stack_depth += YY_START_STACK_INCR;
+               new_size = yy_start_stack_depth * sizeof( int );
+
+               if ( ! yy_start_stack )
+                       yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+               else
+                       yy_start_stack = (int *) yy_flex_realloc(
+                                       (void *) yy_start_stack, new_size );
+
+               if ( ! yy_start_stack )
+                       YY_FATAL_ERROR(
+                       "out of memory expanding start-condition stack" );
+               }
+
+       yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+       BEGIN(new_state);
+       }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state()
+       {
+       if ( --yy_start_stack_ptr < 0 )
+               YY_FATAL_ERROR( "start-condition stack underflow" );
+
+       BEGIN(yy_start_stack[yy_start_stack_ptr]);
+       }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state()
+       {
+       return yy_start_stack[yy_start_stack_ptr - 1];
+       }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+       {
+       (void) fprintf( stderr, "%s\n", msg );
+       exit( YY_EXIT_FAILURE );
+       }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+       do \
+               { \
+               /* Undo effects of setting up yytext. */ \
+               yytext[yyleng] = yy_hold_char; \
+               yy_c_buf_p = yytext + n; \
+               yy_hold_char = *yy_c_buf_p; \
+               *yy_c_buf_p = '\0'; \
+               yyleng = n; \
+               } \
+       while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+yyconst char *s2;
+int n;
+#endif
+       {
+       register int i;
+       for ( i = 0; i < n; ++i )
+               s1[i] = s2[i];
+       }
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst char *s )
+#else
+static int yy_flex_strlen( s )
+yyconst char *s;
+#endif
+       {
+       register int n;
+       for ( n = 0; s[n]; ++n )
+               ;
+
+       return n;
+       }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+       {
+       return (void *) malloc( size );
+       }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+       {
+       /* The cast to (char *) in the following accommodates both
+        * implementations that use char* generic pointers, and those
+        * that use void* generic pointers.  It works with the latter
+        * because both ANSI C and C++ allow castless assignment from
+        * any pointer type to void*, and deal with argument conversions
+        * as though doing an assignment.
+        */
+       return (void *) realloc( (char *) ptr, size );
+       }
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+       {
+       free( ptr );
+       }
+
+#if YY_MAIN
+int main()
+       {
+       yylex();
+       return 0;
+       }
+#endif
+
+
+/* Element context stack lookup. */
+int element_context(int i)
+{
+  return (0<i && i<yy_start_stack_depth
+         ? yy_start_stack[yy_start_stack_ptr - i]
+         : 0);
+}
+
+#ifdef FLEX_DEBUG
+void print_yy_stack(char* fmt, ...)
+{
+  int i = 0; va_list ap; va_start(ap, fmt);
+  vfprintf(stderr, fmt, ap);
+  for (i=1; i<yy_start_stack_ptr; i++)
+    fprintf(stderr, "%s/", statenames[yy_start_stack[i]]);
+  fprintf(stderr,"%s\n", statenames[YY_START]);
+  va_end(ap);
+}
+
+static void debug_enter(int state, char* statename) {
+  yy_push_state(state);
+  if (yy_flex_debug) print_yy_stack("--ENTER(%s) : ",statename);
+}
+
+static void debug_leave(void) {
+  if (yy_flex_debug) print_yy_stack("--LEAVE : ");
+  yy_pop_state();
+}
+
+static void debug_set(int state, char* statename) {
+  BEGIN(state);
+  if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename);
+}
+#endif
+
+
+static int fail(const char* fmt, ...)
+{
+  va_list ap; va_start(ap, fmt);
+#ifdef FLEXML_yylineno
+  fprintf(stderr, "Invalid XML (XML input line %d, state %d): ", yylineno, YY_START);
+#else
+  fprintf(stderr, "Invalid XML (state %d): ",YY_START);
+#endif
+  vfprintf(stderr, fmt, ap);
+  fprintf(stderr, "\n");
+  va_end(ap);
+  return 1;
+}
diff --git a/modules/gui/skins/parser/skin.act b/modules/gui/skins/parser/skin.act
new file mode 100644 (file)
index 0000000..1d2658a
--- /dev/null
@@ -0,0 +1,142 @@
+<!-- vim: set filetype=xml : -->
+<!--
+ *****************************************************************************
+ * skin.act: FleXML actions file
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: skin.act,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************
+-->
+
+<!DOCTYPE actions SYSTEM "flexml-act.dtd">
+<actions>
+    <top>
+        <![CDATA[
+            #include "wrappers.h"
+        ]]>
+    </top>
+    <start tag="Bitmap">
+        <![CDATA[
+            AddBitmap( {id}, {file}, {alphacolor} );
+        ]]>
+    </start>
+    <start tag="Event">
+        <![CDATA[
+            AddEvent( {id}, {event}, {key} );
+        ]]>
+    </start>
+    <start tag="Font">
+        <![CDATA[
+            AddFont( {id}, {font}, {size}, {color}, {weight}, {italic},
+                     {underline} );
+        ]]>
+    </start>
+    <start tag="ThemeInfo">
+        <![CDATA[
+            AddThemeInfo( {name}, {author}, {email}, {webpage} );
+        ]]>
+    </start>
+    <start tag="Window">
+        <![CDATA[
+            StartWindow( {id}, {x}, {y}, {visible}, {fadetime}, {alpha},
+                         {movealpha}, {dragdrop} );
+        ]]>
+    </start>
+    <end tag="Window">
+        <![CDATA[
+            EndWindow();
+        ]]>
+    </end>
+    <start tag="ControlGroup">
+        <![CDATA[
+            StartControlGroup( {x}, {y} );
+        ]]>
+    </start>
+    <end tag="ControlGroup">
+        <![CDATA[
+            EndControlGroup();
+        ]]>
+    </end>
+    <start tag="Anchor">
+        <![CDATA[
+            AddAnchor( {x}, {y}, {range}, {priority} );
+        ]]>
+    </start>
+    <start tag="ImageControl">
+        <![CDATA[
+            AddImage( {id}, {visible}, {x}, {y}, {image}, {onclick}, {help} );
+        ]]>
+    </start>
+    <start tag="RectangleControl">
+        <![CDATA[
+            AddRectangle( {id}, {visible}, {x}, {y}, {w}, {h}, {color},
+                          {onclick}, {help} );
+        ]]>
+    </start>
+    <start tag="ButtonControl">
+        <![CDATA[
+            AddButton( {id}, {visible}, {x}, {y}, {up}, {down}, {disabled},
+                       {onclick}, {tooltiptext}, {help} );
+        ]]>
+    </start>
+    <start tag="CheckBoxControl">
+        <![CDATA[
+            AddCheckBox( {id}, {visible}, {x}, {y}, {img1}, {img2}, {clickimg1},
+                         {clickimg2}, {disabled1}, {disabled2}, {onclick1},
+                         {onclick2}, {tooltiptext1}, {tooltiptext2}, {help} );
+        ]]>
+    </start>
+    <start tag="SliderControl">
+        <![CDATA[
+            AddSlider( {id}, {visible}, {x}, {y}, {type}, {up}, {down}, {abs},
+                       {ord}, {tooltiptext}, {help} );
+        ]]>
+    </start>
+    <start tag="TextControl">
+        <![CDATA[
+            AddText( {id}, {visible}, {x}, {y}, {text}, {font}, {align},
+                     {width}, {display}, {scroll}, {scrollspace},
+                     {help} );
+        ]]>
+    </start>
+    <start tag="PlayListControl">
+        <![CDATA[
+            AddPlayList( {id}, {visible}, {x}, {y}, {width}, {infowidth},
+                         {font}, {playfont}, {selcolor}, {abs}, {ord},
+                         {longfilename}, {help} );
+        ]]>
+    </start>
+    <end tag="PlayListControl">
+        <![CDATA[
+            AddPlayListEnd();
+        ]]>
+    </end>
+    <start tag="Theme">
+        <![CDATA[
+            StartTheme( {log}, {magnet} );
+        ]]>
+    </start>
+    <end tag="Theme">
+        <![CDATA[
+            EndTheme();
+        ]]>
+    </end>
+</actions>
diff --git a/modules/gui/skins/parser/skin.c b/modules/gui/skins/parser/skin.c
new file mode 100644 (file)
index 0000000..1ec7e80
--- /dev/null
@@ -0,0 +1,249 @@
+/* XML application for skin.dtd (Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp).
+ * Includes actions from skin.act.
+ * Generated 2003/03/18 03:18:31.
+ *
+ * This program was generated with the FleXML XML processor generator,
+ * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
+ * Copyright © 1999 Kristoffer Rose.  All rights reserved.
+ *
+ * You can redistribute and/or modify this program provided the following
+ * two conditions hold:
+ *
+ * 1. The program is distributed WITHOUT ANY WARRANTY from the author of
+ *    FleXML; without even the implied warranty of MERCHANTABILITY or
+ *    FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * 2. The program distribution conditions do not in any way affect the
+ *    distribution conditions of the FleXML system used to generate this
+ *    file or any version of FleXML derived from that system.
+ *
+ * Notice that these are explicit rights granted to you for files
+ * generated by the FleXML system.  For your rights in connection with
+ * the FleXML system itself please consult the GNU General Public License.
+ */
+
+#include "skin.h"
+
+
+#line 31 "skin.act"
+
+        
+            #include "wrappers.h"
+        
+    
+void STag_Bitmap(void)
+{
+#line 36 "skin.act"
+
+        
+            AddBitmap( A_Bitmap_id, A_Bitmap_file, A_Bitmap_alphacolor );
+        
+    
+} /* STag_Bitmap */
+
+void STag_Event(void)
+{
+#line 41 "skin.act"
+
+        
+            AddEvent( A_Event_id, A_Event_event, A_Event_key );
+        
+    
+} /* STag_Event */
+
+void STag_Font(void)
+{
+#line 46 "skin.act"
+
+        
+            AddFont( A_Font_id, A_Font_font, A_Font_size, A_Font_color, A_Font_weight, A_Font_italic,
+                     A_Font_underline );
+        
+    
+} /* STag_Font */
+
+void STag_ThemeInfo(void)
+{
+#line 52 "skin.act"
+
+        
+            AddThemeInfo( A_ThemeInfo_name, A_ThemeInfo_author, A_ThemeInfo_email, A_ThemeInfo_webpage );
+        
+    
+} /* STag_ThemeInfo */
+
+void STag_Window(void)
+{
+#line 57 "skin.act"
+
+        
+            StartWindow( A_Window_id, A_Window_x, A_Window_y, A_Window_visible, A_Window_fadetime, A_Window_alpha,
+                         A_Window_movealpha, A_Window_dragdrop );
+        
+    
+} /* STag_Window */
+
+void ETag_Window(void)
+{
+#line 63 "skin.act"
+
+        
+            EndWindow();
+        
+    
+} /* ETag_Window */
+
+void STag_ControlGroup(void)
+{
+#line 68 "skin.act"
+
+        
+            StartControlGroup( A_ControlGroup_x, A_ControlGroup_y );
+        
+    
+} /* STag_ControlGroup */
+
+void ETag_ControlGroup(void)
+{
+#line 73 "skin.act"
+
+        
+            EndControlGroup();
+        
+    
+} /* ETag_ControlGroup */
+
+void STag_Anchor(void)
+{
+#line 78 "skin.act"
+
+        
+            AddAnchor( A_Anchor_x, A_Anchor_y, A_Anchor_range, A_Anchor_priority );
+        
+    
+} /* STag_Anchor */
+
+void STag_ImageControl(void)
+{
+#line 83 "skin.act"
+
+        
+            AddImage( A_ImageControl_id, A_ImageControl_visible, A_ImageControl_x, A_ImageControl_y, A_ImageControl_image, A_ImageControl_onclick, A_ImageControl_help );
+        
+    
+} /* STag_ImageControl */
+
+void STag_RectangleControl(void)
+{
+#line 88 "skin.act"
+
+        
+            AddRectangle( A_RectangleControl_id, A_RectangleControl_visible, A_RectangleControl_x, A_RectangleControl_y, A_RectangleControl_w, A_RectangleControl_h, A_RectangleControl_color,
+                          A_RectangleControl_onclick, A_RectangleControl_help );
+        
+    
+} /* STag_RectangleControl */
+
+void STag_ButtonControl(void)
+{
+#line 94 "skin.act"
+
+        
+            AddButton( A_ButtonControl_id, A_ButtonControl_visible, A_ButtonControl_x, A_ButtonControl_y, A_ButtonControl_up, A_ButtonControl_down, A_ButtonControl_disabled,
+                       A_ButtonControl_onclick, A_ButtonControl_tooltiptext, A_ButtonControl_help );
+        
+    
+} /* STag_ButtonControl */
+
+void STag_CheckBoxControl(void)
+{
+#line 100 "skin.act"
+
+        
+            AddCheckBox( A_CheckBoxControl_id, A_CheckBoxControl_visible, A_CheckBoxControl_x, A_CheckBoxControl_y, A_CheckBoxControl_img1, A_CheckBoxControl_img2, A_CheckBoxControl_clickimg1,
+                         A_CheckBoxControl_clickimg2, A_CheckBoxControl_disabled1, A_CheckBoxControl_disabled2, A_CheckBoxControl_onclick1,
+                         A_CheckBoxControl_onclick2, A_CheckBoxControl_tooltiptext1, A_CheckBoxControl_tooltiptext2, A_CheckBoxControl_help );
+        
+    
+} /* STag_CheckBoxControl */
+
+void STag_SliderControl(void)
+{
+#line 107 "skin.act"
+
+        
+            AddSlider( A_SliderControl_id, A_SliderControl_visible, A_SliderControl_x, A_SliderControl_y, A_SliderControl_type, A_SliderControl_up, A_SliderControl_down, A_SliderControl_abs,
+                       A_SliderControl_ord, A_SliderControl_tooltiptext, A_SliderControl_help );
+        
+    
+} /* STag_SliderControl */
+
+void STag_TextControl(void)
+{
+#line 113 "skin.act"
+
+        
+            AddText( A_TextControl_id, A_TextControl_visible, A_TextControl_x, A_TextControl_y, A_TextControl_text, A_TextControl_font, A_TextControl_align,
+                     A_TextControl_width, A_TextControl_display, A_TextControl_scroll, A_TextControl_scrollspace,
+                     A_TextControl_help );
+        
+    
+} /* STag_TextControl */
+
+void STag_PlayListControl(void)
+{
+#line 120 "skin.act"
+
+        
+            AddPlayList( A_PlayListControl_id, A_PlayListControl_visible, A_PlayListControl_x, A_PlayListControl_y, A_PlayListControl_width, A_PlayListControl_infowidth,
+                         A_PlayListControl_font, A_PlayListControl_playfont, A_PlayListControl_selcolor, A_PlayListControl_abs, A_PlayListControl_ord,
+                         A_PlayListControl_longfilename, A_PlayListControl_help );
+        
+    
+} /* STag_PlayListControl */
+
+void ETag_PlayListControl(void)
+{
+#line 127 "skin.act"
+
+        
+            AddPlayListEnd();
+        
+    
+} /* ETag_PlayListControl */
+
+void STag_Theme(void)
+{
+#line 132 "skin.act"
+
+        
+            StartTheme( A_Theme_log, A_Theme_magnet );
+        
+    
+} /* STag_Theme */
+
+void ETag_Theme(void)
+{
+#line 137 "skin.act"
+
+        
+            EndTheme();
+        
+    
+} /* ETag_Theme */
+
+/* Dummy main: filter XML from stdin. */
+//int main() { exit(yylex()); }
+
+/* XML application entry points. */
+void ETag_Bitmap(void) {}
+void ETag_Event(void) {}
+void ETag_Font(void) {}
+void ETag_ThemeInfo(void) {}
+void ETag_Anchor(void) {}
+void ETag_ImageControl(void) {}
+void ETag_RectangleControl(void) {}
+void ETag_ButtonControl(void) {}
+void ETag_CheckBoxControl(void) {}
+void ETag_SliderControl(void) {}
+void ETag_TextControl(void) {}
diff --git a/modules/gui/skins/parser/skin.dtd b/modules/gui/skins/parser/skin.dtd
new file mode 100644 (file)
index 0000000..1140e53
--- /dev/null
@@ -0,0 +1,192 @@
+<!--
+ *****************************************************************************
+ * skin.dtd: DTD for the VLC skins
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: skin.dtd,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************
+-->
+
+
+<!ELEMENT Theme (ThemeInfo,(Bitmap|Font|Window|Event)*)>
+    <!ATTLIST Theme
+        magnet      CDATA   "9"
+        log         CDATA   "false"
+    >
+
+<!-- main elements -->
+<!ELEMENT Bitmap EMPTY>
+    <!ATTLIST Bitmap
+        id          CDATA   #REQUIRED
+        file        CDATA   #REQUIRED
+        alphacolor  CDATA   #REQUIRED
+    >
+<!ELEMENT Event EMPTY>
+    <!ATTLIST Event
+        id          CDATA   #REQUIRED
+        event       CDATA   #REQUIRED
+        key         CDATA   "none"
+    >
+<!ELEMENT Font EMPTY>
+    <!ATTLIST Font
+        id          CDATA   "default"
+        font        CDATA   "arial"
+        size        CDATA   "12"
+        color       CDATA   "#000000"
+        weight      CDATA   "400"
+        italic      CDATA   "false"
+        underline   CDATA   "false"
+    >
+<!ELEMENT ThemeInfo EMPTY>
+    <!ATTLIST ThemeInfo
+        name        CDATA   #IMPLIED
+        author      CDATA   #IMPLIED
+        email       CDATA   #IMPLIED
+        webpage     CDATA   #IMPLIED
+    >
+<!ELEMENT Window (ControlGroup)>
+    <!ATTLIST Window
+        id          CDATA   #REQUIRED
+        visible     CDATA   "true"
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        fadetime    CDATA   "500"
+        alpha       CDATA   "255"
+        movealpha   CDATA   "255"
+        dragdrop    CDATA   "true"
+    >
+
+<!ELEMENT ControlGroup (ControlGroup|ImageControl|ButtonControl|PlayListControl|
+                        SliderControl|TextControl|CheckBoxControl|
+                        RectangleControl|Anchor)+>
+    <!ATTLIST ControlGroup
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+    >
+
+<!-- Anchors -->
+<!ELEMENT Anchor EMPTY>
+    <!ATTLIST Anchor
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        priority    CDATA   #REQUIRED
+        range       CDATA   "10"
+    >
+
+<!-- Controls -->
+<!ELEMENT ImageControl EMPTY>
+    <!ATTLIST ImageControl
+        id          CDATA   "none"
+        visible     CDATA   "true"
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        image       CDATA   #REQUIRED
+        onclick     CDATA   "none"
+        help        CDATA   "\0"
+    >
+<!ELEMENT RectangleControl EMPTY>
+    <!ATTLIST RectangleControl
+        id          CDATA   "none"
+        visible     CDATA   "true"
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        w           CDATA   "50"
+        h           CDATA   "50"
+        color       CDATA   "#C0C0C0"
+        onclick     CDATA   "none"
+        help        CDATA   "\0"
+    >
+<!ELEMENT ButtonControl EMPTY>
+    <!ATTLIST ButtonControl
+        id          CDATA   "none"
+        visible     CDATA   "true"
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        up          CDATA   #REQUIRED
+        down        CDATA   #REQUIRED
+        disabled    CDATA   "none"
+        onclick     CDATA   "none"
+        tooltiptext CDATA   "none"
+        help        CDATA   "\0"
+    >
+<!ELEMENT CheckBoxControl EMPTY>
+    <!ATTLIST CheckBoxControl
+        id           CDATA   "none"
+        visible      CDATA   "true"
+        x            CDATA   "\0"
+        y            CDATA   "\0"
+        img1         CDATA   #REQUIRED
+        clickimg1    CDATA   "none"
+        img2         CDATA   #REQUIRED
+        clickimg2    CDATA   "none"
+        disabled1    CDATA   "none"
+        disabled2    CDATA   "none"
+        onclick1     CDATA   "none"
+        onclick2     CDATA   "none"
+        tooltiptext1 CDATA   "none"
+        tooltiptext2 CDATA   "none"
+        help         CDATA   "\0"
+    >
+<!ELEMENT SliderControl EMPTY>
+    <!ATTLIST SliderControl
+        id          CDATA   "none"
+        visible     CDATA   "true"
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        type        CDATA   "time"
+        up          CDATA   #REQUIRED
+        down        CDATA   #REQUIRED
+        abs         CDATA   #REQUIRED
+        ord         CDATA   #REQUIRED
+        tooltiptext CDATA   "none"
+        help        CDATA   "\0"
+    >
+<!ELEMENT TextControl EMPTY>
+    <!ATTLIST TextControl
+        id          CDATA   "none"
+        visible     CDATA   "true"
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        text        CDATA   ""
+        font        CDATA   #REQUIRED
+        align       CDATA   "left"
+        width       CDATA   "\0"
+        display     CDATA   "none"
+        scroll      CDATA   "true"
+        scrollspace CDATA   "20"
+        help        CDATA   "\0"
+    >
+<!ELEMENT PlayListControl SliderControl>
+    <!ATTLIST PlayListControl
+        id          CDATA   "none"
+        visible     CDATA   "true"
+        x           CDATA   "\0"
+        y           CDATA   "\0"
+        width       CDATA   "200"
+        infowidth   CDATA   "50"
+        font        CDATA   #REQUIRED
+        playfont    CDATA   "none"
+        selcolor    CDATA   "#0000FF"
+        abs         CDATA   #REQUIRED
+        ord         CDATA   #REQUIRED
+        help        CDATA   "\0"
+        longfilename CDATA   "false"
+    >
diff --git a/modules/gui/skins/parser/skin.h b/modules/gui/skins/parser/skin.h
new file mode 100644 (file)
index 0000000..197fa5e
--- /dev/null
@@ -0,0 +1,399 @@
+/* XML processor/application API for skin.dtd (Id: skin.dtd,v 1.8 2003/03/17 22:14:47 karibu Exp).
+ * Generated 2003/03/18 03:18:31.
+ *
+ * This program was generated with the FleXML XML processor generator,
+ * (Id: flexml.pl,v 1.24 1999/12/13 16:18:30 krisrose Exp).
+ * Copyright © 1999 Kristoffer Rose.  All rights reserved.
+ *
+ * You can redistribute and/or modify this program provided the following
+ * two conditions hold:
+ *
+ * 1. The program is distributed WITHOUT ANY WARRANTY from the author of
+ *    FleXML; without even the implied warranty of MERCHANTABILITY or
+ *    FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * 2. The program distribution conditions do not in any way affect the
+ *    distribution conditions of the FleXML system used to generate this
+ *    file or any version of FleXML derived from that system.
+ *
+ * Notice that these are explicit rights granted to you for files
+ * generated by the FleXML system.  For your rights in connection with
+ * the FleXML system itself please consult the GNU General Public License.
+ */
+
+#ifndef _FLEXML_skin_H
+
+/* XML application entry points. */
+extern void STag_Theme(void);
+extern void ETag_Theme(void);
+extern void STag_Bitmap(void);
+extern void ETag_Bitmap(void);
+extern void STag_Event(void);
+extern void ETag_Event(void);
+extern void STag_Font(void);
+extern void ETag_Font(void);
+extern void STag_ThemeInfo(void);
+extern void ETag_ThemeInfo(void);
+extern void STag_Window(void);
+extern void ETag_Window(void);
+extern void STag_ControlGroup(void);
+extern void ETag_ControlGroup(void);
+extern void STag_Anchor(void);
+extern void ETag_Anchor(void);
+extern void STag_ImageControl(void);
+extern void ETag_ImageControl(void);
+extern void STag_RectangleControl(void);
+extern void ETag_RectangleControl(void);
+extern void STag_ButtonControl(void);
+extern void ETag_ButtonControl(void);
+extern void STag_CheckBoxControl(void);
+extern void ETag_CheckBoxControl(void);
+extern void STag_SliderControl(void);
+extern void ETag_SliderControl(void);
+extern void STag_TextControl(void);
+extern void ETag_TextControl(void);
+extern void STag_PlayListControl(void);
+extern void ETag_PlayListControl(void);
+
+/* XML application data. */
+typedef char* AT_TextControl_display;
+#define AU_TextControl_display NULL
+typedef char* AT_SliderControl_x;
+#define AU_SliderControl_x NULL
+typedef char* AT_ButtonControl_onclick;
+#define AU_ButtonControl_onclick NULL
+typedef char* AT_RectangleControl_color;
+#define AU_RectangleControl_color NULL
+typedef char* AT_SliderControl_y;
+#define AU_SliderControl_y NULL
+typedef char* AT_ButtonControl_id;
+#define AU_ButtonControl_id NULL
+typedef char* AT_Window_movealpha;
+#define AU_Window_movealpha NULL
+typedef char* AT_SliderControl_down;
+#define AU_SliderControl_down NULL
+typedef char* AT_ButtonControl_down;
+#define AU_ButtonControl_down NULL
+typedef char* AT_CheckBoxControl_disabled1;
+#define AU_CheckBoxControl_disabled1 NULL
+typedef char* AT_CheckBoxControl_disabled2;
+#define AU_CheckBoxControl_disabled2 NULL
+typedef char* AT_Font_underline;
+#define AU_Font_underline NULL
+typedef char* AT_ButtonControl_visible;
+#define AU_ButtonControl_visible NULL
+typedef char* AT_TextControl_scroll;
+#define AU_TextControl_scroll NULL
+typedef char* AT_SliderControl_id;
+#define AU_SliderControl_id NULL
+typedef char* AT_CheckBoxControl_x;
+#define AU_CheckBoxControl_x NULL
+typedef char* AT_Window_alpha;
+#define AU_Window_alpha NULL
+typedef char* AT_TextControl_x;
+#define AU_TextControl_x NULL
+typedef char* AT_CheckBoxControl_y;
+#define AU_CheckBoxControl_y NULL
+typedef char* AT_Window_id;
+#define AU_Window_id NULL
+typedef char* AT_TextControl_y;
+#define AU_TextControl_y NULL
+typedef char* AT_RectangleControl_onclick;
+#define AU_RectangleControl_onclick NULL
+typedef char* AT_Theme_magnet;
+#define AU_Theme_magnet NULL
+typedef char* AT_TextControl_font;
+#define AU_TextControl_font NULL
+typedef char* AT_PlayListControl_selcolor;
+#define AU_PlayListControl_selcolor NULL
+typedef char* AT_Anchor_x;
+#define AU_Anchor_x NULL
+typedef char* AT_Anchor_y;
+#define AU_Anchor_y NULL
+typedef char* AT_ButtonControl_up;
+#define AU_ButtonControl_up NULL
+typedef char* AT_RectangleControl_visible;
+#define AU_RectangleControl_visible NULL
+typedef char* AT_SliderControl_type;
+#define AU_SliderControl_type NULL
+typedef char* AT_CheckBoxControl_id;
+#define AU_CheckBoxControl_id NULL
+typedef char* AT_Anchor_priority;
+#define AU_Anchor_priority NULL
+typedef char* AT_PlayListControl_visible;
+#define AU_PlayListControl_visible NULL
+typedef char* AT_Bitmap_alphacolor;
+#define AU_Bitmap_alphacolor NULL
+typedef char* AT_ImageControl_onclick;
+#define AU_ImageControl_onclick NULL
+typedef char* AT_PlayListControl_x;
+#define AU_PlayListControl_x NULL
+typedef char* AT_PlayListControl_y;
+#define AU_PlayListControl_y NULL
+typedef char* AT_ImageControl_image;
+#define AU_ImageControl_image NULL
+typedef char* AT_ThemeInfo_name;
+#define AU_ThemeInfo_name NULL
+typedef char* AT_TextControl_width;
+#define AU_TextControl_width NULL
+typedef char* AT_PlayListControl_id;
+#define AU_PlayListControl_id NULL
+typedef char* AT_Bitmap_id;
+#define AU_Bitmap_id NULL
+typedef char* AT_Font_italic;
+#define AU_Font_italic NULL
+typedef char* AT_PlayListControl_ord;
+#define AU_PlayListControl_ord NULL
+typedef char* AT_ButtonControl_disabled;
+#define AU_ButtonControl_disabled NULL
+typedef char* AT_SliderControl_up;
+#define AU_SliderControl_up NULL
+typedef char* AT_ImageControl_x;
+#define AU_ImageControl_x NULL
+typedef char* AT_ControlGroup_x;
+#define AU_ControlGroup_x NULL
+typedef char* AT_PlayListControl_infowidth;
+#define AU_PlayListControl_infowidth NULL
+typedef char* AT_ImageControl_y;
+#define AU_ImageControl_y NULL
+typedef char* AT_ControlGroup_y;
+#define AU_ControlGroup_y NULL
+typedef char* AT_PlayListControl_longfilename;
+#define AU_PlayListControl_longfilename NULL
+typedef char* AT_PlayListControl_abs;
+#define AU_PlayListControl_abs NULL
+typedef char* AT_ImageControl_visible;
+#define AU_ImageControl_visible NULL
+typedef char* AT_Theme_log;
+#define AU_Theme_log NULL
+typedef char* AT_PlayListControl_width;
+#define AU_PlayListControl_width NULL
+typedef char* AT_SliderControl_help;
+#define AU_SliderControl_help NULL
+typedef char* AT_ButtonControl_help;
+#define AU_ButtonControl_help NULL
+typedef char* AT_TextControl_scrollspace;
+#define AU_TextControl_scrollspace NULL
+typedef char* AT_Font_font;
+#define AU_Font_font NULL
+typedef char* AT_SliderControl_visible;
+#define AU_SliderControl_visible NULL
+typedef char* AT_PlayListControl_playfont;
+#define AU_PlayListControl_playfont NULL
+typedef char* AT_TextControl_text;
+#define AU_TextControl_text NULL
+typedef char* AT_SliderControl_ord;
+#define AU_SliderControl_ord NULL
+typedef char* AT_Window_visible;
+#define AU_Window_visible NULL
+typedef char* AT_TextControl_align;
+#define AU_TextControl_align NULL
+typedef char* AT_TextControl_id;
+#define AU_TextControl_id NULL
+typedef char* AT_Window_x;
+#define AU_Window_x NULL
+typedef char* AT_SliderControl_abs;
+#define AU_SliderControl_abs NULL
+typedef char* AT_Window_y;
+#define AU_Window_y NULL
+typedef char* AT_RectangleControl_help;
+#define AU_RectangleControl_help NULL
+typedef char* AT_CheckBoxControl_img1;
+#define AU_CheckBoxControl_img1 NULL
+typedef char* AT_CheckBoxControl_img2;
+#define AU_CheckBoxControl_img2 NULL
+typedef char* AT_ButtonControl_x;
+#define AU_ButtonControl_x NULL
+typedef char* AT_ButtonControl_y;
+#define AU_ButtonControl_y NULL
+typedef char* AT_Window_dragdrop;
+#define AU_Window_dragdrop NULL
+typedef char* AT_ImageControl_help;
+#define AU_ImageControl_help NULL
+typedef char* AT_PlayListControl_help;
+#define AU_PlayListControl_help NULL
+typedef char* AT_Font_weight;
+#define AU_Font_weight NULL
+typedef char* AT_ThemeInfo_author;
+#define AU_ThemeInfo_author NULL
+typedef char* AT_CheckBoxControl_help;
+#define AU_CheckBoxControl_help NULL
+typedef char* AT_TextControl_visible;
+#define AU_TextControl_visible NULL
+typedef char* AT_ButtonControl_tooltiptext;
+#define AU_ButtonControl_tooltiptext NULL
+typedef char* AT_Event_event;
+#define AU_Event_event NULL
+typedef char* AT_RectangleControl_h;
+#define AU_RectangleControl_h NULL
+typedef char* AT_ThemeInfo_webpage;
+#define AU_ThemeInfo_webpage NULL
+typedef char* AT_CheckBoxControl_tooltiptext1;
+#define AU_CheckBoxControl_tooltiptext1 NULL
+typedef char* AT_CheckBoxControl_tooltiptext2;
+#define AU_CheckBoxControl_tooltiptext2 NULL
+typedef char* AT_ImageControl_id;
+#define AU_ImageControl_id NULL
+typedef char* AT_CheckBoxControl_onclick1;
+#define AU_CheckBoxControl_onclick1 NULL
+typedef char* AT_Font_size;
+#define AU_Font_size NULL
+typedef char* AT_Bitmap_file;
+#define AU_Bitmap_file NULL
+typedef char* AT_CheckBoxControl_onclick2;
+#define AU_CheckBoxControl_onclick2 NULL
+typedef char* AT_Window_fadetime;
+#define AU_Window_fadetime NULL
+typedef char* AT_Event_id;
+#define AU_Event_id NULL
+typedef char* AT_Font_id;
+#define AU_Font_id NULL
+typedef char* AT_CheckBoxControl_visible;
+#define AU_CheckBoxControl_visible NULL
+typedef char* AT_Event_key;
+#define AU_Event_key NULL
+typedef char* AT_ThemeInfo_email;
+#define AU_ThemeInfo_email NULL
+typedef char* AT_Font_color;
+#define AU_Font_color NULL
+typedef char* AT_RectangleControl_w;
+#define AU_RectangleControl_w NULL
+typedef char* AT_SliderControl_tooltiptext;
+#define AU_SliderControl_tooltiptext NULL
+typedef char* AT_RectangleControl_x;
+#define AU_RectangleControl_x NULL
+typedef char* AT_RectangleControl_y;
+#define AU_RectangleControl_y NULL
+typedef char* AT_CheckBoxControl_clickimg1;
+#define AU_CheckBoxControl_clickimg1 NULL
+typedef char* AT_CheckBoxControl_clickimg2;
+#define AU_CheckBoxControl_clickimg2 NULL
+typedef char* AT_Anchor_range;
+#define AU_Anchor_range NULL
+typedef char* AT_PlayListControl_font;
+#define AU_PlayListControl_font NULL
+typedef char* AT_TextControl_help;
+#define AU_TextControl_help NULL
+typedef char* AT_RectangleControl_id;
+#define AU_RectangleControl_id NULL
+
+/* FleXML-provided data. */
+extern char* pcdata;
+extern AT_TextControl_display A_TextControl_display;
+extern AT_SliderControl_x A_SliderControl_x;
+extern AT_ButtonControl_onclick A_ButtonControl_onclick;
+extern AT_RectangleControl_color A_RectangleControl_color;
+extern AT_SliderControl_y A_SliderControl_y;
+extern AT_ButtonControl_id A_ButtonControl_id;
+extern AT_Window_movealpha A_Window_movealpha;
+extern AT_SliderControl_down A_SliderControl_down;
+extern AT_ButtonControl_down A_ButtonControl_down;
+extern AT_CheckBoxControl_disabled1 A_CheckBoxControl_disabled1;
+extern AT_CheckBoxControl_disabled2 A_CheckBoxControl_disabled2;
+extern AT_Font_underline A_Font_underline;
+extern AT_ButtonControl_visible A_ButtonControl_visible;
+extern AT_TextControl_scroll A_TextControl_scroll;
+extern AT_SliderControl_id A_SliderControl_id;
+extern AT_CheckBoxControl_x A_CheckBoxControl_x;
+extern AT_Window_alpha A_Window_alpha;
+extern AT_TextControl_x A_TextControl_x;
+extern AT_CheckBoxControl_y A_CheckBoxControl_y;
+extern AT_Window_id A_Window_id;
+extern AT_TextControl_y A_TextControl_y;
+extern AT_RectangleControl_onclick A_RectangleControl_onclick;
+extern AT_Theme_magnet A_Theme_magnet;
+extern AT_TextControl_font A_TextControl_font;
+extern AT_PlayListControl_selcolor A_PlayListControl_selcolor;
+extern AT_Anchor_x A_Anchor_x;
+extern AT_Anchor_y A_Anchor_y;
+extern AT_ButtonControl_up A_ButtonControl_up;
+extern AT_RectangleControl_visible A_RectangleControl_visible;
+extern AT_SliderControl_type A_SliderControl_type;
+extern AT_CheckBoxControl_id A_CheckBoxControl_id;
+extern AT_Anchor_priority A_Anchor_priority;
+extern AT_PlayListControl_visible A_PlayListControl_visible;
+extern AT_Bitmap_alphacolor A_Bitmap_alphacolor;
+extern AT_ImageControl_onclick A_ImageControl_onclick;
+extern AT_PlayListControl_x A_PlayListControl_x;
+extern AT_PlayListControl_y A_PlayListControl_y;
+extern AT_ImageControl_image A_ImageControl_image;
+extern AT_ThemeInfo_name A_ThemeInfo_name;
+extern AT_TextControl_width A_TextControl_width;
+extern AT_PlayListControl_id A_PlayListControl_id;
+extern AT_Bitmap_id A_Bitmap_id;
+extern AT_Font_italic A_Font_italic;
+extern AT_PlayListControl_ord A_PlayListControl_ord;
+extern AT_ButtonControl_disabled A_ButtonControl_disabled;
+extern AT_SliderControl_up A_SliderControl_up;
+extern AT_ImageControl_x A_ImageControl_x;
+extern AT_ControlGroup_x A_ControlGroup_x;
+extern AT_PlayListControl_infowidth A_PlayListControl_infowidth;
+extern AT_ImageControl_y A_ImageControl_y;
+extern AT_ControlGroup_y A_ControlGroup_y;
+extern AT_PlayListControl_longfilename A_PlayListControl_longfilename;
+extern AT_PlayListControl_abs A_PlayListControl_abs;
+extern AT_ImageControl_visible A_ImageControl_visible;
+extern AT_Theme_log A_Theme_log;
+extern AT_PlayListControl_width A_PlayListControl_width;
+extern AT_SliderControl_help A_SliderControl_help;
+extern AT_ButtonControl_help A_ButtonControl_help;
+extern AT_TextControl_scrollspace A_TextControl_scrollspace;
+extern AT_Font_font A_Font_font;
+extern AT_SliderControl_visible A_SliderControl_visible;
+extern AT_PlayListControl_playfont A_PlayListControl_playfont;
+extern AT_TextControl_text A_TextControl_text;
+extern AT_SliderControl_ord A_SliderControl_ord;
+extern AT_Window_visible A_Window_visible;
+extern AT_TextControl_align A_TextControl_align;
+extern AT_TextControl_id A_TextControl_id;
+extern AT_Window_x A_Window_x;
+extern AT_SliderControl_abs A_SliderControl_abs;
+extern AT_Window_y A_Window_y;
+extern AT_RectangleControl_help A_RectangleControl_help;
+extern AT_CheckBoxControl_img1 A_CheckBoxControl_img1;
+extern AT_CheckBoxControl_img2 A_CheckBoxControl_img2;
+extern AT_ButtonControl_x A_ButtonControl_x;
+extern AT_ButtonControl_y A_ButtonControl_y;
+extern AT_Window_dragdrop A_Window_dragdrop;
+extern AT_ImageControl_help A_ImageControl_help;
+extern AT_PlayListControl_help A_PlayListControl_help;
+extern AT_Font_weight A_Font_weight;
+extern AT_ThemeInfo_author A_ThemeInfo_author;
+extern AT_CheckBoxControl_help A_CheckBoxControl_help;
+extern AT_TextControl_visible A_TextControl_visible;
+extern AT_ButtonControl_tooltiptext A_ButtonControl_tooltiptext;
+extern AT_Event_event A_Event_event;
+extern AT_RectangleControl_h A_RectangleControl_h;
+extern AT_ThemeInfo_webpage A_ThemeInfo_webpage;
+extern AT_CheckBoxControl_tooltiptext1 A_CheckBoxControl_tooltiptext1;
+extern AT_CheckBoxControl_tooltiptext2 A_CheckBoxControl_tooltiptext2;
+extern AT_ImageControl_id A_ImageControl_id;
+extern AT_CheckBoxControl_onclick1 A_CheckBoxControl_onclick1;
+extern AT_Font_size A_Font_size;
+extern AT_Bitmap_file A_Bitmap_file;
+extern AT_CheckBoxControl_onclick2 A_CheckBoxControl_onclick2;
+extern AT_Window_fadetime A_Window_fadetime;
+extern AT_Event_id A_Event_id;
+extern AT_Font_id A_Font_id;
+extern AT_CheckBoxControl_visible A_CheckBoxControl_visible;
+extern AT_Event_key A_Event_key;
+extern AT_ThemeInfo_email A_ThemeInfo_email;
+extern AT_Font_color A_Font_color;
+extern AT_RectangleControl_w A_RectangleControl_w;
+extern AT_SliderControl_tooltiptext A_SliderControl_tooltiptext;
+extern AT_RectangleControl_x A_RectangleControl_x;
+extern AT_RectangleControl_y A_RectangleControl_y;
+extern AT_CheckBoxControl_clickimg1 A_CheckBoxControl_clickimg1;
+extern AT_CheckBoxControl_clickimg2 A_CheckBoxControl_clickimg2;
+extern AT_Anchor_range A_Anchor_range;
+extern AT_PlayListControl_font A_PlayListControl_font;
+extern AT_TextControl_help A_TextControl_help;
+extern AT_RectangleControl_id A_RectangleControl_id;
+
+/* XML application utilities. */
+extern int element_context(int);
+
+/* XML processor entry point. */
+extern int yylex(void);
+
+#endif
diff --git a/modules/gui/skins/parser/wrappers.cpp b/modules/gui/skins/parser/wrappers.cpp
new file mode 100644 (file)
index 0000000..1d8d9c4
--- /dev/null
@@ -0,0 +1,375 @@
+/*****************************************************************************
+ * wrappers.cpp: Wrappers around C++ objects
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: wrappers.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- GENERAL ---------------------------------------------------------------
+#include <stdlib.h>
+#include <string>
+using namespace std;
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+extern intf_thread_t *g_pIntf;
+
+//--- SKIN ------------------------------------------------------------------
+#include "anchor.h"
+#include "banks.h"
+#include "controls.h"
+#include "window.h"
+#include "theme.h"
+#include "skin_common.h"
+#include "wrappers.h"
+
+
+//---------------------------------------------------------------------------
+// Local prototypes
+//---------------------------------------------------------------------------
+static bool ConvertBoolean( const char *value );
+static int  ConvertColor( const char *transcolor );
+static int  CheckCoords( const char *coord );
+static void ConvertCoords( char *coord, double *p_coord );
+static int  ConvertAlign( char *align );
+
+//---------------------------------------------------------------------------
+// Wrappers
+//---------------------------------------------------------------------------
+void AddBitmap( char *name, char *file, char *transcolor )
+{
+    g_pIntf->p_sys->p_theme->BmpBank->Add( name, file,
+                                           ConvertColor( transcolor ) );
+}
+//---------------------------------------------------------------------------
+void AddEvent( char *name, char *event, char *key )
+{
+    g_pIntf->p_sys->p_theme->EvtBank->Add( name, event, key );
+}
+//---------------------------------------------------------------------------
+void AddFont( char *name, char *font, char *size, char *color,
+              char *weight, char *italic, char *underline )
+{
+    g_pIntf->p_sys->p_theme->FntBank->Add(
+        name, font, atoi( size ), ConvertColor( color ), atoi( weight ),
+        ConvertBoolean( italic ), ConvertBoolean( underline ) );
+}
+//---------------------------------------------------------------------------
+void AddThemeInfo( char *name, char *author, char *email, char *webpage )
+{
+    g_pIntf->p_sys->p_theme->ChangeClientWindowName(
+        "VLC Media Player - " + (string)name );
+}
+//---------------------------------------------------------------------------
+void StartWindow( char *name, char *x, char *y, char *visible, char *fadetime,
+    char *alpha, char *movealpha, char *dragdrop )
+{
+    g_pIntf->p_sys->p_theme->AddWindow( name, atoi( x ), atoi( y ),
+        ConvertBoolean( visible ), atoi( fadetime ), atoi( alpha ),
+        atoi( movealpha ), ConvertBoolean( dragdrop ) );
+}
+//---------------------------------------------------------------------------
+void EndWindow()
+{
+}
+//---------------------------------------------------------------------------
+void StartTheme( char *log, char *magnet )
+{
+    g_pIntf->p_sys->p_theme->StartTheme( ConvertBoolean( log ),
+        atoi( magnet ) );
+}
+//---------------------------------------------------------------------------
+void EndTheme()
+{
+}
+//---------------------------------------------------------------------------
+void StartControlGroup( char *x, char *y )
+{
+    g_pIntf->p_sys->p_theme->OffBank->PushOffSet( atoi( x ), atoi( y ) );
+}
+//---------------------------------------------------------------------------
+void EndControlGroup()
+{
+    g_pIntf->p_sys->p_theme->OffBank->PopOffSet();
+}
+
+//---------------------------------------------------------------------------
+void AddAnchor( char *x, char *y, char *len, char *priority )
+{
+    int XOff, YOff;
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+    vlcWin->AnchorList.push_back( new Anchor( g_pIntf, atoi( x ) + XOff,
+                                  atoi( y ) + YOff, atoi( len ),
+                                  atoi( priority ), vlcWin ) );
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// CONTROLS\r
+//---------------------------------------------------------------------------
+void AddImage( char *id, char *visible, char *x, char *y, char *image,
+    char *event, char *help )
+{
+    int XOff, YOff;
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+
+    vlcWin->ControlList.push_back( new ControlImage( id,
+        ConvertBoolean( visible ), atoi( x ) + XOff,
+        atoi( y ) + YOff, image, event, help, vlcWin ) );
+}
+//---------------------------------------------------------------------------
+void AddRectangle( char *id, char *visible, char *x, char *y, char *w, char *h,
+    char *color, char *event, char *help )
+{
+    int XOff, YOff;
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+
+    vlcWin->ControlList.push_back( new ControlRectangle( id,
+        ConvertBoolean( visible ), atoi( x ) + XOff, atoi( y ) + YOff,
+        atoi( w ), atoi( h ), ConvertColor( color ), event, help, vlcWin ) );
+}
+//---------------------------------------------------------------------------
+void AddButton( char *id, char *visible, char *x, char *y, char *up, char *down,
+    char *disabled, char *click, char *tooltiptext, char *help )
+{
+    int XOff, YOff;
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+
+    vlcWin->ControlList.push_back( new ControlButton( id,
+        ConvertBoolean( visible ), atoi( x ) + XOff, atoi( y ) + YOff,
+        up, down, disabled, click, tooltiptext, help, vlcWin ) );
+}
+//---------------------------------------------------------------------------
+void AddCheckBox( char *id, char *visible, char *x, char *y, char *img1,
+    char *img2, char *click1, char *click2, char *disabled1, char *disabled2,
+    char *action1, char *action2, char *tooltiptext1, char *tooltiptext2,
+    char *help )
+{
+    int XOff, YOff;
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+
+    vlcWin->ControlList.push_back( new ControlCheckBox( id,
+        ConvertBoolean( visible ), atoi( x ) + XOff,
+        atoi( y ) + YOff, img1, img2, click1, click2, disabled1, disabled2,
+        action1, action2, tooltiptext1, tooltiptext2, help, vlcWin ) );
+}
+//---------------------------------------------------------------------------
+void AddSlider( char *id, char *visible, char *x, char *y, char *type, char *up,
+    char *down, char *abs, char *ord, char *tooltiptext, char *help )
+{
+    int XOff, YOff, i;
+    int res1 = CheckCoords( abs );
+    int res2 = CheckCoords( ord );
+    if( res1 < 2 || res2 < 2 )
+    {
+        msg_Warn( g_pIntf, "Cannot add slider: not enough points" );
+        return;
+    }
+    if( res1 != res2 )
+    {
+        msg_Warn( g_pIntf, "Cannot add slider: invalid list of points" );
+        return;
+    }
+
+    // now, res1 == res2
+    double *p_abs, *p_ord;
+    p_abs = new double[res1];
+    p_ord = new double[res1];
+    ConvertCoords( abs, p_abs );
+    ConvertCoords( ord, p_ord );
+
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    // Move control
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+    for( i = 0; i < res1; i++ )
+    {
+        p_abs[i] += XOff + atoi(x);
+        p_ord[i] += YOff + atoi(y);
+    }
+
+    // Create Control
+    if( g_pIntf->p_sys->p_theme->ConstructPlaylist )
+    {
+        GenericControl *playlist = vlcWin->ControlList.back();
+        ( (ControlPlayList *)playlist )->InitSliderCurve( p_abs, p_ord, res1,
+                                                          up, down );
+    }
+    else
+    {
+        vlcWin->ControlList.push_back( new ControlSlider( id,
+            ConvertBoolean( visible ), type, up, down, p_abs, p_ord, res1,
+            tooltiptext, help, vlcWin ) );
+    }
+
+    delete[] p_abs;
+    delete[] p_ord;
+}
+//---------------------------------------------------------------------------
+void AddPlayList( char *id, char *visible, char *x, char *y, char *width,
+    char *infowidth, char *font, char *playfont, char *selcolor, char *abs,
+    char *ord, char *longfilename, char *help )
+{
+    g_pIntf->p_sys->p_theme->ConstructPlaylist = true;
+
+    int XOff, YOff, i;
+    int res1 = CheckCoords( abs );
+    int res2 = CheckCoords( ord );
+    if( res1 < 2 || res2 < 2 )
+    {
+        msg_Warn( g_pIntf, "Cannot add slider: not enough points" );
+        return;
+    }
+    if( res1 != res2 )
+    {
+        msg_Warn( g_pIntf, "Cannot add slider: invalid list of points" );
+        return;
+    }
+
+    // now, res1 == res2
+    double *p_abs, *p_ord;
+    p_abs = new double[res1];
+    p_ord = new double[res1];
+    ConvertCoords( abs, p_abs );
+    ConvertCoords( ord, p_ord );
+
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    // Move control
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+    for( i = 0; i < res1; i++ )
+    {
+        p_abs[i] += XOff + atoi(x);
+        p_ord[i] += YOff + atoi(y);
+    }
+
+    // Move control
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+
+    vlcWin->ControlList.push_back( new ControlPlayList( id,
+        ConvertBoolean( visible ), atoi( width ), atoi( infowidth ), font,
+        playfont, ConvertColor( selcolor ), p_abs, p_ord, res1,
+        ConvertBoolean( longfilename ), help, vlcWin ) );
+
+    delete[] p_abs;
+    delete[] p_ord;
+
+}
+//---------------------------------------------------------------------------
+void AddPlayListEnd()
+{
+    g_pIntf->p_sys->p_theme->ConstructPlaylist = false;
+}
+//---------------------------------------------------------------------------
+void AddText( char *id, char *visible, char *x, char *y, char *text, char *font,
+    char *align, char *width, char *display, char *scroll, char *scrollspace,
+    char *help )
+{
+    int XOff, YOff;
+    Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
+
+    g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
+
+    vlcWin->ControlList.push_back( new ControlText( id,
+        ConvertBoolean( visible ), atoi( x ) + XOff,
+        atoi( y ) + YOff, text, font, ConvertAlign( align ), atoi( width ),
+        display, ConvertBoolean( scroll ), atoi( scrollspace ), help,
+        vlcWin ) );
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// Useful functions
+//---------------------------------------------------------------------------
+static bool ConvertBoolean( const char *value )
+{
+    return strcmp( value, "true" ) == 0;
+}
+//---------------------------------------------------------------------------
+static int ConvertColor( const char *transcolor )
+{
+    int iRed, iGreen, iBlue;
+    iRed = iGreen = iBlue = 0;
+    sscanf( transcolor, "#%2X%2X%2X", &iRed, &iGreen, &iBlue );
+    return ( 65536 * iBlue + 256 * iGreen + iRed );
+}
+//---------------------------------------------------------------------------
+// Check that abs and ord contain the same number of comas
+static int CheckCoords( const char *coord )
+{
+    int i_coord = 1;
+    while( coord && *coord )
+    {
+        if( *coord == ',' )
+            i_coord++;
+        coord++;
+    }
+    return i_coord;
+}
+//---------------------------------------------------------------------------
+static void ConvertCoords( char *coord, double *p_coord )
+{
+    int i = 0;
+    char *ptr = coord;
+
+    while( coord && *coord )
+    {
+        if( *coord == ',' )
+        {
+            *coord = '\0';
+            p_coord[i] = atof( ptr );
+            i++;
+            ptr = coord + 1;
+        }
+        coord++;
+    }
+    p_coord[i] = atof( ptr );
+}
+//---------------------------------------------------------------------------
+static int ConvertAlign( char *align )
+{
+    if( strcmp( align, "left" ) == 0 )
+        return DT_LEFT;
+    else if( strcmp( align, "right" ) == 0 )
+        return DT_RIGHT;
+    else if( strcmp( align, "center" ) == 0 )
+        return DT_CENTER;
+    else
+        return DT_LEFT;
+}
+//---------------------------------------------------------------------------
diff --git a/modules/gui/skins/parser/wrappers.h b/modules/gui/skins/parser/wrappers.h
new file mode 100644 (file)
index 0000000..bc53bc4
--- /dev/null
@@ -0,0 +1,96 @@
+/*****************************************************************************
+ * wrappers.h: Wrappers around C++ objects
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: wrappers.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//---------------------------------------------------------------------------
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+
+//---------------------------------------------------------------------------
+// Divers
+//---------------------------------------------------------------------------
+    void AddAnchor( char *x, char *y, char *len, char *priority );
+    void AddBitmap( char *name, char *file, char *transcolor );
+    void AddEvent( char *name, char *event, char *key );
+    void AddFont( char *name, char *font, char *size,
+                  char *color, char *weight, char *italic, char *underline );
+    void StartControlGroup( char *x, char *y );
+    void EndControlGroup();
+
+//---------------------------------------------------------------------------
+// Theme
+//---------------------------------------------------------------------------
+    void AddThemeInfo( char *name, char *author, char *email,
+                       char *webpage );
+    void StartTheme( char *log, char *magnet );
+    void EndTheme();
+
+//---------------------------------------------------------------------------
+// Window
+//---------------------------------------------------------------------------
+    void StartWindow( char *name, char *x, char *y, char *visible,
+                      char *fadetime, char *alpha, char *movealpha,
+                      char *dragdrop );
+    void EndWindow();
+
+//---------------------------------------------------------------------------
+// Control
+//---------------------------------------------------------------------------
+    void AddImage( char *id, char *visible, char *x, char *y, char *image,
+                   char *event, char *help );
+
+    void AddRectangle( char *id, char *visible, char *x, char *y, char *w,
+                       char *h, char *color, char *event, char *help );
+
+    void AddButton( char *id, char *visible, char *x, char *y, char *up,
+                    char *down, char *disabled, char *click,
+                    char *tooltiptext, char *help );
+
+    void AddCheckBox( char *id, char *visible, char *x, char *y, char *img1,
+                      char *img2, char *click1, char *click2, char *disabled1,
+                      char *disabled2, char *action1, char *action2,
+                      char *tooltiptext1, char *tooltiptext2, char *help );
+
+    void AddSlider( char *id, char *visible, char *x, char *y, char *type,
+                    char *up, char *down, char *abs, char *ord,
+                    char *tooltiptext, char *help );
+
+    void AddText( char *id, char *visible, char *x, char *y, char *text,
+                  char *font, char *align, char *width, char *display,
+                  char *scroll, char *scrollspace, char *help );
+
+    void AddPlayList( char *id, char *visible, char *x, char *y, char *width,
+                      char *infowidth, char *font, char *playfont,
+                      char *selcolor, char *abs, char *ord,
+                      char *longfilename, char *help );
+
+    void AddPlayListEnd();
+//---------------------------------------------------------------------------
+
+#if defined(__cplusplus)
+}
+#endif
diff --git a/modules/gui/skins/src/.cvsignore b/modules/gui/skins/src/.cvsignore
new file mode 100644 (file)
index 0000000..84c4d6f
--- /dev/null
@@ -0,0 +1,6 @@
+.deps
+.dirstamp
+*.dll
+*.dylib
+*.sl
+*.so
diff --git a/modules/gui/skins/src/anchor.cpp b/modules/gui/skins/src/anchor.cpp
new file mode 100644 (file)
index 0000000..d77feee
--- /dev/null
@@ -0,0 +1,101 @@
+/*****************************************************************************
+ * anchor.cpp: Anchor class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: anchor.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- GENERAL ---------------------------------------------------------------
+#include <math.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "anchor.h"
+#include "window.h"
+
+
+//---------------------------------------------------------------------------
+// Anchors
+//---------------------------------------------------------------------------
+Anchor::Anchor( intf_thread_t *_p_intf, int x, int y, int len, int priority,
+                Window *parent )
+{
+    p_intf = _p_intf;
+    Parent   = parent;
+    Left     = x;
+    Top      = y;
+    Priority = priority;
+    Len      = len;
+}
+//---------------------------------------------------------------------------
+bool Anchor::IsInList( Anchor *anc )
+{
+    // Declare iterator
+    list<Anchor *>::const_iterator elt;
+
+    // Iterate through list
+    for( elt = HangList.begin(); elt != HangList.end(); elt++)
+    {
+        if( (*elt) == anc )
+            return true;
+    }
+
+    return false;
+}
+//---------------------------------------------------------------------------
+void Anchor::Add( Anchor *anc )
+{
+    HangList.push_back( anc );
+}
+//---------------------------------------------------------------------------
+void Anchor::Remove( Anchor *anc )
+{
+    HangList.remove( anc );
+}
+//---------------------------------------------------------------------------
+bool Anchor::Hang( Anchor *anc, int mx, int my )
+{
+    // Get position of anchor
+    int x, y, px, py;
+    Parent->GetPos( px, py );
+    anc->GetPos( x, y );
+    x += mx - px;
+    y += my - py;
+
+    // Len of 0 is equal to unactivate anchor
+    if( Len > 0 && sqrt( (Left-x)*(Left-x) + (Top-y)*(Top-y) ) <= Len )
+    {
+        return true;
+    }
+
+    return false;
+}
+//---------------------------------------------------------------------------
+void Anchor::GetPos( int &x, int &y )
+{
+    x = Left;
+    y = Top;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/anchor.h b/modules/gui/skins/src/anchor.h
new file mode 100644 (file)
index 0000000..e9e3776
--- /dev/null
@@ -0,0 +1,80 @@
+/*****************************************************************************
+ * anchor.h: Anchor class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: anchor.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_ANCHOR
+#define VLC_SKIN_ANCHOR
+
+//--- GENERAL ---------------------------------------------------------------
+#include <list>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Window;
+//---------------------------------------------------------------------------
+class Anchor
+{
+    private:
+        // Position parameters
+        int Left;
+        int Top;
+
+        // Ray of action
+        int Len;
+
+        // Priority
+        int Priority;
+
+        // Parent window
+        Window *Parent;
+
+        // Interface thread
+        intf_thread_t *p_intf;
+
+    public:
+        // Constructor
+        Anchor( intf_thread_t *_p_intf, int x, int y, int len, int priority,
+                Window *parent );
+
+        // Hang to anchor if in neighbourhood
+        bool Hang( Anchor *anc, int mx, int my );
+        void Add( Anchor *anc );
+        void Remove( Anchor *anc );
+        bool IsInList( Anchor *anc );
+
+        // List of windows actually magnetized
+        list<Anchor *> HangList;
+
+        // Get position of anchor
+        void GetPos( int &x, int &y );
+
+        // Getters
+        int GetPriority()       { return Priority; }
+        Window *GetParent()     { return Parent; }
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/src/banks.cpp b/modules/gui/skins/src/banks.cpp
new file mode 100644 (file)
index 0000000..7df5f05
--- /dev/null
@@ -0,0 +1,284 @@
+/*****************************************************************************
+ * banks.cpp: Bitmap bank, Event, bank, Font bank and OffSet bank
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: banks.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "bitmap.h"
+#include "os_bitmap.h"
+#include "event.h"
+#include "os_event.h"
+#include "font.h"
+#include "os_font.h"
+#include "banks.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+//  Bitmap Bank
+//---------------------------------------------------------------------------
+BitmapBank::BitmapBank( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+
+    // Create default bitmap
+    Add( DEFAULT_BITMAP_NAME, "", 0 );
+}
+//---------------------------------------------------------------------------
+BitmapBank::~BitmapBank()
+{
+    for( map<string,Bitmap *>::iterator iter = Bank.begin();
+         iter != Bank.end(); iter++ )
+    {
+        delete (OSBitmap *)iter->second;
+    }
+}
+//---------------------------------------------------------------------------
+bool BitmapBank::Add( string Id, string FileName, int AColor )
+{
+    if( Bank[Id] != NULL )
+    {
+        msg_Warn( p_intf, "Bitmap name already exists: %s", Id.c_str() );
+        return false;
+    }
+
+    Bank[Id] = (Bitmap *)new OSBitmap( p_intf, FileName, AColor );
+    return true;
+}
+//---------------------------------------------------------------------------
+Bitmap * BitmapBank::Get( string Id )
+{
+    // If the specified bitmap doesn't exist, use the default one
+    if( Bank[Id] == NULL )
+    {
+        msg_Warn( p_intf, "Unknown bitmap name '%s', using default one",
+                  Id.c_str() );
+        return Bank[DEFAULT_BITMAP_NAME];
+    }
+
+    return Bank[Id];
+}
+//---------------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------------
+//  Font Bank
+//---------------------------------------------------------------------------
+FontBank::FontBank( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+
+    // Create default font
+    Add( DEFAULT_FONT_NAME, "arial", 12, 0, 400, false, false );
+}
+//---------------------------------------------------------------------------
+FontBank::~FontBank()
+{
+    for( map<string,Font *>::iterator iter = Bank.begin();
+         iter != Bank.end(); iter++ )
+    {
+        delete (OSFont *)iter->second;
+    }
+}
+//---------------------------------------------------------------------------
+bool FontBank::Add( string name, string fontname, int size,
+                    int color, int weight, bool italic, bool underline )
+{
+    if( Bank[name] != NULL )
+    {
+        msg_Warn( p_intf, "Font name already exists: %s", name.c_str() );
+        return false;
+    }
+
+    Bank[name] = (Font *)new OSFont( p_intf, fontname, size, color,
+                                     weight, italic, underline );
+    return true;
+}
+//---------------------------------------------------------------------------
+Font * FontBank::Get( string Id )
+{
+    // If the specified font doesn't exist, use the default one
+    if( Bank[Id] == NULL )
+    {
+        msg_Warn( p_intf, "Unknown font name '%s', using default one",
+                  Id.c_str() );
+        return Bank[DEFAULT_FONT_NAME];
+    }
+
+    return Bank[Id];
+}
+//---------------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------------
+//  Event Bank
+//---------------------------------------------------------------------------
+EventBank::EventBank( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+
+    // Create default event
+    Add( DEFAULT_EVENT_NAME, "VLC_NOTHING",             "none" );
+
+    Add( "none",             "VLC_NOTHING",             "none" );
+    Add( "time",             "VLC_STREAMPOS",           "none" );
+    Add( "left_time",        "VLC_ENDSTREAMPOS",        "none" );
+    Add( "total_time",       "VLC_TOTALSTREAMPOS",      "none" );
+    Add( "file_name",        "VLC_STREAMNAME",          "none" );
+    Add( "help",             "VLC_HELP_TEXT",           "none" );
+
+    Add( "tray",             "VLC_CHANGE_TRAY",         "CTRL+T" );
+    Add( "taskbar",          "VLC_CHANGE_TASKBAR",      "CTRL+B" );
+
+    Add( "playlist_refresh", "CTRL_PLAYLIST",           "none" );
+    Add( "play",             "VLC_PLAY",                "X" );
+    Add( "pause",            "VLC_PAUSE",               "C" );
+    Add( "stop",             "VLC_STOP",                "V" );
+    Add( "next",             "VLC_NEXT",                "B" );
+    Add( "prev",             "VLC_PREV",                "Z" );
+    Add( "fullscreen",       "VLC_FULLSCREEN",          "F" );
+
+    // Volume control
+    Add( "mute",             "VLC_VOLUME_CHANGE(MUTE)", "none" );
+    Add( "volume_up",        "VLC_VOLUME_CHANGE(UP)",   "none" );
+    Add( "volume_down",      "VLC_VOLUME_CHANGE(DOWN)", "none" );
+    Add( "volume_refresh",   "VLC_VOLUME_CHANGE(SET)",  "none" );
+
+    // Log events
+    Add( "show_log",         "VLC_LOG_SHOW(TRUE)",      "none" );
+    Add( "hide_log",         "VLC_LOG_SHOW(FALSE)",     "none" );
+    Add( "clear_log",        "VLC_LOG_CLEAR",           "none" );
+
+    Add( "quit",             "VLC_HIDE(VLC_QUIT)",      "CTRL+C" );
+    Add( "open",             "VLC_OPEN",                "CTRL+O" );
+    Add( "add_file",         "VLC_PLAYLIST_ADD_FILE",   "CTRL+A" );
+    Add( "load_skin",        "VLC_LOAD_SKIN",           "CTRL+S" );
+
+}
+//---------------------------------------------------------------------------
+EventBank::~EventBank()
+{
+    for( map<string,Event *>::iterator iter = Bank.begin();
+         iter != Bank.end(); iter++ )
+    {
+        delete (OSEvent *)iter->second;
+    }
+}
+//---------------------------------------------------------------------------
+bool EventBank::Add( string Name, string EventDesc, string shortcut )
+{
+    if( Bank[Name] != NULL )
+    {
+        msg_Warn( p_intf, "Event name already exists: %s", Name.c_str() );
+        return false;
+    }
+
+    Bank[Name] = (Event *)new OSEvent( p_intf, EventDesc, shortcut );
+    return true;
+}
+//---------------------------------------------------------------------------
+void EventBank::TestShortcut( int key, int mod )
+{
+    for( map<string,Event *>::iterator iter = Bank.begin();
+         iter != Bank.end(); iter++ )
+    {
+        // If key and modifier match to event shortcut, send event
+        if( iter->second->MatchShortcut( key, mod ) )
+            iter->second->SendEvent();
+    }
+}
+//---------------------------------------------------------------------------
+Event * EventBank::Get( string Id )
+{
+    // If the specified font doesn't exist, use the default one
+    if( Bank[Id] == NULL )
+    {
+        msg_Warn( p_intf, "Unknown event name '%s', using default one",
+                  Id.c_str() );
+        return Bank[DEFAULT_EVENT_NAME];
+    }
+
+    return Bank[Id];
+}
+//---------------------------------------------------------------------------
+void EventBank::Init()
+{
+    for( map<string,Event *>::iterator iter = Bank.begin();
+         iter != Bank.end(); iter++ )
+    {
+        iter->second->CreateEvent();
+    }
+}
+//---------------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------------
+//  Offset Bank
+//---------------------------------------------------------------------------
+OffSetBank::OffSetBank( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+    XOff = 0;
+    YOff = 0;
+}
+//---------------------------------------------------------------------------
+OffSetBank::~OffSetBank()
+{
+    if( !XList.empty() )
+        msg_Warn( p_intf, "At least one offset remains" );
+}
+//---------------------------------------------------------------------------
+void OffSetBank::PushOffSet( int X, int Y )
+{
+    XList.push_front( X );
+    YList.push_front( Y );
+    XOff += X;
+    YOff += Y;
+}
+//---------------------------------------------------------------------------
+void OffSetBank::PopOffSet()
+{
+    if( XList.empty() )
+    {
+        msg_Warn( p_intf, "No offset to pop" );
+        return;
+    }
+
+    XOff -= XList.front();
+    YOff -= YList.front();
+    XList.pop_front();
+    YList.pop_front();
+}
+//---------------------------------------------------------------------------
+void OffSetBank::GetOffSet( int &X, int &Y )
+{
+    X = XOff;
+    Y = YOff;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/banks.h b/modules/gui/skins/src/banks.h
new file mode 100644 (file)
index 0000000..529a639
--- /dev/null
@@ -0,0 +1,106 @@
+/*****************************************************************************
+ * banks.h: Bitmap bank, Event bank, Font bank and OffSet bank
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: banks.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_BANKS
+#define VLC_SKIN_BANKS
+
+//---------------------------------------------------------------------------
+//--- GENERAL ---------------------------------------------------------------
+#include <map>
+#include <list>
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+#define DEFAULT_BITMAP_NAME   "DEFAULT_BITMAP"
+#define DEFAULT_FONT_NAME     "DEFAULT_FONT"
+#define DEFAULT_EVENT_NAME    "DEFAULT_EVENT"
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Bitmap;
+class Font;
+class Event;
+
+//---------------------------------------------------------------------------
+class BitmapBank
+{
+    private:
+        map<string,Bitmap *> Bank;
+        intf_thread_t *p_intf;
+    public:
+        BitmapBank( intf_thread_t *_p_intf );
+        ~BitmapBank();
+        bool Add( string Id, string FileName, int AColor );   // Add a bitmap
+        Bitmap * Get( string Id );  // Return the bitmap with matching ID
+};
+//---------------------------------------------------------------------------
+class FontBank
+{
+    private:
+        map<string,Font *> Bank;
+        intf_thread_t *p_intf;
+    public:
+        FontBank( intf_thread_t *_p_intf );
+        ~FontBank();
+        bool Add( string name, string fontname, int size,
+                  int color, int weight, bool italic, bool underline );
+        Font * Get( string Id ); // Return the font with matching ID
+};
+//---------------------------------------------------------------------------
+class EventBank
+{
+    private:
+        map<string,Event *> Bank;
+        intf_thread_t *p_intf;
+    public:
+        EventBank( intf_thread_t *_p_intf );
+        ~EventBank();
+        bool Add( string Name, string EventDesc, string shortcut );
+        void TestShortcut( int key, int mod );
+        Event * Get( string Id );   // Return the event with matching ID
+        void Init();
+};
+//---------------------------------------------------------------------------
+class OffSetBank
+{
+    private:
+        int XOff;
+        int YOff;
+        list<int> XList;
+        list<int> YList;
+        intf_thread_t *p_intf;
+    public:
+        OffSetBank( intf_thread_t *_p_intf );
+        ~OffSetBank();
+        void PushOffSet( int X, int Y );
+        void PopOffSet();
+        void GetOffSet( int &X, int &Y );
+};
+//---------------------------------------------------------------------------
+
+#endif
+
diff --git a/modules/gui/skins/src/bezier.cpp b/modules/gui/skins/src/bezier.cpp
new file mode 100644 (file)
index 0000000..a74d2ac
--- /dev/null
@@ -0,0 +1,174 @@
+/*****************************************************************************
+ * bezier.cpp: Functions to handle Bezier curves
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: bezier.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+//--- SKIN ------------------------------------------------------------------
+#include "bezier.h"
+
+
+
+//---------------------------------------------------------------------------
+// Inline methods : supposed to accelerate the code
+//---------------------------------------------------------------------------
+inline double Bezier::melange( int i, int n, double t )
+{
+    return Power( t, i ) * Power( 1 - t, (n - i) ) * ft[n] / ft[i] / ft[n - i];
+}
+//---------------------------------------------------------------------------
+inline double Bezier::bezier_pty( double t )
+{
+    double res = 0;
+    for( int i = 0; i <= maxpt; i++ )
+    {
+        res += pty[i] * melange( i, maxpt, t );
+    }
+    return res;
+}
+//---------------------------------------------------------------------------
+inline double Bezier::bezier_ptx( double t )
+{
+    double res = 0;
+    for( int i = 0; i <= maxpt; i++ )
+    {
+        res += ptx[i] * melange( i, maxpt, t );
+    }
+    return res;
+}
+//---------------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------------
+// BEZIER
+// The bezier class generate bezier curves
+//---------------------------------------------------------------------------
+Bezier::Bezier( double *x, double *y, int n, int flag )
+{
+    int i;
+
+    // x and y pointer are arrays of the coordinates of the points
+    // n is the number of points
+
+    // Allocation of ressources for arrays of points
+    ptx = new double[n];
+    pty = new double[n];
+
+    // ft is factoriels
+    // Here we create an array an precalculate them
+    ft  = new double[n];
+    ft[0] = 1;
+    for( i = 0; i < n; i++ )
+    {
+        ptx[i] = x[i];    // assign values of coordinates
+        pty[i] = y[i];
+        if( i > 0 )
+            ft[i] = i * ft[i - 1];
+    }
+    maxpt = n - 1;
+
+    // FLAG values :
+    //   - BEZIER_PTS_ALL : when x and y are differents
+    //   - BEZIER_PTS_Y   : when only y is different
+    //   - BEZIER_PTS_X   : when only x is different
+
+    // Initialization
+    Flag         = flag;
+    Max          = 0;                 // Init number of pixels
+    double Range = MAX_BEZIER_POINT;  // max number of pixel
+    int last_i   = 0;
+    int cx, cy, oldx, oldy;
+    Left = new int[MAX_BEZIER_POINT + 1];
+    Top  = new int[MAX_BEZIER_POINT + 1];
+
+    // Calculate first point
+    double per = 0;
+    double j;
+    GetPoint( per, oldx, oldy );
+    Left[0] = oldx;
+    Top[0]  = oldy;
+
+    // Search for number of different points
+    for( j = 1; j <= Range; j++ )
+    {
+        per = j / Range;
+        GetPoint( per, cx, cy );
+        if( ( Flag == BEZIER_PTS_ALL && ( cy != oldy || cx != oldx ) ) ||
+            ( Flag == BEZIER_PTS_Y   && cy != oldy ) ||
+            ( Flag == BEZIER_PTS_X   && cx != oldx ) )
+        {
+            Max++;
+            Left[Max] = cx;
+            Top[Max]  = cy;
+            oldx = cx;
+            oldy = cy;
+
+            // Accelerator
+            if( i - last_i > 2 )
+            {
+                i += i - last_i - 1;
+            }
+            last_i = i;
+        }
+    }
+}
+//---------------------------------------------------------------------------
+Bezier::~Bezier()
+{
+    delete[] Left;
+    delete[] Top;
+    delete[] ptx;
+    delete[] pty;
+    delete[] ft;
+}
+//---------------------------------------------------------------------------
+void Bezier::GetPoint( double i, int &x, int &y )
+{
+    // Get the coordinates of the point at i precent of
+    // the curve (i must be between 0 and 1)
+    x = (int)(float)bezier_ptx( i );
+    y = (int)(float)bezier_pty( i );
+}
+//---------------------------------------------------------------------------
+int Bezier::GetNumOfDifferentPoints()
+{
+    return Max;
+}
+//---------------------------------------------------------------------------
+void Bezier::GetDifferentPoints( int *x, int *y, int OffX, int OffY )
+{
+    for( int i = 0; i <= Max; i++ )
+    {
+        x[i] = Left[i] + OffX;
+        y[i] = Top[i]  + OffY;
+    }
+}
+//---------------------------------------------------------------------------
+double Bezier::Power( double x, int n )
+{
+    if( n > 0 )
+        return x * Power( x, n - 1);
+    else
+        return 1;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/bezier.h b/modules/gui/skins/src/bezier.h
new file mode 100644 (file)
index 0000000..b04f0b9
--- /dev/null
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * bezier.h: Functios to handle Bezier curves
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: bezier.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_BEZIER
+#define VLC_SKIN_BEZIER
+
+//---------------------------------------------------------------------------
+#define MAX_BEZIER_POINT    1023
+#define BEZIER_PTS_ALL      0
+#define BEZIER_PTS_Y        1
+#define BEZIER_PTS_X        2
+
+
+
+//---------------------------------------------------------------------------
+class Bezier
+{
+    private:
+        int maxpt;
+        double *ptx;
+        double *pty;
+        double *ft;
+        double melange( int i, int n, double t );
+        double bezier_pty( double t );
+        double bezier_ptx( double t );
+
+        // Different points
+        int Flag;
+        int Max;
+        int *Left;
+        int *Top;
+
+        // x^n
+        double Power( double x, int n );
+
+    public:
+        // Constructor
+        Bezier( double *x, double *y, int n, int flag = BEZIER_PTS_ALL );
+
+        // Destructor
+        ~Bezier();
+
+        void GetPoint( double i, int &x, int &y );
+        void GetDifferentPoints( int *x, int *y, int OffX = 0, int OffY = 0 );
+        int  GetNumOfDifferentPoints();
+
+};
+
+//---------------------------------------------------------------------------
+#endif
diff --git a/modules/gui/skins/src/bitmap.cpp b/modules/gui/skins/src/bitmap.cpp
new file mode 100644 (file)
index 0000000..1f7c8d1
--- /dev/null
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * bitmap.cpp: Bitmap class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: bitmap.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "bitmap.h"
+
+
+
+//---------------------------------------------------------------------------
+//   Bitmap
+//---------------------------------------------------------------------------
+Bitmap::Bitmap( intf_thread_t *_p_intf, string FileName, int AColor )
+{
+    p_intf = _p_intf;
+}
+//---------------------------------------------------------------------------
+Bitmap::Bitmap( intf_thread_t *_p_intf, Graphics *from, int x, int y,
+                int w, int h, int AColor )
+{
+    p_intf = _p_intf;
+}
+//---------------------------------------------------------------------------
+Bitmap::Bitmap( intf_thread_t *_p_intf, Bitmap *c )
+{
+    p_intf = _p_intf;
+}
+//---------------------------------------------------------------------------
+Bitmap::~Bitmap()
+{
+}
+//---------------------------------------------------------------------------
+void Bitmap::GetSize( int &w, int &h )
+{
+    w = Width;
+    h = Height;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/bitmap.h b/modules/gui/skins/src/bitmap.h
new file mode 100644 (file)
index 0000000..e6b58d7
--- /dev/null
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * bitmap.h: Bitmap class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: bitmap.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_BITMAP
+#define VLC_SKIN_BITMAP
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Graphics;
+
+//---------------------------------------------------------------------------
+class Bitmap
+{
+    protected:
+        int Width;
+        int Height;
+        unsigned int AlphaColor;
+        intf_thread_t *p_intf;
+
+    public:
+        void GetSize( int &w, int &h );
+        int GetAlphaColor()     { return AlphaColor; }
+
+        // Constructors
+        Bitmap( intf_thread_t *_p_intf, string FileName, int AColor );
+        Bitmap( intf_thread_t *_p_intf, Graphics *from, int x, int y,
+                int w, int h, int AColor );
+        Bitmap( intf_thread_t *_p_intf, Bitmap *c );
+
+        // Destructor
+        virtual ~Bitmap();
+
+        virtual void DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
+                                 Graphics *dest ) = 0;
+        virtual bool Hit( int x, int y ) = 0;
+
+        virtual int  GetBmpPixel( int x, int y ) = 0;
+        virtual void SetBmpPixel( int x, int y, int color ) = 0;
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/src/dialog.cpp b/modules/gui/skins/src/dialog.cpp
new file mode 100644 (file)
index 0000000..e0773b7
--- /dev/null
@@ -0,0 +1,115 @@
+/*****************************************************************************
+ * dialog.cpp: Classes for some dialog boxes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: dialog.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "dialog.h"
+
+
+
+//---------------------------------------------------------------------------
+// Open file dialog box
+//---------------------------------------------------------------------------
+OpenFileDialog::OpenFileDialog( string title, bool multiselect )
+{
+    MultiSelect  = multiselect;
+    Title        = title;
+    Filter       = new char[200];
+    FilterLength = 0;
+}
+//---------------------------------------------------------------------------
+OpenFileDialog::~OpenFileDialog()
+{
+    delete[] Filter;
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// Log Window
+//---------------------------------------------------------------------------
+LogWindow::LogWindow( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+    Visible = false;
+}
+//---------------------------------------------------------------------------
+LogWindow::~LogWindow()
+{
+}
+//---------------------------------------------------------------------------
+void LogWindow::Update( msg_subscription_t *Sub )
+{
+    //if( !Visible )
+    //    return;
+
+    int i_start, i_stop;
+    int i_max_lines;
+
+    vlc_mutex_lock( Sub->p_lock );
+    i_stop = *Sub->pi_stop;
+    vlc_mutex_unlock( Sub->p_lock );
+
+    if( Sub->i_start != i_stop )
+    {
+        for( i_start = Sub->i_start;
+             i_start != i_stop;
+             i_start = (i_start+1) % VLC_MSG_QSIZE )
+        {
+
+
+            // Append all messages to log window
+            switch( Sub->p_msg[i_start].i_type )
+            {
+                case VLC_MSG_ERR:
+                    ChangeColor( RGB( 255, 0, 0 ), true );
+                    break;
+                case VLC_MSG_WARN:
+                    ChangeColor( RGB( 255, 128, 0 ), true );
+                    break;
+                default:
+                    ChangeColor( RGB( 128, 128, 128 ) );
+                    break;
+            }
+
+            // Add message
+            if( i_max_lines )
+            {
+                AddLine( (string)Sub->p_msg[i_start].psz_msg );
+            }
+        }
+
+        vlc_mutex_lock( Sub->p_lock );
+        Sub->i_start = i_start;
+        vlc_mutex_unlock( Sub->p_lock );
+    }
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/dialog.h b/modules/gui/skins/src/dialog.h
new file mode 100644 (file)
index 0000000..5da5a8f
--- /dev/null
@@ -0,0 +1,93 @@
+/*****************************************************************************
+ * dialog.h: Classes for some dialog boxes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: dialog.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_DIALOG
+#define VLC_SKIN_DIALOG
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+#include <list>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+struct msg_subscription_t;
+
+//---------------------------------------------------------------------------
+class OpenFileDialog
+{
+    private:
+
+    protected:
+        char   *Filter;
+        int    FilterLength;
+        string Title;
+        bool   MultiSelect;
+
+    public:
+        // Constructors
+        OpenFileDialog( string title, bool multiselect );
+
+        // Destructors
+        virtual ~OpenFileDialog();
+
+        // List of files
+        list<string> FileList;
+
+        // Specific methods
+        virtual void AddFilter( string name, string type ) = 0;
+        virtual bool Open() = 0;
+};
+//---------------------------------------------------------------------------
+class LogWindow
+{
+    protected:
+        bool Visible;
+        intf_thread_t *p_intf;
+
+    public:
+        // Constructors
+        LogWindow( intf_thread_t *_p_intf );
+
+        // Destructors
+        virtual ~LogWindow();
+
+        virtual void Clear() = 0;
+        virtual void AddLine( string line ) = 0;
+        virtual void ChangeColor( int color, bool bold = false ) = 0;
+        virtual void Show() = 0;
+        virtual void Hide() = 0;
+
+        // Getters
+        bool IsVisible()    { return Visible; };
+
+        void Update( msg_subscription_t *Sub );
+
+};
+//---------------------------------------------------------------------------
+
+#endif
+
diff --git a/modules/gui/skins/src/event.cpp b/modules/gui/skins/src/event.cpp
new file mode 100644 (file)
index 0000000..169882b
--- /dev/null
@@ -0,0 +1,486 @@
+/*****************************************************************************
+ * event.cpp: Event class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: event.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "skin_common.h"
+#include "banks.h"
+#include "generic.h"
+#include "window.h"
+#include "theme.h"
+#include "event.h"
+#include "os_event.h"
+
+
+
+//---------------------------------------------------------------------------
+//   VLC Event
+//---------------------------------------------------------------------------
+Event::Event( intf_thread_t *_p_intf, string Desc, string shortcut )
+{
+    p_intf = _p_intf;
+    EventDesc = Desc;
+    Message   = VLC_NOTHING;
+    Param1    = 0;
+    Param2    = 0;
+    Shortcut  = shortcut;
+}
+//---------------------------------------------------------------------------
+Event::Event( intf_thread_t *_p_intf, unsigned int msg, unsigned int par1,
+              long par2 )
+{
+    p_intf = _p_intf;
+    Message  = msg;
+    Param1   = par1;
+    Param2   = par2;
+    Shortcut = "none";
+}
+//---------------------------------------------------------------------------
+Event::~Event()
+{
+}
+//---------------------------------------------------------------------------
+void Event::DestructParameters()
+{
+    switch( Message )
+    {
+        case CTRL_SYNCHRO:
+            if( Param2 == (int)true )
+                delete (Event *)Param1;
+            break;
+
+        case CTRL_SET_TEXT:
+            delete (char *)Param2;
+            break;
+    }
+
+}
+//---------------------------------------------------------------------------
+bool Event::IsEqual( Event *evt )
+{
+    return( evt->GetMessage() == Message && evt->GetParam1() == Param1 &&
+            evt->GetParam2()  == Param2 );
+}
+//---------------------------------------------------------------------------
+void Event::PostSynchroMessage( bool autodelete )
+{
+    OSAPI_PostMessage( NULL, CTRL_SYNCHRO, (unsigned int)this,
+                      (long)autodelete );
+}
+//---------------------------------------------------------------------------
+void Event::PostTextMessage( string text )
+{
+    char *txt = new char[text.size()];
+    strcpy( txt, text.c_str() );
+    OSAPI_PostMessage( NULL, CTRL_SET_TEXT, (unsigned int)this, (long)txt );
+}
+//---------------------------------------------------------------------------
+unsigned int Event::GetMessageType( string Desc )
+{
+    if( Desc == "VLC_NOTHING" )
+        return VLC_NOTHING;
+
+    // VLC messages
+    else if( Desc == "VLC_QUIT" )
+        return VLC_QUIT;
+    else if( Desc == "VLC_HIDE" )
+        return VLC_HIDE;
+    else if( Desc == "VLC_OPEN" )
+        return VLC_OPEN;
+    else if( Desc == "VLC_LOAD_SKIN" )
+        return VLC_LOAD_SKIN;
+    else if( Desc == "VLC_CHANGE_TRAY" )
+        return VLC_CHANGE_TRAY;
+    else if( Desc == "VLC_CHANGE_TASKBAR" )
+        return VLC_CHANGE_TASKBAR;
+
+    // Stream control
+    else if( Desc == "VLC_PLAY" )
+        return VLC_PLAY;
+    else if( Desc == "VLC_STOP" )
+        return VLC_STOP;
+    else if( Desc == "VLC_PAUSE" )
+        return VLC_PAUSE;
+    else if( Desc == "VLC_NEXT" )
+        return VLC_NEXT;
+    else if( Desc == "VLC_PREV" )
+        return VLC_PREV;
+    else if( Desc == "VLC_STREAMPOS" )
+        return VLC_STREAMPOS;
+    else if( Desc == "VLC_ENDSTREAMPOS" )
+        return VLC_ENDSTREAMPOS;
+    else if( Desc == "VLC_TOTALSTREAMPOS" )
+        return VLC_TOTALSTREAMPOS;
+    else if( Desc == "VLC_STREAMNAME" )
+        return VLC_STREAMNAME;
+    else if( Desc == "VLC_HELP_TEXT" )
+        return VLC_HELP_TEXT;
+
+    // Volume control
+    else if( Desc == "VLC_VOLUME_CHANGE" )
+        return VLC_VOLUME_CHANGE;
+    else if( Desc == "VLC_VOLUME_MUTE" )
+        return VLC_VOLUME_MUTE;
+    else if( Desc == "VLC_VOLUME_UP" )
+        return VLC_VOLUME_UP;
+    else if( Desc == "VLC_VOLUME_DOWN" )
+        return VLC_VOLUME_DOWN;
+    else if( Desc == "VLC_VOLUME_SET" )
+        return VLC_VOLUME_SET;
+
+    // Logs
+    else if( Desc == "VLC_LOG_SHOW" )
+        return VLC_LOG_SHOW;
+    else if( Desc == "VLC_LOG_CLEAR" )
+        return VLC_LOG_CLEAR;
+
+    // Playlist events
+    else if( Desc == "VLC_PLAYLIST_ADD_FILE" )
+        return VLC_PLAYLIST_ADD_FILE;
+
+    // Video output events
+    else if( Desc == "VLC_FULLSCREEN" )
+        return VLC_FULLSCREEN;
+
+    // Window event
+    else if( Desc == "WINDOW_MOVE" )
+        return WINDOW_MOVE;
+    else if( Desc == "WINDOW_OPEN" )
+        return WINDOW_OPEN;
+    else if( Desc == "WINDOW_CLOSE" )
+        return WINDOW_CLOSE;
+    else if( Desc == "WINDOW_SHOW" )
+        return WINDOW_SHOW;
+    else if( Desc == "WINDOW_HIDE" )
+        return WINDOW_HIDE;
+    else if( Desc == "WINDOW_FADE" )
+        return WINDOW_FADE;
+
+    // Control event
+    else if( Desc == "CTRL_ENABLED" )
+        return CTRL_ENABLED;
+    else if( Desc == "CTRL_VISIBLE" )
+        return CTRL_VISIBLE;
+    else if( Desc == "CTRL_SYNCHRO" )
+        return CTRL_SYNCHRO;
+    else if( Desc == "CTRL_SET_TEXT" )
+        return CTRL_SET_TEXT;
+    else if( Desc == "CTRL_SET_SLIDER" )
+        return CTRL_SET_SLIDER;
+
+
+    // Control event by ID
+    else if( Desc == "CTRL_ID_VISIBLE" )
+        return CTRL_ID_VISIBLE;
+    else if( Desc == "CTRL_ID_ENABLED" )
+        return CTRL_ID_ENABLED;
+    else if( Desc == "CTRL_ID_MOVE" )
+        return CTRL_ID_MOVE;
+
+    // Control definition
+    else if( Desc == "CTRL_SLIDER" )
+        return CTRL_SLIDER;
+    else if( Desc == "CTRL_TIME" )
+        return CTRL_TIME;
+    else if( Desc == "CTRL_PLAYLIST" )
+        return CTRL_PLAYLIST;
+
+    // Playlist
+    else if( Desc == "PLAYLIST_ID_DEL" )
+        return PLAYLIST_ID_DEL;
+
+    // Not found
+    else
+    {
+        msg_Warn( p_intf, "Theme: Unknown event (%s)", EventDesc.c_str() );
+        return VLC_NOTHING;
+    }
+}
+//---------------------------------------------------------------------------
+void Event::CreateEvent()
+{
+    // Initiatization
+    int x, y;
+    char *msg   = new char[MAX_EVENT_SIZE];
+    char *para1 = new char[MAX_PARAM_SIZE];
+    char *para2 = new char[MAX_PARAM_SIZE];
+    char *para3 = new char[MAX_PARAM_SIZE];
+
+    // Scan the event
+    int scan = sscanf( EventDesc.c_str(),
+        "%[^(](%[^,)],%[^,)],%[^,)])", msg, para1, para2, para3 );
+
+    // Check parameters
+    if( scan < 1 )
+        msg = "VLC_NOTHING";
+    if( scan < 2 )
+        para1 = "";
+    if( scan < 3 )
+        para2 = "";
+    if( scan < 4 )
+        para3 = "";
+
+    // Find Message type
+    Message = GetMessageType( msg );
+
+    // Find Parameters
+    switch( Message )
+    {
+        case VLC_HIDE:
+            Param1 = GetMessageType( para1 );
+            break;
+
+        case VLC_VOLUME_CHANGE:
+            if( strcmp( para1, "MUTE" ) == 0 )
+                Param1 = VLC_VOLUME_MUTE;
+            else if( strcmp( para1, "UP" ) == 0 )
+                Param1 = VLC_VOLUME_UP;
+            else if( strcmp( para1, "DOWN" ) == 0 )
+                Param1 = VLC_VOLUME_DOWN;
+            else if( strcmp( para1, "SET" ) == 0 )
+            {
+                Param1 = VLC_VOLUME_SET;
+                Param2 = atoi( para2 ) * AOUT_VOLUME_MAX / 100;
+            }
+            break;
+
+        case VLC_LOG_SHOW:
+            Param2 = GetBool( para1 );
+            break;
+
+        case CTRL_ID_VISIBLE:
+            Param1 = (unsigned int)FindControl( para1 );
+            Param2 = GetBool( para2 );
+            break;
+
+        case CTRL_ID_ENABLED:
+            Param1 = (unsigned int)FindControl( para1 );
+            Param2 = GetBool( para2 );
+            break;
+
+        case CTRL_ID_MOVE:
+            Param1 = (unsigned int)FindControl( para1 );
+            x = atoi( para2 );
+            y = atoi( para3 );
+            if( x < 0 )
+                x = -x + 0x8000;
+            if( y < 0 )
+                y = -y + 0x8000;
+            Param2 = ( y << 16 ) | x;
+            break;
+
+        case WINDOW_OPEN:
+            Param2 = GetBool( para2 );
+            break;
+
+        case WINDOW_CLOSE:
+            Param2 = GetBool( para2 );
+            break;
+
+        case PLAYLIST_ID_DEL:
+            Param1 = (unsigned int)FindControl( para1 );
+            break;
+
+        default:
+            break;
+    }
+
+    // Get OS specific parameters
+    CreateOSEvent( para1, para2, para3 );
+
+    // Free memory
+    delete[] msg;
+    delete[] para1;
+    delete[] para2;
+    delete[] para3;
+
+    // Create shortcut
+    CreateShortcut();
+
+}
+//---------------------------------------------------------------------------
+GenericControl * Event::FindControl( string id )
+{
+    list<Window *>::const_iterator win;
+    unsigned int i;
+
+    for( win = p_intf->p_sys->p_theme->WindowList.begin();
+         win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+    {
+        for( i = 0; i < (*win)->ControlList.size(); i++ )
+        {
+            if( (*win)->ControlList[i]->IsID( id ) )
+                return (*win)->ControlList[i];
+        }
+    }
+    return NULL;
+
+}
+//---------------------------------------------------------------------------
+int Event::GetBool( string expr )
+{
+    if( expr == "FALSE" )
+    {
+        return 0;
+    }
+    else if( expr == "TRUE" )
+    {
+        return 1;
+    }
+    else if( expr == "CHANGE" )
+    {
+        return 2;
+    }
+    return 2;
+}
+//---------------------------------------------------------------------------
+void Event::CreateShortcut()
+{
+    if( Shortcut == "none" )
+        return;
+
+    // Initiatization
+    char *mod = new char[4];
+    char *key = new char[4];
+
+    // Scan the event
+    int scan = sscanf( Shortcut.c_str(), "%[^+]+%s", mod, key );
+
+    // Check parameters
+    if( scan == 2 )
+    {
+        Key = (int)key[0];
+        if( (string)mod == "ALT" )
+            KeyModifier = 1;
+        else if( (string)mod == "CTRL" )
+            KeyModifier = 2;
+        else
+            KeyModifier = 0;
+    }
+    else if( scan == 1 )
+    {
+        Key = (int)mod[0];
+        KeyModifier = 0;
+    }
+
+    delete[] mod;
+    delete[] key;
+}
+//---------------------------------------------------------------------------
+bool Event::MatchShortcut( int key, int mod )
+{
+    // Modifier
+    // None    = 0
+    // ALT     = 1
+    // CONTROL = 2
+    if( Shortcut != "none" && key == Key && mod == KeyModifier )
+        return true;
+    else
+        return false;
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// Action
+//---------------------------------------------------------------------------
+Action::Action( intf_thread_t *_p_intf, string code )
+{
+    p_intf = _p_intf;
+
+    // Initiatization
+    int scan;
+    char *evt  = new char[MAX_EVENT_SIZE];
+    char *next = new char[MAX_PARAM_SIZE];
+
+    // Create events separated with a semicolon
+    while( code != "none" )
+    {
+        scan  = sscanf( code.c_str(), "%[^;];%s", evt, next );
+        EventList.push_back( p_intf->p_sys->p_theme->EvtBank->Get( evt ) );
+
+        // Check if script is finished
+        if( scan < 2 )
+            code = "none";
+        else
+            code = next;
+    }
+
+    // Free memory
+    delete[] evt;
+    delete[] next;
+
+}
+//---------------------------------------------------------------------------
+Action::~Action()
+{
+
+}
+//---------------------------------------------------------------------------
+bool Action::SendEvent()
+{
+    bool res = false;
+    for( list<Event *>::const_iterator evt = EventList.begin();
+         evt != EventList.end(); evt++ )
+    {
+        res |= (*evt)->SendEvent();
+    }
+    return res;
+}
+//---------------------------------------------------------------------------
+bool Action::MatchEvent( Event *evt, int flag )
+{
+    list<Event *>::const_iterator event;
+
+    switch( flag )
+    {
+        case ACTION_MATCH_ALL:
+            for( event = EventList.begin(); event != EventList.end(); event++ )
+                if( !(*event)->IsEqual( evt ) )
+                    return false;
+            break;
+
+        case ACTION_MATCH_ONE:
+            for( event = EventList.begin(); event != EventList.end(); event++ )
+                if( (*event)->IsEqual( evt ) )
+                    return true;
+            return false;
+            break;
+
+        case ACTION_MATCH_FIRST:
+            if( !(*EventList.begin())->IsEqual( evt ) )
+                return false;
+            break;
+    }
+    return true;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/event.h b/modules/gui/skins/src/event.h
new file mode 100644 (file)
index 0000000..3c3146a
--- /dev/null
@@ -0,0 +1,211 @@
+/*****************************************************************************
+ * event.h: Event class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: event.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_EVENT
+#define VLC_SKIN_EVENT
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+#include <list>
+using namespace std;
+
+
+
+//---------------------------------------------------------------------------
+// VLC specific messages
+//---------------------------------------------------------------------------
+
+#define MAX_EVENT_SIZE 20
+#define MAX_PARAM_SIZE 20
+
+#define VLC_MESSAGE         (WM_APP)
+#define VLC_WINDOW          (WM_APP + 1000)
+#define VLC_CONTROL         (WM_APP + 2000)
+
+// VLC messages
+#define VLC_NOTHING         (VLC_MESSAGE + 1)
+#define VLC_SHOW            (VLC_MESSAGE + 2)
+#define VLC_HIDE            (VLC_MESSAGE + 3)
+
+#define VLC_QUIT            (VLC_MESSAGE + 4)
+#define VLC_OPEN            (VLC_MESSAGE + 5)
+#define VLC_LOAD_SKIN       (VLC_MESSAGE + 6)
+#define VLC_DROP            (VLC_MESSAGE + 7)
+
+#define VLC_LOG_SHOW        (VLC_MESSAGE + 20)
+#define VLC_LOG_CLEAR       (VLC_MESSAGE + 22)
+
+#define VLC_INTF_REFRESH    (VLC_MESSAGE + 30)
+#define VLC_CHANGE_TRAY     (VLC_MESSAGE + 31)
+#define VLC_CHANGE_TASKBAR  (VLC_MESSAGE + 32)
+
+#define VLC_FULLSCREEN      (VLC_MESSAGE + 40)
+
+// Stream control
+#define VLC_PLAY            (VLC_MESSAGE + 101)
+#define VLC_STOP            (VLC_MESSAGE + 102)
+#define VLC_PAUSE           (VLC_MESSAGE + 103)
+#define VLC_NEXT            (VLC_MESSAGE + 104)
+#define VLC_PREV            (VLC_MESSAGE + 105)
+#define VLC_STREAMPOS       (VLC_MESSAGE + 106)
+#define VLC_ENDSTREAMPOS    (VLC_MESSAGE + 107)
+#define VLC_TOTALSTREAMPOS  (VLC_MESSAGE + 108)
+#define VLC_STREAMNAME      (VLC_MESSAGE + 109)
+#define VLC_HELP_TEXT       (VLC_MESSAGE + 110)
+
+// Volume control
+#define VLC_VOLUME_CHANGE   (VLC_MESSAGE + 201)
+#define VLC_VOLUME_MUTE     (VLC_MESSAGE + 202)
+#define VLC_VOLUME_UP       (VLC_MESSAGE + 203)
+#define VLC_VOLUME_DOWN     (VLC_MESSAGE + 204)
+#define VLC_VOLUME_SET      (VLC_MESSAGE + 205)
+
+// Playlist events
+#define VLC_PLAYLIST_ADD_FILE (VLC_MESSAGE + 301)
+#define VLC_TEST_ALL_CLOSED (VLC_MESSAGE + 600)
+
+// Window event
+#define WINDOW_MOVE         (VLC_WINDOW + 1)
+#define WINDOW_OPEN         (VLC_WINDOW + 2)
+#define WINDOW_CLOSE        (VLC_WINDOW + 3)
+#define WINDOW_SHOW         (VLC_WINDOW + 4)
+#define WINDOW_HIDE         (VLC_WINDOW + 5)
+#define WINDOW_FADE         (VLC_WINDOW + 6)
+
+// Control event
+#define CTRL_ENABLED        (VLC_CONTROL + 1)
+#define CTRL_VISIBLE        (VLC_CONTROL + 2)
+#define CTRL_SYNCHRO        (VLC_CONTROL + 3)
+
+#define CTRL_SET_SLIDER     (VLC_CONTROL + 10)
+#define CTRL_SET_TEXT       (VLC_CONTROL + 11)
+
+// Control event by ID
+#define CTRL_ID_VISIBLE     (VLC_CONTROL + 100)
+#define CTRL_ID_ENABLED     (VLC_CONTROL + 101)
+#define CTRL_ID_MOVE        (VLC_CONTROL + 102)
+
+// Control definition
+#define CTRL_SLIDER         (VLC_CONTROL + 301)
+#define CTRL_TIME           (VLC_CONTROL + 302)
+#define CTRL_PLAYLIST       (VLC_CONTROL + 303)
+
+// Playlist
+#define PLAYLIST_ID_DEL     (VLC_CONTROL + 400)
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class GenericControl;
+class Window;
+class Event;
+
+
+
+//---------------------------------------------------------------------------
+// EVENT CLASS
+//---------------------------------------------------------------------------
+class Event
+{
+    protected:
+        string          EventDesc;
+        unsigned int    Message;
+        unsigned int    Param1;
+        long            Param2;
+        unsigned int    GetMessageType( string desc );
+        string          Shortcut;
+        int             KeyModifier;
+        int             Key;
+        intf_thread_t * p_intf;
+
+        // Transform expr to special boolean :
+        //   0 = false
+        //   1 = true
+        //   2 = change boolean
+        int GetBool( string expr );
+
+    public:
+        // Constructor
+        Event( intf_thread_t *_p_intf, string Desc, string shortcut );
+        Event( intf_thread_t *_p_intf, unsigned int msg, unsigned int par1,
+               long par2 );
+
+        // Destructor
+        virtual ~Event();
+        void DestructParameters();
+
+        // General operations on events
+        GenericControl * FindControl( string id );
+        void CreateEvent();
+        virtual void CreateOSEvent( string para1, string para2,
+                                    string para3 ) = 0;
+        virtual bool IsEqual( Event *evt );
+
+        // Event sending
+        virtual bool SendEvent() = 0;
+        void PostTextMessage( string text );
+        void PostSynchroMessage( bool autodelete = false );
+
+        // Shortcuts methods
+        bool MatchShortcut( int key, int mod );
+        void CreateShortcut();
+
+        // Getters
+        unsigned int GetMessage()   { return Message; }
+        unsigned int GetParam1()    { return Param1; }
+        long         GetParam2()    { return Param2; }
+
+        // Setters
+        void SetParam1( unsigned int p1 )    { Param1 = p1; }
+        void SetParam2( unsigned int p2 )    { Param2 = p2; }
+};
+//---------------------------------------------------------------------------
+
+#define ACTION_MATCH_ALL    0
+#define ACTION_MATCH_FIRST  1
+#define ACTION_MATCH_ONE    2
+
+//---------------------------------------------------------------------------
+class Action
+{
+    private:
+        list<Event *> EventList;
+        int GetBool( string expr );
+        intf_thread_t * p_intf;
+
+    public:
+        // Constructor
+        Action::Action( intf_thread_t *_p_intf, string code );
+
+        // Destructor
+        Action::~Action();
+
+        // Send event
+        bool SendEvent();
+        bool MatchEvent( Event *evt, int flag = ACTION_MATCH_ALL );
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/src/font.cpp b/modules/gui/skins/src/font.cpp
new file mode 100644 (file)
index 0000000..101a57e
--- /dev/null
@@ -0,0 +1,59 @@
+/*****************************************************************************
+ * font.cpp: Font class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: font.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "font.h"
+
+
+
+//---------------------------------------------------------------------------
+// Font object
+//---------------------------------------------------------------------------
+Font::Font( intf_thread_t *_p_intf, string fontname, int size, int color,
+    int weight, bool italic, bool underline )
+{
+    p_intf = _p_intf;
+
+    FontName  = fontname;
+    Size      = size;
+    Color     = OSAPI_GetNonTransparentColor( color );
+    Italic    = italic;
+    Underline = underline;
+    Weight    = weight;
+    if( Weight > 1000 )
+        Weight = 1000;
+    if( Weight < 1 )
+        Weight = 1;
+}
+//---------------------------------------------------------------------------
+Font::~Font()
+{
+}
+//---------------------------------------------------------------------------
diff --git a/modules/gui/skins/src/font.h b/modules/gui/skins/src/font.h
new file mode 100644 (file)
index 0000000..0e857b0
--- /dev/null
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * font.h: Font class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: font.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_FONT
+#define VLC_SKIN_FONT
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Graphics;
+
+//---------------------------------------------------------------------------
+class Font
+{
+    private:
+        // Assign font to Device Context
+        virtual void AssignFont( Graphics *dest ) = 0;
+
+        // Helper function
+        virtual void GenericPrint( Graphics *dest, string text, int x, int y,
+                                   int w, int h, int align, int color ) = 0;
+    protected:
+        int Weight;
+        string FontName;
+        bool Italic;
+        bool Underline;
+        int Size;
+        int Color;
+        intf_thread_t *p_intf;
+
+    public:
+        // Constructor
+        Font( intf_thread_t *_p_intf, string fontname, int size, int color,
+              int weight, bool italic, bool underline );
+
+        // Destructor
+        virtual ~Font();
+
+        // Get size of text
+        virtual void GetSize( string text, int &w, int &h ) = 0;
+
+        // Draw text with boundaries
+        virtual void Print( Graphics *dest, string text, int x, int y, int w,
+                            int h, int align ) = 0;
+
+        virtual void PrintColor( Graphics *dest, string text, int x, int y,
+                                 int w, int h, int align, int color ) = 0;
+
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/src/graphics.cpp b/modules/gui/skins/src/graphics.cpp
new file mode 100644 (file)
index 0000000..f6cfbdc
--- /dev/null
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ * graphics.cpp: Graphics class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: graphics.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- SKIN ------------------------------------------------------------------
+#include "graphics.h"
+
+
+
+//---------------------------------------------------------------------------
+Graphics::Graphics( int w, int h )
+{
+    Width  = w;
+    Height = h;
+}
+//---------------------------------------------------------------------------
+Graphics::~Graphics()
+{
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// REGION
+//---------------------------------------------------------------------------
+Region::Region()
+{
+}
+//---------------------------------------------------------------------------
+Region::Region( int x, int y, int w, int h )
+{
+}
+//---------------------------------------------------------------------------
+Region::~Region()
+{
+}
+//---------------------------------------------------------------------------
diff --git a/modules/gui/skins/src/graphics.h b/modules/gui/skins/src/graphics.h
new file mode 100644 (file)
index 0000000..26bcae7
--- /dev/null
@@ -0,0 +1,74 @@
+/*****************************************************************************
+ * graphics.h: Graphics and Region classes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: graphics.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_GRAPHICS
+#define VLC_SKIN_GRAPHICS
+
+//---------------------------------------------------------------------------
+class Region;
+
+//---------------------------------------------------------------------------
+class Graphics
+{
+    private:
+        int Width;
+        int Height;
+    public:
+        // Constructor
+        Graphics( int w, int h );
+        // Destructor
+        virtual ~Graphics();
+        // Drawing methods
+        virtual void CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
+                               int sx, int sy, int Flag ) = 0;
+        //virtual void CopyTo( Graphics *Dest, int dx, int dy, int dw, int dh,
+        //                     int sx, int sy, int Flag ) = 0;
+        virtual void DrawRect( int x, int y, int w, int h, int color ) = 0;
+
+        // Clipping methods
+        virtual void SetClipRegion( Region *rgn ) = 0;
+};
+//---------------------------------------------------------------------------
+class Region
+{
+    private:
+    public:
+        // Constructor
+        Region();
+        Region( int x, int y, int w, int h );
+        // Destructor
+        virtual ~Region();
+        // Modify region
+        virtual void Move( int x, int y ) = 0;
+        virtual void AddPoint( int x, int y ) = 0;
+        virtual void AddRectangle( int x, int y, int w, int h ) = 0;
+        virtual void AddElipse( int x, int y, int w, int h ) = 0;
+
+        virtual bool Hit( int x, int y ) = 0;
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/src/skin_common.h b/modules/gui/skins/src/skin_common.h
new file mode 100644 (file)
index 0000000..dab6e4a
--- /dev/null
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ * skin_common.h: Private Skin interface description
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: skin_common.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef SKIN_COMMON_H
+#define SKIN_COMMON_H
+
+#define SLIDER_RANGE        1048576  // 1024*1024
+#define DEFAULT_SKIN_FILE   "skins/default.vlt"
+
+
+class Theme;
+
+/*****************************************************************************
+ * intf_sys_t: description and status of skin interface
+ *****************************************************************************/
+struct intf_sys_t
+{
+    /* Pointer to the theme main class */
+    Theme *p_theme;
+    char *p_new_theme_file;
+
+    /* The input thread */
+    input_thread_t  * p_input;
+
+    /* The playlist thread */
+    playlist_t * p_playlist;
+
+    // Check if thread is closing
+    int  i_close_status;
+    bool b_all_win_closed;
+
+    /* message bank subscription */
+    msg_subscription_t* p_sub;
+
+    // Interface status
+    int         i_index;        // Set wich file is being played
+    int         i_size;         // Size of playlist;
+
+};
+
+#endif
+
+
+
+
diff --git a/modules/gui/skins/src/skin_main.cpp b/modules/gui/skins/src/skin_main.cpp
new file mode 100644 (file)
index 0000000..d87bae1
--- /dev/null
@@ -0,0 +1,323 @@
+/*****************************************************************************
+ * skin-main.cpp: skins plugin for VLC
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: skin_main.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/vlc.h>
+#include <vlc/intf.h>
+#include <vlc/aout.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "event.h"
+#include "dialog.h"
+#include "os_dialog.h"
+#include "banks.h"
+#include "window.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "themeloader.h"
+#include "vlcproc.h"
+#include "skin_common.h"
+
+
+//---------------------------------------------------------------------------
+// Interface thread
+// It is a global variable because we have C code for the parser, and we
+// need to access C++ objects from there
+//---------------------------------------------------------------------------
+intf_thread_t *g_pIntf;
+
+//---------------------------------------------------------------------------
+// Exported interface functions.
+//---------------------------------------------------------------------------
+extern "C" __declspec( dllexport )
+    int __VLC_SYMBOL( vlc_entry ) ( module_t *p_module );
+
+//---------------------------------------------------------------------------
+// Local prototypes.
+//---------------------------------------------------------------------------
+static int  Open   ( vlc_object_t * );
+static void Close  ( vlc_object_t * );
+static void Run    ( intf_thread_t * );
+
+int  SkinManage( intf_thread_t *p_intf );
+void OSRun( intf_thread_t *p_intf );
+
+//---------------------------------------------------------------------------
+// Open: initialize interface
+//---------------------------------------------------------------------------
+static int Open ( vlc_object_t *p_this )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)p_this;
+    g_pIntf = p_intf;
+
+    // Allocate instance and initialize some members
+    p_intf->p_sys = (intf_sys_t *) malloc( sizeof( intf_sys_t ) );
+    if( p_intf->p_sys == NULL )
+    {
+        msg_Err( p_intf, "out of memory" );
+        return( 1 );
+    };
+
+    p_intf->pf_run = Run;
+
+
+    // Suscribe to messages bank
+    p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
+
+    // Set no new theme when opening file
+    p_intf->p_sys->p_new_theme_file = NULL;
+
+    // Initialize Win32 thread
+    p_intf->p_sys->i_index        = -1;
+    p_intf->p_sys->i_size         = 0;
+
+
+    p_intf->p_sys->i_close_status = VLC_NOTHING;
+
+    p_intf->p_sys->p_input = NULL;
+    p_intf->p_sys->p_playlist = (playlist_t *)vlc_object_find( p_intf,
+        VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+
+    p_intf->p_sys->p_theme = (Theme *)new OSTheme( p_intf );
+
+    return( 0 );
+}
+
+//---------------------------------------------------------------------------
+// Close: destroy interface
+//---------------------------------------------------------------------------
+static void Close ( vlc_object_t *p_this )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
+
+    if( p_intf->p_sys->p_input )
+    {
+        vlc_object_release( p_intf->p_sys->p_input );
+    }
+
+    if( p_intf->p_sys->p_playlist )
+    {
+        vlc_object_release( p_intf->p_sys->p_playlist );
+    }
+
+    // Delete theme, it's important to do it correctly
+    delete (OSTheme *)p_intf->p_sys->p_theme;
+
+    // Unsuscribe to messages bank
+    msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+
+
+
+    // Destroy structure
+    free( p_intf->p_sys );
+}
+
+
+//---------------------------------------------------------------------------
+// Run: main loop
+//---------------------------------------------------------------------------
+static void Run( intf_thread_t *p_intf )
+{
+    int a = OSAPI_GetTime();
+
+    // Load a theme
+    char *skin_last = config_GetPsz( p_intf, "skin_last" );
+    ThemeLoader *Loader = new ThemeLoader( p_intf );
+
+    if( skin_last == NULL || ! Loader->Load( skin_last ) )
+    {
+        // Too bad, it failed. Let's try with the default theme
+        if( ! Loader->Load( DEFAULT_SKIN_FILE ) )
+        {
+            // Last chance: the user can  select a new theme file
+
+            // Initialize file structure
+            OpenFileDialog *OpenFile;
+            OpenFile = (OpenFileDialog *)new OSOpenFileDialog( _("Open skin"),
+                false );
+            OpenFile->AddFilter( _("Skin files"), "*.vlt" );
+            OpenFile->AddFilter( _("Skin files"), "*.xml" );
+            OpenFile->AddFilter( _("All files"), "*.*" );
+
+            // Open dialog box
+            if( OpenFile->Open() )
+            {
+                // try to load selected file
+                if( ! Loader->Load( OpenFile->FileList.front() ) )
+                {
+                    // He, he, what the hell is he doing ?
+                    delete OpenFile;
+                    delete Loader;
+                    return;
+                }
+            }
+            else
+            {
+                delete OpenFile;
+                delete Loader;
+                return;
+            }
+
+            delete OpenFile;
+        }
+    }
+
+    // Show the theme
+    p_intf->p_sys->p_theme->InitTheme();
+    p_intf->p_sys->p_theme->ShowTheme();
+
+    delete Loader;
+
+    msg_Err( p_intf, "Load theme time : %i ms", OSAPI_GetTime() - a );
+
+    // Refresh the whole interface
+    OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true );
+
+    // Run interface message loop
+    OSRun( p_intf );
+}
+
+//---------------------------------------------------------------------------
+// Module descriptor
+//---------------------------------------------------------------------------
+#define DEFAULT_SKIN        N_("Last skin actually used")
+#define DEFAULT_SKIN_LONG   N_("Last skin actually used")
+#define SKIN_CONFIG         N_("Config of last used skin")
+#define SKIN_CONFIG_LONG    N_("Config of last used skin")
+#define SKIN_TRAY           N_("Show application in system tray")
+#define SKIN_TRAY_LONG      N_("Show application in system tray")
+#define SKIN_TASKBAR        N_("Show application in taskbar")
+#define SKIN_TASKBAR_LONG   N_("Show application in taskbar")
+
+vlc_module_begin();
+    add_string( "skin_last", "", NULL, DEFAULT_SKIN, DEFAULT_SKIN_LONG,
+                VLC_TRUE );
+    add_string( "skin_config", "", NULL, SKIN_CONFIG, SKIN_CONFIG_LONG,
+                VLC_TRUE );
+    add_bool( "show_in_tray", VLC_FALSE, NULL, SKIN_TRAY, SKIN_TRAY_LONG,
+              VLC_FALSE );
+    add_bool( "show_in_taskbar", VLC_TRUE, NULL, SKIN_TASKBAR,
+              SKIN_TASKBAR_LONG, VLC_FALSE );
+    set_description( _("Skinnable Interface Module") );
+    set_capability( "interface", 30 );
+    set_callbacks( E_(Open), E_(Close) );
+    add_shortcut( "skin" );
+vlc_module_end();
+
+
+//---------------------------------------------------------------------------
+// Refresh procedure
+//---------------------------------------------------------------------------
+int SkinManage( intf_thread_t *p_intf )
+{
+    vlc_mutex_lock( &p_intf->change_lock );
+
+    // Update the input
+    if( p_intf->p_sys->p_input == NULL )
+    {
+        p_intf->p_sys->p_input = (input_thread_t *)
+                    vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
+    }
+    else if( p_intf->p_sys->p_input->b_dead )
+    {
+        vlc_object_release( p_intf->p_sys->p_input );
+        p_intf->p_sys->p_input = NULL;
+    }
+
+    OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (long)false );
+
+    // Update the log window
+    //p_intf->p_sys->p_theme->UpdateLog( p_intf->p_sys->p_sub );
+
+    //-------------------------------------------------------------------------
+    if( p_intf->p_sys->p_input != NULL && !p_intf->p_sys->p_input->b_die )
+    {
+        input_thread_t  * p_input = p_intf->p_sys->p_input;
+
+        vlc_mutex_lock( &p_input->stream.stream_lock );
+
+        // Refresh sound volume
+        audio_volume_t volume;
+
+        // Get sound volume from VLC
+        aout_VolumeGet( p_intf, &volume);
+
+        // Update sliders
+        OSAPI_PostMessage( NULL, CTRL_SET_SLIDER,
+            (unsigned int)
+            p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ),
+            (long)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) );
+
+
+        // Refresh slider
+        //if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
+        //{
+#define p_area p_input->stream.p_selected_area
+
+            // Set value of sliders
+            long Value = SLIDER_RANGE *
+                p_input->stream.p_selected_area->i_tell /
+                p_input->stream.p_selected_area->i_size;
+
+            // Update sliders
+            OSAPI_PostMessage( NULL, CTRL_SET_SLIDER, (unsigned int)
+                p_intf->p_sys->p_theme->EvtBank->Get( "time" ), (long)Value );
+
+            // Text char * for updating text controls
+            char *text = new char[OFFSETTOTIME_MAX_SIZE];
+
+            // Create end time text
+            input_OffsetToTime( p_intf->p_sys->p_input, &text[1],
+                                p_area->i_size - p_area->i_tell );
+            text[0] = '-';
+            p_intf->p_sys->p_theme->EvtBank->Get( "left_time" )
+                ->PostTextMessage( text );
+
+            // Create time text and update
+            input_OffsetToTime( p_intf->p_sys->p_input, text, p_area->i_tell );
+            p_intf->p_sys->p_theme->EvtBank->Get( "time" )
+                ->PostTextMessage( text );
+
+            // Create total time text
+            input_OffsetToTime( p_intf->p_sys->p_input, text, p_area->i_size );
+            p_intf->p_sys->p_theme->EvtBank->Get( "total_time" )
+                ->PostTextMessage( text );
+
+            // Free memory
+            delete[] text;
+
+#undef p_area
+        //}
+        vlc_mutex_unlock( &p_input->stream.stream_lock );
+    }
+    //-------------------------------------------------------------------------
+    vlc_mutex_unlock( &p_intf->change_lock );
+
+    return( TRUE );
+}
+//---------------------------------------------------------------------------
diff --git a/modules/gui/skins/src/theme.cpp b/modules/gui/skins/src/theme.cpp
new file mode 100644 (file)
index 0000000..ed1a9e5
--- /dev/null
@@ -0,0 +1,431 @@
+/*****************************************************************************
+ * theme.cpp: Theme class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: theme.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "window.h"
+#include "os_window.h"
+#include "dialog.h"
+#include "os_dialog.h"
+#include "banks.h"
+#include "anchor.h"
+#include "event.h"
+#include "os_event.h"
+#include "generic.h"
+#include "theme.h"
+#include "vlcproc.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// THEME
+//---------------------------------------------------------------------------
+Theme::Theme( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+    BmpBank = new BitmapBank( p_intf );
+    FntBank = new FontBank( p_intf );
+    EvtBank = new EventBank( p_intf );
+    OffBank = new OffSetBank( p_intf );
+    Log = NULL;
+    ConstructPlaylist = false;
+
+    ShowInTray    = false;
+    ShowInTaskbar = false;
+
+}
+//---------------------------------------------------------------------------
+Theme::~Theme()
+{
+    // Delete the windows
+    list<Window *>::const_iterator win;
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
+    {
+        delete (OSWindow *)(*win);
+    }
+    delete (OSLogWindow *)Log;
+    delete OffBank;
+    delete EvtBank;
+    delete BmpBank;
+    delete FntBank;
+}
+//---------------------------------------------------------------------------
+void Theme::ShowTheme()
+{
+    // Get parameters form vlcrc config file
+    if( ShowInTray != (bool)config_GetInt( p_intf, "show_in_tray" ) )
+        ChangeTray();
+
+    if( ShowInTaskbar != (bool)config_GetInt( p_intf, "show_in_taskbar" ) )
+        ChangeTaskbar();
+
+    list<Window *>::const_iterator win;
+    Event *evt;
+
+    // Synchronize control to visible aspect
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
+    {
+        // Synchronize windows visibility
+        if( (*win)->OnStartThemeVisible )
+            evt = (Event *)new OSEvent( p_intf, (*win), WINDOW_OPEN, 0, 1 );
+        else
+            evt = (Event *)new OSEvent( p_intf, (*win), WINDOW_CLOSE, 0, 1 );
+
+        evt->PostSynchroMessage( true );
+    }
+
+    // Initialize magnetism
+    CheckAnchors();
+
+    // Show windows
+    OSAPI_PostMessage( NULL, VLC_SHOW, 0, 0 );
+}
+//---------------------------------------------------------------------------
+void Theme::CreateSystemMenu()
+{
+    AddSystemMenu( "Open file...", EvtBank->Get( "open" ) );
+    AddSystemMenu( "Change skin...", EvtBank->Get( "load_skin" ) );
+    AddSystemMenu( "Preferences...", NULL );
+    AddSystemMenu( "SEPARATOR", 0 );
+    AddSystemMenu( "Exit", EvtBank->Get( "quit" ) );
+}
+//---------------------------------------------------------------------------
+void Theme::LoadConfig()
+{
+    // Get config from vlcrc file
+    char *save = config_GetPsz( p_intf, "skin_config" );
+    if( save == NULL )
+        return;
+
+    // Initialization
+    list<Window *>::const_iterator win;
+    int i = 0;
+    int x, y, v, scan;
+
+    // Get config for each window
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
+    {
+        // Get config
+        scan = sscanf( &save[i * 13], "(%4d,%4d,%1d)", &x, &y, &v );
+
+        // If config has the correct number of arguments
+        if( scan > 2 )
+        {
+            (*win)->Move( x, y );
+            (*win)->OnStartThemeVisible = (bool)v;
+        }
+
+        // Next window
+        i++;
+    }
+}
+//---------------------------------------------------------------------------
+void Theme::SaveConfig()
+{
+    // Initialize char where config is stored
+    char *save  = new char[400];
+    list<Window *>::const_iterator win;
+    int i = 0;
+    int x, y;
+
+    // Save config of every window
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
+    {
+        // Print config
+        (*win)->GetPos( x, y );
+        sprintf( &save[i * 13], "(%4d,%4d,%1d)", x, y,
+            (*win)->OnStartThemeVisible );
+        i++;
+    }
+
+    // Save config to file
+    config_PutPsz( p_intf, "skin_config",     save );
+    config_PutInt( p_intf, "show_in_tray",    (int)ShowInTray );
+    config_PutInt( p_intf, "show_in_taskbar", (int)ShowInTaskbar );
+    config_SaveConfigFile( p_intf, "skin" );
+
+    // Free memory
+    delete[] save;
+
+}
+//---------------------------------------------------------------------------
+void Theme::StartTheme( bool log, int magnet )
+{
+    Magnet = magnet;
+    if( log )
+    {
+        Log = (LogWindow *)new OSLogWindow( p_intf );
+    }
+}
+//---------------------------------------------------------------------------
+void Theme::InitTheme()
+{
+    // Initialize the events
+    EvtBank->Init();
+
+    // Initialize the controls
+    InitControls();
+
+    // Initialize the windows
+    InitWindows();
+}
+//---------------------------------------------------------------------------
+void Theme::InitWindows()
+{
+    for( list<Window *>::const_iterator win = WindowList.begin();
+         win != WindowList.end(); win++ )
+    {
+        (*win)->Init();
+    }
+}
+//---------------------------------------------------------------------------
+void Theme::InitControls()
+{
+    for( list<Window *>::const_iterator win = WindowList.begin();
+         win != WindowList.end(); win++ )
+    {
+        for( unsigned int i = 0; i < (*win)->ControlList.size(); i++ )
+        {
+            (*win)->ControlList[i]->Init();
+        }
+    }
+}
+//---------------------------------------------------------------------------
+Window * Theme::GetWindow( string name )
+{
+    for( list<Window *>::const_iterator win = WindowList.begin();
+         win != WindowList.end(); win++ )
+    {
+        if( name == OSAPI_GetWindowTitle( *win ) )
+        {
+            return (*win);
+        }
+    }
+    return NULL;
+}
+//---------------------------------------------------------------------------
+void Theme::MoveSkin( Window *wnd, int left, int top )
+{
+    int x, y, oldx, oldy;
+    Window *win;
+    list<Anchor *>::const_iterator anc;
+    list<Anchor *>::const_iterator hang;
+    wnd->GetPos( oldx, oldy );
+
+    // Move child windows recursively
+    for( anc = wnd->AnchorList.begin(); anc != wnd->AnchorList.end(); anc++ )
+    {
+        for( hang = (*anc)->HangList.begin(); hang != (*anc)->HangList.end();
+            hang++ )
+        {
+            win = (*hang)->GetParent();
+            win->GetPos( x, y );
+            MoveSkin( win, left, top );
+        }
+    }
+
+    // Move window only if has not been moved yet
+    if( !wnd->Moved )
+    {
+        wnd->Moved = true;
+        wnd->Move( oldx + left, oldy + top );
+    }
+}
+//---------------------------------------------------------------------------
+bool Theme::MoveSkinMagnet( Window *wnd, int left, int top )
+{
+
+    // If magnetism not activate
+    if( !Magnet )
+    {
+        wnd->Move( left, top );
+        return false;
+    }
+
+    // Screen bounds initialization
+    int NewLeft = left;
+    int NewTop  = top;
+    int Sx, Sy, Wx, Wy;
+    OSAPI_GetScreenSize( Sx, Sy );
+    int width, height;
+    wnd->GetSize( width, height );
+    wnd->GetPos( Wx, Wy );
+
+    // Magnetism with screen bounds
+    if( left < Magnet && left > -Magnet)
+        NewLeft = 0;
+    else if( left + width > Sx - Magnet && left + width < Sx + Magnet )
+        NewLeft = Sx - width;
+    if( top < Magnet && top > -Magnet )
+        NewTop = 0;
+    else if( top + height > Sy - Magnet && top + height < Sy + Magnet )
+        NewTop = Sy - height;
+
+    // Deal with anchors
+    HangToAnchors( wnd, NewLeft, NewTop );
+
+    // All windows can be moved
+    list<Window *>::const_iterator win;
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
+        (*win)->Moved = false;
+
+    // Move Window
+    MoveSkin( wnd, NewLeft - Wx, NewTop - Wy );
+
+    return true;
+}
+//---------------------------------------------------------------------------
+void Theme::HangToAnchors( Window *wnd, int &x, int &y, bool init )
+{
+    // Magnetism initialization
+    int win_x, win_y, win_anchor_x, win_anchor_y, wnd_anchor_x, wnd_anchor_y;
+    list<Window *>::const_iterator win;
+    list<Anchor *>::const_iterator win_anchor, wnd_anchor;
+
+    // Parse list of windows
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
+    {
+        // If window is moved window
+        if( (*win) == wnd )
+            continue;               // Check next window
+
+        // If window is hidden
+        if( !init )
+        {
+            if( (*win)->IsHidden() )
+                continue;           // Check next window
+        }
+        else
+        {
+            if( !(*win)->OnStartThemeVisible )
+                continue;           // Check next window
+        }
+
+        // Parse anchor lists
+        for( wnd_anchor  = wnd->AnchorList.begin();
+             wnd_anchor != wnd->AnchorList.end(); wnd_anchor++ )
+        {
+            for( win_anchor  = (*win)->AnchorList.begin();
+                 win_anchor != (*win)->AnchorList.end(); win_anchor++ )
+            {
+                if( (*wnd_anchor)->GetPriority() <
+                    (*win_anchor)->GetPriority() )
+                {
+                    // Parent anchor is win and child is wnd !!!
+
+
+                    if( !(*win_anchor)->Hang( (*wnd_anchor), x, y ) )
+                    {
+                        // If child is in parent list and parent doesn't hang ch
+                        if( (*win_anchor)->IsInList( (*wnd_anchor) ) )
+                            (*win_anchor)->Remove( (*wnd_anchor) );
+                    }
+                    else
+                    {
+                        // If parent hang child and child is not still in list
+                        if( !(*win_anchor)->IsInList( (*wnd_anchor) ) )
+                            (*win_anchor)->Add( (*wnd_anchor) );
+
+                        // Move window to stick anchor
+                        (*wnd_anchor)->GetPos( wnd_anchor_x, wnd_anchor_y );
+                        (*win_anchor)->GetPos( win_anchor_x, win_anchor_y );
+                        (*win)->GetPos( win_x, win_y );
+
+                        x = win_x + win_anchor_x - wnd_anchor_x;
+                        y = win_y + win_anchor_y - wnd_anchor_y;
+
+                        break;
+                    }
+
+                }
+                else if( (*win_anchor)->Hang( (*wnd_anchor), x, y ) )
+                {
+                    // Move window to stick anchor
+                    (*wnd_anchor)->GetPos( wnd_anchor_x, wnd_anchor_y );
+                    (*win_anchor)->GetPos( win_anchor_x, win_anchor_y );
+                    (*win)->GetPos( win_x, win_y );
+
+                    x = win_x + win_anchor_x - wnd_anchor_x;
+                    y = win_y + win_anchor_y - wnd_anchor_y;
+
+                    break;
+                }
+            }
+        }
+    }
+}
+//---------------------------------------------------------------------------
+void Theme::CheckAnchors()
+{
+    list<Window *>::const_iterator win;
+    int x, y;
+
+    for( win = WindowList.begin(); win != WindowList.end(); win++ )
+    {
+        (*win)->GetPos( x, y );
+        HangToAnchors( (*win), x, y, true );
+    }
+}
+//---------------------------------------------------------------------------
+void Theme::UpdateLog( msg_subscription_t *Sub )
+{
+    if( Log != NULL )
+        Log->Update( Sub );
+}
+//---------------------------------------------------------------------------
+void Theme::ShowLog( int show )
+{
+    if( Log == NULL )
+        return;
+
+    if( show == 1 )
+    {
+        Log->Show();
+    }
+    else if( show == 0 )
+    {
+        Log->Hide();
+    }
+    else if( show == 2 )
+    {
+        if( Log->IsVisible() )
+            Log->Hide();
+        else
+            Log->Show();
+    }
+}
+//---------------------------------------------------------------------------
+void Theme::ClearLog()
+{
+    if( Log!= NULL )
+        Log->Clear();
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/theme.h b/modules/gui/skins/src/theme.h
new file mode 100644 (file)
index 0000000..85a3577
--- /dev/null
@@ -0,0 +1,116 @@
+/*****************************************************************************
+ * theme.h: Theme class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: theme.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_THEME
+#define VLC_SKIN_THEME
+
+//--- GENERAL ---------------------------------------------------------------
+#include <list>
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Window;
+class EventBank;
+class BitmapBank;
+class FontBank;
+class Event;
+class OffSetBank;
+class LogWindow;
+
+//---------------------------------------------------------------------------
+class Theme
+{
+    private:
+
+    protected:
+        LogWindow *Log;
+        int  Magnet;
+        intf_thread_t *p_intf;
+
+        bool ShowInTray;
+        bool ShowInTaskbar;
+
+    public:
+        // Constructors
+        Theme( intf_thread_t *_p_intf );
+        void StartTheme( bool log, int magnet );
+
+        // Destructor
+        virtual ~Theme();
+        virtual void OnLoadTheme() = 0;
+
+        // Initialization
+        void InitTheme();
+        void InitWindows();
+        void InitControls();
+        void ShowTheme();
+
+        virtual void AddWindow( string name, int x, int y, bool visible,
+            int fadetime, int alpha, int movealpha, bool dragdrop ) = 0;
+        virtual void ChangeClientWindowName( string name ) = 0;
+
+        Window * GetWindow( string name );
+
+        // Banks
+        BitmapBank *BmpBank;
+        EventBank  *EvtBank;
+        FontBank   *FntBank;
+        OffSetBank *OffBank;
+
+        // List of the windows of the skin
+        list<Window *> WindowList;
+
+        // Magetism
+        void HangToAnchors( Window *wnd, int &x, int &y, bool init = false );
+        bool MoveSkinMagnet( Window *wnd, int left, int top );
+        void MoveSkin( Window *wnd, int left, int top );
+        void CheckAnchors();
+
+        // Log window
+        LogWindow *GetLogWindow()   { return Log; };
+        void UpdateLog( msg_subscription_t *Sub );
+        void ShowLog( int show );
+        void ClearLog();
+
+        bool ConstructPlaylist;
+
+        // Config file treatment
+        void LoadConfig();
+        void SaveConfig();
+
+        // Taskbar && system tray
+        void CreateSystemMenu();
+        virtual void AddSystemMenu( string name, Event *event ) = 0;
+        virtual void ChangeTray() = 0;
+        virtual void ChangeTaskbar() = 0;
+
+};
+//---------------------------------------------------------------------------
+
+#endif
+
diff --git a/modules/gui/skins/src/themeloader.cpp b/modules/gui/skins/src/themeloader.cpp
new file mode 100644 (file)
index 0000000..9161382
--- /dev/null
@@ -0,0 +1,244 @@
+/*****************************************************************************
+ * themeloader.cpp: ThemeLoader class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: themeloader.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+#include <fcntl.h>
+
+#if defined( HAVE_LIBTAR_H ) && defined( HAVE_ZLIB_H )
+#   include <zlib.h>
+#   include <libtar.h>
+#endif
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/vlc.h>
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "themeloader.h"
+#include "skin_common.h"
+
+#define DEFAULT_XML_FILE "theme.xml"
+
+//---------------------------------------------------------------------------
+extern "C"
+{
+    extern FILE *yyin;
+    int yylex();
+}
+
+//---------------------------------------------------------------------------
+ThemeLoader::ThemeLoader( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+}
+//---------------------------------------------------------------------------
+ThemeLoader::~ThemeLoader()
+{
+}
+//---------------------------------------------------------------------------
+int gzopen_frontend( char *pathname, int oflags, int mode )
+{
+#if defined( HAVE_LIBTAR_H ) && defined( HAVE_ZLIB_H )
+    char *gzflags;
+    gzFile gzf;
+    int fd;
+
+    switch( oflags & O_ACCMODE )
+    {
+        case O_WRONLY:
+            gzflags = "wb";
+            break;
+        case O_RDONLY:
+            gzflags = "rb";
+            break;
+        case O_RDWR:
+        default:
+            errno = EINVAL;
+            return -1;
+    }
+
+    fd = open( pathname, oflags, mode );
+    if( fd == -1 )
+        return -1;
+
+//    if( ( oflags & O_CREAT ) && fchmod( fd, mode ) )
+//        return -1;
+
+    gzf = gzdopen( fd, gzflags );
+    if( !gzf )
+    {
+        errno = ENOMEM;
+        return -1;
+    }
+
+    return (int)gzf;
+#else
+    return 0;
+#endif
+}
+//---------------------------------------------------------------------------
+#if defined( HAVE_LIBTAR_H ) && defined( HAVE_ZLIB_H )
+bool ThemeLoader::ExtractTarGz( const string tarfile, const string rootdir )
+{
+    TAR *t;
+    tartype_t gztype = { (openfunc_t) gzopen_frontend, (closefunc_t) gzclose,
+        (readfunc_t) gzread, (writefunc_t) gzwrite };
+
+    if( tar_open( &t, (char *)tarfile.c_str(), &gztype, O_RDONLY, 0,
+                  TAR_GNU ) == -1 )
+    {
+        return false;
+    }
+
+    if( tar_extract_all( t, (char *)rootdir.c_str() ) != 0 )
+    {
+        return false;
+    }
+
+    if( tar_close( t ) != 0 )
+    {
+        return false;
+    }
+
+    return true;
+}
+//---------------------------------------------------------------------------
+bool ThemeLoader::Extract( const string FileName )
+{
+    char *tmpdir = tempnam( NULL, "vlt" );
+    string TempPath = tmpdir;
+    free( tmpdir );
+
+    if( ! ExtractTarGz( FileName, TempPath ) )
+        return false;
+
+    if( ! Parse( TempPath + DIRECTORY_SEPARATOR + string( DEFAULT_XML_FILE ) ) )
+    {
+        DeleteTempFiles( TempPath );
+        return false;
+    }
+
+    DeleteTempFiles( TempPath );
+    return true;
+}
+//---------------------------------------------------------------------------
+void ThemeLoader::DeleteTempFiles( const string Path )
+{
+    OSAPI_RmDir( Path );
+}
+#endif
+//---------------------------------------------------------------------------
+void ThemeLoader::CleanTheme()
+{
+    delete (OSTheme *)p_intf->p_sys->p_theme;
+    p_intf->p_sys->p_theme = (Theme *)new OSTheme( p_intf );
+}
+//---------------------------------------------------------------------------
+bool ThemeLoader::Parse( const string XmlFile )
+{
+    // Things to do before loading theme
+    p_intf->p_sys->p_theme->OnLoadTheme();
+
+    // Set the file to parse
+    yyin = fopen( XmlFile.c_str(), "r" );
+    if( yyin == NULL )
+    {
+        // Skin cannot be opened
+        msg_Warn( p_intf, "Cannot open the specified skin file: %s",
+                  XmlFile.c_str() );
+        return false;
+    }
+
+    // File loaded
+    msg_Dbg( p_intf, "Using skin file: %s", XmlFile.c_str() );
+
+    // Save current working directory
+    char *cwd = new char[MAX_PATH];
+    getcwd( cwd, MAX_PATH );
+
+    // Directory separator is different in each OS !
+    int p = XmlFile.rfind( DIRECTORY_SEPARATOR, XmlFile.size() );
+
+    // Change current working directory to xml file
+    string path = "";
+    if( p > 0 )
+        path = XmlFile.substr( 0, p );
+    chdir( path.c_str() );
+
+    p_intf->p_sys->b_all_win_closed = false;
+
+    // Start the parser
+    int lex = yylex();
+    fclose( yyin );
+    if( lex )
+    {
+        // Set old working directory to current
+        chdir( cwd );
+        delete[] cwd;
+
+        msg_Warn( p_intf, "yylex failed: %i", lex );
+        CleanTheme();
+        return false;
+    }
+
+    // Set old working directory to current
+    chdir( cwd );
+    delete[] cwd;
+
+    return true;
+}
+//---------------------------------------------------------------------------
+bool ThemeLoader::Load( const string FileName )
+{
+    // First, we try to un-targz the file, and if it fails we hope it's a XML
+    // file...
+#if defined( HAVE_LIBTAR_H ) && defined( HAVE_ZLIB_H )
+    if( ! Extract( FileName ) && ! Parse( FileName ) )
+        return false;
+#else
+    if( ! Parse( FileName ) )
+        return false;
+#endif
+
+    // Check if the skin to load is in the config file, to load its config
+    char *skin_last = config_GetPsz( p_intf, "skin_last" );
+    if( skin_last != NULL && FileName == (string)skin_last )
+    {
+        p_intf->p_sys->p_theme->LoadConfig();
+    }
+    else
+    {
+        config_PutPsz( p_intf, "skin_last", FileName.c_str() );
+        config_SaveConfigFile( p_intf, "skin" );
+    }
+
+    return true;
+}
+//---------------------------------------------------------------------------
diff --git a/modules/gui/skins/src/themeloader.h b/modules/gui/skins/src/themeloader.h
new file mode 100644 (file)
index 0000000..4f753d2
--- /dev/null
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ * themeloader.h: ThemeLoader class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: themeloader.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_THEMELOADER
+#define VLC_SKIN_THEMELOADER
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+int gzopen_frontend( char *pathname, int oFlags, int mode );
+//---------------------------------------------------------------------------
+class ThemeLoader
+{
+    private:
+        intf_thread_t *p_intf;
+
+#ifdef HAVE_LIBTAR_LIBZ
+        bool ExtractTarGz( const string tarfile, const string rootdir );
+        bool Extract( const string FileName );
+        void DeleteTempFiles( const string Path );
+#endif
+        void CleanTheme();
+        bool Parse( const string XmlFile );
+    public:
+        ThemeLoader( intf_thread_t *_p_intf );
+        ~ThemeLoader();
+
+        bool Load( const string FileName );
+};
+
+#endif
+
diff --git a/modules/gui/skins/src/vlcproc.cpp b/modules/gui/skins/src/vlcproc.cpp
new file mode 100644 (file)
index 0000000..cf13caf
--- /dev/null
@@ -0,0 +1,585 @@
+/*****************************************************************************
+ * vlcproc.cpp: VlcProc class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: vlcproc.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/vlc.h>
+#include <vlc/intf.h>
+#include <vlc/aout.h>
+#include <vlc/vout.h>
+
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "dialog.h"
+#include "os_dialog.h"
+#include "event.h"
+#include "banks.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "themeloader.h"
+#include "window.h"
+#include "vlcproc.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// VlcProc
+//---------------------------------------------------------------------------
+VlcProc::VlcProc( intf_thread_t *_p_intf )
+{
+    p_intf = _p_intf;
+}
+//---------------------------------------------------------------------------
+bool VlcProc::EventProc( Event *evt )
+{
+    switch( evt->GetMessage() )
+    {
+        case VLC_STREAMPOS:
+            MoveStream( evt->GetParam2() );
+            return true;
+
+        case VLC_VOLUME_CHANGE:
+            ChangeVolume( evt->GetParam1(), evt->GetParam2() );
+            return true;
+
+        case VLC_FULLSCREEN:
+            FullScreen();
+            return true;
+
+        case VLC_HIDE:
+            for( list<Window *>::const_iterator win =
+                    p_intf->p_sys->p_theme->WindowList.begin();
+                 win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+            {
+                (*win)->OnStartThemeVisible = !(*win)->IsHidden();
+            }
+            p_intf->p_sys->i_close_status = (int)evt->GetParam1();
+            OSAPI_PostMessage( NULL, WINDOW_CLOSE, 0, 0 );
+            return true;
+
+        case VLC_SHOW:
+            for( list<Window *>::const_iterator win =
+                    p_intf->p_sys->p_theme->WindowList.begin();
+                 win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+            {
+                if( (*win)->OnStartThemeVisible )
+                    OSAPI_PostMessage( (*win), WINDOW_OPEN, 0, 0 );
+            }
+            p_intf->p_sys->b_all_win_closed = false;
+            return true;
+
+        case VLC_OPEN:
+            OpenFile( true );
+            return true;
+
+        case VLC_LOAD_SKIN:
+            LoadSkin();
+            return true;
+
+        case VLC_DROP:
+            DropFile( evt->GetParam1() );
+            return true;
+
+        case VLC_PLAY:
+            PlayStream();
+            return true;
+
+        case VLC_PAUSE:
+            PauseStream();
+            return true;
+
+        case VLC_STOP:
+            StopStream();
+            return true;
+
+        case VLC_NEXT:
+            NextStream();
+            return true;
+
+        case VLC_PREV:
+            PrevStream();
+            return true;
+
+        case VLC_PLAYLIST_ADD_FILE:
+            OpenFile( false );
+            return true;
+
+        case VLC_LOG_SHOW:
+            p_intf->p_sys->p_theme->ShowLog( evt->GetParam2() );
+            return true;
+
+        case VLC_LOG_CLEAR:
+            p_intf->p_sys->p_theme->ClearLog();
+            return true;
+
+        case VLC_INTF_REFRESH:
+            InterfaceRefresh( (bool)evt->GetParam2() );
+            return true;
+
+        case VLC_TEST_ALL_CLOSED:
+            return EventProcEnd();
+
+        case VLC_QUIT:
+            return false;
+
+        case VLC_CHANGE_TRAY:
+            p_intf->p_sys->p_theme->ChangeTray();
+            return true;
+
+        case VLC_CHANGE_TASKBAR:
+            p_intf->p_sys->p_theme->ChangeTaskbar();
+            return true;
+
+        default:
+            return true;
+    }
+}
+//---------------------------------------------------------------------------
+bool VlcProc::EventProcEnd()
+{
+    if( p_intf->p_sys->b_all_win_closed )
+        return true;
+
+    list<Window *>::const_iterator win;
+
+    // If a window has been closed, test if all are closed !
+    for( win = p_intf->p_sys->p_theme->WindowList.begin();
+         win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+    {
+        if( !(*win)->IsHidden() )   // Not all windows closed
+        {
+            return true;
+        }
+    }
+
+    // All window are closed
+    switch( p_intf->p_sys->i_close_status )
+    {
+        case VLC_QUIT:
+            // Save config before exiting
+            p_intf->p_sys->p_theme->SaveConfig();
+            break;
+    }
+
+    // Send specified event
+    OSAPI_PostMessage( NULL, p_intf->p_sys->i_close_status, 0, 0 );
+
+    // Reset values
+    p_intf->p_sys->i_close_status = VLC_NOTHING;
+    p_intf->p_sys->b_all_win_closed = true;
+
+    // Return true
+    return true;
+}
+//---------------------------------------------------------------------------
+bool VlcProc::IsClosing()
+{
+    if( p_intf->b_die && p_intf->p_sys->i_close_status != VLC_QUIT )
+    {
+        p_intf->p_sys->i_close_status = VLC_QUIT;
+        OSAPI_PostMessage( NULL, VLC_HIDE, VLC_QUIT, 0 );
+    }
+    return true;
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// Private methods
+//---------------------------------------------------------------------------
+void VlcProc::InterfaceRefresh( bool All )
+{
+    // Shortcut pointers
+    intf_sys_t  *Sys      = p_intf->p_sys;
+    Theme       *Thema    = Sys->p_theme;
+    playlist_t  *PlayList = Sys->p_playlist;
+
+
+    // Refresh
+    if( PlayList != NULL && Sys->p_input != NULL &&
+        Sys->p_input->stream.b_seekable )
+    {
+        // Refresh stream control controls ! :)
+        switch( PlayList->i_status )
+        {
+            case PLAYLIST_STOPPED:
+                EnabledEvent( "time", false );
+                EnabledEvent( "stop", false );
+                EnabledEvent( "play", true );
+                EnabledEvent( "pause", false );
+                break;
+            case PLAYLIST_RUNNING:
+                EnabledEvent( "time", true );
+                EnabledEvent( "stop", true );
+                EnabledEvent( "play", false );
+                EnabledEvent( "pause", true );
+                break;
+            case PLAYLIST_PAUSED:
+                EnabledEvent( "time", true );
+                EnabledEvent( "stop", true );
+                EnabledEvent( "play", true );
+                EnabledEvent( "pause", false );
+                break;
+        }
+
+        // Refresh next and prev buttons
+        if( PlayList->i_index == 0 || PlayList->i_size == 1 )
+            EnabledEvent( "prev", false );
+        else
+            EnabledEvent( "prev", true );
+
+        if( PlayList->i_index == PlayList->i_size - 1 || PlayList->i_size == 1 )
+            EnabledEvent( "next", false );
+        else
+            EnabledEvent( "next", true );
+
+
+        // Update file name text
+        if( PlayList->i_index != Sys->i_index )
+        {
+            Thema->EvtBank->Get( "file_name" )->PostTextMessage(
+                PlayList->pp_items[PlayList->i_index]->psz_name );
+        }
+
+        // Update playlists
+        if( PlayList->i_index != Sys->i_index ||
+            PlayList->i_size != Sys->i_size )
+        {
+            Thema->EvtBank->Get( "playlist_refresh" )->PostSynchroMessage();
+            Sys->i_size  = PlayList->i_size;
+            Sys->i_index = PlayList->i_index;
+        }
+    }
+    else
+    {
+        EnabledEvent( "time", false );
+        EnabledEvent( "stop",  false );
+        EnabledEvent( "play",  false );
+        EnabledEvent( "pause", false );
+        EnabledEvent( "prev",  false );
+        EnabledEvent( "next",  false );
+
+        // Update playlists
+        if( Sys->i_size > 0 )
+        {
+            Thema->EvtBank->Get( "playlist_refresh" )->PostSynchroMessage();
+            Sys->i_size  = 0;
+        }
+    }
+
+}
+//---------------------------------------------------------------------------
+void VlcProc::EnabledEvent( string type, bool state )
+{
+    OSAPI_PostMessage( NULL, CTRL_ENABLED, (unsigned int)
+        p_intf->p_sys->p_theme->EvtBank->Get( type ), (int)state );
+}
+//---------------------------------------------------------------------------
+
+
+
+//---------------------------------------------------------------------------
+// Common VLC procedures
+//---------------------------------------------------------------------------
+void VlcProc::LoadSkin()
+{
+    if( p_intf->p_sys->p_new_theme_file == NULL )
+    {
+        // Initialize file structure
+        OpenFileDialog *OpenFile;
+        OpenFile = (OpenFileDialog *)new OSOpenFileDialog(
+            _("Change skin - Open new file"), false );
+        OpenFile->AddFilter( _("Skin files"), "*.vlt" );
+        OpenFile->AddFilter( _("Skin files"), "*.xml" );
+        OpenFile->AddFilter( _("All files"), "*.*" );
+
+        // Open dialog box
+        if( OpenFile->Open() )
+        {
+            p_intf->p_sys->p_new_theme_file =
+                new char[OpenFile->FileList.front().length()];
+
+            strcpy( p_intf->p_sys->p_new_theme_file,
+                    OpenFile->FileList.front().c_str() );
+
+            // Tell vlc to change skin after hiding interface
+            OSAPI_PostMessage( NULL, VLC_HIDE, VLC_LOAD_SKIN, 0 );
+        }
+
+        // Free memory
+        delete OpenFile;
+    }
+    else
+    {
+        // Place a new theme in the global structure, because it will
+        // be filled by the parser
+        // We save the old one to restore it in case of problem
+        Theme *oldTheme = p_intf->p_sys->p_theme;
+        p_intf->p_sys->p_theme = (Theme *)new OSTheme( p_intf );
+
+        // Run the XML parser
+        ThemeLoader *Loader = new ThemeLoader( p_intf );
+        if( Loader->Load( p_intf->p_sys->p_new_theme_file ) )
+        {
+            // Everything went well
+            msg_Dbg( p_intf, "New theme successfully loaded" );
+            delete (OSTheme *)oldTheme;
+
+            // Show the theme
+            p_intf->p_sys->p_theme->InitTheme();
+            p_intf->p_sys->p_theme->ShowTheme();
+        }
+        else
+        {
+            msg_Warn( p_intf, "A problem occurred when loading the new theme,"
+                      " restoring the previous one" );
+            delete (OSTheme *)p_intf->p_sys->p_theme;
+            p_intf->p_sys->p_theme = oldTheme;
+
+            // Show the theme
+            p_intf->p_sys->p_theme->ShowTheme();
+        }
+        delete Loader;
+
+        // Uninitialize new theme
+        delete (char *)p_intf->p_sys->p_new_theme_file;
+        p_intf->p_sys->p_new_theme_file = NULL;
+    }
+}
+//---------------------------------------------------------------------------
+void VlcProc::OpenFile( bool play )
+{
+    // Initialize file structure
+    OpenFileDialog *OpenFile;
+    if( play )
+    {
+        OpenFile = (OpenFileDialog *)new OSOpenFileDialog( _("Open file"),
+                                                           false );
+    }
+    else
+    {
+        OpenFile = (OpenFileDialog *)new OSOpenFileDialog( _("Add file"),
+                                                           true );
+    }
+    OpenFile->AddFilter( _("All files"), "*.*" );
+
+    // Check if palylist is available
+    playlist_t *p_playlist = p_intf->p_sys->p_playlist;
+    if( p_playlist == NULL )
+        return;
+
+    // Open dialog box and launch file
+    if( OpenFile->Open() )
+    {
+        list<string>::const_iterator file;
+        for( file = OpenFile->FileList.begin();
+             file != OpenFile->FileList.end(); file++ )
+        {
+            playlist_Add( p_playlist, (*file).c_str(), PLAYLIST_APPEND,
+                          PLAYLIST_END );
+        }
+
+        // Refreshing
+        if( play )
+        {
+            // Play
+            p_intf->p_sys->p_theme->EvtBank->Get( "play" )->SendEvent();
+        }
+
+        // Refresh interface !
+        p_intf->p_sys->p_theme->EvtBank->Get( "playlist_refresh" )
+            ->PostSynchroMessage();
+        InterfaceRefresh();
+    }
+
+    // Free memory
+    delete OpenFile;
+}
+//---------------------------------------------------------------------------
+void VlcProc::DropFile( unsigned int param )
+{
+    // Get pointer to file
+    char *FileName = (char *)param;
+
+    // Add the new file to the playlist
+    if( p_intf->p_sys->p_playlist != NULL )
+    {
+        if( config_GetInt( p_intf, "enqueue" ) )
+        {
+            playlist_Add( p_intf->p_sys->p_playlist, FileName,
+                          PLAYLIST_APPEND, PLAYLIST_END );
+        }
+        else
+        {
+            playlist_Add( p_intf->p_sys->p_playlist, FileName,
+                          PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
+        }
+    }
+
+    // VLC_DROP must be called with a pointer to a char else it will
+    // ******** SEGFAULT ********
+    // The delete is here because the processus in asynchronous
+    delete[] FileName;
+
+    // Refresh interface
+    InterfaceRefresh();
+
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// Stream Control
+//---------------------------------------------------------------------------
+void VlcProc::PauseStream()
+{
+    if( p_intf->p_sys->p_input == NULL )
+        return;
+    input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
+
+    // Refresh interface
+    InterfaceRefresh();
+}
+//---------------------------------------------------------------------------
+void VlcProc::PlayStream()
+{
+    if( p_intf->p_sys->p_playlist == NULL )
+        return;
+    if( !p_intf->p_sys->p_playlist->i_size )
+        return;
+
+    playlist_Play( p_intf->p_sys->p_playlist );
+
+    // Refresh interface
+    InterfaceRefresh();
+}
+//---------------------------------------------------------------------------
+void VlcProc::StopStream()
+{
+    if( p_intf->p_sys->p_playlist == NULL )
+        return;
+    playlist_Stop( p_intf->p_sys->p_playlist );
+
+    // Refresh interface
+    InterfaceRefresh();
+}
+//---------------------------------------------------------------------------
+void VlcProc::NextStream()
+{
+    if( p_intf->p_sys->p_playlist == NULL )
+        return;
+
+    playlist_Next( p_intf->p_sys->p_playlist );
+
+    // Refresh interface
+    InterfaceRefresh();
+}
+//---------------------------------------------------------------------------
+void VlcProc::PrevStream()
+{
+    if( p_intf->p_sys->p_playlist == NULL )
+        return;
+
+    playlist_Prev( p_intf->p_sys->p_playlist );
+
+    // Refresh interface
+    InterfaceRefresh();
+}
+//---------------------------------------------------------------------------
+void VlcProc::MoveStream( long Pos )
+{
+    if( p_intf->p_sys->p_input == NULL )
+        return;
+
+    off_t i_seek = (off_t)(Pos *
+        p_intf->p_sys->p_input->stream.p_selected_area->i_size
+        / SLIDER_RANGE);
+
+    input_Seek( p_intf->p_sys->p_input, i_seek, INPUT_SEEK_SET );
+
+    // Refresh interface
+    InterfaceRefresh();
+}
+//---------------------------------------------------------------------------
+
+
+
+//---------------------------------------------------------------------------
+// Fullscreen
+//---------------------------------------------------------------------------
+void VlcProc::FullScreen()
+{
+    vout_thread_t *p_vout;
+
+    if( p_intf->p_sys->p_input == NULL )
+        return;
+
+    p_vout = (vout_thread_t *)vlc_object_find( p_intf->p_sys->p_input,
+                                               VLC_OBJECT_VOUT, FIND_CHILD );
+    if( p_vout == NULL )
+        return;
+
+    p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+    vlc_object_release( p_vout );
+}
+//---------------------------------------------------------------------------
+
+
+
+//---------------------------------------------------------------------------
+// Volume Control
+//---------------------------------------------------------------------------
+void VlcProc::ChangeVolume( unsigned int msg, long param )
+{
+    audio_volume_t volume;
+    switch( msg )
+    {
+        case VLC_VOLUME_MUTE:
+            aout_VolumeMute( p_intf, NULL );
+            break;
+        case VLC_VOLUME_UP:
+            aout_VolumeUp( p_intf, 1, NULL );
+            break;
+        case VLC_VOLUME_DOWN:
+            aout_VolumeDown( p_intf, 1, NULL );
+            break;
+        case VLC_VOLUME_SET:
+            aout_VolumeSet( p_intf, param * AOUT_VOLUME_MAX / SLIDER_RANGE );
+            break;
+    }
+    aout_VolumeGet( p_intf, &volume );
+
+    PostMessage( NULL, CTRL_SET_SLIDER,
+        (unsigned int)
+            p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ),
+        (int)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) );
+}
+//---------------------------------------------------------------------------
diff --git a/modules/gui/skins/src/vlcproc.h b/modules/gui/skins/src/vlcproc.h
new file mode 100644 (file)
index 0000000..553c42d
--- /dev/null
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ * vlcproc.h: VlcProc class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: vlcproc.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_PROC
+#define VLC_SKIN_PROC
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+
+//---------------------------------------------------------------------------
+class VlcProc
+{
+    private:
+        intf_thread_t *p_intf;
+
+        // Vlc methods
+        void LoadSkin();
+        void OpenFile( bool play );
+        void DropFile( unsigned int param );
+        void PauseStream();
+        void PlayStream();
+        void StopStream();
+        void NextStream();
+        void PrevStream();
+        void MoveStream( long Pos );
+        void FullScreen();
+        void ChangeVolume( unsigned int msg, long param );
+
+        void InterfaceRefresh( bool All = false );
+        void EnabledEvent( string type, bool state );
+
+    public:
+        // Constuctor
+        VlcProc( intf_thread_t *_p_intf );
+
+        // Destructor
+        ~VlcProc();
+
+        // Event procedures
+        bool EventProc( Event *evt );
+        bool EventProcEnd();
+        bool IsClosing();
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/src/window.cpp b/modules/gui/skins/src/window.cpp
new file mode 100644 (file)
index 0000000..1a78951
--- /dev/null
@@ -0,0 +1,441 @@
+/*****************************************************************************
+ * window.cpp: Window class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: window.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "anchor.h"
+#include "generic.h"
+#include "window.h"
+#include "event.h"
+#include "os_api.h"
+#include "graphics.h"
+#include "os_graphics.h"
+#include "banks.h"
+#include "theme.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+// Skinable Window
+//---------------------------------------------------------------------------
+Window::Window( intf_thread_t *_p_intf, int x, int y, bool visible,
+    int transition, int normalalpha, int movealpha, bool dragdrop )
+{
+    p_intf = _p_intf;
+
+    // Set position parameters
+    Left         = x;
+    Top          = y;
+    Width        = 0;
+    Height       = 0;
+    WindowMoving = false;
+    Moved        = false;
+
+    // Set transparency
+    Transition   = transition;
+    if( Transition < 1 )
+        Transition = 1;
+    NormalAlpha  = normalalpha;
+    MoveAlpha    = movealpha;
+    Alpha        = normalalpha;
+    StartAlpha   = 0;
+    EndAlpha     = 0;
+    StartTime    = 0;
+    EndTime      = 0;
+    Lock         = 0;
+
+    // Visible parameters
+    Image               = NULL;
+    Hidden              = true;
+    Changing            = false;
+    OnStartThemeVisible = visible;
+
+    // Drag & drop
+    DragDrop = dragdrop;
+
+    // ToolTip
+    ToolTipText = "none";
+}
+//---------------------------------------------------------------------------
+Window::~Window()
+{
+    // Destroy the controls
+    for( unsigned int i = 0; i < ControlList.size(); i++ )
+        delete ControlList[i];
+}
+//---------------------------------------------------------------------------
+void Window::Open()
+{
+    if( !Hidden )
+        return;
+
+    Changing = true;
+
+    if( Transition )
+    {
+        SetTransparency( 0 );
+        OSAPI_PostMessage( this, WINDOW_SHOW, 0, 0 );
+        Fade( NormalAlpha, Transition );
+    }
+    else
+    {
+        OSAPI_PostMessage( this, WINDOW_SHOW, 0, 0 );
+    }
+}
+//---------------------------------------------------------------------------
+void Window::Close()
+{
+    Changing = true;
+
+    if( Transition )
+        Fade( 0, Transition, WINDOW_HIDE );
+    else
+        OSAPI_PostMessage( this, WINDOW_FADE, WINDOW_HIDE, 1242 );
+}
+//---------------------------------------------------------------------------
+void Window::Show()
+{
+    Changing = false;
+    Hidden   = false;
+    OSShow( true );
+}
+//---------------------------------------------------------------------------
+void Window::Hide()
+{
+    if( Hidden )
+        return;
+
+    Changing = false;
+    Hidden   = true;
+    OSShow( false );
+    OSAPI_PostMessage( NULL, VLC_TEST_ALL_CLOSED, 0, 0 );
+}
+//---------------------------------------------------------------------------
+void Window::Fade( int To, int Time, unsigned int evt )
+{
+    StartAlpha = Alpha;
+    EndAlpha   = To;
+    StartTime  = OSAPI_GetTime();
+    EndTime    = StartTime + Time;
+    Lock++;
+
+    OSAPI_PostMessage( this, WINDOW_FADE, evt, Lock );
+}
+//---------------------------------------------------------------------------
+bool Window::ProcessEvent( Event *evt )
+{
+    unsigned int i;
+    unsigned int msg = evt->GetMessage();
+    unsigned int p1  = evt->GetParam1();
+    int          p2  = evt->GetParam2();
+
+    // Send event to control if necessary
+    if( msg > VLC_CONTROL )
+    {
+        for( i = 0; i < ControlList.size(); i++ )
+            ControlList[i]->GenericProcessEvent( evt );
+        return true;
+    }
+
+    // Message processing
+    switch( msg )
+    {
+        case WINDOW_FADE:
+            if( Lock == p2 && ChangeAlpha( OSAPI_GetTime() ) )
+            {
+                OSAPI_PostMessage( this, WINDOW_FADE, p1, p2 );
+            }
+            else
+            {
+                OSAPI_PostMessage( this, p1, 0, 0 );
+            }
+            return true;
+
+        case WINDOW_MOVE:
+            WindowManualMoveInit();
+            WindowMoving = true;
+            if( MoveAlpha )
+                Fade( MoveAlpha, 100 );
+            return true;
+
+        case WINDOW_OPEN:
+            Open();
+            return true;
+
+        case WINDOW_CLOSE:
+            Close();
+            return true;
+
+        case WINDOW_SHOW:
+            Show();
+            return true;
+
+        case WINDOW_HIDE:
+            Hide();
+            return true;
+
+        default:
+            // OS specific messages processing
+            return ProcessOSEvent( evt );
+    }
+}
+//---------------------------------------------------------------------------
+bool Window::ChangeAlpha( int time )
+{
+    if( time >= EndTime )
+    {
+        if( Lock )
+        {
+            SetTransparency( EndAlpha );
+            Lock = 0;
+        }
+        return false;
+    }
+
+    int NewAlpha = StartAlpha + (EndAlpha - StartAlpha) * (time - StartTime)
+        / (EndTime - StartTime);
+    if( NewAlpha != Alpha )
+        SetTransparency( NewAlpha );
+    if( NewAlpha == EndAlpha )
+    {
+        Lock = 0;
+        return false;
+    }
+    return true;
+}
+//---------------------------------------------------------------------------
+void Window::RefreshImage( int x, int y, int w, int h )
+{
+    unsigned int i;
+
+    // Create Bitmap Buffer
+    Graphics *Buffer = (Graphics *)new OSGraphics( w, h, this );
+
+    // Draw every control
+        for( i = 0; i < ControlList.size(); i++ )
+            ControlList[i]->Draw( x, y, w, h, Buffer );
+
+    // Copy buffer in Image
+    Image->CopyFrom( x, y, w, h, Buffer, 0, 0, SRC_COPY );
+
+    // Free memory
+    delete Buffer;
+}
+//---------------------------------------------------------------------------
+void Window::Refresh( int x, int y, int w, int h )
+{
+    if( Image == NULL )
+        return;
+
+    // Refresh buffer image
+    RefreshImage( x, y, w, h );
+
+    if( Hidden )
+        return;
+
+    // And copy buffer to window
+    RefreshFromImage( x, y, w, h );
+
+}
+//---------------------------------------------------------------------------
+void Window::RefreshAll()
+{
+    Refresh( 0, 0, Width, Height );
+}
+//---------------------------------------------------------------------------
+void Window::MouseDown( int x, int y, int button )
+{
+    // Checking event in controls
+
+    for( int i = ControlList.size() - 1; i >= 0 ; i-- )
+    {
+        if( ControlList[i]->MouseDown( x, y, button ) )
+        {
+            return;
+        }
+    }
+}
+//---------------------------------------------------------------------------
+void Window::MouseMove( int x, int y, int button  )
+{
+    int i;
+
+    // Move window if selected !
+    if( WindowMoving )
+    {
+        WindowManualMove();
+    }
+
+    // Checking event in controls
+    for( i = ControlList.size() - 1; i >= 0 ; i-- )
+    {
+        ControlList[i]->MouseMove( x, y, button );
+    }
+
+    // Checking help text
+    for( i = ControlList.size() - 1; i >= 0 ; i-- )
+    {
+        if( ControlList[i]->MouseOver( x, y ) )
+        {
+            if( ControlList[i]->SendNewHelpText() )
+            {
+                break;
+            }
+        }
+    }
+
+    // If help text not found, change it to ""
+    if( i == -1 )
+    {
+        p_intf->p_sys->p_theme->EvtBank->Get( "help" )
+            ->PostTextMessage( " " );
+    }
+
+    // Checking for change in Tool Tip
+    for( i = ControlList.size() - 1; i >= 0 ; i-- )
+    {
+        if( ControlList[i]->ToolTipTest( x, y ) )
+            break;
+    }
+
+    // If no change, delete tooltip text
+    if( i == -1 )
+        ChangeToolTipText( "none" );
+}
+//---------------------------------------------------------------------------
+void Window::MouseUp( int x, int y, int button )
+{
+    int i;
+
+    // Move window if selected !
+    if( WindowMoving )
+    {
+        if( MoveAlpha )
+            Fade( NormalAlpha, 100 );
+
+        // Check for magnetism
+        p_intf->p_sys->p_theme->CheckAnchors();
+
+        WindowMoving = false;
+    }
+
+    // Checking event in controls
+    for( i = ControlList.size() - 1; i >= 0 ; i-- )
+    {
+        if( ControlList[i]->MouseUp( x, y, button ) )
+            return;
+    }
+}
+//---------------------------------------------------------------------------
+void Window::MouseDblClick( int x, int y, int button )
+{
+    int i;
+
+    // Checking event in controls
+    for( i = ControlList.size() - 1; i >= 0 ; i-- )
+    {
+        if( ControlList[i]->MouseDblClick( x, y, button ) )
+            return;
+    }
+}
+//---------------------------------------------------------------------------
+void Window::Init()
+{
+    // Get size of window
+    ReSize();
+
+    // Refresh Image buffer
+    RefreshImage( 0, 0, Width, Height );
+}
+//---------------------------------------------------------------------------
+void Window::ReSize()
+{
+    // Initialization
+    unsigned int i;
+    int w    = 0;
+    int h    = 0;
+    int MinX = 10000000;
+    int MinY = 10000000;
+
+    // Search size of window and negative values to move all
+    for( i = 0; i < ControlList.size(); i++ )
+    {
+#define min(a,b) ((a)<(b))?(a):(b)
+#define max(a,b) ((a)>(b))?(a):(b)
+        w    = max( w,    ControlList[i]->Left + ControlList[i]->Width );
+        h    = max( h,    ControlList[i]->Top + ControlList[i]->Height );
+        MinX = min( MinX, ControlList[i]->Left );
+        MinY = min( MinY, ControlList[i]->Top );
+#undef max
+#undef min
+    }
+
+    // Correct values
+    w = w - MinX;
+    h = h - MinY;
+    if( w <= 0 )
+        w = 1;
+    if( h <= 0 )
+        h = 1;
+
+    // Move window and controls !
+    if( MinX != 0 || MinY != 0 )
+    {
+        Move( Left + MinX, Top + MinY );
+        for( i = 0; i < ControlList.size(); i++ )
+            ControlList[i]->MoveRelative( -MinX, -MinY );
+    }
+
+    // Create buffer image for repainting if size has changed
+    if( w != Width || h != Height )
+    {
+        // Change image buffer
+        if( Image != NULL )
+            delete (OSGraphics *)Image;
+        Image = (Graphics *)new OSGraphics( w, h, this );
+
+
+        Size( w, h );
+    }
+
+}
+//---------------------------------------------------------------------------
+void Window::GetSize( int &w, int &h )
+{
+    w = Width;
+    h = Height;
+}
+//---------------------------------------------------------------------------
+void Window::GetPos( int &x, int &y )
+{
+    x = Left;
+    y = Top;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/src/window.h b/modules/gui/skins/src/window.h
new file mode 100644 (file)
index 0000000..9e72ae2
--- /dev/null
@@ -0,0 +1,144 @@
+/*****************************************************************************
+ * window.h: Window class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: window.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN
+#define VLC_SKIN_WIN
+
+//--- GENERAL ---------------------------------------------------------------
+#include <list>
+#include <string>
+#include <vector>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Graphics;
+class GenericControl;
+class Anchor;
+class Event;
+
+//---------------------------------------------------------------------------
+class Window
+{
+    protected:
+        // Interface thread
+        intf_thread_t *p_intf;
+
+        // Position parmaters
+        int  Left;
+        int  Top;
+        int  Width;
+        int  Height;
+
+        // General parameters
+        Graphics *Image;
+        int  Transition;
+        int  MoveAlpha;
+        int  NormalAlpha;
+        int  Alpha;
+        bool WindowMoving;
+        bool Hidden;
+        bool Changing;
+
+        // Fading transition;
+        int StartAlpha;
+        int EndAlpha;
+        int StartTime;
+        int EndTime;
+        int Lock;
+
+        // Tooltip
+        string ToolTipText;
+
+        // Drag & drop
+        bool DragDrop;
+
+    public:
+        // Controls
+        vector<GenericControl *> ControlList;
+
+        // Constructors
+        Window( intf_thread_t *_p_intf, int x, int y, bool visible,
+                int transition, int normalalpha, int movealpha, bool dragdrop );
+
+        // Destructors
+        virtual ~Window();
+
+        // Event processing
+        bool ProcessEvent( Event *evt );
+        virtual bool ProcessOSEvent( Event *evt ) = 0;
+
+        // Mouse events
+        void MouseUp(       int x, int y, int nutton );
+        void MouseDown(     int x, int y, int button );
+        void MouseMove(     int x, int y, int button );
+        void MouseDblClick( int x, int y, int button );
+
+        // Window graphic aspect
+        bool OnStartThemeVisible;
+        void Show();
+        void Hide();
+        void Open();
+        void Close();
+
+        void RefreshAll();
+        void Refresh( int x, int y, int w, int h );
+        void RefreshImage( int x, int y, int w, int h );
+        virtual void RefreshFromImage( int x, int y, int w, int h ) = 0;
+
+        void Fade( int To, int Time = 1000, unsigned int evt = 0 );
+        bool IsHidden() { return Hidden; };
+
+        virtual void OSShow( bool show ) = 0;
+        virtual void SetTransparency( int Value = -1 ) = 0;
+        virtual void WindowManualMove() = 0;
+        virtual void WindowManualMoveInit() = 0;
+
+        // Window methods
+        void Init();
+        void ReSize();
+        void GetSize( int &w, int &h );
+        void GetPos(  int &x, int &y );
+        virtual void Move( int left, int top ) = 0;
+        virtual void Size( int width, int height ) = 0;
+
+        // Fading transition
+        bool ChangeAlpha( int time );
+        void Init( int start, int end, int time );
+
+        // Texts
+        virtual void ChangeToolTipText( string text ) = 0;
+
+        // Magnetic Anchors
+        list<Anchor *> AnchorList;
+        bool Moved;
+
+        // Get the interface thread
+        intf_thread_t *GetIntf()    { return p_intf; }
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/win32/.cvsignore b/modules/gui/skins/win32/.cvsignore
new file mode 100644 (file)
index 0000000..84c4d6f
--- /dev/null
@@ -0,0 +1,6 @@
+.deps
+.dirstamp
+*.dll
+*.dylib
+*.sl
+*.so
diff --git a/modules/gui/skins/win32/win32_api.cpp b/modules/gui/skins/win32/win32_api.cpp
new file mode 100644 (file)
index 0000000..4c940d0
--- /dev/null
@@ -0,0 +1,161 @@
+/*****************************************************************************
+ * win32_api.cpp: Various win32-specific functions
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_api.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "window.h"
+#include "os_window.h"
+#include "os_api.h"
+#include "event.h"         // for MAX_PARAM_SIZE
+
+
+
+//---------------------------------------------------------------------------
+// Event API
+//---------------------------------------------------------------------------
+void OSAPI_SendMessage( Window *win, unsigned int message, unsigned int param1,
+                        long param2 )
+{
+    if( win == NULL )
+        SendMessage( NULL, message, param1, param2 );
+    else
+        SendMessage( ( (Win32Window *)win )->GetHandle(), message, param1,
+                     param2 );
+}
+//---------------------------------------------------------------------------
+void OSAPI_PostMessage( Window *win, unsigned int message, unsigned int param1,
+                        long param2 )
+{
+    if( win == NULL )
+        PostMessage( NULL, message, param1, param2 );
+    else
+        PostMessage( ( (Win32Window *)win )->GetHandle(), message, param1,
+                     param2 );
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// Graphic API
+//---------------------------------------------------------------------------
+int OSAPI_GetNonTransparentColor( int c )
+{
+    // Get desktop device context
+    HDC DeskDC = GetWindowDC( GetDesktopWindow() );
+
+    // If color is black or color is same as black wether pixel color depth
+    if( c == 0 || SetPixel( DeskDC, 0, 0, c ) == 0 )
+    {
+        if( GetDeviceCaps( DeskDC, BITSPIXEL ) < 24 )
+            c = RGB(8, 0, 0);
+        else
+            c = RGB(1, 0, 0);
+    }
+    ReleaseDC( GetDesktopWindow(), DeskDC );
+    return c;
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// General
+//---------------------------------------------------------------------------
+int OSAPI_GetTime()
+{
+    return GetTickCount();
+}
+//---------------------------------------------------------------------------
+void OSAPI_GetScreenSize( int &w, int &h )
+{
+    w = GetSystemMetrics(SM_CXSCREEN);
+    h = GetSystemMetrics(SM_CYSCREEN);
+}
+//---------------------------------------------------------------------------
+void OSAPI_GetMousePos( int &x, int &y )
+{
+    LPPOINT MousePos = new POINT;
+    GetCursorPos( MousePos );
+    x = MousePos->x;
+    y = MousePos->y;
+    delete MousePos;
+}
+//---------------------------------------------------------------------------
+string OSAPI_GetWindowTitle( Window *win )
+{
+    char *buffer = new char[MAX_PARAM_SIZE];
+    GetWindowText( ((Win32Window *)win)->GetHandle(), buffer, MAX_PARAM_SIZE );
+    string Title = buffer;
+    delete buffer;
+
+    return Title;
+}
+//---------------------------------------------------------------------------
+bool OSAPI_RmDir( string path )
+{
+    WIN32_FIND_DATA find;
+    string File;
+    string FindFiles = path + "\\*.*";
+    HANDLE handle    = FindFirstFile( (char *)FindFiles.c_str(), &find );
+
+    while( handle != INVALID_HANDLE_VALUE )
+    {
+        // If file is neither "." nor ".."
+        if( strcmp( find.cFileName, "." ) && strcmp( find.cFileName, ".." ) )
+        {
+            // Set file name
+            File = path + "\\" + (string)find.cFileName;
+
+            // If file is a directory, delete it recursively
+            if( find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
+            {
+                OSAPI_RmDir( File );
+            }
+            // Else, it is a file so simply delete it
+            else
+            {
+                DeleteFile( (char *)File.c_str() );
+            }
+        }
+
+        // If no more file in directory, exit while
+        if( !FindNextFile( handle, &find ) )
+            break;
+    }
+
+    // Now directory is empty so can be removed
+    FindClose( handle );
+    RemoveDirectory( (char *)path.c_str() );
+
+    return true;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/win32/win32_bitmap.cpp b/modules/gui/skins/win32/win32_bitmap.cpp
new file mode 100644 (file)
index 0000000..e189b59
--- /dev/null
@@ -0,0 +1,175 @@
+/*****************************************************************************
+ * win32_bitmap.cpp: Win32 implementation of the Bitmap class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_bitmap.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- WIN32 -----------------------------------------------------------------
+#define WINVER  0x0500
+#include <windows.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "graphics.h"
+#include "win32_graphics.h"
+#include "bitmap.h"
+#include "win32_bitmap.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+//   Win32Bitmap
+//---------------------------------------------------------------------------
+Win32Bitmap::Win32Bitmap( intf_thread_t *p_intf, string FileName, int AColor )
+    : Bitmap( p_intf, FileName, AColor )
+{
+    HBITMAP HBitmap;
+    HBITMAP HBuf;
+    BITMAP  Bmp;
+    HDC     bufDC;
+    AlphaColor = AColor;
+
+    // Create image from file if it exists
+    HBitmap = (HBITMAP) LoadImage( NULL, FileName.c_str(), IMAGE_BITMAP,
+                                   0, 0, LR_LOADFROMFILE );
+    if( HBitmap == NULL )
+    {
+        if( FileName != "" )
+            msg_Warn( p_intf, "Couldn't load bitmap: %s", FileName.c_str() );
+
+        HBitmap = CreateBitmap( 0, 0, 1, 32, NULL );
+    }
+
+    // Create device context
+    bmpDC   = CreateCompatibleDC( NULL );
+    SelectObject( bmpDC, HBitmap );
+
+    // Get size of image
+    GetObject( HBitmap, sizeof( Bmp ), &Bmp );
+    Width  = Bmp.bmWidth;
+    Height = Bmp.bmHeight;
+
+    // If alpha color is not 0, then change 0 colors to non black color to avoid
+    // window transparency
+    if( (int)AlphaColor != OSAPI_GetNonTransparentColor( 0 ) )
+    {
+        bufDC = CreateCompatibleDC( bmpDC );
+        HBuf = CreateCompatibleBitmap( bmpDC, Width, Height );
+        SelectObject( bufDC, HBuf );
+
+        LPRECT r = new RECT;
+        HBRUSH Brush = CreateSolidBrush( OSAPI_GetNonTransparentColor( 0 ) );
+        r->left   = 0;
+        r->top    = 0;
+        r->right  = Width;
+        r->bottom = Height;
+        FillRect( bufDC, r, Brush );
+        DeleteObject( Brush );
+        delete r;
+
+        TransparentBlt( bufDC, 0, 0, Width, Height, bmpDC, 0, 0, Width, Height, 0 );
+        BitBlt( bmpDC, 0, 0, Width, Height, bufDC, 0, 0, SRCCOPY );
+        DeleteDC( bufDC );
+        DeleteObject( HBuf );
+    }
+
+    // Delete objects
+    DeleteObject( HBitmap );
+}
+//---------------------------------------------------------------------------
+Win32Bitmap::Win32Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y,
+    int w, int h, int AColor ) : Bitmap( p_intf, from, x, y, w, h, AColor )
+{
+    Width  = w;
+    Height = h;
+    AlphaColor = AColor;
+    HBITMAP HBmp;
+    HDC fromDC = ( (Win32Graphics *)from )->GetImageHandle();
+
+    // Create image
+    bmpDC = CreateCompatibleDC( fromDC );
+    HBmp  = CreateCompatibleBitmap( fromDC, Width, Height );
+    SelectObject( bmpDC, HBmp );
+    DeleteObject( HBmp );
+    BitBlt( bmpDC, 0, 0, Width, Height, fromDC, x, y, SRCCOPY );
+}
+//---------------------------------------------------------------------------
+Win32Bitmap::Win32Bitmap( intf_thread_t *p_intf, Bitmap *c )
+    : Bitmap( p_intf, c )
+{
+    HBITMAP HBuf;
+
+    // Copy attibutes
+    c->GetSize( Width, Height );
+    AlphaColor = c->GetAlphaColor();
+
+    // Copy bmpDC
+    bmpDC = CreateCompatibleDC( NULL );
+    HBuf  = CreateCompatibleBitmap( bmpDC, Width, Height );
+    SelectObject( bmpDC, HBuf );
+
+    BitBlt( bmpDC, 0, 0, Width, Height, ( (Win32Bitmap *)c )->GetBmpDC(),
+            0, 0, SRCCOPY );
+    DeleteObject( HBuf );
+}
+//---------------------------------------------------------------------------
+Win32Bitmap::~Win32Bitmap()
+{
+    DeleteDC( bmpDC );
+}
+//---------------------------------------------------------------------------
+void Win32Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
+                              Graphics *dest )
+{
+    HDC destDC = ( (Win32Graphics *)dest )->GetImageHandle();
+
+    // New method, not available in win95
+    TransparentBlt( destDC, xRef, yRef, w, h, bmpDC, x, y, w, h, AlphaColor );
+
+}
+//---------------------------------------------------------------------------
+bool Win32Bitmap::Hit( int x, int y)
+{
+    unsigned int c = GetPixel( bmpDC, x, y );
+    if( c == AlphaColor || c == CLR_INVALID )
+        return false;
+    else
+        return true;
+
+}
+//---------------------------------------------------------------------------
+int Win32Bitmap::GetBmpPixel( int x, int y )
+{
+    return GetPixel( bmpDC, x, y );
+}
+//---------------------------------------------------------------------------
+void Win32Bitmap::SetBmpPixel( int x, int y, int color )
+{
+    SetPixelV( bmpDC, x, y, color );
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/win32/win32_bitmap.h b/modules/gui/skins/win32/win32_bitmap.h
new file mode 100644 (file)
index 0000000..efcb1d0
--- /dev/null
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * win32_bitmap.h: Win32 implementation of the Bitmap class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_bitmap.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_WIN32_BITMAP
+#define VLC_WIN32_BITMAP
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Bitmap;
+class Graphics;
+
+//---------------------------------------------------------------------------
+class Win32Bitmap : public Bitmap
+{
+    private:
+        HDC bmpDC;
+
+    public:
+        // Constructors
+        Win32Bitmap( intf_thread_t *p_intf, string FileName, int AColor );
+        Win32Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y,
+                     int w, int h, int AColor );
+        Win32Bitmap( intf_thread_t *p_intf, Bitmap *c );
+
+        // Destructor
+        virtual ~Win32Bitmap();
+
+        virtual void DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
+                                 Graphics *dest );
+        virtual bool Hit( int x, int y );
+
+        virtual int  GetBmpPixel( int x, int y );
+        virtual void SetBmpPixel( int x, int y, int color );
+
+        HDC GetBmpDC() { return bmpDC; }
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/win32/win32_dialog.cpp b/modules/gui/skins/win32/win32_dialog.cpp
new file mode 100644 (file)
index 0000000..ffeecf2
--- /dev/null
@@ -0,0 +1,334 @@
+/*****************************************************************************
+ * win32_dialog.cpp: Win32 implementation of some dialog boxes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_dialog.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- WIN32 -----------------------------------------------------------------
+#define _WIN32_IE 0x0400    // Yes, i think it's a fucking kludge !
+#include <windows.h>
+#include <commdlg.h>
+#include <commctrl.h>
+#include <richedit.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "banks.h"
+#include "dialog.h"
+#include "os_dialog.h"
+#include "skin_common.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "event.h"
+#include "os_api.h"
+
+
+//---------------------------------------------------------------------------
+// Open file dialog box
+//---------------------------------------------------------------------------
+Win32OpenFileDialog::Win32OpenFileDialog( string title, bool multiselect ) :
+    OpenFileDialog( title, multiselect )
+{
+}
+//---------------------------------------------------------------------------
+Win32OpenFileDialog::~Win32OpenFileDialog()
+{
+}
+//---------------------------------------------------------------------------
+void Win32OpenFileDialog::AddFilter( string name, string type )
+{
+    unsigned int i;
+
+    for( i = 0; i < name.length(); i++ )
+        Filter[FilterLength++] = name[i];
+
+    Filter[FilterLength++] = ' ';
+    Filter[FilterLength++] = '(';
+
+    for( i = 0; i < type.length(); i++ )
+        Filter[FilterLength++] = type[i];
+
+    Filter[FilterLength++] = ')';
+    Filter[FilterLength++] = '\0';
+
+    for( i = 0; i < type.length(); i++ )
+        Filter[FilterLength++] = type[i];
+
+    Filter[FilterLength++] = '\0';
+
+    // Ending null character if this filter is the last
+    Filter[FilterLength] = '\0';
+}
+//---------------------------------------------------------------------------
+bool Win32OpenFileDialog::Open()
+{
+    // Initailize dialog box
+    OPENFILENAME OpenFile;
+    memset( &OpenFile, 0, sizeof( OpenFile ) );
+    OpenFile.lStructSize  = sizeof( OPENFILENAME );
+    OpenFile.hwndOwner = NULL;
+    OpenFile.lpstrFile = new char[MAX_PATH];
+    OpenFile.lpstrFile[0] = '\0';
+    OpenFile.nMaxFile = MAX_PATH;
+    if( MultiSelect )
+    {
+        OpenFile.Flags = OFN_ALLOWMULTISELECT | OFN_EXPLORER;
+    }
+    else
+    {
+        OpenFile.Flags = OFN_EXPLORER;
+    }
+    OpenFile.lpstrTitle  = Title.c_str();
+    OpenFile.lpstrFilter = Filter;
+
+    // Show dialog box
+    if( !GetOpenFileName( &OpenFile ) )
+        return false;
+
+    // Find files in string result
+    char * File = OpenFile.lpstrFile;
+    int i       = OpenFile.nFileOffset;
+    int last    = OpenFile.nFileOffset;
+    string path;
+    string tmpFile;
+
+
+    // If only one file has been selected
+    if( File[OpenFile.nFileOffset - 1] != '\0' )
+    {
+        FileList.push_back( (string)File );
+    }
+    // If multiple files have been selected
+    else
+    {
+        // Add \ if not present at end of path
+        if( File[OpenFile.nFileOffset - 2] != '\\' )
+        {
+            path = (string)File + '\\';
+        }
+        else
+        {
+            path = (string)File;
+        }
+
+        // Search filenames
+        while( true )
+        {
+            if( File[i] == '\0' )
+            {
+                if( i == last )
+                    break;
+                else
+                {
+                    // Add file
+                    FileList.push_back( path + (string)&File[last] );
+                    last = i + 1;
+                }
+            }
+            i++;
+        }
+    }
+
+    // Free memory
+    delete[] OpenFile.lpstrFile;
+
+    return true;
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// CALLBACKs
+//---------------------------------------------------------------------------
+LRESULT CALLBACK LogWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
+                                LPARAM lParam )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)GetWindowLongPtr( hwnd,
+        GWLP_USERDATA );
+
+    //msg_Err( p_intf, "Message to hwnd %i (%i)", (int)hwnd, (int)uMsg );
+    switch( uMsg )
+    {
+        case WM_PAINT:
+            PAINTSTRUCT Infos;
+            BeginPaint( hwnd , &Infos );
+            EndPaint( hwnd , &Infos );
+            return 0;
+
+        case WM_SIZE:
+            if( ( (Win32Theme *)p_intf->p_sys->p_theme )
+                ->GetLogHandle() == hwnd )
+            {
+                SetWindowPos( ( (Win32LogWindow *)
+                    p_intf->p_sys->p_theme->GetLogWindow() )->GetRichCtrl(),
+                    0, 0, 0, LOWORD( lParam ), HIWORD( lParam ),
+                    SWP_NOREDRAW|SWP_NOZORDER|SWP_NOMOVE );
+            }
+            return 0;
+
+        case WM_CLOSE:
+            OSAPI_PostMessage( NULL, VLC_LOG_SHOW, 0, (int)false );
+            p_intf->p_sys->p_theme->EvtBank->Get( "hide_log" )
+                ->PostSynchroMessage();
+            return 0;
+
+    }
+    return DefWindowProc( hwnd, uMsg, wParam, lParam );
+}
+//---------------------------------------------------------------------------
+DWORD CALLBACK LogWindowStream( DWORD_PTR dwCookie, LPBYTE pbBuff,
+                                LONG cb, LONG *pcb )
+{
+    int i;
+    char *text = (char *)( (string *)dwCookie )->c_str();
+
+    if( strlen( text ) < (unsigned int)cb )
+    {
+        *pcb = strlen( text );
+        for( i = 0; i < *pcb; i++ )
+            pbBuff[i] = text[i];
+    }
+    else
+    {
+        *pcb = cb;
+        for( i = 0; i < *pcb; i++ )
+            pbBuff[i] = text[i];
+    }
+    delete (string *)dwCookie;
+    return 0;
+}
+//---------------------------------------------------------------------------
+
+
+
+//---------------------------------------------------------------------------
+// Win32 Log Window class
+//---------------------------------------------------------------------------
+Win32LogWindow::Win32LogWindow( intf_thread_t *_p_intf ) : LogWindow( _p_intf )
+{
+    hWindow   = NULL;
+    hRichCtrl = NULL;
+
+    // Define window class
+    WNDCLASS WindowClass;
+    WindowClass.style = CS_VREDRAW|CS_HREDRAW;
+    WindowClass.lpfnWndProc = (WNDPROC)LogWindowProc;
+    WindowClass.lpszClassName = "LogWindow";
+    WindowClass.lpszMenuName = NULL;
+    WindowClass.cbClsExtra = 0;
+    WindowClass.cbWndExtra = 0;
+    WindowClass.hbrBackground = HBRUSH (COLOR_WINDOW);
+    WindowClass.hCursor = LoadCursor( NULL , IDC_ARROW );
+    WindowClass.hIcon = LoadIcon( GetModuleHandle( NULL ), "VLC_ICON" );
+    WindowClass.hInstance = GetModuleHandle( NULL );
+
+    // Register window class
+    RegisterClass( &WindowClass );
+
+    // Load library
+    LoadLibrary("riched20.dll");
+
+    // Init common controls
+    InitCommonControlsEx( NULL );
+
+    // Create log window
+    hWindow = CreateWindowEx( 0, "LogWindow", "Log Window",
+        WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 300, 0, 0,
+        GetModuleHandle( NULL ), NULL );
+    // Store with it a pointer to the interface thread
+    SetWindowLongPtr( hWindow, GWLP_USERDATA, (LONG_PTR)p_intf );
+
+    // Create rich text control
+    hRichCtrl = CreateWindowEx( 0, RICHEDIT_CLASS, NULL,
+        WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE|ES_READONLY|WS_VSCROLL,
+        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+        hWindow, 0, GetModuleHandle( NULL ), 0);
+
+    // Change text format
+    SendMessage( hRichCtrl, EM_SETBKGNDCOLOR, 0, RGB(0,0,0) );
+    ChangeColor( RGB( 128, 128, 128 ) );
+    RtfHeader = "{\\rtf1 ";
+
+    Clear();
+}
+//---------------------------------------------------------------------------
+Win32LogWindow::~Win32LogWindow()
+{
+    DestroyWindow( hRichCtrl );
+    DestroyWindow( hWindow );
+}
+//---------------------------------------------------------------------------
+void Win32LogWindow::Clear()
+{
+    EDITSTREAM *Stream;
+    Stream = new EDITSTREAM;
+    string *buffer = new string( RtfHeader );
+    Stream->dwCookie = (DWORD)buffer;
+    Stream->dwError  = 0;
+    Stream->pfnCallback = (EDITSTREAMCALLBACK)LogWindowStream;
+    SendMessage( hRichCtrl, EM_STREAMIN, SF_RTF, (LPARAM)Stream );
+}
+//---------------------------------------------------------------------------
+void Win32LogWindow::AddLine( string line )
+{
+    // Initialize stream
+        EDITSTREAM *Stream;
+        string *buffer      = new string( RtfHeader + line + "\\par }" );
+        Stream              = new EDITSTREAM;
+        Stream->dwCookie    = (DWORD)buffer;
+        Stream->dwError     = 0;
+        Stream->pfnCallback = (EDITSTREAMCALLBACK)LogWindowStream;
+
+    SendMessage( hRichCtrl, EM_STREAMIN, SF_RTF|SFF_SELECTION, (LPARAM)Stream );
+
+    SendMessage( hRichCtrl, WM_VSCROLL, SB_BOTTOM, 0 );
+}
+//---------------------------------------------------------------------------
+void Win32LogWindow::ChangeColor( int color, bool bold )
+{
+    CHARFORMAT format;
+    memset(&format, 0, sizeof(CHARFORMAT));
+    format.cbSize      = sizeof(CHARFORMAT);
+    format.dwMask      = bold ? CFM_COLOR|CFM_BOLD : CFM_COLOR;
+    format.dwEffects   = bold ? CFE_BOLD           : 0;
+    format.crTextColor = color;
+    SendMessage( hRichCtrl, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&format );
+}
+//---------------------------------------------------------------------------
+void Win32LogWindow::Show()
+{
+    ShowWindow( hWindow, SW_SHOW );
+    Visible = true;
+}
+//---------------------------------------------------------------------------
+void Win32LogWindow::Hide()
+{
+    ShowWindow( hWindow, SW_HIDE );
+    Visible = false;
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/win32/win32_dialog.h b/modules/gui/skins/win32/win32_dialog.h
new file mode 100644 (file)
index 0000000..355bc9f
--- /dev/null
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ * win32_dialog.h: Win32 implementation of some dialog boxes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_dialog.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN32_DIALOG
+#define VLC_SKIN_WIN32_DIALOG
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+
+
+//---------------------------------------------------------------------------
+class Win32OpenFileDialog : OpenFileDialog
+{
+    private:
+
+    protected:
+
+    public:
+        // Constructors
+        Win32OpenFileDialog( string title, bool multiselect );
+
+        // Destructors
+        virtual ~Win32OpenFileDialog();
+
+        virtual void AddFilter( string name, string type );
+        virtual bool Open();
+};
+//---------------------------------------------------------------------------
+class Win32LogWindow : LogWindow
+{
+    private:
+        HWND hWindow;
+        HWND hRichCtrl;
+        string RtfHeader;
+
+    public:
+        // Constructors
+        Win32LogWindow( intf_thread_t *_p_intf );
+
+        // Destructors
+        virtual ~Win32LogWindow();
+
+        virtual void Clear();
+        virtual void AddLine( string line );
+        virtual void ChangeColor( int color, bool bold = false );
+        virtual void Show();
+        virtual void Hide();
+
+        // Specific methods
+        HWND GetRichCtrl() { return hRichCtrl; };
+        HWND GetWindow()   { return hWindow; };
+
+};
+//---------------------------------------------------------------------------
+
+#endif
+
diff --git a/modules/gui/skins/win32/win32_dragdrop.cpp b/modules/gui/skins/win32/win32_dragdrop.cpp
new file mode 100644 (file)
index 0000000..af3547b
--- /dev/null
@@ -0,0 +1,170 @@
+/*****************************************************************************
+ * win32_dragdrop.cpp: Win32 implementation of the drag & drop
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_dragdrop.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- GENERAL ---------------------------------------------------------------
+#include <list>
+using namespace std;
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "event.h"
+#include "win32_dragdrop.h"
+
+
+
+//---------------------------------------------------------------------------
+Win32DropObject::Win32DropObject() : IDropTarget()
+{
+    References = 1;
+}
+//---------------------------------------------------------------------------
+Win32DropObject::~Win32DropObject()
+{
+}
+//---------------------------------------------------------------------------
+void Win32DropObject::HandleDrop( HDROP HDrop )
+{
+    // Get number of files that are dropped into vlc
+    int NbFiles = DragQueryFile( (HDROP)HDrop, 0xFFFFFFFF, NULL, 0 );
+
+    // For each dropped files
+    for( int i = 0; i < NbFiles; i++ )
+    {
+        // Get the name of the file
+        int NameLength = DragQueryFile( (HDROP)HDrop, i, NULL, 0 ) + 1;
+        char *FileName = new char[NameLength];
+        DragQueryFile( (HDROP)HDrop, i, FileName, NameLength );
+
+        // The pointer must not be deleted here because it will be deleted
+        // in the VLC specific messages processing function
+        PostMessage( NULL, VLC_DROP, (WPARAM)FileName, 0 );
+    }
+
+    DragFinish( (HDROP)HDrop );
+
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP Win32DropObject::QueryInterface( REFIID iid, void FAR* FAR* ppv )
+{
+    // Tell other objects about our capabilities
+    if( iid == IID_IUnknown || iid == IID_IDropTarget )
+    {
+        *ppv = this;
+        AddRef();
+        return S_OK;
+    }
+    *ppv = NULL;
+    return ResultFromScode( E_NOINTERFACE );
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP_(ULONG) Win32DropObject::AddRef()
+{
+    return ++References;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP_(ULONG) Win32DropObject::Release()
+{
+    if( --References == 0 )
+    {
+        delete this;
+        return 0;
+    }
+    return References;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP Win32DropObject::DragEnter( LPDATAOBJECT pDataObj,
+    DWORD grfKeyState, POINTL pt, DWORD *pdwEffect )
+{
+    FORMATETC fmtetc;
+
+    fmtetc.cfFormat = CF_HDROP;
+    fmtetc.ptd      = NULL;
+    fmtetc.dwAspect = DVASPECT_CONTENT;
+    fmtetc.lindex   = -1;
+    fmtetc.tymed    = TYMED_HGLOBAL;
+
+    // Check that the drag source provides CF_HDROP,
+    // which is the only format we accept
+    if( pDataObj->QueryGetData( &fmtetc ) == S_OK )
+        *pdwEffect = DROPEFFECT_COPY;
+    else
+        *pdwEffect = DROPEFFECT_NONE;
+
+    return S_OK;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP Win32DropObject::DragOver( DWORD grfKeyState, POINTL pt,
+   DWORD *pdwEffect )
+{
+    // For visual feedback
+    // TODO
+    return S_OK;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP Win32DropObject::DragLeave()
+{
+    // Remove visual feedback
+    // TODO
+    return S_OK;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP Win32DropObject::Drop( LPDATAOBJECT pDataObj, DWORD grfKeyState,
+   POINTL pt, DWORD *pdwEffect )
+{
+    // User has dropped on us -- get the CF_HDROP data from drag source
+    FORMATETC fmtetc;
+    fmtetc.cfFormat = CF_HDROP;
+    fmtetc.ptd      = NULL;
+    fmtetc.dwAspect = DVASPECT_CONTENT;
+    fmtetc.lindex   = -1;
+    fmtetc.tymed    = TYMED_HGLOBAL;
+
+    STGMEDIUM medium;
+    HRESULT hr = pDataObj->GetData( &fmtetc, &medium );
+
+    if( !FAILED(hr) )
+    {
+        // Grab a pointer to the data
+        HGLOBAL HFiles = medium.hGlobal;
+        HDROP HDrop = (HDROP)GlobalLock( HFiles );
+
+        // Notify the Form of the drop
+        HandleDrop( HDrop );
+
+        // Release the pointer to the memory
+        GlobalUnlock( HFiles );
+//        ReleaseStgMedium( &medium );
+    }
+    else
+    {
+        *pdwEffect = DROPEFFECT_NONE;
+        return hr;
+    }
+    return S_OK;
+}
+
diff --git a/modules/gui/skins/win32/win32_dragdrop.h b/modules/gui/skins/win32/win32_dragdrop.h
new file mode 100644 (file)
index 0000000..1748c0a
--- /dev/null
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ * win32_dragdrop.h: Win32 implementation of the drag & drop
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_dragdrop.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN32_DRAGDROP
+#define VLC_SKIN_WIN32_DRAGDROP
+
+//--- WIN32 -----------------------------------------------------------------
+#include <shellapi.h>
+#include <ole2.h>
+
+//---------------------------------------------------------------------------
+class Win32DropObject : public IDropTarget
+{
+    public:
+       Win32DropObject();
+       virtual ~Win32DropObject();
+
+    protected:
+        // IUnknown methods
+        STDMETHOD(QueryInterface)( REFIID riid, void FAR* FAR* ppvObj );
+        STDMETHOD_(ULONG, AddRef)();
+        STDMETHOD_(ULONG, Release)();
+
+        // IDropTarget methods
+        STDMETHOD(DragEnter)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
+                              POINTL pt, DWORD *pdwEffect );
+        STDMETHOD(DragOver)( DWORD grfKeyState, POINTL pt, DWORD *pdwEffect );
+        STDMETHOD(DragLeave)();
+        STDMETHOD(Drop)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
+                         POINTL pt, DWORD *pdwEffect );
+
+    private:
+        unsigned long References;
+
+        // Helper function
+        void HandleDrop( HDROP HDrop );
+};
+//---------------------------------------------------------------------------
+#endif
diff --git a/modules/gui/skins/win32/win32_event.cpp b/modules/gui/skins/win32/win32_event.cpp
new file mode 100644 (file)
index 0000000..1f156be
--- /dev/null
@@ -0,0 +1,113 @@
+/*****************************************************************************
+ * win32_event.cpp: Win32 implementation of the Event class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_event.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "event.h"
+#include "os_event.h"
+#include "window.h"
+#include "os_window.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "skin_common.h"
+
+
+
+//---------------------------------------------------------------------------
+//   VLC Event
+//---------------------------------------------------------------------------
+Win32Event::Win32Event( intf_thread_t *p_intf, string Desc, string shortcut )
+    : Event( p_intf, Desc, shortcut )
+{
+    hWnd = NULL;
+}
+//---------------------------------------------------------------------------
+Win32Event::Win32Event( intf_thread_t *p_intf, HWND hwnd, unsigned int msg,
+    unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
+{
+    hWnd = hwnd;
+}
+//---------------------------------------------------------------------------
+Win32Event::Win32Event( intf_thread_t *p_intf, Window *win, unsigned int msg,
+    unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
+{
+    hWnd = ( (Win32Window *)win )->GetHandle();
+}
+//---------------------------------------------------------------------------
+Win32Event::~Win32Event()
+{
+}
+//---------------------------------------------------------------------------
+bool Win32Event::SendEvent()
+{
+    if( Message != VLC_NOTHING )
+    {
+        PostMessage( hWnd, Message, Param1, Param2 );
+        PostSynchroMessage();
+        return true;
+    }
+
+    return true;
+
+}
+//---------------------------------------------------------------------------
+bool Win32Event::IsEqual( Event *evt )
+{
+    Win32Event *WinEvt = (Win32Event *)evt;
+    return( WinEvt->GetWindow() == hWnd   && WinEvt->GetMessage() == Message &&
+            WinEvt->GetParam1() == Param1 && WinEvt->GetParam2()  == Param2 );
+}
+//---------------------------------------------------------------------------
+void Win32Event::CreateOSEvent( string para1, string para2, string para3 )
+{
+
+    // Find Parameters
+    switch( Message )
+    {
+        case WINDOW_MOVE:
+            hWnd = GetWindowFromName( para1 );
+            break;
+
+    }
+
+}
+//---------------------------------------------------------------------------
+HWND Win32Event::GetWindowFromName( string name )
+{
+    Win32Window *win = (Win32Window *)
+        p_intf->p_sys->p_theme->GetWindow( name );
+    if( win == NULL )
+        return NULL;
+    else
+        return win->GetHandle();
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/win32/win32_event.h b/modules/gui/skins/win32/win32_event.h
new file mode 100644 (file)
index 0000000..7f7c75e
--- /dev/null
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * win32_event.h: Win32 implementation of the Event class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_event.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN32_EVENT
+#define VLC_SKIN_WIN32_EVENT
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Window;
+
+//---------------------------------------------------------------------------
+class Win32Event : Event
+{
+    private:
+        HWND GetWindowFromName( string name );
+        HWND hWnd;
+    public:
+        // Constructor
+        Win32Event( intf_thread_t *p_intf, string Desc, string shortcut );
+        Win32Event( intf_thread_t *p_intf, HWND hwnd, unsigned int msg,
+                    unsigned int par1, long par2 );
+        Win32Event( intf_thread_t *p_intf, Window *win, unsigned int msg,
+                    unsigned int par1, long par2 );
+
+        // Destructor
+        virtual ~Win32Event();
+
+        // Event sending
+        virtual bool SendEvent();
+
+        // General operations on events
+        virtual void CreateOSEvent( string para1, string para2, string para3 );
+        virtual bool IsEqual( Event *evt );
+
+        // Getters
+        HWND GetWindow()    { return hWnd; }
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/win32/win32_font.cpp b/modules/gui/skins/win32/win32_font.cpp
new file mode 100644 (file)
index 0000000..70eaa13
--- /dev/null
@@ -0,0 +1,149 @@
+/*****************************************************************************
+ * win32_font.cpp: Win32 implementation of the Font class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_font.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "graphics.h"
+#include "win32_graphics.h"
+#include "font.h"
+#include "win32_font.h"
+
+
+
+//---------------------------------------------------------------------------
+// Font object
+//---------------------------------------------------------------------------
+Win32Font::Win32Font( intf_thread_t *_p_intf, string fontname, int size,
+    int color, int weight, bool italic, bool underline )
+    : Font( _p_intf, fontname, size, color, weight, italic, underline )
+{
+}
+//---------------------------------------------------------------------------
+Win32Font::~Win32Font()
+{
+}
+//---------------------------------------------------------------------------
+void Win32Font::AssignWin32Font( HDC DC )
+{
+    // Create font
+    HGDIOBJ fontObj = CreateFont(
+        -MulDiv( Size, GetDeviceCaps( DC, LOGPIXELSX ), 72 ),
+        0,
+        0,                  // angle of escapement
+        0,                  // base-line orientation angle
+        Weight,             // font weight
+        Italic,             // italic attribute flag
+        Underline,          // underline attribute flag
+        0,                  // strikeout attribute flag
+        ANSI_CHARSET,       // character set identifier
+        OUT_TT_PRECIS,      // output precision
+        0,                  // clipping precision
+        ANTIALIASED_QUALITY,      // output quality
+        0,                  // pitch and family
+        FontName.c_str()    // pointer to typeface name string
+    );
+
+    // Assign font to DC
+    SelectObject( DC, fontObj );
+
+    // Free memory
+    DeleteObject( fontObj );
+}
+//---------------------------------------------------------------------------
+void Win32Font::AssignFont( Graphics *dest )
+{
+    HDC DC = ( (Win32Graphics *)dest )->GetImageHandle();
+    AssignWin32Font( DC );
+}
+//---------------------------------------------------------------------------
+void Win32Font::GetSize( string text, int &w, int &h )
+{
+    // Get device context of screen
+    HDC DeskDC = GetWindowDC( GetDesktopWindow() );
+
+    // Get size
+    LPRECT rect = new RECT;;
+    rect->left   = 0;
+    rect->top    = 0;
+    AssignWin32Font( DeskDC );
+    DrawText( DeskDC, text.c_str(), text.length(), rect, DT_CALCRECT);
+    w = rect->right - rect->left;
+    h = rect->bottom - rect->top;
+
+    // Release screen device context
+    ReleaseDC( GetDesktopWindow(), DeskDC );
+}
+//---------------------------------------------------------------------------
+void Win32Font::GenericPrint( Graphics *dest, string text, int x, int y,
+                                 int w, int h, int align, int color )
+{
+    HDC DC = ( (Win32Graphics *)dest )->GetImageHandle();
+    // Set boundaries
+    LPRECT r = new RECT;
+    r->left   = x;
+    r->top    = y;
+    r->right  = x + w;
+    r->bottom = y + h;
+
+    // Get desktop Device Context
+    SetBkMode( DC, TRANSPARENT );
+
+    // Modify desktop attributes
+    AssignFont( dest );
+
+    // Change text color
+    SetTextColor( DC, color );
+
+    // Draw text on screen
+    DrawText( DC, text.c_str(), text.length(), r, align );
+
+    // Set text color to black to avoid graphic bugs
+    SetTextColor( DC, 0 );
+
+    // Free memory
+    delete r;
+}
+
+//---------------------------------------------------------------------------
+void Win32Font::Print( Graphics *dest, string text, int x, int y, int w,
+                       int h, int align )
+{
+    GenericPrint( dest, text, x, y, w, h, align, Color );
+}
+//---------------------------------------------------------------------------
+void Win32Font::PrintColor( Graphics *dest, string text, int x, int y, int w,
+                            int h, int align, int color )
+{
+    GenericPrint( dest, text, x, y, w, h, align, color );
+}
+//---------------------------------------------------------------------------
+
+
diff --git a/modules/gui/skins/win32/win32_font.h b/modules/gui/skins/win32/win32_font.h
new file mode 100644 (file)
index 0000000..0e388b9
--- /dev/null
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ * win32_font.h: Win32 implementation of the Font class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_font.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN32_FONT
+#define VLC_SKIN_WIN32_FONT
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Graphics;
+
+//---------------------------------------------------------------------------
+class Win32Font : Font
+{
+    private:
+        // Assign font to Device Context
+        virtual void AssignFont( Graphics *dest );
+        void AssignWin32Font( HDC DC );
+
+        // Helper function
+        virtual void GenericPrint( Graphics *dest, string text, int x, int y,
+                                   int w, int h, int align, int color );
+
+    public:
+        // Constructor
+        Win32Font( intf_thread_t *_p_intf, string fontname, int size, int color,
+                   int weight, bool italic, bool underline );
+
+        // Destructor
+        virtual ~Win32Font();
+
+        // Get size of text
+        virtual void GetSize( string text, int &w, int &h );
+
+        // Draw text with boundaries
+        virtual void Print( Graphics *dest, string text, int x, int y, int w,
+                            int h, int align );
+
+        virtual void PrintColor( Graphics *dest, string text, int x, int y,
+                                 int w, int h, int align, int color );
+
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/win32/win32_graphics.cpp b/modules/gui/skins/win32/win32_graphics.cpp
new file mode 100644 (file)
index 0000000..df72992
--- /dev/null
@@ -0,0 +1,148 @@
+/*****************************************************************************
+ * win32_graphics.cpp: Win32 implementation of the Graphics and Region classes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_graphics.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "graphics.h"
+#include "window.h"
+#include "os_window.h"
+#include "win32_graphics.h"
+
+
+
+//---------------------------------------------------------------------------
+// WIN32 GRAPHICS
+//---------------------------------------------------------------------------
+Win32Graphics::Win32Graphics( int w, int h, Window *from ) : Graphics( w, h )
+{
+    HBITMAP HImage ;
+    Image          = CreateCompatibleDC( NULL );
+    if( from != NULL )
+    {
+        HDC DC = GetWindowDC( ( (Win32Window *)from )->GetHandle() );
+        HImage = CreateCompatibleBitmap( DC, w, h );
+        ReleaseDC( ( (Win32Window *)from )->GetHandle(), DC );
+    }
+    else
+    {
+        HImage = CreateCompatibleBitmap( Image, w, h );
+    }
+    SelectObject( Image, HImage );
+    DeleteObject( HImage );
+}
+//---------------------------------------------------------------------------
+Win32Graphics::~Win32Graphics()
+{
+    DeleteDC( Image );
+}
+//---------------------------------------------------------------------------
+void Win32Graphics::CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
+                              int sx, int sy, int Flag )
+{
+    BitBlt( Image, dx, dy, dw, dh, ( (Win32Graphics *)Src )->GetImageHandle(),
+        sx, sy, Flag );
+}
+//---------------------------------------------------------------------------
+/*void Win32Graphics::CopyTo( Graphics *Dest, int dx, int dy, int dw, int dh,
+                            int sx, int sy, int Flag )
+{
+    BitBlt( ( (Win32Graphics *)Dest )->GetImageHandle(), dx, dy, dw, dh, Image,
+        sx, sy, Flag );
+}*/
+//---------------------------------------------------------------------------
+void Win32Graphics::DrawRect( int x, int y, int w, int h, int color )
+{
+    LPRECT r = new RECT;
+    HBRUSH  Brush = CreateSolidBrush( color );
+    r->left   = x;
+    r->top    = y;
+    r->right  = x + w;
+    r->bottom = y + h;
+    FillRect( Image, r, Brush );
+    DeleteObject( Brush );
+    delete r;
+}
+//---------------------------------------------------------------------------
+void Win32Graphics::SetClipRegion( Region *rgn )
+{
+    SelectClipRgn( Image, ( (Win32Region *)rgn )->GetHandle() );
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// WIN32 REGION
+//---------------------------------------------------------------------------
+Win32Region::Win32Region()
+{
+    Rgn = CreateRectRgn( 0, 0, 0, 0 );
+}
+//---------------------------------------------------------------------------
+Win32Region::Win32Region( int x, int y, int w, int h )
+{
+    Rgn = CreateRectRgn( x, y, x + w, y + h );
+}
+//---------------------------------------------------------------------------
+Win32Region::~Win32Region()
+{
+    DeleteObject( Rgn );
+}
+//---------------------------------------------------------------------------
+void Win32Region::AddPoint( int x, int y )
+{
+    AddRectangle( x, y, x + 1, y + 1 );
+}
+//---------------------------------------------------------------------------
+void Win32Region::AddRectangle( int x, int y, int w, int h )
+{
+    HRGN Buffer;
+    Buffer = CreateRectRgn( x, y, x + w, y + h );
+    CombineRgn( Rgn, Buffer, Rgn, 0x2 );
+    DeleteObject( Buffer );
+}
+//---------------------------------------------------------------------------
+void Win32Region::AddElipse( int x, int y, int w, int h )
+{
+    HRGN Buffer;
+    Buffer = CreateEllipticRgn( x, y, x + w, y + h );
+    CombineRgn( Rgn, Buffer, Rgn, 0x2 );
+    DeleteObject( Buffer );
+}
+//---------------------------------------------------------------------------
+void Win32Region::Move( int x, int y )
+{
+    OffsetRgn( Rgn, x, y );
+}
+//---------------------------------------------------------------------------
+bool Win32Region::Hit( int x, int y )
+{
+    return PtInRegion( Rgn, x, y );
+}
+//---------------------------------------------------------------------------
diff --git a/modules/gui/skins/win32/win32_graphics.h b/modules/gui/skins/win32/win32_graphics.h
new file mode 100644 (file)
index 0000000..823d7be
--- /dev/null
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ * win32_graphics.h: Win32 implementation of the Graphics and Region classes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_graphics.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN32_GRAPHICS
+#define VLC_SKIN_WIN32_GRAPHICS
+
+//---------------------------------------------------------------------------
+class Region;
+class Window;
+
+//---------------------------------------------------------------------------
+class Win32Graphics : public Graphics
+{
+    private:
+        int Width;
+        int Height;
+        HDC Image;
+    public:
+        // Constructor
+        Win32Graphics( int w, int h, Window *from = NULL );
+        // Destructor
+        virtual ~Win32Graphics();
+        // Drawing methods
+        virtual void CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
+                              int sx, int sy, int Flag );
+        //virtual void CopyTo(  Graphics *Dest, int dx, int dy, int dw, int dh,
+        //                      int sx, int sy, int Flag );
+        virtual void DrawRect( int x, int y, int w, int h, int color );
+
+        // Clipping methods
+        virtual void SetClipRegion( Region *rgn );
+
+        // Specific win32 methods
+        HDC GetImageHandle()    { return Image; };
+};
+//---------------------------------------------------------------------------
+class Win32Region : public Region
+{
+    private:
+        HRGN Rgn;
+    public:
+        // Constructor
+        Win32Region();
+        Win32Region( int x, int y, int w, int h );
+        // Destructor
+        ~Win32Region();
+        // Modify region
+        virtual void AddPoint( int x, int y );
+        virtual void AddRectangle( int x, int y, int w, int h );
+        virtual void AddElipse( int x, int y, int w, int h );
+        virtual void Move( int x, int y );
+
+        virtual bool Hit( int x, int y );
+
+        // Specific win32 methods
+        HRGN GetHandle() { return Rgn; };
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/modules/gui/skins/win32/win32_run.cpp b/modules/gui/skins/win32/win32_run.cpp
new file mode 100644 (file)
index 0000000..862d665
--- /dev/null
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ * win32_run.cpp:
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_run.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "event.h"
+#include "os_event.h"
+#include "banks.h"
+#include "window.h"
+#include "os_window.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "skin_common.h"
+#include "vlcproc.h"
+
+
+
+//---------------------------------------------------------------------------
+// Specific method
+//---------------------------------------------------------------------------
+bool IsVLCEvent( unsigned int msg );
+int  SkinManage( intf_thread_t *p_intf );
+
+
+
+//---------------------------------------------------------------------------
+// REFRESH TIMER CALLBACK
+//---------------------------------------------------------------------------
+void CALLBACK RefreshTimer( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)GetWindowLongPtr( hwnd,
+        GWLP_USERDATA );
+    SkinManage( p_intf );
+}
+//---------------------------------------------------------------------------
+
+
+
+//---------------------------------------------------------------------------
+// Win32 interface
+//---------------------------------------------------------------------------
+void OSRun( intf_thread_t *p_intf )
+{
+    VlcProc *Proc = new VlcProc( p_intf );
+    MSG msg;
+    list<Window *>::const_iterator win;
+    Event *ProcessEvent;
+    int KeyModifier = 0;
+
+    // Create refresh timer
+    SetTimer( ((OSTheme *)p_intf->p_sys->p_theme)->GetParentWindow(), 42, 200,
+              (TIMERPROC)RefreshTimer );
+
+    // Compute windows message list
+    while( GetMessage( &msg, NULL, 0, 0 ) )
+    {
+        // Translate keys
+        TranslateMessage( &msg );
+
+        // Create event
+        ProcessEvent = (Event *)new OSEvent( p_intf, msg.hwnd, msg.message,
+                                             msg.wParam, msg.lParam );
+
+        /*****************************
+        * Process keyboard shortcuts *
+        *****************************/
+        if( msg.message == WM_KEYUP )
+        {
+            // If key is CTRL
+            if( msg.wParam == 17 )
+                KeyModifier = 0;
+            else if( KeyModifier == 0 )
+                p_intf->p_sys->p_theme->EvtBank->TestShortcut(
+                    msg.wParam, KeyModifier );
+        }
+        else if( msg.message == WM_KEYDOWN )
+        {
+            // If key is control
+            if( msg.wParam == 17 )
+                KeyModifier = 2;
+            else if( KeyModifier > 0 )
+                p_intf->p_sys->p_theme->EvtBank->TestShortcut(
+                    msg.wParam, KeyModifier );
+        }
+        else if( msg.message == WM_SYSKEYDOWN )
+        {
+            // If key is ALT
+            if( msg.wParam == 18 )
+                KeyModifier = 1;
+        }
+        else if( msg.message == WM_SYSKEYUP )
+        {
+            // If key is a system key
+            KeyModifier = 0;
+        }
+
+        /************************
+        * Process timer message *
+        ************************/
+        else if( msg.message == WM_TIMER )
+        {
+            DispatchMessage( &msg );
+        }
+
+        /***********************
+        * VLC specific message *
+        ***********************/
+        else if( IsVLCEvent( msg.message ) )
+        {
+            if( !Proc->EventProc( ProcessEvent ) )
+                break;      // Exit VLC !
+        }
+
+        /**********************
+        * Broadcsated message *
+        **********************/
+        else if( msg.hwnd == NULL )
+        {
+            for( win = p_intf->p_sys->p_theme->WindowList.begin();
+                win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+            {
+                (*win)->ProcessEvent( ProcessEvent );
+            }
+        }
+
+        /***********************
+        * Process window event *
+        ***********************/
+        else
+        {
+            DispatchMessage( &msg );
+        }
+
+        // Delete event
+        ProcessEvent->DestructParameters();
+        delete (OSEvent *)ProcessEvent;
+
+        // Check if vlc is closing
+        Proc->IsClosing();
+    }
+}
+//---------------------------------------------------------------------------
+bool IsVLCEvent( unsigned int msg )
+{
+    return( msg > VLC_MESSAGE && msg < VLC_WINDOW );
+}
+//---------------------------------------------------------------------------
+
+
diff --git a/modules/gui/skins/win32/win32_theme.cpp b/modules/gui/skins/win32/win32_theme.cpp
new file mode 100644 (file)
index 0000000..a5f4243
--- /dev/null
@@ -0,0 +1,343 @@
+/*****************************************************************************
+ * win32_theme.cpp: Win32 implementation of the Theme class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_theme.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "banks.h"
+#include "window.h"
+#include "os_window.h"
+#include "event.h"
+#include "os_event.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "dialog.h"
+#include "os_dialog.h"
+#include "vlcproc.h"
+#include "skin_common.h"
+
+
+//---------------------------------------------------------------------------
+void SkinManage( intf_thread_t *p_intf );
+
+
+
+//---------------------------------------------------------------------------
+// Win32 interface
+//---------------------------------------------------------------------------
+LRESULT CALLBACK Win32Proc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+{
+    // Get pointer to thread info
+    intf_thread_t *p_intf = (intf_thread_t *)GetWindowLongPtr( hwnd,
+        GWLP_USERDATA );
+
+    // If doesn't exist, treat windows message normally
+    if( p_intf == NULL )
+        return DefWindowProc( hwnd, uMsg, wParam, lParam );
+
+    // Create event to dispatch in windows
+    Event *evt = (Event *)new OSEvent( p_intf, hwnd, uMsg, wParam, lParam );
+
+
+    // Find window matching with hwnd
+    list<Window *>::const_iterator win;
+    for( win = p_intf->p_sys->p_theme->WindowList.begin();
+         win != p_intf->p_sys->p_theme->WindowList.end(); win++ )
+    {
+        // If it is the correct window
+        if( hwnd == ( (Win32Window *)(*win) )->GetHandle() )
+        {
+            // Send event and check if processed
+            if( (*win)->ProcessEvent( evt ) )
+            {
+                delete (OSEvent *)evt;
+                return 0;
+            }
+            else
+            {
+                break;
+            }
+        }
+    }
+    delete (OSEvent *)evt;
+
+
+    // If Window is parent window
+    if( hwnd == ( (Win32Theme *)p_intf->p_sys->p_theme )->GetParentWindow() )
+    {
+        if( uMsg == WM_SYSCOMMAND )
+        {
+            if( (Event *)wParam != NULL )
+                ( (Event *)wParam )->SendEvent();
+            return 0;
+        }
+        else if( uMsg == WM_RBUTTONDOWN && wParam == 42 &&
+                 lParam == WM_RBUTTONDOWN )
+        {
+            int x, y;
+            OSAPI_GetMousePos( x, y );
+            TrackPopupMenu(
+                ( (Win32Theme *)p_intf->p_sys->p_theme )->GetSysMenu(),
+                0, x, y, 0, hwnd, NULL );
+        }
+    }
+
+
+    // If closing parent window
+    if( uMsg == WM_CLOSE )
+    {
+        OSAPI_PostMessage( NULL, VLC_HIDE, VLC_QUIT, 0 );
+        return 0;
+    }
+
+    // If hwnd does not match any window or message not processed
+    return DefWindowProc( hwnd, uMsg, wParam, lParam );
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// THEME
+//---------------------------------------------------------------------------
+Win32Theme::Win32Theme( intf_thread_t *_p_intf ) : Theme( _p_intf )
+{
+    // Get instance handle
+    hinst = GetModuleHandle( NULL );
+
+    // Create window class
+    WNDCLASS SkinWindow;
+
+    SkinWindow.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
+    SkinWindow.lpfnWndProc = (WNDPROC) Win32Proc;
+    SkinWindow.lpszClassName = "SkinWindow";
+    SkinWindow.lpszMenuName = NULL;
+    SkinWindow.cbClsExtra = 0;
+    SkinWindow.cbWndExtra = 0;
+    SkinWindow.hbrBackground = HBRUSH (COLOR_WINDOW);
+    SkinWindow.hCursor = LoadCursor( NULL , IDC_ARROW );
+    SkinWindow.hIcon = LoadIcon( hinst, "VLC_ICON" );
+    SkinWindow.hInstance = hinst;
+
+    if( !RegisterClass( &SkinWindow ) )
+    {
+        WNDCLASS wndclass;
+
+        // Check why it failed. If it's because the class already exists
+        // then fine, otherwise return with an error.
+        if( !GetClassInfo( hinst, "SkinWindow", &wndclass ) )
+        {
+            msg_Err( p_intf, "Cannot register window class" );
+            return;
+        }
+    }
+
+    //Initialize value
+    ParentWindow = NULL;
+
+}
+//---------------------------------------------------------------------------
+Win32Theme::~Win32Theme()
+{
+    // Unregister the window class if needed
+    WNDCLASS wndclass;
+    if( GetClassInfo( hinst, "SkinWindow", &wndclass ) )
+    {
+        UnregisterClass( "SkinWindow", hinst );
+    }
+    if( GetClassInfo( hinst, "LogWindow", &wndclass ) )
+    {
+        UnregisterClass( "LogWindow", hinst );
+    }
+    if( GetClassInfo( hinst, "ParentWindow", &wndclass ) )
+    {
+        UnregisterClass( "ParentWindow", hinst );
+    }
+
+    // Delete tray icon if exists
+    if( ShowInTray )
+    {
+        Shell_NotifyIcon( NIM_DELETE, &TrayIcon );
+    }
+
+    // Destroy parent window
+    if( ParentWindow )
+    {
+        DestroyWindow( ParentWindow );
+    }
+}
+//---------------------------------------------------------------------------
+void Win32Theme::OnLoadTheme()
+{
+    // Create window class
+    WNDCLASS ParentClass;
+    ParentClass.style = CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS;
+    ParentClass.lpfnWndProc = (WNDPROC) Win32Proc;
+    ParentClass.lpszClassName = "ParentWindow";
+    ParentClass.lpszMenuName = NULL;
+    ParentClass.cbClsExtra = 0;
+    ParentClass.cbWndExtra = 0;
+    ParentClass.hbrBackground = HBRUSH (COLOR_WINDOW);
+    ParentClass.hCursor = LoadCursor( NULL , IDC_ARROW );
+    ParentClass.hIcon = LoadIcon( hinst, "VLC_ICON" );
+    ParentClass.hInstance = hinst;
+
+    // register class and check it
+    if( !RegisterClass( &ParentClass ) )
+    {
+        WNDCLASS wndclass;
+
+        // Check why it failed. If it's because the class already exists
+        // then fine, otherwise return with an error.
+        if( !GetClassInfo( hinst, "ParentWindow", &wndclass ) )
+        {
+            msg_Err( p_intf, "Cannot register window class" );
+            return;
+        }
+    }
+
+    // Create Window
+    ParentWindow = CreateWindowEx( WS_EX_LAYERED|WS_EX_TOOLWINDOW,
+        "ParentWindow", "VLC Media Player",
+        WS_SYSMENU,
+        0, 0, 0, 0, 0, 0, hinst, NULL );
+
+    // Store with it a pointer to the interface thread
+    SetWindowLongPtr( ParentWindow, GWLP_USERDATA, (LONG_PTR)p_intf );
+    ShowWindow( ParentWindow, SW_SHOW );
+
+    // System tray icon
+    TrayIcon.cbSize = sizeof( PNOTIFYICONDATA );\r
+    TrayIcon.hWnd = ParentWindow;\r
+    TrayIcon.uID = 42;\r
+    TrayIcon.uFlags = NIF_ICON|NIF_TIP|NIF_MESSAGE;\r
+    TrayIcon.uCallbackMessage = WM_RBUTTONDOWN;\r
+    TrayIcon.hIcon = LoadIcon( hinst, "VLC_ICON" );
+    strcpy( TrayIcon.szTip, "VLC Media Player" );
+
+    // Remove default entries from system menu popup
+    SysMenu = GetSystemMenu( ParentWindow, false );
+    RemoveMenu( SysMenu, SC_RESTORE,  MF_BYCOMMAND );
+    RemoveMenu( SysMenu, SC_MOVE,     MF_BYCOMMAND );
+    RemoveMenu( SysMenu, SC_SIZE,     MF_BYCOMMAND );
+    RemoveMenu( SysMenu, SC_MINIMIZE, MF_BYCOMMAND );
+    RemoveMenu( SysMenu, SC_MAXIMIZE, MF_BYCOMMAND );
+    RemoveMenu( SysMenu, SC_CLOSE,    MF_BYCOMMAND );
+    RemoveMenu( SysMenu, 0,           MF_BYPOSITION );
+
+    // The create menu
+    CreateSystemMenu();
+
+}
+//---------------------------------------------------------------------------
+void Win32Theme::AddSystemMenu( string name, Event *event )
+{
+    if( name == "SEPARATOR" )
+    {
+        AppendMenu( SysMenu, MF_SEPARATOR, 0, NULL );
+    }
+    else
+    {
+        AppendMenu( SysMenu, MF_STRING, (unsigned int)event,
+                    (char *)name.c_str() );
+    }
+}
+//---------------------------------------------------------------------------
+void Win32Theme::ChangeClientWindowName( string name )
+{
+    SetWindowText( ParentWindow, name.c_str() );
+}
+//---------------------------------------------------------------------------
+void Win32Theme::AddWindow( string name, int x, int y, bool visible,
+    int fadetime, int alpha, int movealpha, bool dragdrop )
+{
+    HWND hwnd;
+
+    hwnd = CreateWindowEx( WS_EX_LAYERED|WS_EX_TOOLWINDOW,
+        "SkinWindow", name.c_str(), WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT,
+        0, 0, ParentWindow, 0, hinst, NULL );
+
+    if( !hwnd )
+    {
+        msg_Err( p_intf, "CreateWindow failed" );
+        return;
+    }
+
+    SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG_PTR)p_intf );
+
+    WindowList.push_back( (Window *)new OSWindow( p_intf, hwnd, x, y, visible,
+        fadetime, alpha, movealpha, dragdrop ) ) ;
+}
+//---------------------------------------------------------------------------
+HWND Win32Theme::GetLogHandle()
+{
+    if( Log != NULL )
+        return ( (Win32LogWindow *)Log )->GetWindow();
+    else
+        return NULL;
+}
+//---------------------------------------------------------------------------
+void Win32Theme::ChangeTray()
+{
+    if( ShowInTray )
+    {
+        Shell_NotifyIcon( NIM_DELETE, &TrayIcon );
+        ShowInTray = false;
+    }
+    else
+    {
+        Shell_NotifyIcon( NIM_ADD, &TrayIcon );
+        ShowInTray = true;
+    }
+}
+//---------------------------------------------------------------------------
+void Win32Theme::ChangeTaskbar()
+{
+    if( ShowInTaskbar )
+    {
+        ShowWindow( ParentWindow, SW_HIDE );
+        SetWindowLongPtr( ParentWindow, GWL_EXSTYLE,
+                          WS_EX_LAYERED|WS_EX_TOOLWINDOW );
+        ShowWindow( ParentWindow, SW_SHOW );
+        ShowInTaskbar = false;
+    }
+    else
+    {
+        ShowWindow( ParentWindow, SW_HIDE );
+        SetWindowLongPtr( ParentWindow, GWL_EXSTYLE,
+                          WS_EX_LAYERED|WS_EX_APPWINDOW );
+        ShowWindow( ParentWindow, SW_SHOW );
+        ShowInTaskbar = true;
+    }
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/win32/win32_theme.h b/modules/gui/skins/win32/win32_theme.h
new file mode 100644 (file)
index 0000000..931ca6b
--- /dev/null
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ * win32_theme.h: Win32 implementation of the Theme class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_theme.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN32_THEME
+#define VLC_SKIN_WIN32_THEME
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//--- WIN32 -----------------------------------------------------------------
+#include <shellapi.h>
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Window;
+class EventBank;
+class BitmapBank;
+class FontBank;
+class LogWindow;
+
+//---------------------------------------------------------------------------
+class Win32Theme : public Theme
+{
+    protected:
+        // Handles
+        HINSTANCE hinst;
+        HWND ParentWindow;
+
+        // System tray icon
+        NOTIFYICONDATA TrayIcon;
+        HMENU SysMenu;
+
+    public:
+        // Constructor
+        Win32Theme( intf_thread_t *_p_intf );
+        virtual void OnLoadTheme();
+
+        // Destructor
+        virtual ~Win32Theme();
+
+        // Specific windows methods
+        HINSTANCE getInstance()       { return hinst; }
+        HWND      GetLogHandle();
+        HWND      GetParentWindow()   { return ParentWindow; }
+
+        // !!!
+        virtual void AddWindow( string name, int x, int y, bool visible,
+            int fadetime, int alpha, int movealpha, bool dragdrop );
+        virtual void ChangeClientWindowName( string name );
+
+        // Taskbar && system tray
+        virtual void AddSystemMenu( string name, Event *event );
+        virtual void ChangeTray();
+        virtual void ChangeTaskbar();
+        HMENU GetSysMenu() { return SysMenu; }
+};
+//---------------------------------------------------------------------------
+
+
+#endif
+
diff --git a/modules/gui/skins/win32/win32_window.cpp b/modules/gui/skins/win32/win32_window.cpp
new file mode 100644 (file)
index 0000000..a5894dd
--- /dev/null
@@ -0,0 +1,285 @@
+/*****************************************************************************
+ * win32_window.cpp: Win32 implementation of the Window class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_window.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+//--- GENERAL ---------------------------------------------------------------
+//#include <math.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- WIN32 -----------------------------------------------------------------
+#include <windows.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "anchor.h"
+#include "generic.h"
+#include "window.h"
+#include "os_window.h"
+#include "event.h"
+#include "os_event.h"
+#include "graphics.h"
+#include "os_graphics.h"
+#include "skin_common.h"
+#include "theme.h"
+
+
+
+//---------------------------------------------------------------------------
+// Fading API
+//---------------------------------------------------------------------------
+#define LWA_COLORKEY  0x00000001
+#define LWA_ALPHA     0x00000002
+typedef BOOL (WINAPI *SLWA)(HWND, COLORREF, BYTE, DWORD);
+HMODULE hModule = LoadLibrary( "user32.dll" );
+SLWA SetLayeredWindowAttributes =
+    (SLWA)GetProcAddress( hModule, "SetLayeredWindowAttributes" );
+
+
+//---------------------------------------------------------------------------
+// Skinable Window
+//---------------------------------------------------------------------------
+Win32Window::Win32Window( intf_thread_t *p_intf, HWND hwnd, int x, int y,
+    bool visible, int transition, int normalalpha, int movealpha,
+    bool dragdrop )
+    : Window( p_intf, x, y, visible, transition, normalalpha, movealpha,
+              dragdrop )
+{
+    // Set handles
+    hWnd           = hwnd;
+
+    // Set position parameters
+    CursorPos    = new POINT;
+    WindowPos    = new POINT;
+
+    // Create Tool Tip Window
+    ToolTipWindow = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL,
+        WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
+        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+        hWnd, 0, GetModuleHandle( NULL ), 0);
+
+    // Create Tool Tip infos
+    ToolTipInfo.cbSize = sizeof(TOOLINFO);
+    ToolTipInfo.uFlags = TTF_SUBCLASS|TTF_IDISHWND;
+    ToolTipInfo.hwnd = hWnd;
+    ToolTipInfo.hinst = GetModuleHandle( NULL );
+    ToolTipInfo.uId = (unsigned int)hWnd;
+    ToolTipInfo.lpszText = NULL;
+    ToolTipInfo.rect.left = ToolTipInfo.rect.top = 0;
+        ToolTipInfo.rect.right = ToolTipInfo.rect.bottom = 0;
+
+    SendMessage( ToolTipWindow, TTM_ADDTOOL, 0,
+                    (LPARAM)(LPTOOLINFO) &ToolTipInfo );
+
+    // Drag & drop
+    if( DragDrop )
+    {
+        // Initialize the OLE library
+        OleInitialize( NULL );
+        DropTarget = (LPDROPTARGET) new Win32DropObject();
+        // register the listview as a drop target
+        RegisterDragDrop( hWnd, DropTarget );
+    }
+
+}
+//---------------------------------------------------------------------------
+Win32Window::~Win32Window()
+{
+    delete CursorPos;
+    delete WindowPos;
+
+    if( hWnd != NULL )
+    {
+        DestroyWindow( hWnd );
+    }
+    if( ToolTipWindow != NULL )
+    {
+        DestroyWindow( ToolTipWindow );
+    }
+    if( DragDrop )
+    {
+        // Remove the listview from the list of drop targets
+        RevokeDragDrop( hWnd );
+        DropTarget->Release();
+        // Uninitialize the OLE library
+        OleUninitialize();
+    }
+
+}
+//---------------------------------------------------------------------------
+void Win32Window::OSShow( bool show )
+{
+    if( show )
+    {
+        ShowWindow( hWnd, SW_SHOW );
+    }
+    else
+    {
+        ShowWindow( hWnd, SW_HIDE );
+    }
+}
+//---------------------------------------------------------------------------
+bool Win32Window::ProcessOSEvent( Event *evt )
+{
+    HDC DC;
+    unsigned int msg = evt->GetMessage();
+    unsigned int p1  = evt->GetParam1();
+    int          p2  = evt->GetParam2();
+
+    switch( msg )
+    {
+        case WM_PAINT:
+            PAINTSTRUCT Infos;
+            DC = BeginPaint( hWnd , &Infos );
+            EndPaint( hWnd , &Infos );
+            RefreshFromImage( 0, 0, Width, Height );
+            return true;
+
+        case WM_MOUSEMOVE:
+            if( p1 == MK_LBUTTON )
+                MouseMove( LOWORD( p2 ), HIWORD( p2 ), 1 );
+            else if( p1 == MK_RBUTTON )
+                MouseMove( LOWORD( p2 ), HIWORD( p2 ), 2 );
+            else
+                MouseMove( LOWORD( p2 ), HIWORD( p2 ), 0 );
+
+            return true;
+
+        case WM_LBUTTONDOWN:
+            SetCapture( hWnd );
+            MouseDown( LOWORD( p2 ), HIWORD( p2 ), 1 );
+            return true;
+
+        case WM_LBUTTONUP:
+            ReleaseCapture();
+            MouseUp( LOWORD( p2 ), HIWORD( p2 ), 1 );
+            return true;
+
+        case WM_RBUTTONDOWN:
+            MouseDown( LOWORD( p2 ), HIWORD( p2 ), 2 );
+            return true;
+
+        case WM_RBUTTONUP:
+            MouseUp( LOWORD( p2 ), HIWORD( p2 ), 2 );
+            return true;
+
+        case WM_LBUTTONDBLCLK:
+            MouseDblClick( LOWORD( p2 ), HIWORD( p2 ), 1 );
+            return true;
+
+        default:
+            return false;
+    }
+}
+//---------------------------------------------------------------------------
+void Win32Window::SetTransparency( int Value )
+{
+    if( Value > -1 )
+        Alpha = Value;
+    SetLayeredWindowAttributes( hWnd, 0, Alpha, LWA_ALPHA | LWA_COLORKEY );
+    UpdateWindow( hWnd );
+}
+//---------------------------------------------------------------------------
+void Win32Window::RefreshFromImage( int x, int y, int w, int h )
+{
+    // Initialize painting
+    HDC DC = GetWindowDC( hWnd );
+
+    // Draw image on window
+    BitBlt( DC, x, y, w, h, ( (Win32Graphics *)Image )->GetImageHandle(),
+            x, y, SRCCOPY );
+
+    // Release window device context
+    ReleaseDC( hWnd, DC );
+
+}
+//---------------------------------------------------------------------------
+void Win32Window::WindowManualMove()
+{
+    // Get mouse cursor position
+    LPPOINT NewPos = new POINT;
+    GetCursorPos( NewPos );
+
+    // Move window and chek for magnetism
+    p_intf->p_sys->p_theme->MoveSkinMagnet( this,
+        WindowPos->x + NewPos->x - CursorPos->x,
+        WindowPos->y + NewPos->y - CursorPos->y );
+
+    // Free memory
+    delete[] NewPos;
+
+}
+//---------------------------------------------------------------------------
+void Win32Window::WindowManualMoveInit()
+{
+    GetCursorPos( CursorPos );
+    WindowPos->x = Left;
+    WindowPos->y = Top;
+}
+//---------------------------------------------------------------------------
+void Win32Window::Move( int left, int top )
+{
+    Left = left;
+    Top  = top;
+    //SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height,
+    //              SWP_NOSIZE|SWP_NOREDRAW|SWP_NOZORDER );
+    MoveWindow( hWnd, Left, Top, Width, Height, false );
+}
+//---------------------------------------------------------------------------
+void Win32Window::Size( int width, int height )
+{
+    Width  = width;
+    Height = height;
+    SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height,
+                  SWP_NOMOVE|SWP_NOREDRAW|SWP_NOZORDER );
+}
+//---------------------------------------------------------------------------
+void Win32Window::ChangeToolTipText( string text )
+{
+    if( text == "none" )
+    {
+        if( ToolTipText != "none" )
+        {
+            ToolTipText = "none";
+            ToolTipInfo.lpszText = NULL;
+            SendMessage( ToolTipWindow, TTM_ACTIVATE, 0 , 0 );
+        }
+    }
+    else
+    {
+        if( text != ToolTipText )
+        {
+            ToolTipText = text;
+            ToolTipInfo.lpszText = (char *)ToolTipText.c_str();
+            SendMessage( ToolTipWindow, TTM_ACTIVATE, 1 , 0 );
+            SendMessage( ToolTipWindow, TTM_UPDATETIPTEXT, 0,
+                             (LPARAM)(LPTOOLINFO)&ToolTipInfo );
+        }
+    }
+
+}
+//---------------------------------------------------------------------------
+
diff --git a/modules/gui/skins/win32/win32_window.h b/modules/gui/skins/win32/win32_window.h
new file mode 100644 (file)
index 0000000..e5197c5
--- /dev/null
@@ -0,0 +1,84 @@
+/*****************************************************************************
+ * win32_window.h: Win32 implementation of the Window class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: win32_window.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ *
+ * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Emmanuel Puig    <karibu@via.ecp.fr>
+ *
+ * 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,
+ * USA.
+ *****************************************************************************/
+
+
+#ifndef VLC_SKIN_WIN32_WIN
+#define VLC_SKIN_WIN32_WIN
+
+//--- WIN32 -----------------------------------------------------------------
+#include <commctrl.h>
+
+//---------------------------------------------------------------------------
+class Graphics;
+class Event;
+
+//---------------------------------------------------------------------------
+class Win32Window : public Window
+{
+    private:
+        // General parameters
+        HWND hWnd;
+        LPPOINT CursorPos;
+        LPPOINT WindowPos;
+
+        // Tooltip texts
+        HWND ToolTipWindow;
+        TOOLINFO ToolTipInfo;
+
+        // Drag & drop
+        LPDROPTARGET DropTarget;
+
+    public:
+        // Cosntructors
+        Win32Window( intf_thread_t *_p_intf, HWND hwnd, int x, int y,
+            bool visible, int transition, int normalalpha, int movealpha,
+            bool dragdrop );
+
+        // Destructors
+        virtual ~Win32Window();
+
+        // Event processing
+        virtual bool ProcessOSEvent( Event *evt );
+
+        // Window graphic aspect
+        virtual void OSShow( bool show );
+        virtual void RefreshFromImage( int x, int y, int w, int h );
+        virtual void SetTransparency( int Value = -1 );
+        virtual void WindowManualMove();
+        virtual void WindowManualMoveInit();
+
+        // Window methods
+        virtual void Move( int left, int top );
+        virtual void Size( int width, int height );
+
+        // Specific win32 methods
+        HWND GetHandle() {return hWnd; };
+
+        // Tooltip texts
+        virtual void ChangeToolTipText( string text );
+};
+//---------------------------------------------------------------------------
+
+#endif
diff --git a/toolbox b/toolbox
index 79598333b559a49fb2ba8f0814e06f45bc94d616..7a55c96dff1b7ffe5f6e79a502a190cc1f00b5e2 100755 (executable)
--- a/toolbox
+++ b/toolbox
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 ##  toolbox for the VLC media player
-##  $Id: toolbox,v 1.17 2003/03/18 01:54:40 sam Exp $
+##  $Id: toolbox,v 1.18 2003/03/18 02:21:47 ipkiss Exp $
 ##
 ##  Authors: Samuel Hocevar <sam@zoy.org>
 
@@ -26,6 +26,7 @@ recognized flags are:
   --update-includes [BUILTINS]  generate various include files
   --update-glade                generate and fix Glade code
   --update-glade2               generate and fix Glade 2 code
+  --update-flexml               generate and fix flexml and flex code
 EOF
   exit 1
 }
@@ -62,6 +63,9 @@ case "$1" in
   --update-includes)
     action=includes
     ;;
+  --update-flexml)
+    action=flexml
+    ;;
   --update-glade|--fix-glade)
     action=glade
     ;;
@@ -471,3 +475,17 @@ then
   exit 0
 fi
 
+##
+##  Fix flexml-generated files
+##
+if test "${action}" = "flexml"
+then
+  cd modules/gui/skins/parser
+  flexml -SH -a skin.act skin.dtd
+  # comment the dummy main function
+  file=skin.c
+  sed 's@int main@//int main@' < $file > $file.$$.bak
+  mv -f $file.$$.bak $file
+  flex -oflex.c -BLs skin.l
+fi
+