dep_bool ' Gnome interface support' CONFIG_GNOME $CONFIG_GTK
bool 'GTK2 support' CONFIG_GTK2
dep_bool ' Gnome2 support' CONFIG_GNOME2 $CONFIG_GTK2
-bool 'Win32 skins module' CONFIG_SKINS
+bool 'Skins module' CONFIG_SKINS
bool 'Familiar GTK+ support' CONFIG_FAMILIAR
bool 'wxWindows support' CONFIG_WXWINDOWS
bool 'Qt interface support' CONFIG_QT
PLUGINS="${PLUGINS} skins"
CPPFLAGS_skins="${CPPFLAGS_skins} -O2 -fno-rtti -Imodules/gui/skins -Imodules/gui/skins/src -Imodules/gui/skins/win32 -Imodules/gui/skins/controls"
LDFLAGS_skins="${LDFLAGS_skins} -lstdc++ -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32 -lmsimg32"
+ else
+ PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.0.0, gthread-2.0])
+ PLUGINS="${PLUGINS} skins"
+ CPPFLAGS_skins="${CPPFLAGS_skins} -O2 -fno-rtti -Imodules/gui/skins -Imodules/gui/skins/src -Imodules/gui/skins/gtk2 -Imodules/gui/skins/controls -Imodules/gui/skins/parser ${GTK2_CFLAGS}"
+ LDFLAGS_skins="${LDFLAGS_skins} -lstdc++ ${GTK2_LIBS}"
fi
fi
modules/gui/skins/win32/win32_theme.h \
modules/gui/skins/win32/win32_window.cpp \
modules/gui/skins/win32/win32_window.h \
+ \
+ modules/gui/skins/gtk2/gtk2_api.cpp \
+ modules/gui/skins/gtk2/gtk2_bitmap.cpp \
+ modules/gui/skins/gtk2/gtk2_bitmap.h \
+ modules/gui/skins/gtk2/gtk2_dialog.cpp \
+ modules/gui/skins/gtk2/gtk2_dialog.h \
+ modules/gui/skins/gtk2/gtk2_dragdrop.cpp \
+ modules/gui/skins/gtk2/gtk2_dragdrop.h \
+ modules/gui/skins/gtk2/gtk2_event.cpp \
+ modules/gui/skins/gtk2/gtk2_event.h \
+ 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 \
$(NULL)
EXTRA_DIST += \
* slider.cpp: Slider control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: slider.cpp,v 1.2 2003/03/21 00:17:00 karibu Exp $
+ * $Id: slider.cpp,v 1.3 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
{
delete[] CursorX;
delete[] CursorY;
+/* FIXME: kludge */
+#ifdef WIN32
DeleteObject( HitRgn );
+#else
+ fprintf(stderr, "WARNING: fixme in slider.cpp!!!!!");
+#endif
}
//---------------------------------------------------------------------------
void ControlSlider::Init()
--- /dev/null
+/*****************************************************************************
+ * gtk2_api.cpp: Various gtk2-specific functions
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_api.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 ------------------------------------------------------------------
+#include <gtk/gtk.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;
+}
+//---------------------------------------------------------------------------
+*/
--- /dev/null
+/*****************************************************************************
+ * gtk2_bitmap.cpp: GTK2 implementation of the Bitmap class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_bitmap.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 -----------------------------------------------------------------
+//#define WINVER 0x0500
+//#include <windows.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "os_api.h"
+#include "graphics.h"
+#include "gtk2_graphics.h"
+#include "bitmap.h"
+#include "gtk2_bitmap.h"
+#include "skin_common.h"
+
+
+//---------------------------------------------------------------------------
+// GTK2Bitmap
+//---------------------------------------------------------------------------
+GTK2Bitmap::GTK2Bitmap( 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 );*/
+}
+//---------------------------------------------------------------------------
+GTK2Bitmap::GTK2Bitmap( 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 = ( (GTK2Graphics *)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 );*/
+}
+//---------------------------------------------------------------------------
+GTK2Bitmap::GTK2Bitmap( 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, ( (GTK2Bitmap *)c )->GetBmpDC(),
+ 0, 0, SRCCOPY );
+ DeleteObject( HBuf );*/
+}
+//---------------------------------------------------------------------------
+GTK2Bitmap::~GTK2Bitmap()
+{
+/* DeleteDC( bmpDC );*/
+}
+//---------------------------------------------------------------------------
+void GTK2Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
+ Graphics *dest )
+{
+/* HDC destDC = ( (GTK2Graphics *)dest )->GetImageHandle();
+
+ // New method, not available in win95
+ TransparentBlt( destDC, xRef, yRef, w, h, bmpDC, x, y, w, h, AlphaColor );
+*/
+}
+//---------------------------------------------------------------------------
+bool GTK2Bitmap::Hit( int x, int y)
+{
+/* unsigned int c = GetPixel( bmpDC, x, y );
+ if( c == AlphaColor || c == CLR_INVALID )
+ return false;
+ else
+ return true;
+*/
+}
+//---------------------------------------------------------------------------
+int GTK2Bitmap::GetBmpPixel( int x, int y )
+{
+// return GetPixel( bmpDC, x, y );
+}
+//---------------------------------------------------------------------------
+void GTK2Bitmap::SetBmpPixel( int x, int y, int color )
+{
+// SetPixelV( bmpDC, x, y, color );
+}
+//---------------------------------------------------------------------------
+
--- /dev/null
+/*****************************************************************************
+ * gtk2_bitmap.h: GTK2 implementation of the Bitmap class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_bitmap.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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_GTK2_BITMAP
+#define VLC_GTK2_BITMAP
+
+//--- GTK2 -----------------------------------------------------------------
+//#include <windows.h>
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Bitmap;
+class Graphics;
+
+//---------------------------------------------------------------------------
+class GTK2Bitmap : public Bitmap
+{
+ private:
+// HDC bmpDC;
+
+ public:
+ // Constructors
+ GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor );
+ GTK2Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y,
+ int w, int h, int AColor );
+ GTK2Bitmap( intf_thread_t *p_intf, Bitmap *c );
+
+ // Destructor
+ virtual ~GTK2Bitmap();
+
+ 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
--- /dev/null
+/*****************************************************************************
+ * gtk2_dialog.cpp: GTK2 implementation of some dialog boxes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_dialog.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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>
+extern intf_thread_t *g_pIntf;
+
+//--- GTK2 -----------------------------------------------------------------
+#define _GTK2_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 "window.h"
+#include "os_window.h"
+#include "theme.h"
+#include "os_theme.h"
+#include "event.h"
+#include "os_api.h"
+
+/*
+//---------------------------------------------------------------------------
+// Open file dialog box
+//---------------------------------------------------------------------------
+GTK2OpenFileDialog::GTK2OpenFileDialog( intf_thread_t *_p_intf, string title,
+ bool multiselect ) : OpenFileDialog( _p_intf, title, multiselect )
+{
+}
+//---------------------------------------------------------------------------
+GTK2OpenFileDialog::~GTK2OpenFileDialog()
+{
+}
+//---------------------------------------------------------------------------
+void GTK2OpenFileDialog::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 GTK2OpenFileDialog::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;
+
+ // Remove mouse tracking event to avoid non process due to modal open box
+ if( p_intf != NULL && p_intf->p_sys->p_theme != NULL )
+ {
+ TRACKMOUSEEVENT TrackEvent;
+ TrackEvent.cbSize = sizeof( TRACKMOUSEEVENT );\r
+ TrackEvent.dwFlags = TME_LEAVE|TME_CANCEL;\r
+ TrackEvent.dwHoverTime = 1;
+
+ list<Window *>::const_iterator win;
+ for( win = g_pIntf->p_sys->p_theme->WindowList.begin();
+ win != g_pIntf->p_sys->p_theme->WindowList.end(); win++ )
+ {
+ TrackEvent.hwndTrack = ( (GTK2Window *)(*win) )->GetHandle();
+ TrackMouseEvent( &TrackEvent );
+ }
+ }
+
+ // Show dialog box
+ if( !GetOpenFileName( &OpenFile ) )
+ {
+ OSAPI_PostMessage( NULL, WINDOW_LEAVE, 0, 0 );
+ return false;
+ }
+
+ // Tell windows that mouse cursor has left window because it has been
+ // unactivated
+ OSAPI_PostMessage( NULL, WINDOW_LEAVE, 0, 0 );
+
+ // 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( ( (GTK2Theme *)p_intf->p_sys->p_theme )
+ ->GetLogHandle() == hwnd )
+ {
+ SetWindowPos( ( (GTK2LogWindow *)
+ 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;
+}
+//---------------------------------------------------------------------------
+
+
+
+//---------------------------------------------------------------------------
+// GTK2 Log Window class
+//---------------------------------------------------------------------------
+GTK2LogWindow::GTK2LogWindow( 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();
+}
+//---------------------------------------------------------------------------
+GTK2LogWindow::~GTK2LogWindow()
+{
+ DestroyWindow( hRichCtrl );
+ DestroyWindow( hWindow );
+}
+//---------------------------------------------------------------------------
+void GTK2LogWindow::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 GTK2LogWindow::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 GTK2LogWindow::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 GTK2LogWindow::Show()
+{
+ ShowWindow( hWindow, SW_SHOW );
+ Visible = true;
+}
+//---------------------------------------------------------------------------
+void GTK2LogWindow::Hide()
+{
+ ShowWindow( hWindow, SW_HIDE );
+ Visible = false;
+}
+//---------------------------------------------------------------------------
+*/
--- /dev/null
+/*****************************************************************************
+ * gtk2_dialog.h: GTK2 implementation of some dialog boxes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_dialog.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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_GTK2_DIALOG
+#define VLC_SKIN_GTK2_DIALOG
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+
+
+//---------------------------------------------------------------------------
+class GTK2OpenFileDialog : OpenFileDialog
+{
+ private:
+
+ protected:
+
+ public:
+ // Constructors
+ GTK2OpenFileDialog( intf_thread_t *_p_intf, string title,
+ bool multiselect );
+
+ // Destructors
+ virtual ~GTK2OpenFileDialog();
+
+ virtual void AddFilter( string name, string type );
+ virtual bool Open();
+};
+//---------------------------------------------------------------------------
+class GTK2LogWindow : LogWindow
+{
+ private:
+/* HWND hWindow;
+ HWND hRichCtrl;
+ string RtfHeader;*/
+
+ public:
+ // Constructors
+ GTK2LogWindow( intf_thread_t *_p_intf );
+
+ // Destructors
+ virtual ~GTK2LogWindow();
+
+ 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
+
--- /dev/null
+/*****************************************************************************
+ * gtk2_dragdrop.cpp: GTK2 implementation of the drag & drop
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_dragdrop.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 -----------------------------------------------------------------
+//#include <windows.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "event.h"
+#include "gtk2_dragdrop.h"
+
+
+/*
+//---------------------------------------------------------------------------
+GTK2DropObject::GTK2DropObject() : IDropTarget()
+{
+ References = 1;
+}
+//---------------------------------------------------------------------------
+GTK2DropObject::~GTK2DropObject()
+{
+}
+//---------------------------------------------------------------------------
+void GTK2DropObject::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 GTK2DropObject::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) GTK2DropObject::AddRef()
+{
+ return ++References;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP_(ULONG) GTK2DropObject::Release()
+{
+ if( --References == 0 )
+ {
+ delete this;
+ return 0;
+ }
+ return References;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP GTK2DropObject::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 GTK2DropObject::DragOver( DWORD grfKeyState, POINTL pt,
+ DWORD *pdwEffect )
+{
+ // For visual feedback
+ // TODO
+ return S_OK;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP GTK2DropObject::DragLeave()
+{
+ // Remove visual feedback
+ // TODO
+ return S_OK;
+}
+//---------------------------------------------------------------------------
+STDMETHODIMP GTK2DropObject::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;
+}
+*/
--- /dev/null
+/*****************************************************************************
+ * gtk2_dragdrop.h: GTK2 implementation of the drag & drop
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_dragdrop.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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_GTK2_DRAGDROP
+#define VLC_SKIN_GTK2_DRAGDROP
+
+//--- GTK2 -----------------------------------------------------------------
+//#include <shellapi.h>
+//#include <ole2.h>
+
+//---------------------------------------------------------------------------
+/*
+class GTK2DropObject : public IDropTarget
+{
+ public:
+ GTK2DropObject();
+ virtual ~GTK2DropObject();
+
+ 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
--- /dev/null
+/*****************************************************************************
+ * gtk2_event.cpp: GTK2 implementation of the Event class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_event.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 -----------------------------------------------------------------
+//#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
+//---------------------------------------------------------------------------
+GTK2Event::GTK2Event( intf_thread_t *p_intf, string Desc, string shortcut )
+ : Event( p_intf, Desc, shortcut )
+{
+ hWnd = NULL;
+}
+//---------------------------------------------------------------------------
+GTK2Event::GTK2Event( intf_thread_t *p_intf, HWND hwnd, unsigned int msg,
+ unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 )
+{
+ hWnd = hwnd;
+}
+//---------------------------------------------------------------------------
+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();
+}
+//---------------------------------------------------------------------------
+GTK2Event::~GTK2Event()
+{
+}
+//---------------------------------------------------------------------------
+bool GTK2Event::SendEvent()
+{
+ if( Message != VLC_NOTHING )
+ {
+ PostMessage( hWnd, Message, Param1, Param2 );
+ PostSynchroMessage();
+ return true;
+ }
+
+ return true;
+
+}
+//---------------------------------------------------------------------------
+bool GTK2Event::IsEqual( Event *evt )
+{
+ GTK2Event *WinEvt = (GTK2Event *)evt;
+ return( WinEvt->GetWindow() == hWnd && WinEvt->GetMessage() == Message &&
+ WinEvt->GetParam1() == Param1 && WinEvt->GetParam2() == Param2 );
+}
+//---------------------------------------------------------------------------
+void GTK2Event::CreateOSEvent( string para1, string para2, string para3 )
+{
+
+ // Find Parameters
+ switch( Message )
+ {
+ case WINDOW_MOVE:
+ hWnd = GetWindowFromName( para1 );
+ break;
+
+ case WINDOW_CLOSE:
+ hWnd = GetWindowFromName( para1 );
+ break;
+
+ case WINDOW_OPEN:
+ hWnd = GetWindowFromName( para1 );
+ break;
+
+ }
+
+}
+//---------------------------------------------------------------------------
+HWND GTK2Event::GetWindowFromName( string name )
+{
+ GTK2Window *win = (GTK2Window *)
+ p_intf->p_sys->p_theme->GetWindow( name );
+ if( win == NULL )
+ return NULL;
+ else
+ return win->GetHandle();
+}
+//---------------------------------------------------------------------------
+*/
--- /dev/null
+/*****************************************************************************
+ * gtk2_event.h: GTK2 implementation of the Event class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_event.h,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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_GTK2_EVENT
+#define VLC_SKIN_GTK2_EVENT
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//--- GTK2 ------------------------------------------------------------------
+#include <gdk/gdk.h>
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Window;
+
+//---------------------------------------------------------------------------
+class GTK2Event : Event
+{
+ private:
+ GdkWindow *GetWindowFromName( string name );
+ GdkWindow *gWnd;
+ public:
+ // Constructor
+ GTK2Event( intf_thread_t *p_intf, string Desc, string shortcut );
+ GTK2Event( intf_thread_t *p_intf, GdkWindow *gwnd, unsigned int msg,
+ unsigned int par1, long par2 );
+ GTK2Event( intf_thread_t *p_intf, Window *win, unsigned int msg,
+ unsigned int par1, long par2 );
+
+ // Destructor
+ virtual ~GTK2Event();
+
+ // Event sending
+ virtual bool SendEvent();
+
+ // General operations on events
+ virtual void CreateOSEvent( string para1, string para2, string para3 );
+ virtual bool IsEqual( Event *evt );
+
+ // Getters
+ GdkWindow *GetWindow() { return gWnd; }
+};
+//---------------------------------------------------------------------------
+
+#endif
--- /dev/null
+/*****************************************************************************
+ * gtk2_font.cpp: GTK2 implementation of the Font class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_font.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 -----------------------------------------------------------------
+//#include <windows.h>
+
+//--- VLC -------------------------------------------------------------------
+#include <vlc/intf.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "graphics.h"
+#include "gtk2_graphics.h"
+#include "font.h"
+#include "gtk2_font.h"
+
+
+/*
+//---------------------------------------------------------------------------
+// Font object
+//---------------------------------------------------------------------------
+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 )
+{
+}
+//---------------------------------------------------------------------------
+GTK2Font::~GTK2Font()
+{
+}
+//---------------------------------------------------------------------------
+void GTK2Font::AssignGTK2Font( 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 GTK2Font::AssignFont( Graphics *dest )
+{
+ HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle();
+ AssignGTK2Font( DC );
+}
+//---------------------------------------------------------------------------
+void GTK2Font::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;
+ AssignGTK2Font( 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 GTK2Font::GenericPrint( Graphics *dest, string text, int x, int y,
+ int w, int h, int align, int color )
+{
+ HDC DC = ( (GTK2Graphics *)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 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 );
+}
+//---------------------------------------------------------------------------
+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 );
+}
+//---------------------------------------------------------------------------
+
+*/
--- /dev/null
+/*****************************************************************************
+ * 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 $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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_GTK2_FONT
+#define VLC_SKIN_GTK2_FONT
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Graphics;
+
+//---------------------------------------------------------------------------
+class GTK2Font : Font
+{
+ private:
+ // Assign font to Device Context
+ virtual void AssignFont( Graphics *dest );
+// void AssignGTK2Font( 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
+ GTK2Font( intf_thread_t *_p_intf, string fontname, int size, int color,
+ int weight, bool italic, bool underline );
+
+ // Destructor
+ virtual ~GTK2Font();
+
+ // 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
--- /dev/null
+/*****************************************************************************
+ * gtk2_graphics.cpp: GTK2 implementation of the Graphics and Region classes
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_graphics.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 -----------------------------------------------------------------
+//#include <windows.h>
+
+//--- SKIN ------------------------------------------------------------------
+#include "graphics.h"
+#include "window.h"
+#include "os_window.h"
+#include "gtk2_graphics.h"
+
+
+/*
+//---------------------------------------------------------------------------
+// GTK2 GRAPHICS
+//---------------------------------------------------------------------------
+GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h )
+{
+ HBITMAP HImage ;
+ Image = CreateCompatibleDC( NULL );
+ if( from != NULL )
+ {
+ HDC DC = GetWindowDC( ( (GTK2Window *)from )->GetHandle() );
+ HImage = CreateCompatibleBitmap( DC, w, h );
+ ReleaseDC( ( (GTK2Window *)from )->GetHandle(), DC );
+ }
+ else
+ {
+ HImage = CreateCompatibleBitmap( Image, w, h );
+ }
+ SelectObject( Image, HImage );
+ DeleteObject( HImage );
+}
+//---------------------------------------------------------------------------
+GTK2Graphics::~GTK2Graphics()
+{
+ DeleteDC( Image );
+}
+//---------------------------------------------------------------------------
+void GTK2Graphics::CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
+ int sx, int sy, int Flag )
+{
+ BitBlt( Image, dx, dy, dw, dh, ( (GTK2Graphics *)Src )->GetImageHandle(),
+ sx, sy, Flag );
+}
+*/
+//---------------------------------------------------------------------------
+/*void GTK2Graphics::CopyTo( Graphics *Dest, int dx, int dy, int dw, int dh,
+ int sx, int sy, int Flag )
+{
+ BitBlt( ( (GTK2Graphics *)Dest )->GetImageHandle(), dx, dy, dw, dh, Image,
+ sx, sy, Flag );
+}*//*
+//---------------------------------------------------------------------------
+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;
+}
+//---------------------------------------------------------------------------
+void GTK2Graphics::SetClipRegion( Region *rgn )
+{
+ SelectClipRgn( Image, ( (GTK2Region *)rgn )->GetHandle() );
+}
+//---------------------------------------------------------------------------
+
+
+
+
+//---------------------------------------------------------------------------
+// GTK2 REGION
+//---------------------------------------------------------------------------
+GTK2Region::GTK2Region()
+{
+ Rgn = CreateRectRgn( 0, 0, 0, 0 );
+}
+//---------------------------------------------------------------------------
+GTK2Region::GTK2Region( int x, int y, int w, int h )
+{
+ Rgn = CreateRectRgn( x, y, x + w, y + h );
+}
+//---------------------------------------------------------------------------
+GTK2Region::~GTK2Region()
+{
+ DeleteObject( Rgn );
+}
+//---------------------------------------------------------------------------
+void GTK2Region::AddPoint( int x, int y )
+{
+ AddRectangle( x, y, x + 1, y + 1 );
+}
+//---------------------------------------------------------------------------
+void GTK2Region::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 GTK2Region::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 GTK2Region::Move( int x, int y )
+{
+ OffsetRgn( Rgn, x, y );
+}
+//---------------------------------------------------------------------------
+bool GTK2Region::Hit( int x, int y )
+{
+ return PtInRegion( Rgn, x, y );
+}
+//---------------------------------------------------------------------------
+*/
--- /dev/null
+/*****************************************************************************
+ * 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 $
+ *
+ * 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_GTK2_GRAPHICS
+#define VLC_SKIN_GTK2_GRAPHICS
+
+//---------------------------------------------------------------------------
+class Region;
+class Window;
+
+//---------------------------------------------------------------------------
+class GTK2Graphics : public Graphics
+{
+ private:
+ int Width;
+ int Height;
+ // HDC Image;
+ public:
+ // Constructor
+ GTK2Graphics( int w, int h, Window *from = NULL );
+ // Destructor
+ virtual ~GTK2Graphics();
+ // 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 GTK2 methods
+// HDC GetImageHandle() { return Image; };
+};
+//---------------------------------------------------------------------------
+class GTK2Region : public Region
+{
+ private:
+// HRGN Rgn;
+ public:
+ // Constructor
+ GTK2Region();
+ GTK2Region( int x, int y, int w, int h );
+ // Destructor
+ ~GTK2Region();
+ // 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 GTK2 methods
+// HRGN GetHandle() { return Rgn; };
+};
+//---------------------------------------------------------------------------
+
+#endif
--- /dev/null
+/*****************************************************************************
+ * gtk2_run.cpp:
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_run.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 ------------------------------------------------------------------
+//#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"
+
+
+#if 0
+
+//---------------------------------------------------------------------------
+// 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 );
+}
+//---------------------------------------------------------------------------
+
+
+
+//---------------------------------------------------------------------------
+// GTK2 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 )
+ {
+ msg_Err( p_intf, "Key : %i (%i)", msg.wParam, KeyModifier );
+ // If key is CTRL
+ if( msg.wParam == 17 )
+ KeyModifier = 0;
+ else if( KeyModifier == 0 )
+ {
+ p_intf->p_sys->p_theme->EvtBank->TestShortcut(
+ msg.wParam, 0 );
+ }
+ }
+ 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 );
+}
+//---------------------------------------------------------------------------
+
+
+#endif
--- /dev/null
+/*****************************************************************************
+ * 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 $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+
+//--- GTK2 -----------------------------------------------------------------
+#include <gtk/gtk.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 );
+
+/*
+
+//---------------------------------------------------------------------------
+// GTK2 interface
+//---------------------------------------------------------------------------
+LRESULT CALLBACK GTK2Proc( 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 == ( (GTK2Window *)(*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 == ( (GTK2Theme *)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(
+ ( (GTK2Theme *)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
+//---------------------------------------------------------------------------
+GTK2Theme::GTK2Theme( 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) GTK2Proc;
+ 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;
+*/
+}
+
+//---------------------------------------------------------------------------
+GTK2Theme::~GTK2Theme()
+{/*
+ // 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 GTK2Theme::OnLoadTheme()
+{/*
+ // Create window class
+ WNDCLASS ParentClass;
+ ParentClass.style = CS_VREDRAW|CS_HREDRAW|CS_DBLCLKS;
+ ParentClass.lpfnWndProc = (WNDPROC) GTK2Proc;
+ 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 GTK2Theme::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 GTK2Theme::ChangeClientWindowName( string name )
+{/*
+ SetWindowText( ParentWindow, name.c_str() );*/
+}
+//---------------------------------------------------------------------------
+void GTK2Theme::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 GTK2Theme::GetLogHandle()
+{
+ if( Log != NULL )
+ return ( (GTK2LogWindow *)Log )->GetWindow();
+ else
+ return NULL;
+}*/
+//---------------------------------------------------------------------------
+void GTK2Theme::ChangeTray()
+{/*
+ if( ShowInTray )
+ {
+ Shell_NotifyIcon( NIM_DELETE, &TrayIcon );
+ ShowInTray = false;
+ }
+ else
+ {
+ Shell_NotifyIcon( NIM_ADD, &TrayIcon );
+ ShowInTray = true;
+ }*/
+}
+//---------------------------------------------------------------------------
+void GTK2Theme::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;
+ }*/
+}
+//---------------------------------------------------------------------------
+
--- /dev/null
+/*****************************************************************************
+ * 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 $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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_GTK2_THEME
+#define VLC_SKIN_GTK2_THEME
+
+//--- GENERAL ---------------------------------------------------------------
+#include <string>
+using namespace std;
+
+//--- GTK2 -----------------------------------------------------------------
+//#include <shellapi.h>
+
+//---------------------------------------------------------------------------
+struct intf_thread_t;
+class Window;
+class EventBank;
+class BitmapBank;
+class FontBank;
+class LogWindow;
+
+//---------------------------------------------------------------------------
+class GTK2Theme : public Theme
+{
+ protected:
+ // Handles
+/* HINSTANCE hinst;
+ HWND ParentWindow;
+
+ // System tray icon
+ NOTIFYICONDATA TrayIcon;
+ HMENU SysMenu;
+*/
+ public:
+ // Constructor
+ GTK2Theme( intf_thread_t *_p_intf );
+ virtual void OnLoadTheme();
+
+ // Destructor
+ virtual ~GTK2Theme();
+/*
+ // 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
+
--- /dev/null
+/*****************************************************************************
+ * gtk2_window.cpp: GTK2 implementation of the Window class
+ *****************************************************************************
+ * Copyright (C) 2003 VideoLAN
+ * $Id: gtk2_window.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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>
+
+//--- GTK2 ------------------------------------------------------------------
+//#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
+//---------------------------------------------------------------------------
+GTK2Window::GTK2Window( 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 GTK2DropObject();
+ // register the listview as a drop target
+ RegisterDragDrop( hWnd, DropTarget );
+ }
+
+}
+//---------------------------------------------------------------------------
+GTK2Window::~GTK2Window()
+{
+ 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 GTK2Window::OSShow( bool show )
+{
+ if( show )
+ {
+ ShowWindow( hWnd, SW_SHOW );
+ }
+ else
+ {
+ ShowWindow( hWnd, SW_HIDE );
+ }
+}
+//---------------------------------------------------------------------------
+bool GTK2Window::ProcessOSEvent( Event *evt )
+{
+ unsigned int msg = evt->GetMessage();
+ unsigned int p1 = evt->GetParam1();
+ int p2 = evt->GetParam2();
+
+ switch( msg )
+ {
+ case WM_PAINT:
+ HDC DC;
+ PAINTSTRUCT Infos;
+ DC = BeginPaint( hWnd , &Infos );
+ EndPaint( hWnd , &Infos );
+ RefreshFromImage( 0, 0, Width, Height );
+ return true;
+
+ case WM_MOUSEMOVE:
+ TRACKMOUSEEVENT TrackEvent;
+ TrackEvent.cbSize = sizeof( TRACKMOUSEEVENT );\r
+ TrackEvent.dwFlags = TME_LEAVE;\r
+ TrackEvent.hwndTrack = hWnd;\r
+ TrackEvent.dwHoverTime = 1;
+ TrackMouseEvent( &TrackEvent );
+ 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;
+
+ case WM_MOUSELEAVE:
+ OSAPI_PostMessage( this, WINDOW_LEAVE, 0, 0 );
+ return true;
+
+ default:
+ return false;
+ }
+}
+//---------------------------------------------------------------------------
+void GTK2Window::SetTransparency( int Value )
+{
+ if( Value > -1 )
+ Alpha = Value;
+ SetLayeredWindowAttributes( hWnd, 0, Alpha, LWA_ALPHA | LWA_COLORKEY );
+ UpdateWindow( hWnd );
+}
+//---------------------------------------------------------------------------
+void GTK2Window::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, ( (GTK2Graphics *)Image )->GetImageHandle(),
+ x, y, SRCCOPY );
+
+ // Release window device context
+ ReleaseDC( hWnd, DC );
+
+}
+//---------------------------------------------------------------------------
+void GTK2Window::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 GTK2Window::WindowManualMoveInit()
+{
+ GetCursorPos( CursorPos );
+ WindowPos->x = Left;
+ WindowPos->y = Top;
+}
+//---------------------------------------------------------------------------
+void GTK2Window::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 GTK2Window::Size( int width, int height )
+{
+ Width = width;
+ Height = height;
+ SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height,
+ SWP_NOMOVE|SWP_NOREDRAW|SWP_NOZORDER );
+}
+//---------------------------------------------------------------------------
+void GTK2Window::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 );
+ }
+ }
+
+}
+//---------------------------------------------------------------------------
+*/
--- /dev/null
+/*****************************************************************************
+ * 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 $
+ *
+ * Authors: Cyril Deguet <asmax@videolan.org>
+ *
+ * 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_GTK2_WIN
+#define VLC_SKIN_GTK2_WIN
+
+//--- GTK2 -----------------------------------------------------------------
+#include <gdk/gdk.h>
+
+//---------------------------------------------------------------------------
+class Graphics;
+class Event;
+
+//---------------------------------------------------------------------------
+class GTK2Window : public Window
+{
+ private:
+ // General parameters
+ GdkWindow *gWnd;
+/* LPPOINT CursorPos;
+ LPPOINT WindowPos;
+
+ // Tooltip texts
+ HWND ToolTipWindow;
+ TOOLINFO ToolTipInfo;
+
+ // Drag & drop
+ LPDROPTARGET DropTarget;*/
+
+ public:
+ // Cosntructors
+ GTK2Window( intf_thread_t *_p_intf, GdkWindow *gwnd, int x, int y,
+ bool visible, int transition, int normalalpha, int movealpha,
+ bool dragdrop );
+
+ // Destructors
+ virtual ~GTK2Window();
+
+ // 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 gtk2 methods
+ GdkWindow *GetHandle() {return gWnd; };
+
+ // Tooltip texts
+ virtual void ChangeToolTipText( string text );
+};
+//---------------------------------------------------------------------------
+
+#endif
* 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 $
+ * $Id: os_api.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#if defined( WIN32 )
#define DIRECTORY_SEPARATOR '\\'
+#else
+ #define DIRECTORY_SEPARATOR '/'
#endif
* 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 $
+ * $Id: os_bitmap.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#if defined( WIN32 )
#include "win32_bitmap.h"
#define OSBitmap Win32Bitmap
+#else
+ #include "gtk2_bitmap.h"
+ #define OSBitmap GTK2Bitmap
#endif
* 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 $
+ * $Id: os_dialog.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include "win32_dialog.h"
#define OSOpenFileDialog Win32OpenFileDialog
#define OSLogWindow Win32LogWindow
+#else
+ #include "gtk2_dialog.h"
+ #define OSOpenFileDialog GTK2OpenFileDialog
+ #define OSLogWindow GTK2LogWindow
#endif
* 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 $
+ * $Id: os_event.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#if defined( WIN32 )
#include "win32_event.h"
#define OSEvent Win32Event
+#else
+ #include "gtk2_event.h"
+ #define OSEvent GTK2Event
#endif
* 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 $
+ * $Id: os_font.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#if defined( WIN32 )
#include "win32_font.h"
#define OSFont Win32Font
+#else
+ #include "gtk2_font.h"
+ #define OSFont GTK2Font
#endif
* 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 $
+ * $Id: os_graphics.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#if defined( WIN32 )
#include "win32_graphics.h"
-
#define SRC_COPY SRCCOPY
#define SRC_AND SRCAND
#define OSGraphics Win32Graphics
#define OSRegion Win32Region
-
+#else
+ #include "gtk2_graphics.h"
+ #define SRC_COPY SRCCOPY
+ #define SRC_AND SRCAND
+ #define OSGraphics GTK2Graphics
+ #define OSRegion GTK2Region
#endif
* 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 $
+ * $Id: os_theme.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#if defined( WIN32 )
#include "win32_theme.h"
#define OSTheme Win32Theme
+#else
+ #include "gtk2_theme.h"
+ #define OSTheme GTK2Theme
#endif
* 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 $
+ * $Id: os_window.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include "win32_dragdrop.h"
#include "win32_window.h"
#define OSWindow Win32Window
+#else
+ #include "gtk2_dragdrop.h"
+ #include "gtk2_window.h"
+ #define OSWindow GTK2Window
#endif
* wrappers.cpp: Wrappers around C++ objects
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: wrappers.cpp,v 1.4 2003/03/19 17:14:50 karibu Exp $
+ * $Id: wrappers.cpp,v 1.5 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include "anchor.h"
#include "banks.h"
#include "controls.h"
+#include "font.h"
#include "window.h"
#include "theme.h"
#include "skin_common.h"
* dialog.cpp: Classes for some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: dialog.cpp,v 1.2 2003/03/20 09:29:07 karibu Exp $
+ * $Id: dialog.cpp,v 1.3 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
{
+/* FIXME: kludge */
+#ifdef WIN32
// Append all messages to log window
switch( Sub->p_msg[i_start].i_type )
{
default:
ChangeColor( RGB( 128, 128, 128 ) );
break;
+#else
+ fprintf(stderr, "WARNING: FIXME in dialog.cpp");
+ // 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;
+#endif
}
// Add message
* event.h: Event class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: event.h,v 1.4 2003/04/11 22:08:06 videolan Exp $
+ * $Id: event.h,v 1.5 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#define MAX_EVENT_SIZE 30
#define MAX_PARAM_SIZE 20
+#if !defined _WIN32
+#define WM_APP 0x8000
+#endif
+
#define VLC_MESSAGE (WM_APP)
#define VLC_WINDOW (WM_APP + 1000)
#define VLC_CONTROL (WM_APP + 2000)
* font.h: Font class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: font.h,v 1.1 2003/03/18 02:21:47 ipkiss Exp $
+ * $Id: font.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
#include <string>
using namespace std;
+/* FIXME :kludge */
+#define DT_TOP 0 // 0x0000
+#define DT_LEFT 0 // 0x0000
+#define DT_CENTER 1 // 0x0001
+#define DT_RIGHT 2 // 0x0002
+
//---------------------------------------------------------------------------
struct intf_thread_t;
class Graphics;
* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.5 2003/04/06 17:57:11 ipkiss Exp $
+ * $Id: skin_main.cpp,v 1.6 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
//---------------------------------------------------------------------------
// Exported interface functions.
//---------------------------------------------------------------------------
+#ifdef WIN32
extern "C" __declspec( dllexport )
int __VLC_SYMBOL( vlc_entry ) ( module_t *p_module );
+#endif
//---------------------------------------------------------------------------
// Local prototypes.
#if 0
if( ! Loader->Load( DEFAULT_SKIN_FILE ) )
#else
+#ifdef WIN32
string default_dir = (string)p_intf->p_libvlc->psz_vlcpath +
DIRECTORY_SEPARATOR + "skins" +
DIRECTORY_SEPARATOR + "default" +
DIRECTORY_SEPARATOR + "theme.xml";
+#else
+/* FIXME: find VLC directory */
+ string default_dir = (string)"." +
+ DIRECTORY_SEPARATOR + "skins" +
+ DIRECTORY_SEPARATOR + "default" +
+ DIRECTORY_SEPARATOR + "theme.xml";
+#endif
if( ! Loader->Load( default_dir ) )
#endif
{
//-------------------------------------------------------------------------
vlc_mutex_unlock( &p_intf->change_lock );
- return( TRUE );
+ return( VLC_TRUE );
}
//---------------------------------------------------------------------------
* themeloader.cpp: ThemeLoader class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: themeloader.cpp,v 1.3 2003/03/19 03:11:14 karibu Exp $
+ * $Id: themeloader.cpp,v 1.4 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
//--- GENERAL ---------------------------------------------------------------
#include <string>
#include <fcntl.h>
+#if !defined WIN32
+#include <unistd.h>
+#endif
//--- VLC -------------------------------------------------------------------
#include <vlc/vlc.h>
msg_Dbg( p_intf, "Using skin file: %s", XmlFile.c_str() );
// Save current working directory
+#ifdef WIN32
char *cwd = new char[MAX_PATH];
getcwd( cwd, MAX_PATH );
+#else
+ char *cwd = new char[PATH_MAX];
+ getcwd( cwd, PATH_MAX );
+#endif
// Directory separator is different in each OS !
int p = XmlFile.rfind( DIRECTORY_SEPARATOR, XmlFile.size() );
* vlcproc.cpp: VlcProc class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.4 2003/04/11 22:08:06 videolan Exp $
+ * $Id: vlcproc.cpp,v 1.5 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
}
aout_VolumeGet( p_intf, &volume );
+/* FIXME: kludge */
+#ifdef WIN32
PostMessage( NULL, CTRL_SET_SLIDER,
(unsigned int)
p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ),
(int)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) );
+#else
+ fprintf(stderr, "WARNING: FIXME in vlcproc.cpp !!!");
+#endif
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void VlcProc::AddNetworkUDP( int port )
{
- config_PutInt( p_intf, "network-channel", FALSE );
+ config_PutInt( p_intf, "network-channel", VLC_FALSE );
// Build source name
char *s_port = new char[5];
* window.cpp: Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: window.cpp,v 1.4 2003/03/20 09:29:07 karibu Exp $
+ * $Id: window.cpp,v 1.5 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
ControlList[i]->Draw( x, y, w, h, Buffer );
// Copy buffer in Image
+/* FIXME: kludge */
+#ifdef WIN32
Image->CopyFrom( x, y, w, h, Buffer, 0, 0, SRC_COPY );
+#else
+ fprintf(stderr, "WARNING: FIXME in window.cpp !!!!");
+#endif
// Free memory
delete Buffer;
* 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 $
+ * $Id: win32_api.cpp,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#include <windows.h>
}
//---------------------------------------------------------------------------
+#endif
* 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 $
+ * $Id: win32_bitmap.cpp,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#define WINVER 0x0500
}
//---------------------------------------------------------------------------
+#endif
* 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 $
+ * $Id: win32_bitmap.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_WIN32_BITMAP
#define VLC_WIN32_BITMAP
//---------------------------------------------------------------------------
#endif
+
+#endif
* win32_dialog.cpp: Win32 implementation of some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_dialog.cpp,v 1.2 2003/03/20 09:29:07 karibu Exp $
+ * $Id: win32_dialog.cpp,v 1.3 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- VLC -------------------------------------------------------------------
#include <vlc/intf.h>
}
//---------------------------------------------------------------------------
+#endif
* win32_dialog.h: Win32 implementation of some dialog boxes
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_dialog.h,v 1.2 2003/03/20 09:29:07 karibu Exp $
+ * $Id: win32_dialog.h,v 1.3 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_SKIN_WIN32_DIALOG
#define VLC_SKIN_WIN32_DIALOG
#endif
+#endif
* win32_dragdrop.cpp: Win32 implementation of the drag & drop
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_dragdrop.cpp,v 1.2 2003/03/18 04:56:58 ipkiss Exp $
+ * $Id: win32_dragdrop.cpp,v 1.3 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#include <windows.h>
return S_OK;
}
+#endif
* 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 $
+ * $Id: win32_dragdrop.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_SKIN_WIN32_DRAGDROP
#define VLC_SKIN_WIN32_DRAGDROP
};
//---------------------------------------------------------------------------
#endif
+
+#endif
* win32_event.cpp: Win32 implementation of the Event class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_event.cpp,v 1.2 2003/03/19 17:14:50 karibu Exp $
+ * $Id: win32_event.cpp,v 1.3 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#include <windows.h>
}
//---------------------------------------------------------------------------
+#endif
* 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 $
+ * $Id: win32_event.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_SKIN_WIN32_EVENT
#define VLC_SKIN_WIN32_EVENT
//---------------------------------------------------------------------------
#endif
+
+#endif
* 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 $
+ * $Id: win32_font.cpp,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#include <windows.h>
//---------------------------------------------------------------------------
+#endif
* 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 $
+ * $Id: win32_font.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_SKIN_WIN32_FONT
#define VLC_SKIN_WIN32_FONT
//---------------------------------------------------------------------------
#endif
+
+#endif
* 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 $
+ * $Id: win32_graphics.cpp,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#include <windows.h>
return PtInRegion( Rgn, x, y );
}
//---------------------------------------------------------------------------
+
+#endif
* 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 $
+ * $Id: win32_graphics.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_SKIN_WIN32_GRAPHICS
#define VLC_SKIN_WIN32_GRAPHICS
//---------------------------------------------------------------------------
#endif
+
+#endif
* win32_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_run.cpp,v 1.3 2003/03/20 09:29:07 karibu Exp $
+ * $Id: win32_run.cpp,v 1.4 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#include <windows.h>
}
//---------------------------------------------------------------------------
-
+#endif
* 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 $
+ * $Id: win32_theme.cpp,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- WIN32 -----------------------------------------------------------------
#include <windows.h>
}
//---------------------------------------------------------------------------
+#endif
* 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 $
+ * $Id: win32_theme.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_SKIN_WIN32_THEME
#define VLC_SKIN_WIN32_THEME
#endif
+#endif
* win32_window.cpp: Win32 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: win32_window.cpp,v 1.3 2003/03/20 09:29:07 karibu Exp $
+ * $Id: win32_window.cpp,v 1.4 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
//--- GENERAL ---------------------------------------------------------------
//#include <math.h>
}
//---------------------------------------------------------------------------
+#endif
* 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 $
+ * $Id: win32_window.h,v 1.2 2003/04/12 21:43:27 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+#ifdef WIN32
#ifndef VLC_SKIN_WIN32_WIN
#define VLC_SKIN_WIN32_WIN
//---------------------------------------------------------------------------
#endif
+
+#endif