]> git.sesse.net Git - vlc/commitdiff
* Gtk2 skins: it doesn't work but it runs without any segfault, so
authorCyril Deguet <asmax@videolan.org>
Sun, 13 Apr 2003 17:46:23 +0000 (17:46 +0000)
committerCyril Deguet <asmax@videolan.org>
Sun, 13 Apr 2003 17:46:23 +0000 (17:46 +0000)
  I commit ;)
  (I probably broke skins under windows....)

17 files changed:
modules/gui/skins/gtk2/gtk2_api.cpp
modules/gui/skins/gtk2/gtk2_event.cpp
modules/gui/skins/gtk2/gtk2_font.cpp
modules/gui/skins/gtk2/gtk2_font.h
modules/gui/skins/gtk2/gtk2_graphics.cpp
modules/gui/skins/gtk2/gtk2_graphics.h
modules/gui/skins/gtk2/gtk2_run.cpp
modules/gui/skins/gtk2/gtk2_theme.cpp
modules/gui/skins/gtk2/gtk2_theme.h
modules/gui/skins/gtk2/gtk2_window.cpp
modules/gui/skins/gtk2/gtk2_window.h
modules/gui/skins/parser/wrappers.cpp
modules/gui/skins/src/event.cpp
modules/gui/skins/src/skin_main.cpp
modules/gui/skins/src/theme.cpp
modules/gui/skins/src/themeloader.cpp
modules/gui/skins/src/window.cpp

index e2b95846e51db0ec5be7f6e3f5461809207fd6b4..7e43e76487993cf291c69c4f73124a74ba27d861 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_api.cpp: Various gtk2-specific functions
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_api.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $
+ * $Id: gtk2_api.cpp,v 1.3 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet  <asmax@videolan.org>
  *
@@ -24,7 +24,7 @@
 
 
 //--- GTK2 ------------------------------------------------------------------
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
 
 //--- SKIN ------------------------------------------------------------------
 #include "window.h"
@@ -109,12 +109,14 @@ void OSAPI_GetMousePos( int &x, int &y )
 //---------------------------------------------------------------------------
 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;*/
+//    char *buffer = new char[MAX_PARAM_SIZE];
+//    GetWindowText( ((GTK2Window *)win)->GetHandle(), buffer, MAX_PARAM_SIZE );
+//    string Title = buffer;
+/* FIXME */
+string Title = "";
+//    delete buffer;
+
+    return Title;
 }
 //---------------------------------------------------------------------------
 bool OSAPI_RmDir( string path )
index 7168ad4eabc3e8684c2196c34021b916ba59ce12..2f928f194e284ce07fdc45d7d68eb887f178230e 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_event.cpp: GTK2 implementation of the Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_event.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $
+ * $Id: gtk2_event.cpp,v 1.3 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -24,7 +24,7 @@
 
 
 //--- GTK2 -----------------------------------------------------------------
-//#include <windows.h>
+#include <gdk/gdk.h>
 
 //--- VLC -------------------------------------------------------------------
 #include <vlc/intf.h>
 GTK2Event::GTK2Event( intf_thread_t *p_intf, string Desc, string shortcut )
     : Event( p_intf, Desc, shortcut )
 {
-/*    hWnd = NULL;*/
+    gWnd = NULL;
 }
 //---------------------------------------------------------------------------
 GTK2Event::GTK2Event( intf_thread_t *p_intf, GdkWindow *gwnd, unsigned int msg,
     unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
 {
-/*    hWnd = hwnd;*/
+    gWnd = gwnd;
 }
 //---------------------------------------------------------------------------
 GTK2Event::GTK2Event( intf_thread_t *p_intf, Window *win, unsigned int msg,
     unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
 {
-/*    hWnd = ( (GTK2Window *)win )->GetHandle();*/
+    gWnd = ( (GTK2Window *)win )->GetHandle();
 }
 //---------------------------------------------------------------------------
 GTK2Event::~GTK2Event()
@@ -72,9 +72,9 @@ bool GTK2Event::SendEvent()
         PostSynchroMessage();
         return true;
     }
-
-    return true;
 */
+    return true;
+
 }
 //---------------------------------------------------------------------------
 bool GTK2Event::IsEqual( Event *evt )
@@ -86,34 +86,35 @@ bool GTK2Event::IsEqual( Event *evt )
 //---------------------------------------------------------------------------
 void GTK2Event::CreateOSEvent( string para1, string para2, string para3 )
 {
-/*
     // Find Parameters
     switch( Message )
     {
         case WINDOW_MOVE:
-            hWnd = GetWindowFromName( para1 );
+            gWnd = GetWindowFromName( para1 );
             break;
 
         case WINDOW_CLOSE:
-            hWnd = GetWindowFromName( para1 );
+            gWnd = GetWindowFromName( para1 );
             break;
 
         case WINDOW_OPEN:
-            hWnd = GetWindowFromName( para1 );
+            gWnd = GetWindowFromName( para1 );
             break;
 
     }
-*/
 }
 //---------------------------------------------------------------------------
 GdkWindow *GTK2Event::GetWindowFromName( string name )
 {
-/*    GTK2Window *win = (GTK2Window *)
+    GTK2Window *win = (GTK2Window *)
         p_intf->p_sys->p_theme->GetWindow( name );
-    if( win == NULL )
+    if( win == NULL ) 
+    {
         return NULL;
-    else
-        return win->GetHandle();*/
+    }
+    else {
+        return win->GetHandle();
+    }
 }
 //---------------------------------------------------------------------------
 
index 3aa2763cad37e0a0ea76c4a14d9362e1d87b286f..fed3954db38814f8735a642cac6a3d3ae0ea10fe 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_font.cpp: GTK2 implementation of the Font class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_font.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $
+ * $Id: gtk2_font.cpp,v 1.3 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -24,7 +24,7 @@
 
 
 //--- GTK2 -----------------------------------------------------------------
-//#include <windows.h>
+#include <gdk/gdk.h>
 
 //--- VLC -------------------------------------------------------------------
 #include <vlc/intf.h>
@@ -44,13 +44,19 @@ GTK2Font::GTK2Font( 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 )
 {
+/* FIXME */
+/*    GFont = gdk_font_load( "-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1" );
+    if( GFont == NULL )
+    {
+        msg_Err( _p_intf, "Could not load font %s", fontname.c_str());
+    }*/
 }
 //---------------------------------------------------------------------------
 GTK2Font::~GTK2Font()
 {
 }
 //---------------------------------------------------------------------------
-/*void GTK2Font::AssignGTK2Font( HDC DC )
+/*void GTK2Font::AssignGTK2Font( GdkDrawable *DC )
 {
     // Create font
     HGDIOBJ fontObj = CreateFont(
@@ -75,11 +81,13 @@ GTK2Font::~GTK2Font()
 
     // Free memory
     DeleteObject( fontObj );
+//    GdkGC *gc = gdk_gc_new( DC );
+//    gdk_gc_set_font( GFont, gc );
 }*/
 //---------------------------------------------------------------------------
 void GTK2Font::AssignFont( Graphics *dest )
-{/*
-    HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle();
+{
+/*    GdkDrawable *DC = ( (GTK2Graphics *)dest )->GetImageHandle();
     AssignGTK2Font( DC );*/
 }
 //---------------------------------------------------------------------------
@@ -99,6 +107,11 @@ void GTK2Font::GetSize( string text, int &w, int &h )
 
     // Release screen device context
     ReleaseDC( GetDesktopWindow(), DeskDC );*/
+    /*FIXME*/
+/*    w = gdk_text_width( GFont, text.c_str(), text.length() );
+    h = gdk_text_height( GFont, text.c_str(), text.length() );*/
+    w = 0;
+    h = 0;
 }
 //---------------------------------------------------------------------------
 void GTK2Font::GenericPrint( Graphics *dest, string text, int x, int y,
@@ -135,13 +148,13 @@ void GTK2Font::GenericPrint( Graphics *dest, string text, int x, int y,
 void GTK2Font::Print( Graphics *dest, string text, int x, int y, int w,
                        int h, int align )
 {
-/*    GenericPrint( dest, text, x, y, w, h, align, Color );*/
+    GenericPrint( dest, text, x, y, w, h, align, Color );
 }
 //---------------------------------------------------------------------------
 void GTK2Font::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 );*/
+    GenericPrint( dest, text, x, y, w, h, align, color );
 }
 //---------------------------------------------------------------------------
 
index cd7b8b7db38112827db27c67f03825657261d639..2df64d473325baa03049b4f46b832fda522f40d3 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_font.h: GTK2 implementation of the Font class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_font.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ * $Id: gtk2_font.h,v 1.2 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -30,6 +30,9 @@
 #include <string>
 using namespace std;
 
+//--- GTK2 -----------------------------------------------------------------
+#include <gdk/gdk.h>
+
 //---------------------------------------------------------------------------
 struct intf_thread_t;
 class Graphics;
@@ -38,6 +41,7 @@ class Graphics;
 class GTK2Font : Font
 {
     private:
+        GdkFont *GFont;
         // Assign font to Device Context
         virtual void AssignFont( Graphics *dest );
 //        void AssignGTK2Font( HDC DC );
index e30d7f2d38746e0085e5a11b8e955acf7e8d2c76..52dbd1eb99a87fbf3a8f71ecbdf7d46300e25bee 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_graphics.cpp: GTK2 implementation of the Graphics and Region classes
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_graphics.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $
+ * $Id: gtk2_graphics.cpp,v 1.3 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -24,7 +24,7 @@
 
 
 //--- GTK2 -----------------------------------------------------------------
-//#include <windows.h>
+#include <gdk/gdk.h>
 
 //--- SKIN ------------------------------------------------------------------
 #include "graphics.h"
@@ -52,6 +52,9 @@ GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h )
     }
     SelectObject( Image, HImage );
     DeleteObject( HImage );*/
+    
+/*    Image = ( GdkDrawable* )( (GTK2Window *)from )->GetHandle();
+    Gc = gdk_gc_new( Image );*/
 }
 //---------------------------------------------------------------------------
 GTK2Graphics::~GTK2Graphics()
@@ -76,15 +79,7 @@ void GTK2Graphics::CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
 //---------------------------------------------------------------------------
 void GTK2Graphics::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;*/
+//    gdk_draw_rectangle( Image, Gc, TRUE, x, y, w, h);
 }
 //---------------------------------------------------------------------------
 void GTK2Graphics::SetClipRegion( Region *rgn )
index 6029a37e974a58c929d60287278df5306959613d..6a4e108ad53b0a1b75cc91b3d05d8bc3f7651502 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_graphics.h: GTK2 implementation of the Graphics and Region classes
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_graphics.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ * $Id: gtk2_graphics.h,v 1.2 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -27,6 +27,9 @@
 #ifndef VLC_SKIN_GTK2_GRAPHICS
 #define VLC_SKIN_GTK2_GRAPHICS
 
+//--- GTK2 ------------------------------------------------------------------
+#include <gdk/gdk.h>
+
 //---------------------------------------------------------------------------
 class Region;
 class Window;
@@ -37,7 +40,8 @@ class GTK2Graphics : public Graphics
     private:
         int Width;
         int Height;
-  //      HDC Image;
+        GdkDrawable *Image;
+        GdkGC *Gc;
     public:
         // Constructor
         GTK2Graphics( int w, int h, Window *from = NULL );
@@ -54,13 +58,13 @@ class GTK2Graphics : public Graphics
         virtual void SetClipRegion( Region *rgn );
 
         // Specific GTK2 methods
-//        HDC GetImageHandle()    { return Image; };
+        GdkDrawable *GetImageHandle()    { return Image; };
 };
 //---------------------------------------------------------------------------
 class GTK2Region : public Region
 {
     private:
-//        HRGN Rgn;
+        GdkRegion *Rgn;
     public:
         // Constructor
         GTK2Region();
@@ -76,7 +80,7 @@ class GTK2Region : public Region
         virtual bool Hit( int x, int y );
 
         // Specific GTK2 methods
-//        HRGN GetHandle() { return Rgn; };
+        GdkRegion *GetHandle() { return Rgn; };
 };
 //---------------------------------------------------------------------------
 
index 6fe228e39906665a650279a57cad6e4db764b93b..94eaf6746e6974e130937ea62680d464f7336f47 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_run.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $
+ * $Id: gtk2_run.cpp,v 1.3 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -24,7 +24,8 @@
 
 
 //--- GTK2 ------------------------------------------------------------------
-//#include <windows.h>
+#include <glib.h>
+#include <gdk/gdk.h>
 
 //--- VLC -------------------------------------------------------------------
 #include <vlc/intf.h>
@@ -171,6 +172,11 @@ void OSRun( intf_thread_t *p_intf )
         Proc->IsClosing();
     }
     #endif
+    
+    // Main event loop
+    GMainLoop *loop = g_main_loop_new( NULL, TRUE );
+    g_main_loop_run( loop );
+
 }
 //---------------------------------------------------------------------------
 bool IsVLCEvent( unsigned int msg )
index 448a6f1d9b3133c139a70d567ae514b6bb165c85..97338ccf8e15ab427d29df34f6d0b6c3bb40a2f3 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_theme.cpp: GTK2 implementation of the Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_theme.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ * $Id: gtk2_theme.cpp,v 1.2 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -24,7 +24,7 @@
 
 
 //--- GTK2 -----------------------------------------------------------------
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
 
 //--- VLC -------------------------------------------------------------------
 #include <vlc/intf.h>
@@ -160,10 +160,10 @@ GTK2Theme::GTK2Theme( intf_thread_t *_p_intf ) : Theme( _p_intf )
             return;
         }
     }
-
+*/
     //Initialize value
     ParentWindow = NULL;
-*/
+
 }
 
 //---------------------------------------------------------------------------
@@ -258,6 +258,19 @@ void GTK2Theme::OnLoadTheme()
     // The create menu
     CreateSystemMenu();
 */
+    // Set the parent window attributes
+    GdkWindowAttr attr;
+    attr.title = "VLC Media Player";
+    attr.event_mask = GDK_ALL_EVENTS_MASK;
+    attr.width = 100;
+    attr.height = 100;
+    attr.window_type = GDK_WINDOW_TOPLEVEL;
+    attr.wclass = GDK_INPUT_OUTPUT;
+    
+    gint mask = GDK_WA_TITLE;
+    
+    // Create the parent window
+    ParentWindow = gdk_window_new( NULL, &attr, mask);
 }
 //---------------------------------------------------------------------------
 void GTK2Theme::AddSystemMenu( string name, Event *event )
@@ -297,6 +310,31 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible,
 
     WindowList.push_back( (Window *)new OSWindow( p_intf, hwnd, x, y, visible,
         fadetime, alpha, movealpha, dragdrop ) ) ;*/
+        
+    GdkWindowAttr attr;
+    attr.event_mask = GDK_ALL_EVENTS_MASK;
+    attr.width = 100;
+    attr.height = 100;
+    //attr.window_type = GDK_WINDOW_CHILD;
+    attr.window_type = GDK_WINDOW_TOPLEVEL;
+    attr.wclass = GDK_INPUT_OUTPUT;
+    
+    gint mask =0;
+    
+    // Create the parent window
+ //   GdkWindow *gwnd = gdk_window_new( ParentWindow, &attr, mask);
+    GdkWindow *gwnd = gdk_window_new( NULL, &attr, mask);
+    if( !gwnd )
+    {
+        msg_Err( p_intf, "CreateWindow failed" );
+        return;
+    }
+    
+    WindowList.push_back( (Window *)new OSWindow( p_intf, gwnd, x, y, visible,
+        fadetime, alpha, movealpha, dragdrop ) ) ;
+  
+    gdk_window_show( ParentWindow );
+
 }
 //---------------------------------------------------------------------------
 /*HWND GTK2Theme::GetLogHandle()
index b4d8f06c105eb7e75f7603a4510e1916a5c64ca3..c05dcd999af1300b7688e2d35fec7b24153c3a33 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_theme.h: GTK2 implementation of the Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_theme.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ * $Id: gtk2_theme.h,v 1.2 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -31,7 +31,7 @@
 using namespace std;
 
 //--- GTK2 -----------------------------------------------------------------
-//#include <shellapi.h>
+#include <gdk/gdk.h>
 
 //---------------------------------------------------------------------------
 struct intf_thread_t;
@@ -46,9 +46,9 @@ class GTK2Theme : public Theme
 {
     protected:
         // Handles
-/*        HINSTANCE hinst;
-        HWND ParentWindow;
-
+//        HINSTANCE hinst;
+        GdkWindow *ParentWindow;
+/*
         // System tray icon
         NOTIFYICONDATA TrayIcon;
         HMENU SysMenu;
@@ -63,9 +63,9 @@ class GTK2Theme : public Theme
 /*
         // Specific windows methods
         HINSTANCE getInstance()       { return hinst; }
-        HWND      GetLogHandle();
-        HWND      GetParentWindow()   { return ParentWindow; }
-*/
+        HWND      GetLogHandle();*/
+        GdkWindow *GetParentWindow()   { return ParentWindow; }
+
         // !!!
         virtual void AddWindow( string name, int x, int y, bool visible,
             int fadetime, int alpha, int movealpha, bool dragdrop );
index 2c782bcd6dbe1d3bb61cbfe59fa1fba64f17a39a..385ce6e15d4d6757c0f9a1c7e9277da13b0516ea 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_window.cpp: GTK2 implementation of the Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_window.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $
+ * $Id: gtk2_window.cpp,v 1.3 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -30,7 +30,7 @@
 #include <vlc/intf.h>
 
 //--- GTK2 ------------------------------------------------------------------
-//#include <windows.h>
+#include <gdk/gdk.h>
 
 //--- SKIN ------------------------------------------------------------------
 #include "os_api.h"
@@ -68,8 +68,8 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y,
               dragdrop )
 {
     // Set handles
-/*    hWnd           = hwnd;
-
+    gWnd           = gwnd;
+/*
     // Set position parameters
     CursorPos    = new POINT;
     WindowPos    = new POINT;
@@ -103,6 +103,16 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y,
         RegisterDragDrop( hWnd, DropTarget );
     }
 */
+    // Create Tool Tip window
+/*    GdkWindowAttr attr;
+    attr.event_mask = GDK_ALL_EVENTS_MASK;
+    attr.width = 100;
+    attr.height = 100;
+    attr.window_type = GDK_WINDOW_CHILD;
+    attr.wclass = GDK_INPUT_OUTPUT;
+    gint mask = 0;
+    ToolTipWindow = gdk_window_new( gwnd, &attr, mask);*/
+
 }
 //---------------------------------------------------------------------------
 GTK2Window::~GTK2Window()
@@ -133,11 +143,11 @@ void GTK2Window::OSShow( bool show )
 {
 /*    if( show )
     {
-        ShowWindow( hWnd, SW_SHOW );
+        gdk_window_show( gWnd );
     }
     else
     {
-        ShowWindow( hWnd, SW_HIDE );
+        gdk_window_hide( gWnd );
     }*/
 }
 //---------------------------------------------------------------------------
index 4b728c6bb56ba043742711d3e41cd34b96672251..7e93710855261d9694ec8142b10cbae41b028323 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_window.h: GTK2 implementation of the Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_window.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ * $Id: gtk2_window.h,v 1.2 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -39,15 +39,15 @@ class GTK2Window : public Window
     private:
         // General parameters
         GdkWindow *gWnd;
-/*        LPPOINT CursorPos;
-        LPPOINT WindowPos;
+//        LPPOINT CursorPos;
+//        LPPOINT WindowPos;
 
         // Tooltip texts
-        HWND ToolTipWindow;
-        TOOLINFO ToolTipInfo;
+        GdkWindow *ToolTipWindow;
+//        TOOLINFO ToolTipInfo;
 
         // Drag & drop
-        LPDROPTARGET DropTarget;*/
+//        LPDROPTARGET DropTarget;
 
     public:
         // Cosntructors
index a81ddb3bf2fd2ba472ed23dbecb1a6f50ab77e20..41ced9d980c39e80174bccb7f2aea2952ea079e7 100644 (file)
@@ -2,7 +2,7 @@
  * wrappers.cpp: Wrappers around C++ objects
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: wrappers.cpp,v 1.5 2003/04/12 21:43:27 asmax Exp $
+ * $Id: wrappers.cpp,v 1.6 2003/04/13 17:46:22 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -120,6 +120,7 @@ void AddAnchor( char *x, char *y, char *len, char *priority )
     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 ) );
index 66471d3a036252c39d66e889a08502b18377a774..ef4820d1e817d520e17b017fa1644a58dad9456d 100644 (file)
@@ -2,7 +2,7 @@
  * event.cpp: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.cpp,v 1.5 2003/04/11 22:08:06 videolan Exp $
+ * $Id: event.cpp,v 1.6 2003/04/13 17:46:23 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -229,7 +229,7 @@ unsigned int Event::GetMessageType( string Desc )
 //---------------------------------------------------------------------------
 void Event::CreateEvent()
 {
-    // Initiatization
+    // Initialization
     int x, y;
     char *msg   = new char[MAX_EVENT_SIZE];
     char *para1 = new char[MAX_PARAM_SIZE];
index ef07ca797b0046b5622ded45a87e1fc990c8a5f0..5dd90b9ad2ccf9bd42be7cca42a6abb74b313c7c 100644 (file)
@@ -2,7 +2,7 @@
  * skin-main.cpp: skins plugin for VLC
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.6 2003/04/12 21:43:27 asmax Exp $
+ * $Id: skin_main.cpp,v 1.7 2003/04/13 17:46:23 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -145,6 +145,17 @@ static void Close ( vlc_object_t *p_this )
 //---------------------------------------------------------------------------
 static void Run( intf_thread_t *p_intf )
 {
+
+#if !defined WIN32
+/* FIXME: should be elsewhere ? */
+    // Initialize GDK
+    int    i_args   = 1;
+    char  *p_args[] = { "", NULL };
+    char **pp_args  = p_args;
+
+    gdk_init( &i_args, &pp_args );
+#endif
+
     int a = OSAPI_GetTime();
 
     // Load a theme
@@ -163,8 +174,8 @@ static void Run( intf_thread_t *p_intf )
                              DIRECTORY_SEPARATOR + "default" +
                              DIRECTORY_SEPARATOR + "theme.xml";
 #else
-/* FIXME: find VLC directory */
-        string default_dir = (string)"." +
+// FIXME: find VLC directory 
+        string default_dir = (string)"/home/cyril/videolan/vlc/share" +
                              DIRECTORY_SEPARATOR + "skins" +
                              DIRECTORY_SEPARATOR + "default" +
                              DIRECTORY_SEPARATOR + "theme.xml";
index 59a101572823a8b138c20a21ac0fdc245419551a..79effba05792968f4c6ad641372b9e8a1ffcf870 100644 (file)
@@ -2,7 +2,7 @@
  * theme.cpp: Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: theme.cpp,v 1.5 2003/03/21 00:17:00 karibu Exp $
+ * $Id: theme.cpp,v 1.6 2003/04/13 17:46:23 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -195,13 +195,15 @@ void Theme::StartTheme( bool log, int magnet )
 void Theme::InitTheme()
 {
     // Initialize the events
-    EvtBank->Init();
+/* FIXME */
+fprintf(stderr, "FIXME in theme.cpp !\n");
+//    EvtBank->Init();
 
     // Initialize the controls
     InitControls();
 
     // Initialize the windows
-    InitWindows();
+//    InitWindows();
 }
 //---------------------------------------------------------------------------
 void Theme::InitWindows()
index 96659dbc301c9825e152cd9382bcfef3d0f3c855..0c460c7a30dc2d3f2eecea25f556a887fae81f42 100644 (file)
@@ -2,7 +2,7 @@
  * themeloader.cpp: ThemeLoader class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: themeloader.cpp,v 1.4 2003/04/12 21:43:27 asmax Exp $
+ * $Id: themeloader.cpp,v 1.5 2003/04/13 17:46:23 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -47,6 +47,9 @@
 #include "themeloader.h"
 #include "skin_common.h"
 
+#include "anchor.h"
+#include "window.h"
+
 #define DEFAULT_XML_FILE "theme.xml"
 
 //---------------------------------------------------------------------------
@@ -204,6 +207,7 @@ bool ThemeLoader::Parse( const string XmlFile )
 
     // Start the parser
     int lex = yylex();
+    
     fclose( yyin );
     if( lex )
     {
index dab72af35eead5a7176b61c6ad1d64ecaffb4bd6..daedf4d4bf993abcdcc2b38a49a2d5c85702114a 100644 (file)
@@ -2,7 +2,7 @@
  * window.cpp: Window class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: window.cpp,v 1.5 2003/04/12 21:43:27 asmax Exp $
+ * $Id: window.cpp,v 1.6 2003/04/13 17:46:23 asmax Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -282,7 +282,7 @@ void Window::RefreshImage( int x, int y, int w, int h )
 #ifdef WIN32
     Image->CopyFrom( x, y, w, h, Buffer, 0, 0, SRC_COPY );
 #else
-  fprintf(stderr, "WARNING: FIXME in window.cpp !!!!");
+  fprintf(stderr, "%X WARNING: FIXME in window.cpp !!!!", Buffer);
 #endif
 
     // Free memory