Changeset eb3609cdde05a5208ed9be0b84280fcd0234ae61
- Timestamp:
- 04/13/03 00:50:42
(5 years ago)
- Author:
- Cyril Deguet <asmax@videolan.org>
- git-committer:
- Cyril Deguet <asmax@videolan.org> 1050187842 +0000
- git-parent:
[f3bcd927cd924fc64418b5dbf5cce31f8b483553]
- git-author:
- Cyril Deguet <asmax@videolan.org> 1050187842 +0000
- Message:
* now the skin module compiles AND links !
(and segfaults... ;)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| ra64501f |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: text.cpp,v 1.1 2003/03/18 02:21:47 ipkiss Exp $ |
|---|
| | 5 | * $Id: text.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> |
|---|
| … | … | |
| 49 | 49 | //--------------------------------------------------------------------------- |
|---|
| 50 | 50 | |
|---|
| | 51 | #if defined( WIN32 ) |
|---|
| 51 | 52 | //----------------------------------------------------------------------- |
|---|
| 52 | 53 | // Win32 methods |
|---|
| 53 | 54 | //----------------------------------------------------------------------- |
|---|
| 54 | | #if defined( WIN32 ) |
|---|
| 55 | 55 | void CALLBACK ScrollingTextTimer( HWND hwnd, UINT uMsg, UINT_PTR idEvent, |
|---|
| 56 | 56 | DWORD dwTime ) |
|---|
| … | … | |
| 74 | 74 | KillTimer( ( (Win32Window *)ParentWindow )->GetHandle(), |
|---|
| 75 | 75 | (UINT_PTR)this ); |
|---|
| | 76 | } |
|---|
| | 77 | //----------------------------------------------------------------------- |
|---|
| | 78 | |
|---|
| | 79 | #else |
|---|
| | 80 | //----------------------------------------------------------------------- |
|---|
| | 81 | // Gtk2 methods |
|---|
| | 82 | //----------------------------------------------------------------------- |
|---|
| | 83 | void ControlText::StartScrolling() |
|---|
| | 84 | { |
|---|
| | 85 | /* FIXME: kluge */ |
|---|
| | 86 | /* SetTimer( ( (Win32Window *)ParentWindow )->GetHandle(), (UINT_PTR)this, |
|---|
| | 87 | 100, (TIMERPROC)ScrollingTextTimer );*/ |
|---|
| | 88 | } |
|---|
| | 89 | //----------------------------------------------------------------------- |
|---|
| | 90 | void ControlText::StopScrolling() |
|---|
| | 91 | { |
|---|
| | 92 | /* KillTimer( ( (Win32Window *)ParentWindow )->GetHandle(), |
|---|
| | 93 | (UINT_PTR)this );*/ |
|---|
| 76 | 94 | } |
|---|
| 77 | 95 | //----------------------------------------------------------------------- |
|---|
| rf3bcd92 |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_api.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_api.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 33 | 33 | #include "event.h" // for MAX_PARAM_SIZE |
|---|
| 34 | 34 | |
|---|
| 35 | | /* |
|---|
| 36 | 35 | |
|---|
| 37 | 36 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 41 | 40 | long param2 ) |
|---|
| 42 | 41 | { |
|---|
| 43 | | if( win == NULL ) |
|---|
| | 42 | /* if( win == NULL ) |
|---|
| 44 | 43 | SendMessage( NULL, message, param1, param2 ); |
|---|
| 45 | 44 | else |
|---|
| 46 | 45 | SendMessage( ( (Win32Window *)win )->GetHandle(), message, param1, |
|---|
| 47 | | param2 ); |
|---|
| | 46 | param2 );*/ |
|---|
| 48 | 47 | } |
|---|
| 49 | 48 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 51 | 50 | long param2 ) |
|---|
| 52 | 51 | { |
|---|
| 53 | | if( win == NULL ) |
|---|
| | 52 | /* if( win == NULL ) |
|---|
| 54 | 53 | PostMessage( NULL, message, param1, param2 ); |
|---|
| 55 | 54 | else |
|---|
| 56 | 55 | PostMessage( ( (Win32Window *)win )->GetHandle(), message, param1, |
|---|
| 57 | | param2 ); |
|---|
| | 56 | param2 );*/ |
|---|
| 58 | 57 | } |
|---|
| 59 | 58 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 67 | 66 | int OSAPI_GetNonTransparentColor( int c ) |
|---|
| 68 | 67 | { |
|---|
| 69 | | // Get desktop device context |
|---|
| | 68 | /* // Get desktop device context |
|---|
| 70 | 69 | HDC DeskDC = GetWindowDC( GetDesktopWindow() ); |
|---|
| 71 | 70 | |
|---|
| … | … | |
| 79 | 78 | } |
|---|
| 80 | 79 | ReleaseDC( GetDesktopWindow(), DeskDC ); |
|---|
| 81 | | return c; |
|---|
| | 80 | return c;*/ |
|---|
| 82 | 81 | } |
|---|
| 83 | 82 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 91 | 90 | int OSAPI_GetTime() |
|---|
| 92 | 91 | { |
|---|
| 93 | | return GetTickCount(); |
|---|
| | 92 | /* return GetTickCount();*/ |
|---|
| 94 | 93 | } |
|---|
| 95 | 94 | //--------------------------------------------------------------------------- |
|---|
| 96 | 95 | void OSAPI_GetScreenSize( int &w, int &h ) |
|---|
| 97 | 96 | { |
|---|
| 98 | | w = GetSystemMetrics(SM_CXSCREEN); |
|---|
| 99 | | h = GetSystemMetrics(SM_CYSCREEN); |
|---|
| | 97 | /* w = GetSystemMetrics(SM_CXSCREEN); |
|---|
| | 98 | h = GetSystemMetrics(SM_CYSCREEN);*/ |
|---|
| 100 | 99 | } |
|---|
| 101 | 100 | //--------------------------------------------------------------------------- |
|---|
| 102 | 101 | void OSAPI_GetMousePos( int &x, int &y ) |
|---|
| 103 | 102 | { |
|---|
| 104 | | LPPOINT MousePos = new POINT; |
|---|
| | 103 | /* LPPOINT MousePos = new POINT; |
|---|
| 105 | 104 | GetCursorPos( MousePos ); |
|---|
| 106 | 105 | x = MousePos->x; |
|---|
| 107 | 106 | y = MousePos->y; |
|---|
| 108 | | delete MousePos; |
|---|
| | 107 | delete MousePos;*/ |
|---|
| 109 | 108 | } |
|---|
| 110 | 109 | //--------------------------------------------------------------------------- |
|---|
| 111 | 110 | string OSAPI_GetWindowTitle( Window *win ) |
|---|
| 112 | 111 | { |
|---|
| 113 | | char *buffer = new char[MAX_PARAM_SIZE]; |
|---|
| | 112 | /* char *buffer = new char[MAX_PARAM_SIZE]; |
|---|
| 114 | 113 | GetWindowText( ((Win32Window *)win)->GetHandle(), buffer, MAX_PARAM_SIZE ); |
|---|
| 115 | 114 | string Title = buffer; |
|---|
| 116 | 115 | delete buffer; |
|---|
| 117 | 116 | |
|---|
| 118 | | return Title; |
|---|
| | 117 | return Title;*/ |
|---|
| 119 | 118 | } |
|---|
| 120 | 119 | //--------------------------------------------------------------------------- |
|---|
| 121 | 120 | bool OSAPI_RmDir( string path ) |
|---|
| 122 | 121 | { |
|---|
| 123 | | WIN32_FIND_DATA find; |
|---|
| | 122 | /* WIN32_FIND_DATA find; |
|---|
| 124 | 123 | string File; |
|---|
| 125 | 124 | string FindFiles = path + "\\*.*"; |
|---|
| … | … | |
| 155 | 154 | RemoveDirectory( (char *)path.c_str() ); |
|---|
| 156 | 155 | |
|---|
| 157 | | return true; |
|---|
| | 156 | return true;*/ |
|---|
| 158 | 157 | } |
|---|
| 159 | 158 | //--------------------------------------------------------------------------- |
|---|
| 160 | | */ |
|---|
| | 159 | |
|---|
| rf3bcd92 |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_dialog.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_dialog.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 47 | 47 | #include "os_api.h" |
|---|
| 48 | 48 | |
|---|
| 49 | | /* |
|---|
| | 49 | |
|---|
| 50 | 50 | //--------------------------------------------------------------------------- |
|---|
| 51 | 51 | // Open file dialog box |
|---|
| … | … | |
| 62 | 62 | void GTK2OpenFileDialog::AddFilter( string name, string type ) |
|---|
| 63 | 63 | { |
|---|
| 64 | | unsigned int i; |
|---|
| | 64 | /* unsigned int i; |
|---|
| 65 | 65 | |
|---|
| 66 | 66 | for( i = 0; i < name.length(); i++ ) |
|---|
| … | … | |
| 82 | 82 | |
|---|
| 83 | 83 | // Ending null character if this filter is the last |
|---|
| 84 | | Filter[FilterLength] = '\0'; |
|---|
| | 84 | Filter[FilterLength] = '\0';*/ |
|---|
| 85 | 85 | } |
|---|
| 86 | 86 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 88 | 88 | { |
|---|
| 89 | 89 | // Initailize dialog box |
|---|
| 90 | | OPENFILENAME OpenFile; |
|---|
| | 90 | /* OPENFILENAME OpenFile; |
|---|
| 91 | 91 | memset( &OpenFile, 0, sizeof( OpenFile ) ); |
|---|
| 92 | 92 | OpenFile.lStructSize = sizeof( OPENFILENAME ); |
|---|
| … | … | |
| 181 | 181 | delete[] OpenFile.lpstrFile; |
|---|
| 182 | 182 | |
|---|
| 183 | | return true; |
|---|
| | 183 | return true;*/ |
|---|
| 184 | 184 | } |
|---|
| 185 | 185 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 191 | 191 | // CALLBACKs |
|---|
| 192 | 192 | //--------------------------------------------------------------------------- |
|---|
| 193 | | LRESULT CALLBACK LogWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, |
|---|
| | 193 | /*LRESULT CALLBACK LogWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, |
|---|
| 194 | 194 | LPARAM lParam ) |
|---|
| 195 | 195 | { |
|---|
| … | … | |
| 247 | 247 | delete (string *)dwCookie; |
|---|
| 248 | 248 | return 0; |
|---|
| 249 | | } |
|---|
| | 249 | }*/ |
|---|
| 250 | 250 | //--------------------------------------------------------------------------- |
|---|
| 251 | 251 | |
|---|
| … | … | |
| 257 | 257 | GTK2LogWindow::GTK2LogWindow( intf_thread_t *_p_intf ) : LogWindow( _p_intf ) |
|---|
| 258 | 258 | { |
|---|
| 259 | | hWindow = NULL; |
|---|
| | 259 | /* hWindow = NULL; |
|---|
| 260 | 260 | hRichCtrl = NULL; |
|---|
| 261 | 261 | |
|---|
| … | … | |
| 300 | 300 | RtfHeader = "{\\rtf1 "; |
|---|
| 301 | 301 | |
|---|
| 302 | | Clear(); |
|---|
| | 302 | Clear();*/ |
|---|
| 303 | 303 | } |
|---|
| 304 | 304 | //--------------------------------------------------------------------------- |
|---|
| 305 | 305 | GTK2LogWindow::~GTK2LogWindow() |
|---|
| 306 | 306 | { |
|---|
| 307 | | DestroyWindow( hRichCtrl ); |
|---|
| 308 | | DestroyWindow( hWindow ); |
|---|
| | 307 | /* DestroyWindow( hRichCtrl ); |
|---|
| | 308 | DestroyWindow( hWindow );*/ |
|---|
| 309 | 309 | } |
|---|
| 310 | 310 | //--------------------------------------------------------------------------- |
|---|
| 311 | 311 | void GTK2LogWindow::Clear() |
|---|
| 312 | 312 | { |
|---|
| 313 | | EDITSTREAM *Stream; |
|---|
| | 313 | /* EDITSTREAM *Stream; |
|---|
| 314 | 314 | Stream = new EDITSTREAM; |
|---|
| 315 | 315 | string *buffer = new string( RtfHeader ); |
|---|
| … | … | |
| 317 | 317 | Stream->dwError = 0; |
|---|
| 318 | 318 | Stream->pfnCallback = (EDITSTREAMCALLBACK)LogWindowStream; |
|---|
| 319 | | SendMessage( hRichCtrl, EM_STREAMIN, SF_RTF, (LPARAM)Stream ); |
|---|
| | 319 | SendMessage( hRichCtrl, EM_STREAMIN, SF_RTF, (LPARAM)Stream );*/ |
|---|
| 320 | 320 | } |
|---|
| 321 | 321 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 323 | 323 | { |
|---|
| 324 | 324 | // Initialize stream |
|---|
| 325 | | EDITSTREAM *Stream; |
|---|
| | 325 | /* EDITSTREAM *Stream; |
|---|
| 326 | 326 | string *buffer = new string( RtfHeader + line + "\\par }" ); |
|---|
| 327 | 327 | Stream = new EDITSTREAM; |
|---|
| … | … | |
| 332 | 332 | SendMessage( hRichCtrl, EM_STREAMIN, SF_RTF|SFF_SELECTION, (LPARAM)Stream ); |
|---|
| 333 | 333 | |
|---|
| 334 | | SendMessage( hRichCtrl, WM_VSCROLL, SB_BOTTOM, 0 ); |
|---|
| | 334 | SendMessage( hRichCtrl, WM_VSCROLL, SB_BOTTOM, 0 );*/ |
|---|
| 335 | 335 | } |
|---|
| 336 | 336 | //--------------------------------------------------------------------------- |
|---|
| 337 | 337 | void GTK2LogWindow::ChangeColor( int color, bool bold ) |
|---|
| 338 | 338 | { |
|---|
| 339 | | CHARFORMAT format; |
|---|
| | 339 | /* CHARFORMAT format; |
|---|
| 340 | 340 | memset(&format, 0, sizeof(CHARFORMAT)); |
|---|
| 341 | 341 | format.cbSize = sizeof(CHARFORMAT); |
|---|
| … | … | |
| 343 | 343 | format.dwEffects = bold ? CFE_BOLD : 0; |
|---|
| 344 | 344 | format.crTextColor = color; |
|---|
| 345 | | SendMessage( hRichCtrl, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&format ); |
|---|
| | 345 | SendMessage( hRichCtrl, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&format );*/ |
|---|
| 346 | 346 | } |
|---|
| 347 | 347 | //--------------------------------------------------------------------------- |
|---|
| 348 | 348 | void GTK2LogWindow::Show() |
|---|
| 349 | 349 | { |
|---|
| 350 | | ShowWindow( hWindow, SW_SHOW ); |
|---|
| 351 | | Visible = true; |
|---|
| | 350 | /* ShowWindow( hWindow, SW_SHOW ); |
|---|
| | 351 | Visible = true;*/ |
|---|
| 352 | 352 | } |
|---|
| 353 | 353 | //--------------------------------------------------------------------------- |
|---|
| 354 | 354 | void GTK2LogWindow::Hide() |
|---|
| 355 | 355 | { |
|---|
| 356 | | ShowWindow( hWindow, SW_HIDE ); |
|---|
| 357 | | Visible = false; |
|---|
| 358 | | } |
|---|
| 359 | | //--------------------------------------------------------------------------- |
|---|
| 360 | | */ |
|---|
| | 356 | /* ShowWindow( hWindow, SW_HIDE ); |
|---|
| | 357 | Visible = false;*/ |
|---|
| | 358 | } |
|---|
| | 359 | //--------------------------------------------------------------------------- |
|---|
| | 360 | |
|---|
| rf3bcd92 |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_event.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_event.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 40 | 40 | |
|---|
| 41 | 41 | |
|---|
| 42 | | /* |
|---|
| 43 | 42 | //--------------------------------------------------------------------------- |
|---|
| 44 | 43 | // VLC Event |
|---|
| … | … | |
| 47 | 46 | : Event( p_intf, Desc, shortcut ) |
|---|
| 48 | 47 | { |
|---|
| 49 | | hWnd = NULL; |
|---|
| | 48 | /* hWnd = NULL;*/ |
|---|
| 50 | 49 | } |
|---|
| 51 | 50 | //--------------------------------------------------------------------------- |
|---|
| 52 | | GTK2Event::GTK2Event( intf_thread_t *p_intf, HWND hwnd, unsigned int msg, |
|---|
| | 51 | GTK2Event::GTK2Event( intf_thread_t *p_intf, GdkWindow *gwnd, unsigned int msg, |
|---|
| 53 | 52 | unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 ) |
|---|
| 54 | 53 | { |
|---|
| 55 | | hWnd = hwnd; |
|---|
| | 54 | /* hWnd = hwnd;*/ |
|---|
| 56 | 55 | } |
|---|
| 57 | 56 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 59 | 58 | unsigned int par1, long par2 ) : Event( p_intf, msg, par1, par2 ) |
|---|
| 60 | 59 | { |
|---|
| 61 | | hWnd = ( (GTK2Window *)win )->GetHandle(); |
|---|
| | 60 | /* hWnd = ( (GTK2Window *)win )->GetHandle();*/ |
|---|
| 62 | 61 | } |
|---|
| 63 | 62 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 68 | 67 | bool GTK2Event::SendEvent() |
|---|
| 69 | 68 | { |
|---|
| 70 | | if( Message != VLC_NOTHING ) |
|---|
| | 69 | /* if( Message != VLC_NOTHING ) |
|---|
| 71 | 70 | { |
|---|
| 72 | 71 | PostMessage( hWnd, Message, Param1, Param2 ); |
|---|
| … | … | |
| 76 | 75 | |
|---|
| 77 | 76 | return true; |
|---|
| 78 | | |
|---|
| | 77 | */ |
|---|
| 79 | 78 | } |
|---|
| 80 | 79 | //--------------------------------------------------------------------------- |
|---|
| 81 | 80 | bool GTK2Event::IsEqual( Event *evt ) |
|---|
| 82 | 81 | { |
|---|
| 83 | | GTK2Event *WinEvt = (GTK2Event *)evt; |
|---|
| | 82 | /* GTK2Event *WinEvt = (GTK2Event *)evt; |
|---|
| 84 | 83 | return( WinEvt->GetWindow() == hWnd && WinEvt->GetMessage() == Message && |
|---|
| 85 | | WinEvt->GetParam1() == Param1 && WinEvt->GetParam2() == Param2 ); |
|---|
| | 84 | WinEvt->GetParam1() == Param1 && WinEvt->GetParam2() == Param2 );*/ |
|---|
| 86 | 85 | } |
|---|
| 87 | 86 | //--------------------------------------------------------------------------- |
|---|
| 88 | 87 | void GTK2Event::CreateOSEvent( string para1, string para2, string para3 ) |
|---|
| 89 | 88 | { |
|---|
| 90 | | |
|---|
| | 89 | /* |
|---|
| 91 | 90 | // Find Parameters |
|---|
| 92 | 91 | switch( Message ) |
|---|
| … | … | |
| 105 | 104 | |
|---|
| 106 | 105 | } |
|---|
| 107 | | |
|---|
| | 106 | */ |
|---|
| 108 | 107 | } |
|---|
| 109 | 108 | //--------------------------------------------------------------------------- |
|---|
| 110 | | HWND GTK2Event::GetWindowFromName( string name ) |
|---|
| | 109 | GdkWindow *GTK2Event::GetWindowFromName( string name ) |
|---|
| 111 | 110 | { |
|---|
| 112 | | GTK2Window *win = (GTK2Window *) |
|---|
| | 111 | /* GTK2Window *win = (GTK2Window *) |
|---|
| 113 | 112 | p_intf->p_sys->p_theme->GetWindow( name ); |
|---|
| 114 | 113 | if( win == NULL ) |
|---|
| 115 | 114 | return NULL; |
|---|
| 116 | 115 | else |
|---|
| 117 | | return win->GetHandle(); |
|---|
| | 116 | return win->GetHandle();*/ |
|---|
| 118 | 117 | } |
|---|
| 119 | 118 | //--------------------------------------------------------------------------- |
|---|
| 120 | | */ |
|---|
| | 119 | |
|---|
| rf3bcd92 |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_font.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_font.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 37 | 37 | |
|---|
| 38 | 38 | |
|---|
| 39 | | /* |
|---|
| | 39 | |
|---|
| 40 | 40 | //--------------------------------------------------------------------------- |
|---|
| 41 | 41 | // Font object |
|---|
| … | … | |
| 51 | 51 | } |
|---|
| 52 | 52 | //--------------------------------------------------------------------------- |
|---|
| 53 | | void GTK2Font::AssignGTK2Font( HDC DC ) |
|---|
| | 53 | /*void GTK2Font::AssignGTK2Font( HDC DC ) |
|---|
| 54 | 54 | { |
|---|
| 55 | 55 | // Create font |
|---|
| … | … | |
| 76 | 76 | // Free memory |
|---|
| 77 | 77 | DeleteObject( fontObj ); |
|---|
| 78 | | } |
|---|
| | 78 | }*/ |
|---|
| 79 | 79 | //--------------------------------------------------------------------------- |
|---|
| 80 | 80 | void GTK2Font::AssignFont( Graphics *dest ) |
|---|
| 81 | | { |
|---|
| | 81 | {/* |
|---|
| 82 | 82 | HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle(); |
|---|
| 83 | | AssignGTK2Font( DC ); |
|---|
| | 83 | AssignGTK2Font( DC );*/ |
|---|
| 84 | 84 | } |
|---|
| 85 | 85 | //--------------------------------------------------------------------------- |
|---|
| 86 | 86 | void GTK2Font::GetSize( string text, int &w, int &h ) |
|---|
| 87 | 87 | { |
|---|
| 88 | | // Get device context of screen |
|---|
| | 88 | /* // Get device context of screen |
|---|
| 89 | 89 | HDC DeskDC = GetWindowDC( GetDesktopWindow() ); |
|---|
| 90 | 90 | |
|---|
| … | … | |
| 99 | 99 | |
|---|
| 100 | 100 | // Release screen device context |
|---|
| 101 | | ReleaseDC( GetDesktopWindow(), DeskDC ); |
|---|
| | 101 | ReleaseDC( GetDesktopWindow(), DeskDC );*/ |
|---|
| 102 | 102 | } |
|---|
| 103 | 103 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 105 | 105 | int w, int h, int align, int color ) |
|---|
| 106 | 106 | { |
|---|
| 107 | | HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle(); |
|---|
| | 107 | /* HDC DC = ( (GTK2Graphics *)dest )->GetImageHandle(); |
|---|
| 108 | 108 | // Set boundaries |
|---|
| 109 | 109 | LPRECT r = new RECT; |
|---|
| … | … | |
| 129 | 129 | |
|---|
| 130 | 130 | // Free memory |
|---|
| 131 | | delete r; |
|---|
| | 131 | delete r;*/ |
|---|
| 132 | 132 | } |
|---|
| 133 | 133 | |
|---|
| … | … | |
| 136 | 136 | int h, int align ) |
|---|
| 137 | 137 | { |
|---|
| 138 | | GenericPrint( dest, text, x, y, w, h, align, Color ); |
|---|
| | 138 | /* GenericPrint( dest, text, x, y, w, h, align, Color );*/ |
|---|
| 139 | 139 | } |
|---|
| 140 | 140 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 142 | 142 | int h, int align, int color ) |
|---|
| 143 | 143 | { |
|---|
| 144 | | GenericPrint( dest, text, x, y, w, h, align, color ); |
|---|
| | 144 | /* GenericPrint( dest, text, x, y, w, h, align, color );*/ |
|---|
| 145 | 145 | } |
|---|
| 146 | 146 | //--------------------------------------------------------------------------- |
|---|
| 147 | 147 | |
|---|
| 148 | | */ |
|---|
| rf3bcd92 |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_graphics.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_graphics.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 34 | 34 | |
|---|
| 35 | 35 | |
|---|
| 36 | | /* |
|---|
| 37 | 36 | //--------------------------------------------------------------------------- |
|---|
| 38 | 37 | // GTK2 GRAPHICS |
|---|
| … | … | |
| 40 | 39 | GTK2Graphics::GTK2Graphics( int w, int h, Window *from ) : Graphics( w, h ) |
|---|
| 41 | 40 | { |
|---|
| 42 | | HBITMAP HImage ; |
|---|
| | 41 | /* HBITMAP HImage ; |
|---|
| 43 | 42 | Image = CreateCompatibleDC( NULL ); |
|---|
| 44 | 43 | if( from != NULL ) |
|---|
| … | … | |
| 53 | 52 | } |
|---|
| 54 | 53 | SelectObject( Image, HImage ); |
|---|
| 55 | | DeleteObject( HImage ); |
|---|
| | 54 | DeleteObject( HImage );*/ |
|---|
| 56 | 55 | } |
|---|
| 57 | 56 | //--------------------------------------------------------------------------- |
|---|
| 58 | 57 | GTK2Graphics::~GTK2Graphics() |
|---|
| 59 | 58 | { |
|---|
| 60 | | DeleteDC( Image ); |
|---|
| | 59 | /* DeleteDC( Image );*/ |
|---|
| 61 | 60 | } |
|---|
| 62 | 61 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 64 | 63 | int sx, int sy, int Flag ) |
|---|
| 65 | 64 | { |
|---|
| 66 | | BitBlt( Image, dx, dy, dw, dh, ( (GTK2Graphics *)Src )->GetImageHandle(), |
|---|
| 67 | | sx, sy, Flag ); |
|---|
| | 65 | /* BitBlt( Image, dx, dy, dw, dh, ( (GTK2Graphics *)Src )->GetImageHandle(), |
|---|
| | 66 | sx, sy, Flag );*/ |
|---|
| 68 | 67 | } |
|---|
| 69 | | */ |
|---|
| | 68 | |
|---|
| 70 | 69 | //--------------------------------------------------------------------------- |
|---|
| 71 | 70 | /*void GTK2Graphics::CopyTo( Graphics *Dest, int dx, int dy, int dw, int dh, |
|---|
| … | … | |
| 74 | 73 | BitBlt( ( (GTK2Graphics *)Dest )->GetImageHandle(), dx, dy, dw, dh, Image, |
|---|
| 75 | 74 | sx, sy, Flag ); |
|---|
| 76 | | }*//* |
|---|
| | 75 | }*/ |
|---|
| 77 | 76 | //--------------------------------------------------------------------------- |
|---|
| 78 | 77 | void GTK2Graphics::DrawRect( int x, int y, int w, int h, int color ) |
|---|
| 79 | 78 | { |
|---|
| 80 | | LPRECT r = new RECT; |
|---|
| | 79 | /* LPRECT r = new RECT; |
|---|
| 81 | 80 | HBRUSH Brush = CreateSolidBrush( color ); |
|---|
| 82 | 81 | r->left = x; |
|---|
| … | … | |
| 86 | 85 | FillRect( Image, r, Brush ); |
|---|
| 87 | 86 | DeleteObject( Brush ); |
|---|
| 88 | | delete r; |
|---|
| | 87 | delete r;*/ |
|---|
| 89 | 88 | } |
|---|
| 90 | 89 | //--------------------------------------------------------------------------- |
|---|
| 91 | 90 | void GTK2Graphics::SetClipRegion( Region *rgn ) |
|---|
| 92 | 91 | { |
|---|
| 93 | | SelectClipRgn( Image, ( (GTK2Region *)rgn )->GetHandle() ); |
|---|
| | 92 | /* SelectClipRgn( Image, ( (GTK2Region *)rgn )->GetHandle() );*/ |
|---|
| 94 | 93 | } |
|---|
| 95 | 94 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 103 | 102 | GTK2Region::GTK2Region() |
|---|
| 104 | 103 | { |
|---|
| 105 | | Rgn = CreateRectRgn( 0, 0, 0, 0 ); |
|---|
| | 104 | /* Rgn = CreateRectRgn( 0, 0, 0, 0 );*/ |
|---|
| 106 | 105 | } |
|---|
| 107 | 106 | //--------------------------------------------------------------------------- |
|---|
| 108 | 107 | GTK2Region::GTK2Region( int x, int y, int w, int h ) |
|---|
| 109 | 108 | { |
|---|
| 110 | | Rgn = CreateRectRgn( x, y, x + w, y + h ); |
|---|
| | 109 | /* Rgn = CreateRectRgn( x, y, x + w, y + h );*/ |
|---|
| 111 | 110 | } |
|---|
| 112 | 111 | //--------------------------------------------------------------------------- |
|---|
| 113 | 112 | GTK2Region::~GTK2Region() |
|---|
| 114 | 113 | { |
|---|
| 115 | | DeleteObject( Rgn ); |
|---|
| | 114 | /* DeleteObject( Rgn );*/ |
|---|
| 116 | 115 | } |
|---|
| 117 | 116 | //--------------------------------------------------------------------------- |
|---|
| 118 | 117 | void GTK2Region::AddPoint( int x, int y ) |
|---|
| 119 | 118 | { |
|---|
| 120 | | AddRectangle( x, y, x + 1, y + 1 ); |
|---|
| | 119 | /* AddRectangle( x, y, x + 1, y + 1 );*/ |
|---|
| 121 | 120 | } |
|---|
| 122 | 121 | //--------------------------------------------------------------------------- |
|---|
| 123 | 122 | void GTK2Region::AddRectangle( int x, int y, int w, int h ) |
|---|
| 124 | 123 | { |
|---|
| 125 | | HRGN Buffer; |
|---|
| | 124 | /* HRGN Buffer; |
|---|
| 126 | 125 | Buffer = CreateRectRgn( x, y, x + w, y + h ); |
|---|
| 127 | 126 | CombineRgn( Rgn, Buffer, Rgn, 0x2 ); |
|---|
| 128 | | DeleteObject( Buffer ); |
|---|
| | 127 | DeleteObject( Buffer );*/ |
|---|
| 129 | 128 | } |
|---|
| 130 | 129 | //--------------------------------------------------------------------------- |
|---|
| 131 | 130 | void GTK2Region::AddElipse( int x, int y, int w, int h ) |
|---|
| 132 | 131 | { |
|---|
| 133 | | HRGN Buffer; |
|---|
| | 132 | /* HRGN Buffer; |
|---|
| 134 | 133 | Buffer = CreateEllipticRgn( x, y, x + w, y + h ); |
|---|
| 135 | 134 | CombineRgn( Rgn, Buffer, Rgn, 0x2 ); |
|---|
| 136 | | DeleteObject( Buffer ); |
|---|
| | 135 | DeleteObject( Buffer );*/ |
|---|
| 137 | 136 | } |
|---|
| 138 | 137 | //--------------------------------------------------------------------------- |
|---|
| 139 | 138 | void GTK2Region::Move( int x, int y ) |
|---|
| 140 | 139 | { |
|---|
| 141 | | OffsetRgn( Rgn, x, y ); |
|---|
| | 140 | /* OffsetRgn( Rgn, x, y );*/ |
|---|
| 142 | 141 | } |
|---|
| 143 | 142 | //--------------------------------------------------------------------------- |
|---|
| 144 | 143 | bool GTK2Region::Hit( int x, int y ) |
|---|
| 145 | 144 | { |
|---|
| 146 | | return PtInRegion( Rgn, x, y ); |
|---|
| | 145 | /* return PtInRegion( Rgn, x, y );*/ |
|---|
| 147 | 146 | } |
|---|
| 148 | 147 | //--------------------------------------------------------------------------- |
|---|
| 149 | | */ |
|---|
| | 148 | |
|---|
| rf3bcd92 |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_run.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_run.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 43 | 43 | |
|---|
| 44 | 44 | |
|---|
| 45 | | #if 0 |
|---|
| 46 | | |
|---|
| 47 | 45 | //--------------------------------------------------------------------------- |
|---|
| 48 | 46 | // Specific method |
|---|
| … | … | |
| 56 | 54 | // REFRESH TIMER CALLBACK |
|---|
| 57 | 55 | //--------------------------------------------------------------------------- |
|---|
| 58 | | void CALLBACK RefreshTimer( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime ) |
|---|
| | 56 | /*void CALLBACK RefreshTimer( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime ) |
|---|
| 59 | 57 | { |
|---|
| 60 | 58 | intf_thread_t *p_intf = (intf_thread_t *)GetWindowLongPtr( hwnd, |
|---|
| 61 | 59 | GWLP_USERDATA ); |
|---|
| 62 | 60 | SkinManage( p_intf ); |
|---|
| 63 | | } |
|---|
| | 61 | }*/ |
|---|
| 64 | 62 | //--------------------------------------------------------------------------- |
|---|
| 65 | 63 | |
|---|
| … | … | |
| 71 | 69 | void OSRun( intf_thread_t *p_intf ) |
|---|
| 72 | 70 | { |
|---|
| | 71 | #if 0 |
|---|
| 73 | 72 | VlcProc *Proc = new VlcProc( p_intf ); |
|---|
| 74 | 73 | MSG msg; |
|---|
| … | … | |
| 172 | 171 | Proc->IsClosing(); |
|---|
| 173 | 172 | } |
|---|
| | 173 | #endif |
|---|
| 174 | 174 | } |
|---|
| 175 | 175 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 181 | 181 | |
|---|
| 182 | 182 | |
|---|
| 183 | | #endif |
|---|
| rf3bcd92 |
reb3609c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2003 VideoLAN |
|---|
| 5 | | * $Id: gtk2_window.cpp,v 1.1 2003/04/12 21:43:27 asmax Exp $ |
|---|
| | 5 | * $Id: gtk2_window.cpp,v 1.2 2003/04/12 22:50:42 asmax Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cyril Deguet <asmax@videolan.org> |
|---|
| … | … | |
| 47 | 47 | |
|---|
| 48 | 48 | |
|---|
| 49 | | /* |
|---|
| | 49 | |
|---|
| 50 | 50 | //--------------------------------------------------------------------------- |
|---|
| 51 | 51 | // Fading API |
|---|
| 52 | 52 | //--------------------------------------------------------------------------- |
|---|
| 53 | | #define LWA_COLORKEY 0x00000001 |
|---|
| | 53 | /*#define LWA_COLORKEY 0x00000001 |
|---|
| 54 | 54 | #define LWA_ALPHA 0x00000002 |
|---|
| 55 | 55 | typedef BOOL (WINAPI *SLWA)(HWND, COLORREF, BYTE, DWORD); |
|---|
| … | … | |
| 57 | 57 | SLWA SetLayeredWindowAttributes = |
|---|
| 58 | 58 | (SLWA)GetProcAddress( hModule, "SetLayeredWindowAttributes" ); |
|---|
| 59 | | |
|---|
| | 59 | */ |
|---|
| 60 | 60 | |
|---|
| 61 | 61 | //--------------------------------------------------------------------------- |
|---|
| 62 | 62 | // Skinable Window |
|---|
| 63 | 63 | //--------------------------------------------------------------------------- |
|---|
| 64 | | GTK2Window::GTK2Window( intf_thread_t *p_intf, HWND hwnd, int x, int y, |
|---|
| | 64 | GTK2Window::GTK2Window( intf_thread_t *p_intf, GdkWindow *gwnd, int x, int y, |
|---|
| 65 | 65 | bool visible, int transition, int normalalpha, int movealpha, |
|---|
| 66 | 66 | bool dragdrop ) |
|---|
| … | … | |
| 69 | 69 | { |
|---|
| 70 | 70 | // Set handles |
|---|
| 71 | | hWnd = hwnd; |
|---|
| | 71 | /* hWnd = hwnd; |
|---|
| 72 | 72 | |
|---|
| 73 | 73 | // Set position parameters |
|---|
| … | … | |
| 103 | 103 | RegisterDragDrop( hWnd, DropTarget ); |
|---|
| 104 | 104 | } |
|---|
| 105 | | |
|---|
| | 105 | */ |
|---|
| 106 | 106 | } |
|---|
| 107 | 107 | //--------------------------------------------------------------------------- |
|---|
| 108 | 108 | GTK2Window::~GTK2Window() |
|---|
| 109 | 109 | { |
|---|
| 110 | | delete CursorPos; |
|---|
| | 110 | /* delete CursorPos; |
|---|
| 111 | 111 | delete WindowPos; |
|---|
| 112 | 112 | |
|---|
| … | … | |
| 127 | 127 | OleUninitialize(); |
|---|
| 128 | 128 | } |
|---|
| 129 | | |
|---|
| | 129 | */ |
|---|
| 130 | 130 | } |
|---|
| 131 | 131 | //--------------------------------------------------------------------------- |
|---|
| 132 | 132 | void GTK2Window::OSShow( bool show ) |
|---|
| 133 | 133 | { |
|---|
| 134 | | if( show ) |
|---|
| | 134 | /* if( show ) |
|---|
| 135 | 135 | { |
|---|
| 136 | 136 | ShowWindow( hWnd, SW_SHOW ); |
|---|
| … | … | |
| 139 | 139 | { |
|---|
| 140 | 140 | ShowWindow( hWnd, SW_HIDE ); |
|---|
| 141 | | } |
|---|
| | 141 | }*/ |
|---|
| 142 | 142 | } |
|---|
| 143 | 143 | //--------------------------------------------------------------------------- |
|---|
| 144 | 144 | bool GTK2Window::ProcessOSEvent( Event *evt ) |
|---|
| 145 | 145 | { |
|---|
| 146 | | unsigned int msg = evt->GetMessage(); |
|---|
| | 146 | /* unsigned int msg = evt->GetMessage(); |
|---|
| 147 | 147 | unsigned int p1 = evt->GetParam1(); |
|---|
| 148 | 148 | int p2 = evt->GetParam2(); |
|---|
| … | … | |
| 202 | 202 | default: |
|---|
| 203 | 203 | return false; |
|---|
| 204 | | } |
|---|
| | 204 | }*/ |
|---|
| 205 | 205 | } |
|---|
| 206 | 206 | //--------------------------------------------------------------------------- |
|---|
| 207 | 207 | void GTK2Window::SetTransparency( int Value ) |
|---|
| 208 | 208 | { |
|---|
| 209 | | if( Value > -1 ) |
|---|
| | 209 | /* if( Value > -1 ) |
|---|
| 210 | 210 | Alpha = Value; |
|---|
| 211 | 211 | SetLayeredWindowAttributes( hWnd, 0, Alpha, LWA_ALPHA | LWA_COLORKEY ); |
|---|
| 212 | | UpdateWindow( hWnd ); |
|---|
| | 212 | UpdateWindow( hWnd );*/ |
|---|
| 213 | 213 | } |
|---|
| 214 | 214 | //--------------------------------------------------------------------------- |
|---|
| … | … | |
| 216 | 216 | { |
|---|
| 217 | 217 | // Initialize painting |
|---|
| 218 | | HDC DC = GetWindowDC( hWnd ); |
|---|
| | 218 | /* HDC DC = GetWindowDC( hWnd ); |
|---|
| 219 | 219 | |
|---|
| 220 | 220 | // Draw image on window |
|---|
| … | … | |
| 224 | 224 | // Release window device context |
|---|
| 225 | 225 | ReleaseDC( hWnd, DC ); |
|---|
| 226 | | |
|---|
| | 226 | */ |
|---|
| 227 | 227 | } |
|---|
| 228 | 228 | //--------------------------------------------------------------------------- |
|---|
| 229 | 229 | void GTK2Window::WindowManualMove() |
|---|
| 230 | 230 | { |
|---|
| 231 | | // Get mouse cursor position |
|---|
| | 231 | /* // Get mouse cursor position |
|---|
| 232 | 232 | LPPOINT NewPos = new POINT; |
|---|
| 233 | 233 | GetCursorPos( NewPos ); |
|---|
| … | … | |
| 240 | 240 | // Free memory |
|---|
| 241 | 241 | delete[] NewPos; |
|---|
| 242 | | |
|---|
| | 242 | */ |
|---|
| 243 | 243 | } |
|---|
| 244 | 244 | //--------------------------------------------------------------------------- |
|---|
| 245 | 245 | void GTK2Window::WindowManualMoveInit() |
|---|
| 246 | 246 | { |
|---|
| 247 | | GetCursorPos( CursorPos ); |
|---|
| | 247 | /* GetCursorPos( CursorPos ); |
|---|
| 248 | 248 | WindowPos->x = Left; |
|---|
| 249 | | WindowPos->y = Top; |
|---|
| | 249 | WindowPos->y = Top;*/ |
|---|
| 250 | 250 | } |
|---|
| 251 | 251 | //--------------------------------------------------------------------------- |
|---|
| 252 | 252 | void GTK2Window::Move( int left, int top ) |
|---|
| 253 | 253 | { |
|---|
| 254 | | Left = left; |
|---|
| | 254 | /* Left = left; |
|---|
| 255 | 255 | Top = top; |
|---|
| 256 | 256 | //SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height, |
|---|
| 257 | 257 | // SWP_NOSIZE|SWP_NOREDRAW|SWP_NOZORDER ); |
|---|
| 258 | | MoveWindow( hWnd, Left, Top, Width, Height, false ); |
|---|
| | 258 | MoveWindow( hWnd, Left, Top, Width, Height, false );*/ |
|---|
| 259 | 259 | } |
|---|
| 260 | 260 | //--------------------------------------------------------------------------- |
|---|
| 261 | 261 | void GTK2Window::Size( int width, int height ) |
|---|
| 262 | 262 | { |
|---|
| 263 | | Width = width; |
|---|
| | 263 | /* Width = width; |
|---|
| 264 | 264 | Height = height; |
|---|
| 265 | 265 | SetWindowPos( hWnd, HWND_TOP, Left, Top, Width, Height, |
|---|
| 266 | | SWP_NOMOVE|SWP_NOREDRAW|SWP_NOZORDER ); |
|---|
| | 266 | SWP_NOMOVE|SWP_NOREDRAW|SWP_NOZORDER );*/ |
|---|
| 267 | 267 | } |
|---|
| 268 | 268 | //--------------------------------------------------------------------------- |
|---|
| 269 | 269 | void GTK2Window::ChangeToolTipText( string text ) |
|---|
| 270 | 270 | { |
|---|
| 271 | | if( text == "none" ) |
|---|
| | 271 | /* if( text == "none" ) |
|---|
| 272 | 272 | { |
|---|
| 273 | 273 | if( ToolTipText != "none" ) |
|---|
| … | … | |
| 289 | 289 | } |
|---|
| 290 | 290 | } |
|---|
| 291 | | |
|---|
| 292 | | } |
|---|
| 293 | | //--------------------------------------------------------------------------- |
|---|
| 294 | | */ |
|---|
| | 291 | */ |
|---|
| | 292 | } |
|---|
| | 293 | //--------------------------------------------------------------------------- |
|---|
| | 294 | |
|---|