Commit db008d07 authored by Cyril Deguet's avatar Cyril Deguet

* Gtk2 skins: it doesn't work but it runs without any segfault, so

  I commit ;)
  (I probably broke skins under windows....)
parent eb3609cd
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_api.cpp: Various gtk2-specific functions * gtk2_api.cpp: Various gtk2-specific functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//--- GTK2 ------------------------------------------------------------------ //--- GTK2 ------------------------------------------------------------------
#include <gtk/gtk.h> #include <gdk/gdk.h>
//--- SKIN ------------------------------------------------------------------ //--- SKIN ------------------------------------------------------------------
#include "window.h" #include "window.h"
...@@ -109,12 +109,14 @@ void OSAPI_GetMousePos( int &x, int &y ) ...@@ -109,12 +109,14 @@ void OSAPI_GetMousePos( int &x, int &y )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
string OSAPI_GetWindowTitle( Window *win ) string OSAPI_GetWindowTitle( Window *win )
{ {
/* char *buffer = new char[MAX_PARAM_SIZE]; // char *buffer = new char[MAX_PARAM_SIZE];
GetWindowText( ((Win32Window *)win)->GetHandle(), buffer, MAX_PARAM_SIZE ); // GetWindowText( ((GTK2Window *)win)->GetHandle(), buffer, MAX_PARAM_SIZE );
string Title = buffer; // string Title = buffer;
delete buffer; /* FIXME */
string Title = "";
return Title;*/ // delete buffer;
return Title;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool OSAPI_RmDir( string path ) bool OSAPI_RmDir( string path )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_event.cpp: GTK2 implementation of the Event class * gtk2_event.cpp: GTK2 implementation of the Event class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//--- GTK2 ----------------------------------------------------------------- //--- GTK2 -----------------------------------------------------------------
//#include <windows.h> #include <gdk/gdk.h>
//--- VLC ------------------------------------------------------------------- //--- VLC -------------------------------------------------------------------
#include <vlc/intf.h> #include <vlc/intf.h>
...@@ -45,19 +45,19 @@ ...@@ -45,19 +45,19 @@
GTK2Event::GTK2Event( intf_thread_t *p_intf, string Desc, string shortcut ) GTK2Event::GTK2Event( intf_thread_t *p_intf, string Desc, string shortcut )
: Event( p_intf, Desc, shortcut ) : Event( p_intf, Desc, shortcut )
{ {
/* hWnd = NULL;*/ gWnd = NULL;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Event::GTK2Event( intf_thread_t *p_intf, GdkWindow *gwnd, unsigned int msg, GTK2Event::GTK2Event( intf_thread_t *p_intf, GdkWindow *gwnd, unsigned int msg,
unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 ) 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, GTK2Event::GTK2Event( intf_thread_t *p_intf, Window *win, unsigned int msg,
unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 ) unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
{ {
/* hWnd = ( (GTK2Window *)win )->GetHandle();*/ gWnd = ( (GTK2Window *)win )->GetHandle();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Event::~GTK2Event() GTK2Event::~GTK2Event()
...@@ -72,9 +72,9 @@ bool GTK2Event::SendEvent() ...@@ -72,9 +72,9 @@ bool GTK2Event::SendEvent()
PostSynchroMessage(); PostSynchroMessage();
return true; return true;
} }
return true;
*/ */
return true;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool GTK2Event::IsEqual( Event *evt ) bool GTK2Event::IsEqual( Event *evt )
...@@ -86,34 +86,35 @@ bool GTK2Event::IsEqual( Event *evt ) ...@@ -86,34 +86,35 @@ bool GTK2Event::IsEqual( Event *evt )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Event::CreateOSEvent( string para1, string para2, string para3 ) void GTK2Event::CreateOSEvent( string para1, string para2, string para3 )
{ {
/*
// Find Parameters // Find Parameters
switch( Message ) switch( Message )
{ {
case WINDOW_MOVE: case WINDOW_MOVE:
hWnd = GetWindowFromName( para1 ); gWnd = GetWindowFromName( para1 );
break; break;
case WINDOW_CLOSE: case WINDOW_CLOSE:
hWnd = GetWindowFromName( para1 ); gWnd = GetWindowFromName( para1 );
break; break;
case WINDOW_OPEN: case WINDOW_OPEN:
hWnd = GetWindowFromName( para1 ); gWnd = GetWindowFromName( para1 );
break; break;
} }
*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GdkWindow *GTK2Event::GetWindowFromName( string name ) GdkWindow *GTK2Event::GetWindowFromName( string name )
{ {
/* GTK2Window *win = (GTK2Window *) GTK2Window *win = (GTK2Window *)
p_intf->p_sys->p_theme->GetWindow( name ); p_intf->p_sys->p_theme->GetWindow( name );
if( win == NULL ) if( win == NULL )
{
return NULL; return NULL;
else }
return win->GetHandle();*/ else {
return win->GetHandle();
}
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_font.cpp: GTK2 implementation of the Font class * gtk2_font.cpp: GTK2 implementation of the Font class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//--- GTK2 ----------------------------------------------------------------- //--- GTK2 -----------------------------------------------------------------
//#include <windows.h> #include <gdk/gdk.h>
//--- VLC ------------------------------------------------------------------- //--- VLC -------------------------------------------------------------------
#include <vlc/intf.h> #include <vlc/intf.h>
...@@ -44,13 +44,19 @@ GTK2Font::GTK2Font( intf_thread_t *_p_intf, string fontname, int size, ...@@ -44,13 +44,19 @@ GTK2Font::GTK2Font( intf_thread_t *_p_intf, string fontname, int size,
int color, int weight, bool italic, bool underline ) int color, int weight, bool italic, bool underline )
: Font( _p_intf, fontname, size, color, weight, italic, 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() GTK2Font::~GTK2Font()
{ {
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/*void GTK2Font::AssignGTK2Font( HDC DC ) /*void GTK2Font::AssignGTK2Font( GdkDrawable *DC )
{ {
// Create font // Create font
HGDIOBJ fontObj = CreateFont( HGDIOBJ fontObj = CreateFont(
...@@ -75,11 +81,13 @@ GTK2Font::~GTK2Font() ...@@ -75,11 +81,13 @@ GTK2Font::~GTK2Font()
// Free memory // Free memory
DeleteObject( fontObj ); DeleteObject( fontObj );
// GdkGC *gc = gdk_gc_new( DC );
// gdk_gc_set_font( GFont, gc );
}*/ }*/
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Font::AssignFont( Graphics *dest ) void GTK2Font::AssignFont( Graphics *dest )
{/* {
HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle(); /* GdkDrawable *DC = ( (GTK2Graphics *)dest )->GetImageHandle();
AssignGTK2Font( DC );*/ AssignGTK2Font( DC );*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -99,6 +107,11 @@ void GTK2Font::GetSize( string text, int &w, int &h ) ...@@ -99,6 +107,11 @@ void GTK2Font::GetSize( string text, int &w, int &h )
// Release screen device context // Release screen device context
ReleaseDC( GetDesktopWindow(), DeskDC );*/ 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, 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, ...@@ -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, void GTK2Font::Print( Graphics *dest, string text, int x, int y, int w,
int h, int align ) 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, void GTK2Font::PrintColor( Graphics *dest, string text, int x, int y, int w,
int h, int align, int color ) int h, int align, int color )
{ {
/* GenericPrint( dest, text, x, y, w, h, align, color );*/ GenericPrint( dest, text, x, y, w, h, align, color );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_font.h: GTK2 implementation of the Font class * gtk2_font.h: GTK2 implementation of the Font class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#include <string> #include <string>
using namespace std; using namespace std;
//--- GTK2 -----------------------------------------------------------------
#include <gdk/gdk.h>
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
struct intf_thread_t; struct intf_thread_t;
class Graphics; class Graphics;
...@@ -38,6 +41,7 @@ class Graphics; ...@@ -38,6 +41,7 @@ class Graphics;
class GTK2Font : Font class GTK2Font : Font
{ {
private: private:
GdkFont *GFont;
// Assign font to Device Context // Assign font to Device Context
virtual void AssignFont( Graphics *dest ); virtual void AssignFont( Graphics *dest );
// void AssignGTK2Font( HDC DC ); // void AssignGTK2Font( HDC DC );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_graphics.cpp: GTK2 implementation of the Graphics and Region classes * gtk2_graphics.cpp: GTK2 implementation of the Graphics and Region classes
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//--- GTK2 ----------------------------------------------------------------- //--- GTK2 -----------------------------------------------------------------
//#include <windows.h> #include <gdk/gdk.h>
//--- SKIN ------------------------------------------------------------------ //--- SKIN ------------------------------------------------------------------
#include "graphics.h" #include "graphics.h"
...@@ -52,6 +52,9 @@ GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h ) ...@@ -52,6 +52,9 @@ GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h )
} }
SelectObject( Image, HImage ); SelectObject( Image, HImage );
DeleteObject( HImage );*/ DeleteObject( HImage );*/
/* Image = ( GdkDrawable* )( (GTK2Window *)from )->GetHandle();
Gc = gdk_gc_new( Image );*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Graphics::~GTK2Graphics() GTK2Graphics::~GTK2Graphics()
...@@ -76,15 +79,7 @@ void GTK2Graphics::CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src, ...@@ -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 ) void GTK2Graphics::DrawRect( int x, int y, int w, int h, int color )
{ {
/* LPRECT r = new RECT; // gdk_draw_rectangle( Image, Gc, TRUE, x, y, w, h);
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 GTK2Graphics::SetClipRegion( Region *rgn ) void GTK2Graphics::SetClipRegion( Region *rgn )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_graphics.h: GTK2 implementation of the Graphics and Region classes * gtk2_graphics.h: GTK2 implementation of the Graphics and Region classes
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#ifndef VLC_SKIN_GTK2_GRAPHICS #ifndef VLC_SKIN_GTK2_GRAPHICS
#define VLC_SKIN_GTK2_GRAPHICS #define VLC_SKIN_GTK2_GRAPHICS
//--- GTK2 ------------------------------------------------------------------
#include <gdk/gdk.h>
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class Region; class Region;
class Window; class Window;
...@@ -37,7 +40,8 @@ class GTK2Graphics : public Graphics ...@@ -37,7 +40,8 @@ class GTK2Graphics : public Graphics
private: private:
int Width; int Width;
int Height; int Height;
// HDC Image; GdkDrawable *Image;
GdkGC *Gc;
public: public:
// Constructor // Constructor
GTK2Graphics( int w, int h, Window *from = NULL ); GTK2Graphics( int w, int h, Window *from = NULL );
...@@ -54,13 +58,13 @@ class GTK2Graphics : public Graphics ...@@ -54,13 +58,13 @@ class GTK2Graphics : public Graphics
virtual void SetClipRegion( Region *rgn ); virtual void SetClipRegion( Region *rgn );
// Specific GTK2 methods // Specific GTK2 methods
// HDC GetImageHandle() { return Image; }; GdkDrawable *GetImageHandle() { return Image; };
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class GTK2Region : public Region class GTK2Region : public Region
{ {
private: private:
// HRGN Rgn; GdkRegion *Rgn;
public: public:
// Constructor // Constructor
GTK2Region(); GTK2Region();
...@@ -76,7 +80,7 @@ class GTK2Region : public Region ...@@ -76,7 +80,7 @@ class GTK2Region : public Region
virtual bool Hit( int x, int y ); virtual bool Hit( int x, int y );
// Specific GTK2 methods // Specific GTK2 methods
// HRGN GetHandle() { return Rgn; }; GdkRegion *GetHandle() { return Rgn; };
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_run.cpp: * gtk2_run.cpp:
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
//--- GTK2 ------------------------------------------------------------------ //--- GTK2 ------------------------------------------------------------------
//#include <windows.h> #include <glib.h>
#include <gdk/gdk.h>
//--- VLC ------------------------------------------------------------------- //--- VLC -------------------------------------------------------------------
#include <vlc/intf.h> #include <vlc/intf.h>
...@@ -171,6 +172,11 @@ void OSRun( intf_thread_t *p_intf ) ...@@ -171,6 +172,11 @@ void OSRun( intf_thread_t *p_intf )
Proc->IsClosing(); Proc->IsClosing();
} }
#endif #endif
// Main event loop
GMainLoop *loop = g_main_loop_new( NULL, TRUE );
g_main_loop_run( loop );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool IsVLCEvent( unsigned int msg ) bool IsVLCEvent( unsigned int msg )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_theme.cpp: GTK2 implementation of the Theme class * gtk2_theme.cpp: GTK2 implementation of the Theme class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
//--- GTK2 ----------------------------------------------------------------- //--- GTK2 -----------------------------------------------------------------
#include <gtk/gtk.h> #include <gdk/gdk.h>
//--- VLC ------------------------------------------------------------------- //--- VLC -------------------------------------------------------------------
#include <vlc/intf.h> #include <vlc/intf.h>
...@@ -160,10 +160,10 @@ GTK2Theme::GTK2Theme( intf_thread_t *_p_intf ) : Theme( _p_intf ) ...@@ -160,10 +160,10 @@ GTK2Theme::GTK2Theme( intf_thread_t *_p_intf ) : Theme( _p_intf )
return; return;
} }
} }
*/
//Initialize value //Initialize value
ParentWindow = NULL; ParentWindow = NULL;
*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -258,6 +258,19 @@ void GTK2Theme::OnLoadTheme() ...@@ -258,6 +258,19 @@ void GTK2Theme::OnLoadTheme()
// The create menu // The create menu
CreateSystemMenu(); 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 ) void GTK2Theme::AddSystemMenu( string name, Event *event )
...@@ -297,6 +310,31 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible, ...@@ -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, WindowList.push_back( (Window *)new OSWindow( p_intf, hwnd, x, y, visible,
fadetime, alpha, movealpha, dragdrop ) ) ;*/ 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() /*HWND GTK2Theme::GetLogHandle()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_theme.h: GTK2 implementation of the Theme class * gtk2_theme.h: GTK2 implementation of the Theme class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
using namespace std; using namespace std;
//--- GTK2 ----------------------------------------------------------------- //--- GTK2 -----------------------------------------------------------------
//#include <shellapi.h> #include <gdk/gdk.h>
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
struct intf_thread_t; struct intf_thread_t;
...@@ -46,9 +46,9 @@ class GTK2Theme : public Theme ...@@ -46,9 +46,9 @@ class GTK2Theme : public Theme
{ {
protected: protected:
// Handles // Handles
/* HINSTANCE hinst; // HINSTANCE hinst;
HWND ParentWindow; GdkWindow *ParentWindow;
/*
// System tray icon // System tray icon
NOTIFYICONDATA TrayIcon; NOTIFYICONDATA TrayIcon;
HMENU SysMenu; HMENU SysMenu;
...@@ -63,9 +63,9 @@ class GTK2Theme : public Theme ...@@ -63,9 +63,9 @@ class GTK2Theme : public Theme
/* /*
// Specific windows methods // Specific windows methods
HINSTANCE getInstance() { return hinst; } HINSTANCE getInstance() { return hinst; }
HWND GetLogHandle(); HWND GetLogHandle();*/
HWND GetParentWindow() { return ParentWindow; } GdkWindow *GetParentWindow() { return ParentWindow; }
*/
// !!! // !!!
virtual void AddWindow( string name, int x, int y, bool visible, virtual void AddWindow( string name, int x, int y, bool visible,
int fadetime, int alpha, int movealpha, bool dragdrop ); int fadetime, int alpha, int movealpha, bool dragdrop );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_window.cpp: GTK2 implementation of the Window class * gtk2_window.cpp: GTK2 implementation of the Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <vlc/intf.h> #include <vlc/intf.h>
//--- GTK2 ------------------------------------------------------------------ //--- GTK2 ------------------------------------------------------------------
//#include <windows.h> #include <gdk/gdk.h>
//--- SKIN ------------------------------------------------------------------ //--- SKIN ------------------------------------------------------------------
#include "os_api.h" #include "os_api.h"
...@@ -68,8 +68,8 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y, ...@@ -68,8 +68,8 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y,
dragdrop ) dragdrop )
{ {
// Set handles // Set handles
/* hWnd = hwnd; gWnd = gwnd;
/*
// Set position parameters // Set position parameters
CursorPos = new POINT; CursorPos = new POINT;
WindowPos = new POINT; WindowPos = new POINT;
...@@ -103,6 +103,16 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y, ...@@ -103,6 +103,16 @@ GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y,
RegisterDragDrop( hWnd, DropTarget ); 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() GTK2Window::~GTK2Window()
...@@ -133,11 +143,11 @@ void GTK2Window::OSShow( bool show ) ...@@ -133,11 +143,11 @@ void GTK2Window::OSShow( bool show )
{ {
/* if( show ) /* if( show )
{ {
ShowWindow( hWnd, SW_SHOW ); gdk_window_show( gWnd );
} }
else else
{ {
ShowWindow( hWnd, SW_HIDE ); gdk_window_hide( gWnd );
}*/ }*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_window.h: GTK2 implementation of the Window class * gtk2_window.h: GTK2 implementation of the Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -39,15 +39,15 @@ class GTK2Window : public Window ...@@ -39,15 +39,15 @@ class GTK2Window : public Window
private: private:
// General parameters // General parameters
GdkWindow *gWnd; GdkWindow *gWnd;
/* LPPOINT CursorPos; // LPPOINT CursorPos;
LPPOINT WindowPos; // LPPOINT WindowPos;
// Tooltip texts // Tooltip texts
HWND ToolTipWindow; GdkWindow *ToolTipWindow;
TOOLINFO ToolTipInfo; // TOOLINFO ToolTipInfo;
// Drag & drop // Drag & drop
LPDROPTARGET DropTarget;*/ // LPDROPTARGET DropTarget;
public: public:
// Cosntructors // Cosntructors
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wrappers.cpp: Wrappers around C++ objects * wrappers.cpp: Wrappers around C++ objects
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -120,6 +120,7 @@ void AddAnchor( char *x, char *y, char *len, char *priority ) ...@@ -120,6 +120,7 @@ void AddAnchor( char *x, char *y, char *len, char *priority )
Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back(); Window *vlcWin = g_pIntf->p_sys->p_theme->WindowList.back();
g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff ); g_pIntf->p_sys->p_theme->OffBank->GetOffSet( XOff, YOff );
vlcWin->AnchorList.push_back( new Anchor( g_pIntf, atoi( x ) + XOff, vlcWin->AnchorList.push_back( new Anchor( g_pIntf, atoi( x ) + XOff,
atoi( y ) + YOff, atoi( len ), atoi( y ) + YOff, atoi( len ),
atoi( priority ), vlcWin ) ); atoi( priority ), vlcWin ) );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* event.cpp: Event class * event.cpp: Event class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -229,7 +229,7 @@ unsigned int Event::GetMessageType( string Desc ) ...@@ -229,7 +229,7 @@ unsigned int Event::GetMessageType( string Desc )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void Event::CreateEvent() void Event::CreateEvent()
{ {
// Initiatization // Initialization
int x, y; int x, y;
char *msg = new char[MAX_EVENT_SIZE]; char *msg = new char[MAX_EVENT_SIZE];
char *para1 = new char[MAX_PARAM_SIZE]; char *para1 = new char[MAX_PARAM_SIZE];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* skin-main.cpp: skins plugin for VLC * skin-main.cpp: skins plugin for VLC
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -145,6 +145,17 @@ static void Close ( vlc_object_t *p_this ) ...@@ -145,6 +145,17 @@ static void Close ( vlc_object_t *p_this )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static void Run( intf_thread_t *p_intf ) 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(); int a = OSAPI_GetTime();
// Load a theme // Load a theme
...@@ -163,8 +174,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -163,8 +174,8 @@ static void Run( intf_thread_t *p_intf )
DIRECTORY_SEPARATOR + "default" + DIRECTORY_SEPARATOR + "default" +
DIRECTORY_SEPARATOR + "theme.xml"; DIRECTORY_SEPARATOR + "theme.xml";
#else #else
/* FIXME: find VLC directory */ // FIXME: find VLC directory
string default_dir = (string)"." + string default_dir = (string)"/home/cyril/videolan/vlc/share" +
DIRECTORY_SEPARATOR + "skins" + DIRECTORY_SEPARATOR + "skins" +
DIRECTORY_SEPARATOR + "default" + DIRECTORY_SEPARATOR + "default" +
DIRECTORY_SEPARATOR + "theme.xml"; DIRECTORY_SEPARATOR + "theme.xml";
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* theme.cpp: Theme class * theme.cpp: Theme class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -195,13 +195,15 @@ void Theme::StartTheme( bool log, int magnet ) ...@@ -195,13 +195,15 @@ void Theme::StartTheme( bool log, int magnet )
void Theme::InitTheme() void Theme::InitTheme()
{ {
// Initialize the events // Initialize the events
EvtBank->Init(); /* FIXME */
fprintf(stderr, "FIXME in theme.cpp !\n");
// EvtBank->Init();
// Initialize the controls // Initialize the controls
InitControls(); InitControls();
// Initialize the windows // Initialize the windows
InitWindows(); // InitWindows();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void Theme::InitWindows() void Theme::InitWindows()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* themeloader.cpp: ThemeLoader class * themeloader.cpp: ThemeLoader class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
#include "themeloader.h" #include "themeloader.h"
#include "skin_common.h" #include "skin_common.h"
#include "anchor.h"
#include "window.h"
#define DEFAULT_XML_FILE "theme.xml" #define DEFAULT_XML_FILE "theme.xml"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -204,6 +207,7 @@ bool ThemeLoader::Parse( const string XmlFile ) ...@@ -204,6 +207,7 @@ bool ThemeLoader::Parse( const string XmlFile )
// Start the parser // Start the parser
int lex = yylex(); int lex = yylex();
fclose( yyin ); fclose( yyin );
if( lex ) if( lex )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* window.cpp: Window class * window.cpp: Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * 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 Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -282,7 +282,7 @@ void Window::RefreshImage( int x, int y, int w, int h ) ...@@ -282,7 +282,7 @@ void Window::RefreshImage( int x, int y, int w, int h )
#ifdef WIN32 #ifdef WIN32
Image->CopyFrom( x, y, w, h, Buffer, 0, 0, SRC_COPY ); Image->CopyFrom( x, y, w, h, Buffer, 0, 0, SRC_COPY );
#else #else
fprintf(stderr, "WARNING: FIXME in window.cpp !!!!"); fprintf(stderr, "%X WARNING: FIXME in window.cpp !!!!", Buffer);
#endif #endif
// Free memory // Free memory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment