Changeset ef59c8fc56b348a2e10cc795d5f616b06da258fd
- Timestamp:
- 04/30/03 23:16:24
(5 years ago)
- Author:
- Cyril Deguet <asmax@videolan.org>
- git-committer:
- Cyril Deguet <asmax@videolan.org> 1051737384 +0000
- git-parent:
[c7b39fc63ac10a4712a0c9308da0274019b8763f]
- git-author:
- Cyril Deguet <asmax@videolan.org> 1051737384 +0000
- Message:
* enable basic-skins for GTK2 (not tested yet ;)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5023130 |
ref59c8f |
|
| 7 | 7 | GTK2 gtk2 |
|---|
| 8 | 8 | SKINS skins |
|---|
| | 9 | BASIC_SKINS basic-skins |
|---|
| 9 | 10 | FAMILIAR familiar |
|---|
| 10 | 11 | WXWINDOWS wxwindows |
|---|
| r50000c8 |
ref59c8f |
|
| 17 | 17 | dep_bool ' Gnome2 support' CONFIG_GNOME2 $CONFIG_GTK2 |
|---|
| 18 | 18 | bool 'Skins module' CONFIG_SKINS |
|---|
| | 19 | bool 'Basic skins module (without wxWindows)' CONFIG_BASIC_SKINS |
|---|
| 19 | 20 | bool 'Familiar GTK+ support' CONFIG_FAMILIAR |
|---|
| 20 | 21 | bool 'wxWindows support' CONFIG_WXWINDOWS |
|---|
| rf38481f |
ref59c8f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_run.cpp,v 1.21 2003/04/28 12:00:13 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_run.cpp,v 1.22 2003/04/30 21:16:24 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 31 | 31 | |
|---|
| 32 | 32 | //--- WWWINDOWS ------------------------------------------------------------- |
|---|
| | 33 | #ifndef BASIC_SKINS |
|---|
| 33 | 34 | #include <wx/wx.h> |
|---|
| | 35 | #endif |
|---|
| 34 | 36 | |
|---|
| 35 | 37 | //--- VLC ------------------------------------------------------------------- |
|---|
| … | … | |
| 47 | 49 | #include "../src/skin_common.h" |
|---|
| 48 | 50 | #include "../src/vlcproc.h" |
|---|
| | 51 | #ifndef BASIC_SKINS |
|---|
| 49 | 52 | #include "../src/wxdialogs.h" |
|---|
| | 53 | #endif |
|---|
| 50 | 54 | |
|---|
| 51 | 55 | // include the icon graphic |
|---|
| … | … | |
| 70 | 74 | // Local classes declarations. |
|---|
| 71 | 75 | //--------------------------------------------------------------------------- |
|---|
| | 76 | #ifndef BASIC_SKINS |
|---|
| 72 | 77 | class Instance: public wxApp |
|---|
| 73 | 78 | { |
|---|
| … | … | |
| 83 | 88 | CallBackObjects *callbackobj; |
|---|
| 84 | 89 | }; |
|---|
| | 90 | #endif |
|---|
| 85 | 91 | |
|---|
| 86 | 92 | |
|---|
| … | … | |
| 192 | 198 | proc->IsClosing(); |
|---|
| 193 | 199 | |
|---|
| | 200 | #ifndef BASIC_SKINS |
|---|
| 194 | 201 | gtk_main_do_event( event ); |
|---|
| | 202 | #endif |
|---|
| 195 | 203 | |
|---|
| 196 | 204 | } |
|---|
| … | … | |
| 212 | 220 | // Implementation of Instance class |
|---|
| 213 | 221 | //--------------------------------------------------------------------------- |
|---|
| | 222 | #ifndef BASIC_SKINS |
|---|
| 214 | 223 | Instance::Instance( ) |
|---|
| 215 | 224 | { |
|---|
| … | … | |
| 242 | 251 | return TRUE; |
|---|
| 243 | 252 | } |
|---|
| 244 | | |
|---|
| | 253 | #endif |
|---|
| 245 | 254 | |
|---|
| 246 | 255 | |
|---|
| … | … | |
| 256 | 265 | callbackobj->Proc = new VlcProc( p_intf ); |
|---|
| 257 | 266 | |
|---|
| | 267 | #ifndef BASIC_SKINS |
|---|
| 258 | 268 | wxTheApp = new Instance( p_intf, callbackobj ); |
|---|
| 259 | | |
|---|
| 260 | 269 | wxEntry( 1, p_args ); |
|---|
| 261 | | |
|---|
| | 270 | #else |
|---|
| | 271 | gdk_event_handler_set( GTK2Proc, (gpointer)callbackobj, NULL ); |
|---|
| | 272 | // Add timer |
|---|
| | 273 | g_timeout_add( 200, (GSourceFunc)RefreshTimer, (gpointer)p_intf ); |
|---|
| | 274 | #endif |
|---|
| | 275 | |
|---|
| 262 | 276 | delete callbackobj; |
|---|
| 263 | 277 | } |
|---|
| rf38481f |
ref59c8f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: window.cpp,v 1.21 2003/04/28 12:00:14 asmax Exp $ |
|---|
| | 5 | * $Id: window.cpp,v 1.22 2003/04/30 21:16:24 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> |
|---|
| … | … | |
| 291 | 291 | |
|---|
| 292 | 292 | // Create Bitmap Buffer |
|---|
| | 293 | // Graphics *Buffer = (Graphics *)new OSGraphics( p_intf, w, h, this ); |
|---|
| 293 | 294 | Graphics *Buffer = (Graphics *)new OSGraphics( w, h, this ); |
|---|
| 294 | 295 | |
|---|
| … | … | |
| 491 | 492 | if( Image != NULL ) |
|---|
| 492 | 493 | delete (OSGraphics *)Image; |
|---|
| | 494 | // Image = (Graphics *)new OSGraphics( p_intf, w, h, this ); |
|---|
| 493 | 495 | Image = (Graphics *)new OSGraphics( w, h, this ); |
|---|
| 494 | | |
|---|
| 495 | 496 | |
|---|
| 496 | 497 | Size( w, h ); |
|---|
| r2396f46 |
ref59c8f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: x11_bitmap.cpp,v 1.1 2003/04/28 14:32:57 asmax Exp $ |
|---|
| | 5 | * $Id: x11_bitmap.cpp,v 1.2 2003/04/30 21:16:24 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 147 | 147 | if( Bmp ) |
|---|
| 148 | 148 | { |
|---|
| 149 | | /* GdkDrawable *destImg = ( (X11Graphics *)dest )->GetImage(); |
|---|
| 150 | | GdkGC *destGC = ( (X11Graphics *)dest )->GetGC(); |
|---|
| | 149 | Drawable destImg = ( (X11Graphics *)dest )->GetImage(); |
|---|
| | 150 | GC destGC = ( (X11Graphics *)dest )->GetGC(); |
|---|
| 151 | 151 | |
|---|
| 152 | | gdk_pixbuf_render_to_drawable( Bmp, destImg, destGC, x, y, xRef, yRef, |
|---|
| 153 | | w, h, GDK_RGB_DITHER_NORMAL, 0, 0);*/ |
|---|
| | 152 | XCopyArea( display, Bmp, destImg, destGC, x, y, w, h, xRef, yRef ); |
|---|
| 154 | 153 | } |
|---|
| 155 | 154 | } |
|---|
| r2396f46 |
ref59c8f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: x11_graphics.cpp,v 1.1 2003/04/28 14:32:57 asmax Exp $ |
|---|
| | 5 | * $Id: x11_graphics.cpp,v 1.2 2003/04/30 21:16:24 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 29 | 29 | #include <X11/Xlib.h> |
|---|
| 30 | 30 | |
|---|
| | 31 | //--- VLC ----------------------------------------------------------------- |
|---|
| | 32 | #include <vlc/intf.h> |
|---|
| | 33 | |
|---|
| 31 | 34 | //--- SKIN ------------------------------------------------------------------ |
|---|
| 32 | 35 | #include "../src/graphics.h" |
|---|
| … | … | |
| 34 | 37 | #include "../os_window.h" |
|---|
| 35 | 38 | #include "x11_graphics.h" |
|---|
| | 39 | #include "../src/skin_common.h" |
|---|
| 36 | 40 | |
|---|
| 37 | 41 | #include <stdio.h> |
|---|
| … | … | |
| 41 | 45 | // X11 GRAPHICS |
|---|
| 42 | 46 | //--------------------------------------------------------------------------- |
|---|
| 43 | | X11Graphics::X11Graphics( int w, int h, SkinWindow *from ) : Graphics( w, h ) |
|---|
| | 47 | X11Graphics::X11Graphics( intf_thread_t *p_intf, int w, int h, |
|---|
| | 48 | SkinWindow *from ) : Graphics( w, h ) |
|---|
| 44 | 49 | { |
|---|
| 45 | | /* if( from != NULL ) |
|---|
| | 50 | display = p_intf->p_sys->display; |
|---|
| | 51 | int screen = DefaultScreen( display ); |
|---|
| | 52 | |
|---|
| | 53 | if( from != NULL ) |
|---|
| 46 | 54 | { |
|---|
| 47 | | GdkWindow *fromWnd = ( (X11Window *)from )->GetHandle(); |
|---|
| 48 | | Image = (GdkDrawable*) gdk_pixmap_new( fromWnd, w, h, -1 ); |
|---|
| 49 | | Gc = gdk_gc_new( ( GdkDrawable* )fromWnd ); |
|---|
| | 55 | Window fromWnd = ( (X11Window *)from )->GetHandle(); |
|---|
| | 56 | |
|---|
| | 57 | XWindowAttributes attr; |
|---|
| | 58 | XGetWindowAttributes( display, fromWnd, &attr); |
|---|
| | 59 | |
|---|
| | 60 | Image = XCreatePixmap( display, fromWnd, w, h, attr.depth ); |
|---|
| | 61 | Gc = DefaultGC( display, screen ); |
|---|
| 50 | 62 | } |
|---|
| 51 | 63 | else |
|---|
| 52 | 64 | { |
|---|
| 53 | | // FIXME: 8 -> screen depth |
|---|
| 54 | | Image = (GdkDrawable*) gdk_pixmap_new( NULL, w, h, 16 ); |
|---|
| 55 | | gdk_drawable_set_colormap( Image, gdk_colormap_get_system() ); |
|---|
| 56 | | Gc = gdk_gc_new( Image ); |
|---|
| 57 | | } |
|---|
| | 65 | Window root = DefaultRootWindow( display ); |
|---|
| | 66 | Image = XCreatePixmap( display, root, w, h, |
|---|
| | 67 | DefaultDepth( display, screen ) ); |
|---|
| | 68 | Gc = DefaultGC( display, screen ); |
|---|
| | 69 | } |
|---|
| 58 | 70 | |
|---|
| 59 | 71 | // Set the background color to black |
|---|
| 60 | | gdk_draw_rectangle( Image, Gc, TRUE, 0, 0, w, h );*/ |
|---|
| | 72 | // gdk_draw_rectangle( Image, Gc, TRUE, 0, 0, w, h ); |
|---|
| 61 | 73 | } |
|---|
| 62 | 74 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 70 | 82 | int sx, int sy, int Flag ) |
|---|
| 71 | 83 | { |
|---|
| 72 | | /* gdk_draw_drawable( Image, Gc, (( X11Graphics* )Src )->GetImage(), |
|---|
| 73 | | sx, sy, dx, dy, dw, dh );*/ |
|---|
| | 84 | XCopyArea( display, (( X11Graphics* )Src )->GetImage(), Image, Gc, |
|---|
| | 85 | sx, sy, dw, dh, dx, dy ); |
|---|
| 74 | 86 | } |
|---|
| 75 | 87 | //--------------------------------------------------------------------------- |
|---|
| r2396f46 |
ref59c8f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: x11_graphics.h,v 1.1 2003/04/28 14:32:57 asmax Exp $ |
|---|
| | 5 | * $Id: x11_graphics.h,v 1.2 2003/04/30 21:16:24 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@via.ecp.fr> |
|---|
| … | … | |
| 41 | 41 | { |
|---|
| 42 | 42 | protected: |
|---|
| 43 | | /* Drawable *Image; |
|---|
| 44 | | GdkGC *Gc;*/ |
|---|
| | 43 | Display *display; |
|---|
| | 44 | Drawable Image; |
|---|
| | 45 | GC Gc; |
|---|
| 45 | 46 | |
|---|
| 46 | 47 | public: |
|---|
| 47 | 48 | // Constructor |
|---|
| 48 | | X11Graphics( int w, int h, SkinWindow *from = NULL ); |
|---|
| | 49 | X11Graphics( intf_thread_t *p_intf, int w, int h, SkinWindow *from = NULL ); |
|---|
| 49 | 50 | // Destructor |
|---|
| 50 | 51 | virtual ~X11Graphics(); |
|---|
| … | … | |
| 61 | 62 | |
|---|
| 62 | 63 | // Specific X11 methods |
|---|
| 63 | | /* GdkDrawable *GetImage() { return Image; }; |
|---|
| 64 | | GdkGC *GetGC() { return Gc; };*/ |
|---|
| | 64 | Drawable GetImage() { return Image; }; |
|---|
| | 65 | GC GetGC() { return Gc; }; |
|---|
| 65 | 66 | }; |
|---|
| 66 | 67 | //--------------------------------------------------------------------------- |
|---|