Commit 3075f6a4 authored by Cyril Deguet's avatar Cyril Deguet

* something will be visible soon, be patient...

 (this silly GDK doesn't know BMP images :(
parent 4dec9682
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_bitmap.cpp: GTK2 implementation of the Bitmap class * gtk2_bitmap.cpp: GTK2 implementation of the Bitmap class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_bitmap.cpp,v 1.2 2003/04/13 19:09:59 asmax Exp $ * $Id: gtk2_bitmap.cpp,v 1.3 2003/04/13 20:07:34 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -25,8 +25,7 @@ ...@@ -25,8 +25,7 @@
#if !defined WIN32 #if !defined WIN32
//--- GTK2 ----------------------------------------------------------------- //--- GTK2 -----------------------------------------------------------------
//#define WINVER 0x0500 #include <gdk/gdk.h>
//#include <windows.h>
//--- VLC ------------------------------------------------------------------- //--- VLC -------------------------------------------------------------------
#include <vlc/intf.h> #include <vlc/intf.h>
...@@ -98,6 +97,7 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor ) ...@@ -98,6 +97,7 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor )
// Delete objects // Delete objects
DeleteObject( HBitmap );*/ DeleteObject( HBitmap );*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y, GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_bitmap.h: GTK2 implementation of the Bitmap class * gtk2_bitmap.h: GTK2 implementation of the Bitmap class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_bitmap.h,v 1.1 2003/04/12 21:43:27 asmax Exp $ * $Id: gtk2_bitmap.h,v 1.2 2003/04/13 20:07:34 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define VLC_GTK2_BITMAP #define VLC_GTK2_BITMAP
//--- GTK2 ----------------------------------------------------------------- //--- GTK2 -----------------------------------------------------------------
//#include <windows.h> #include <gdk/gdk.h>
//--- GENERAL --------------------------------------------------------------- //--- GENERAL ---------------------------------------------------------------
#include <string> #include <string>
...@@ -42,7 +42,7 @@ class Graphics; ...@@ -42,7 +42,7 @@ class Graphics;
class GTK2Bitmap : public Bitmap class GTK2Bitmap : public Bitmap
{ {
private: private:
// HDC bmpDC; GdkBitmap *bmpDC;
public: public:
// Constructors // Constructors
...@@ -61,7 +61,7 @@ class GTK2Bitmap : public Bitmap ...@@ -61,7 +61,7 @@ class GTK2Bitmap : public Bitmap
virtual int GetBmpPixel( int x, int y ); virtual int GetBmpPixel( int x, int y );
virtual void SetBmpPixel( int x, int y, int color ); virtual void SetBmpPixel( int x, int y, int color );
// HDC GetBmpDC() { return bmpDC; } GdkBitmap *GetBmpDC() { return bmpDC; }
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_graphics.cpp: GTK2 implementation of the Graphics and Region classes * gtk2_graphics.cpp: GTK2 implementation of the Graphics and Region classes
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_graphics.cpp,v 1.4 2003/04/13 19:09:59 asmax Exp $ * $Id: gtk2_graphics.cpp,v 1.5 2003/04/13 20:07:34 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "os_window.h" #include "os_window.h"
#include "gtk2_graphics.h" #include "gtk2_graphics.h"
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GTK2 GRAPHICS // GTK2 GRAPHICS
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -54,8 +53,8 @@ GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h ) ...@@ -54,8 +53,8 @@ GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h )
SelectObject( Image, HImage ); SelectObject( Image, HImage );
DeleteObject( HImage );*/ DeleteObject( HImage );*/
/* Image = ( GdkDrawable* )( (GTK2Window *)from )->GetHandle(); Image = ( GdkDrawable* )( (GTK2Window *)from )->GetHandle();
Gc = gdk_gc_new( Image );*/ Gc = gdk_gc_new( Image );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Graphics::~GTK2Graphics() GTK2Graphics::~GTK2Graphics()
...@@ -80,7 +79,7 @@ void GTK2Graphics::CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src, ...@@ -80,7 +79,7 @@ void GTK2Graphics::CopyFrom( int dx, int dy, int dw, int dh, Graphics *Src,
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Graphics::DrawRect( int x, int y, int w, int h, int color ) void GTK2Graphics::DrawRect( int x, int y, int w, int h, int color )
{ {
// gdk_draw_rectangle( Image, Gc, TRUE, x, y, w, h); gdk_draw_rectangle( Image, Gc, TRUE, x, y, w, h);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Graphics::SetClipRegion( Region *rgn ) void GTK2Graphics::SetClipRegion( Region *rgn )
...@@ -97,12 +96,17 @@ void GTK2Graphics::SetClipRegion( Region *rgn ) ...@@ -97,12 +96,17 @@ void GTK2Graphics::SetClipRegion( Region *rgn )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Region::GTK2Region() GTK2Region::GTK2Region()
{ {
/* Rgn = CreateRectRgn( 0, 0, 0, 0 );*/ Rgn = gdk_region_new();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Region::GTK2Region( int x, int y, int w, int h ) GTK2Region::GTK2Region( int x, int y, int w, int h )
{ {
/* Rgn = CreateRectRgn( x, y, x + w, y + h );*/ GdkRectangle rect;
rect.x = x;
rect.y = y;
rect.width = w;
rect.height = h;
Rgn = gdk_region_rectangle( &rect );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
GTK2Region::~GTK2Region() GTK2Region::~GTK2Region()
...@@ -117,10 +121,13 @@ void GTK2Region::AddPoint( int x, int y ) ...@@ -117,10 +121,13 @@ void GTK2Region::AddPoint( int x, int y )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Region::AddRectangle( int x, int y, int w, int h ) void GTK2Region::AddRectangle( int x, int y, int w, int h )
{ {
/* HRGN Buffer; GdkRectangle rect;
Buffer = CreateRectRgn( x, y, x + w, y + h ); rect.x = x;
CombineRgn( Rgn, Buffer, Rgn, 0x2 ); rect.y = y;
DeleteObject( Buffer );*/ rect.width = w;
rect.height = h;
GdkRegion *Buffer = gdk_region_rectangle( &rect );
gdk_region_union( Rgn, Buffer );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Region::AddElipse( int x, int y, int w, int h ) void GTK2Region::AddElipse( int x, int y, int w, int h )
...@@ -129,6 +136,7 @@ void GTK2Region::AddElipse( int x, int y, int w, int h ) ...@@ -129,6 +136,7 @@ void GTK2Region::AddElipse( int x, int y, int w, int h )
Buffer = CreateEllipticRgn( x, y, x + w, y + h ); Buffer = CreateEllipticRgn( x, y, x + w, y + h );
CombineRgn( Rgn, Buffer, Rgn, 0x2 ); CombineRgn( Rgn, Buffer, Rgn, 0x2 );
DeleteObject( Buffer );*/ DeleteObject( Buffer );*/
/*FIXME*/
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Region::Move( int x, int y ) void GTK2Region::Move( int x, int y )
...@@ -138,7 +146,7 @@ void GTK2Region::Move( int x, int y ) ...@@ -138,7 +146,7 @@ void GTK2Region::Move( int x, int y )
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
bool GTK2Region::Hit( int x, int y ) bool GTK2Region::Hit( int x, int y )
{ {
/* return PtInRegion( Rgn, x, y );*/ return gdk_region_point_in( Rgn, x, y );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk2_theme.cpp: GTK2 implementation of the Theme class * gtk2_theme.cpp: GTK2 implementation of the Theme class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: gtk2_theme.cpp,v 1.3 2003/04/13 19:09:59 asmax Exp $ * $Id: gtk2_theme.cpp,v 1.4 2003/04/13 20:07:34 asmax Exp $
* *
* Authors: Cyril Deguet <asmax@videolan.org> * Authors: Cyril Deguet <asmax@videolan.org>
* *
...@@ -263,15 +263,20 @@ void GTK2Theme::OnLoadTheme() ...@@ -263,15 +263,20 @@ void GTK2Theme::OnLoadTheme()
GdkWindowAttr attr; GdkWindowAttr attr;
attr.title = "VLC Media Player"; attr.title = "VLC Media Player";
attr.event_mask = GDK_ALL_EVENTS_MASK; attr.event_mask = GDK_ALL_EVENTS_MASK;
attr.width = 100; attr.x = 100;
attr.height = 100; attr.y = 100;
attr.window_type = GDK_WINDOW_TOPLEVEL;
attr.width = 400;
attr.height = 200;
attr.window_type = GDK_WINDOW_TOPLEVEL; attr.window_type = GDK_WINDOW_TOPLEVEL;
attr.wclass = GDK_INPUT_OUTPUT; attr.wclass = GDK_INPUT_OUTPUT;
attr.override_redirect = FALSE;
gint mask = GDK_WA_TITLE; gint mask = GDK_WA_TITLE|GDK_WA_X|GDK_WA_Y|GDK_WA_NOREDIR;
// Create the parent window // Create the parent window
ParentWindow = gdk_window_new( NULL, &attr, mask); ParentWindow = gdk_window_new( NULL, &attr, mask);
gdk_window_show( ParentWindow );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void GTK2Theme::AddSystemMenu( string name, Event *event ) void GTK2Theme::AddSystemMenu( string name, Event *event )
...@@ -316,25 +321,23 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible, ...@@ -316,25 +321,23 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible,
attr.event_mask = GDK_ALL_EVENTS_MASK; attr.event_mask = GDK_ALL_EVENTS_MASK;
attr.width = 100; attr.width = 100;
attr.height = 100; attr.height = 100;
//attr.window_type = GDK_WINDOW_CHILD; attr.window_type = GDK_WINDOW_CHILD;
attr.window_type = GDK_WINDOW_TOPLEVEL;
attr.wclass = GDK_INPUT_OUTPUT; attr.wclass = GDK_INPUT_OUTPUT;
gint mask =0; gint mask =0;
// Create the parent window // Create the parent window
// GdkWindow *gwnd = gdk_window_new( ParentWindow, &attr, mask); GdkWindow *gwnd = gdk_window_new( ParentWindow, &attr, mask);
GdkWindow *gwnd = gdk_window_new( NULL, &attr, mask);
if( !gwnd ) if( !gwnd )
{ {
msg_Err( p_intf, "CreateWindow failed" ); msg_Err( p_intf, "CreateWindow failed" );
return; return;
} }
gdk_window_show( gwnd );
WindowList.push_back( (Window *)new OSWindow( p_intf, gwnd, x, y, visible, WindowList.push_back( (Window *)new OSWindow( p_intf, gwnd, x, y, visible,
fadetime, alpha, movealpha, dragdrop ) ) ; fadetime, alpha, movealpha, dragdrop ) ) ;
gdk_window_show( ParentWindow );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* os_graphics.h: Wrapper for the Graphics and Region classes * os_graphics.h: Wrapper for the Graphics and Region classes
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: os_graphics.h,v 1.2 2003/04/12 21:43:27 asmax Exp $ * $Id: os_graphics.h,v 1.3 2003/04/13 20:07:34 asmax Exp $
* *
* Authors: Olivier Teulière <ipkiss@via.ecp.fr> * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
#define OSRegion Win32Region #define OSRegion Win32Region
#else #else
#include "gtk2_graphics.h" #include "gtk2_graphics.h"
#define SRC_COPY SRCCOPY #define SRC_COPY 1
#define SRC_AND SRCAND #define SRC_AND 2
#define OSGraphics GTK2Graphics #define OSGraphics GTK2Graphics
#define OSRegion GTK2Region #define OSRegion GTK2Region
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* window.cpp: Window class * window.cpp: Window class
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: window.cpp,v 1.6 2003/04/13 17:46:23 asmax Exp $ * $Id: window.cpp,v 1.7 2003/04/13 20:07:34 asmax Exp $
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr> * Emmanuel Puig <karibu@via.ecp.fr>
...@@ -278,12 +278,7 @@ void Window::RefreshImage( int x, int y, int w, int h ) ...@@ -278,12 +278,7 @@ void Window::RefreshImage( int x, int y, int w, int h )
ControlList[i]->Draw( x, y, w, h, Buffer ); ControlList[i]->Draw( x, y, w, h, Buffer );
// Copy buffer in Image // Copy buffer in Image
/* FIXME: kludge */
#ifdef WIN32
Image->CopyFrom( x, y, w, h, Buffer, 0, 0, SRC_COPY ); Image->CopyFrom( x, y, w, h, Buffer, 0, 0, SRC_COPY );
#else
fprintf(stderr, "%X WARNING: FIXME in window.cpp !!!!", Buffer);
#endif
// Free memory // Free memory
delete Buffer; delete Buffer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment