]> git.sesse.net Git - vlc/blob - modules/gui/skins/gtk2/gtk2_api.cpp
* should have repaired win32 skins
[vlc] / modules / gui / skins / gtk2 / gtk2_api.cpp
1 /*****************************************************************************
2  * gtk2_api.cpp: Various gtk2-specific functions
3  *****************************************************************************
4  * Copyright (C) 2003 VideoLAN
5  * $Id: gtk2_api.cpp,v 1.4 2003/04/13 19:09:59 asmax Exp $
6  *
7  * Authors: Cyril Deguet  <asmax@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111,
22  * USA.
23  *****************************************************************************/
24
25 #if !defined WIN32
26
27 //--- GTK2 ------------------------------------------------------------------
28 #include <gdk/gdk.h>
29
30 //--- SKIN ------------------------------------------------------------------
31 #include "window.h"
32 #include "os_window.h"
33 #include "os_api.h"
34 #include "event.h"         // for MAX_PARAM_SIZE
35
36
37 //---------------------------------------------------------------------------
38 // Event API
39 //---------------------------------------------------------------------------
40 void OSAPI_SendMessage( Window *win, unsigned int message, unsigned int param1,
41                         long param2 )
42 {
43 /*    if( win == NULL )
44         SendMessage( NULL, message, param1, param2 );
45     else
46         SendMessage( ( (Win32Window *)win )->GetHandle(), message, param1,
47                      param2 );*/
48 }
49 //---------------------------------------------------------------------------
50 void OSAPI_PostMessage( Window *win, unsigned int message, unsigned int param1,
51                         long param2 )
52 {
53 /*    if( win == NULL )
54         PostMessage( NULL, message, param1, param2 );
55     else
56         PostMessage( ( (Win32Window *)win )->GetHandle(), message, param1,
57                      param2 );*/
58 }
59 //---------------------------------------------------------------------------
60
61
62
63
64 //---------------------------------------------------------------------------
65 // Graphic API
66 //---------------------------------------------------------------------------
67 int OSAPI_GetNonTransparentColor( int c )
68 {
69 /*    // Get desktop device context
70     HDC DeskDC = GetWindowDC( GetDesktopWindow() );
71
72     // If color is black or color is same as black wether pixel color depth
73     if( c == 0 || SetPixel( DeskDC, 0, 0, c ) == 0 )
74     {
75         if( GetDeviceCaps( DeskDC, BITSPIXEL ) < 24 )
76             c = RGB(8, 0, 0);
77         else
78             c = RGB(1, 0, 0);
79     }
80     ReleaseDC( GetDesktopWindow(), DeskDC );
81     return c;*/
82 }
83 //---------------------------------------------------------------------------
84
85
86
87
88 //---------------------------------------------------------------------------
89 // General
90 //---------------------------------------------------------------------------
91 int OSAPI_GetTime()
92 {
93 /*    return GetTickCount();*/
94 }
95 //---------------------------------------------------------------------------
96 void OSAPI_GetScreenSize( int &w, int &h )
97 {
98 /*    w = GetSystemMetrics(SM_CXSCREEN);
99     h = GetSystemMetrics(SM_CYSCREEN);*/
100 }
101 //---------------------------------------------------------------------------
102 void OSAPI_GetMousePos( int &x, int &y )
103 {
104 /*    LPPOINT MousePos = new POINT;
105     GetCursorPos( MousePos );
106     x = MousePos->x;
107     y = MousePos->y;
108     delete MousePos;*/
109 }
110 //---------------------------------------------------------------------------
111 string OSAPI_GetWindowTitle( Window *win )
112 {
113 //    char *buffer = new char[MAX_PARAM_SIZE];
114 //    GetWindowText( ((GTK2Window *)win)->GetHandle(), buffer, MAX_PARAM_SIZE );
115 //    string Title = buffer;
116 /* FIXME */
117 string Title = "";
118 //    delete buffer;
119
120     return Title;
121 }
122 //---------------------------------------------------------------------------
123 bool OSAPI_RmDir( string path )
124 {
125 /*    WIN32_FIND_DATA find;
126     string File;
127     string FindFiles = path + "\\*.*";
128     HANDLE handle    = FindFirstFile( (char *)FindFiles.c_str(), &find );
129
130     while( handle != INVALID_HANDLE_VALUE )
131     {
132         // If file is neither "." nor ".."
133         if( strcmp( find.cFileName, "." ) && strcmp( find.cFileName, ".." ) )
134         {
135             // Set file name
136             File = path + "\\" + (string)find.cFileName;
137
138             // If file is a directory, delete it recursively
139             if( find.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
140             {
141                 OSAPI_RmDir( File );
142             }
143             // Else, it is a file so simply delete it
144             else
145             {
146                 DeleteFile( (char *)File.c_str() );
147             }
148         }
149
150         // If no more file in directory, exit while
151         if( !FindNextFile( handle, &find ) )
152             break;
153     }
154
155     // Now directory is empty so can be removed
156     FindClose( handle );
157     RemoveDirectory( (char *)path.c_str() );
158
159     return true;*/
160 }
161 //---------------------------------------------------------------------------
162
163 #endif