Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

win32_tooltip.cpp

00001 /*****************************************************************************
00002  * win32_tooltip.cpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: win32_tooltip.cpp 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #ifdef WIN32_SKINS
00026 
00027 #include "win32_tooltip.hpp"
00028 #include "win32_graphics.hpp"
00029 #include "../src/generic_window.hpp"
00030 
00031 Win32Tooltip::Win32Tooltip( intf_thread_t *pIntf, HINSTANCE hInst,
00032                             HWND hParentWindow ):
00033     OSTooltip( pIntf )
00034 {
00035     // Create the window
00036     m_hWnd = CreateWindowEx( WS_EX_TOOLWINDOW,
00037         "SkinWindowClass", "default name", WS_POPUP, CW_USEDEFAULT,
00038         CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hParentWindow, 0,
00039         hInst, NULL );
00040 
00041     if( !m_hWnd )
00042     {
00043         msg_Err( getIntf(), "CreateWindow failed" );
00044         return;
00045     }
00046 }
00047 
00048 
00049 Win32Tooltip::~Win32Tooltip()
00050 {
00051     if( m_hWnd )
00052         DestroyWindow( m_hWnd );
00053 }
00054 
00055 
00056 void Win32Tooltip::show( int left, int top, OSGraphics &rText )
00057 {
00058     // Source drawable
00059     HDC srcDC = ((Win32Graphics&)rText).getDC();
00060     int width = rText.getWidth();
00061     int height = rText.getHeight();
00062 
00063     // Set the window on top, resize it and show it
00064     SetWindowPos( m_hWnd, HWND_TOPMOST, left, top, width, height, 0 );
00065     ShowWindow( m_hWnd, SW_SHOW );
00066 
00067     HDC wndDC = GetWindowDC( m_hWnd );
00068     BitBlt( wndDC, 0, 0, width, height, srcDC, 0, 0, SRCCOPY );
00069     ReleaseDC( m_hWnd, wndDC );
00070 }
00071 
00072 
00073 void Win32Tooltip::hide()
00074 {
00075     ShowWindow( m_hWnd, SW_HIDE );
00076 }
00077 
00078 
00079 #endif
00080 

Generated on Tue Dec 20 10:14:44 2005 for vlc-0.8.4a by  doxygen 1.4.2