Commit 36449bd0 authored by Cyril Deguet's avatar Cyril Deguet

* at last an image !!

parent e8f95f34
......@@ -2,7 +2,7 @@
* image.cpp: Image control
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: image.cpp,v 1.2 2003/04/11 21:19:49 videolan Exp $
* $Id: image.cpp,v 1.3 2003/04/13 22:55:15 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -84,7 +84,7 @@ void ControlImage::Draw( int x, int y, int w, int h, Graphics *dest )
{
if( !Visible )
return;
int xI, yI, wI, hI;
if( GetIntersectRgn(x, y, w, h, Left, Top, Width, Height, xI, yI, wI, hI ) )
Img[0]->DrawBitmap( xI-Left, yI-Top, wI, hI, xI-x, yI-y, dest );
......
......@@ -2,7 +2,7 @@
* gtk2_bitmap.cpp: GTK2 implementation of the Bitmap class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_bitmap.cpp,v 1.3 2003/04/13 20:07:34 asmax Exp $
* $Id: gtk2_bitmap.cpp,v 1.4 2003/04/13 22:55:15 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -25,6 +25,7 @@
#if !defined WIN32
//--- GTK2 -----------------------------------------------------------------
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
//--- VLC -------------------------------------------------------------------
......@@ -98,6 +99,16 @@ GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, string FileName, int AColor )
// Delete objects
DeleteObject( HBitmap );*/
// Load the bitmap image
Bmp = gdk_pixbuf_new_from_file( FileName.c_str(), NULL );
if( Bmp == NULL )
{
if( FileName != "" )
msg_Warn( p_intf, "Couldn't load bitmap: %s", FileName.c_str() );
// Bmp = gdk_pixbuf_new( GDK_COLORSPACE_RGB, TRUE, 8, 1, 1);
Bmp = NULL;
}
}
//---------------------------------------------------------------------------
GTK2Bitmap::GTK2Bitmap( intf_thread_t *p_intf, Graphics *from, int x, int y,
......@@ -149,6 +160,13 @@ void GTK2Bitmap::DrawBitmap( int x, int y, int w, int h, int xRef, int yRef,
// New method, not available in win95
TransparentBlt( destDC, xRef, yRef, w, h, bmpDC, x, y, w, h, AlphaColor );
*/
GdkDrawable *destImg = ( (GTK2Graphics *)dest )->GetImageHandle();
GdkGC *gc = gdk_gc_new( destImg );
/*gdk_pixbuf_render_to_drawable( Bmp, destImg, gc, 0, 0, x, y, w, h,
GDK_RGB_DITHER_NONE, 0, 0);*/
gdk_pixbuf_render_to_drawable( Bmp, destImg, gc, 0, 0, x, y, 50, 50,
GDK_RGB_DITHER_NONE, 0, 0);
}
//---------------------------------------------------------------------------
bool GTK2Bitmap::Hit( int x, int y)
......
......@@ -2,7 +2,7 @@
* gtk2_bitmap.h: GTK2 implementation of the Bitmap class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_bitmap.h,v 1.2 2003/04/13 20:07:34 asmax Exp $
* $Id: gtk2_bitmap.h,v 1.3 2003/04/13 22:55:15 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -42,7 +42,7 @@ class Graphics;
class GTK2Bitmap : public Bitmap
{
private:
GdkBitmap *bmpDC;
GdkPixbuf *Bmp;
public:
// Constructors
......@@ -60,8 +60,6 @@ class GTK2Bitmap : public Bitmap
virtual int GetBmpPixel( int x, int y );
virtual void SetBmpPixel( int x, int y, int color );
GdkBitmap *GetBmpDC() { return bmpDC; }
};
//---------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
* gtk2_theme.cpp: GTK2 implementation of the Theme class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_theme.cpp,v 1.4 2003/04/13 20:07:34 asmax Exp $
* $Id: gtk2_theme.cpp,v 1.5 2003/04/13 22:55:15 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -26,6 +26,7 @@
//--- GTK2 -----------------------------------------------------------------
#include <gdk/gdk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
//--- VLC -------------------------------------------------------------------
#include <vlc/intf.h>
......@@ -265,9 +266,8 @@ void GTK2Theme::OnLoadTheme()
attr.event_mask = GDK_ALL_EVENTS_MASK;
attr.x = 100;
attr.y = 100;
attr.window_type = GDK_WINDOW_TOPLEVEL;
attr.width = 400;
attr.height = 200;
attr.height = 150;
attr.window_type = GDK_WINDOW_TOPLEVEL;
attr.wclass = GDK_INPUT_OUTPUT;
attr.override_redirect = FALSE;
......@@ -276,6 +276,7 @@ void GTK2Theme::OnLoadTheme()
// Create the parent window
ParentWindow = gdk_window_new( NULL, &attr, mask);
gdk_window_show( ParentWindow );
}
//---------------------------------------------------------------------------
......@@ -319,8 +320,8 @@ void GTK2Theme::AddWindow( string name, int x, int y, bool visible,
GdkWindowAttr attr;
attr.event_mask = GDK_ALL_EVENTS_MASK;
attr.width = 100;
attr.height = 100;
attr.width = 400;
attr.height = 150;
attr.window_type = GDK_WINDOW_CHILD;
attr.wclass = GDK_INPUT_OUTPUT;
......
......@@ -2,7 +2,7 @@
* gtk2_window.cpp: GTK2 implementation of the Window class
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_window.cpp,v 1.4 2003/04/13 19:09:59 asmax Exp $
* $Id: gtk2_window.cpp,v 1.5 2003/04/13 22:55:15 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -142,14 +142,14 @@ GTK2Window::~GTK2Window()
//---------------------------------------------------------------------------
void GTK2Window::OSShow( bool show )
{
/* if( show )
if( show )
{
gdk_window_show( gWnd );
}
else
{
gdk_window_hide( gWnd );
}*/
}
}
//---------------------------------------------------------------------------
bool GTK2Window::ProcessOSEvent( Event *evt )
......@@ -271,9 +271,9 @@ void GTK2Window::Move( int left, int top )
//---------------------------------------------------------------------------
void GTK2Window::Size( int width, int height )
{
/* Width = width;
Width = width;
Height = height;
SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height,
/* SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height,
SWP_NOMOVE|SWP_NOREDRAW|SWP_NOZORDER );*/
}
//---------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: skin_main.cpp,v 1.7 2003/04/13 17:46:23 asmax Exp $
* $Id: skin_main.cpp,v 1.8 2003/04/13 22:55:15 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -175,7 +175,7 @@ static void Run( intf_thread_t *p_intf )
DIRECTORY_SEPARATOR + "theme.xml";
#else
// FIXME: find VLC directory
string default_dir = (string)"/home/cyril/videolan/vlc/share" +
string default_dir = (string)"." +
DIRECTORY_SEPARATOR + "skins" +
DIRECTORY_SEPARATOR + "default" +
DIRECTORY_SEPARATOR + "theme.xml";
......
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