WINE build compatibility

svn path=/trunk/; revision=5931
This commit is contained in:
Martin Fuchs 2003-08-30 11:30:18 +00:00
parent 2566f13f3e
commit b69868a964
12 changed files with 86 additions and 48 deletions

View file

@ -38,6 +38,8 @@
#include "explorer_intres.h"
#include <locale.h>
ExplorerGlobals g_Globals;

View file

@ -8,8 +8,10 @@
// Generated from the TEXTINCLUDE 2 resource.
//
#ifndef _ROS_
#ifndef __WINE__
#include "afxres.h"
#endif
#endif
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@ -140,9 +142,8 @@ IDB_LOGOV BITMAP DISCARDABLE "res/logov.bmp"
IDA_EXPLORER ACCELERATORS DISCARDABLE
BEGIN
"X", ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT
"S", ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL,
NOINVERT
0x58, ID_FILE_EXIT, VIRTKEY, ALT, NOINVERT
0x53, ID_VIEW_FULLSCREEN, VIRTKEY, SHIFT, CONTROL, NOINVERT
END
#endif // Neutral resources

View file

@ -89,15 +89,15 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info)
#ifdef __linux__
if (info._etype == ET_UNIX)
{
_root.drive_type = GetDriveType(path);
_root._drive_type = GetDriveType(info._path);
_tsplitpath(info._path, drv, NULL, NULL, NULL);
lstrcat(drv, TEXT("/"));
lstrcpy(_root.volname, TEXT("root fs"));
_root.fs_flags = 0;
lstrcpy(_root.fs, TEXT("unixfs"));
lstrcpy(_root.path, TEXT("/"));
_root._entry = new UnixDirectory(_root._path, info._path);
lstrcpy(_root._volname, TEXT("root fs"));
_root._fs_flags = 0;
lstrcpy(_root._fs, TEXT("unixfs"));
lstrcpy(_root._path, TEXT("/"));
_root._entry = new UnixDirectory(_root._path);
entry = _root._entry->read_tree(info._path, SORT_NAME/*_sortOrder*/);
}
else

View file

@ -33,6 +33,8 @@
#include "../explorer_intres.h"
//#include <tchar.h> // for _splitpath()
MainFrame::MainFrame(HWND hwnd)
: super(hwnd)

View file

@ -37,11 +37,10 @@
// for UnixDirectory::read_directory()
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
void UnixDirectory::read_directory(LPCTSTR path)
void UnixDirectory::read_directory()
{
Entry* first_entry = NULL;
Entry* last = NULL;
@ -49,6 +48,7 @@ void UnixDirectory::read_directory(LPCTSTR path)
int level = _level + 1;
LPCTSTR path = (LPCTSTR)_path;
DIR* pdir = opendir(path);
if (pdir) {
@ -63,7 +63,9 @@ void UnixDirectory::read_directory(LPCTSTR path)
*p++ = '/';
while((ent=readdir(pdir))) {
if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
int statres = stat(buffer, &st);
if (!statres && S_ISDIR(st.st_mode))
entry = new UnixDirectory(this, buffer);
else
entry = new UnixEntry(this);
@ -72,46 +74,46 @@ void UnixDirectory::read_directory(LPCTSTR path)
first_entry = entry;
if (last)
last->next = entry;
last->_next = entry;
lstrcpy(entry->data.cFileName, ent->d_name);
entry->data.dwFileAttributes = ent->d_name[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0;
lstrcpy(entry->_data.cFileName, ent->d_name);
entry->_data.dwFileAttributes = ent->d_name[0]=='.'? FILE_ATTRIBUTE_HIDDEN: 0;
strcpy(p, ent->d_name);
if (!stat(buffer, &st)) {
if (!statres) {
if (S_ISDIR(st.st_mode))
entry->data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
entry->_data.dwFileAttributes |= FILE_ATTRIBUTE_DIRECTORY;
entry->data.nFileSizeLow = st.st_size & 0xFFFFFFFF;
entry->data.nFileSizeHigh = st.st_size >> 32;
entry->_data.nFileSizeLow = st.st_size & 0xFFFFFFFF;
entry->_data.nFileSizeHigh = st.st_size >> 32;
memset(&entry->data.ftCreationTime, 0, sizeof(FILETIME));
time_to_filetime(&st.st_atime, &entry->data.ftLastAccessTime);
time_to_filetime(&st.st_mtime, &entry->data.ftLastWriteTime);
memset(&entry->_data.ftCreationTime, 0, sizeof(FILETIME));
time_to_filetime(&st.st_atime, &entry->_data.ftLastAccessTime);
time_to_filetime(&st.st_mtime, &entry->_data.ftLastWriteTime);
entry->bhfi.nFileIndexLow = ent->d_ino;
entry->bhfi.nFileIndexHigh = 0;
entry->_bhfi.nFileIndexLow = ent->d_ino;
entry->_bhfi.nFileIndexHigh = 0;
entry->bhfi.nNumberOfLinks = st.st_nlink;
entry->_bhfi.nNumberOfLinks = st.st_nlink;
entry->bhfi_valid = TRUE;
entry->_bhfi_valid = TRUE;
} else {
entry->data.nFileSizeLow = 0;
entry->data.nFileSizeHigh = 0;
entry->bhfi_valid = FALSE;
entry->_data.nFileSizeLow = 0;
entry->_data.nFileSizeHigh = 0;
entry->_bhfi_valid = FALSE;
}
entry->down = NULL;
entry->up = dir;
entry->expanded = FALSE;
entry->scanned = FALSE;
entry->level = level;
entry->_down = NULL;
entry->_up = this;
entry->_expanded = FALSE;
entry->_scanned = FALSE;
entry->_level = level;
last = entry;
}
last->next = NULL;
last->_next = NULL;
closedir(pdir);
}
@ -142,9 +144,9 @@ Entry* UnixDirectory::find_entry(const void* p)
{
LPCTSTR name = (LPCTSTR)p;
for(Entry*entry=_down; entry; entry=entry->next) {
for(Entry*entry=_down; entry; entry=entry->_next) {
LPCTSTR p = name;
LPCTSTR q = entry->data.cFileName;
LPCTSTR q = entry->_data.cFileName;
do {
if (!*p || *p==TEXT('/'))
@ -162,7 +164,7 @@ void UnixEntry::get_path(PTSTR path) const
int level = 0;
int len = 0;
for(Entry* entry=this; entry; level++) {
for(const Entry* entry=this; entry; level++) {
LPCTSTR name = entry->_data.cFileName;
int l = 0;

View file

@ -47,7 +47,7 @@ struct UnixDirectory : public UnixEntry, public Directory
}
UnixDirectory(UnixDirectory* parent, LPCTSTR path)
: UnixEntry(parent),
: UnixEntry(parent)
{
_path = _tcsdup(path);
}

View file

@ -798,7 +798,7 @@ void StartMenuRoot::ShowRestartDialog(HWND hwndOwner, UINT flags)
RESTARTWINDOWSDLG RestartDlg = (RESTARTWINDOWSDLG)GetProcAddress(hShell32, (LPCSTR)59);
if (RestartDlg)
RestartDlg(hwndOwner, L"You selected <Log Off>.\n\n", flags); //TODO: ANSI string conversion if needed
RestartDlg(hwndOwner, (LPWSTR)L"You selected <Log Off>.\n\n", flags); //TODO: ANSI string conversion if needed
}
void StartMenuRoot::ShowSearchDialog()

View file

@ -325,7 +325,7 @@ EnumFormatEtcImpl::EnumFormatEtcImpl(const StorageArray& ArrFE)
m_pFmtEtc.push_back(*it->_format);
}
STDMETHODIMP EnumFormatEtcImpl::QueryInterface(REFIID refiid, void FAR* FAR* ppv)
STDMETHODIMP EnumFormatEtcImpl::QueryInterface(REFIID refiid, void** ppv)
{
*ppv = NULL;
if (IID_IUnknown==refiid || IID_IEnumFORMATETC==refiid)
@ -356,7 +356,7 @@ STDMETHODIMP_(ULONG) EnumFormatEtcImpl::Release(void)
return nTemp;
}
STDMETHODIMP EnumFormatEtcImpl::Next( ULONG celt,LPFORMATETC lpFormatEtc, ULONG FAR *pceltFetched)
STDMETHODIMP EnumFormatEtcImpl::Next( ULONG celt,LPFORMATETC lpFormatEtc, ULONG* pceltFetched)
{
if (pceltFetched != NULL)
*pceltFetched=0;
@ -395,7 +395,7 @@ STDMETHODIMP EnumFormatEtcImpl::Reset(void)
return S_OK;
}
STDMETHODIMP EnumFormatEtcImpl::Clone(IEnumFORMATETC FAR * FAR*ppCloneEnumFormatEtc)
STDMETHODIMP EnumFormatEtcImpl::Clone(IEnumFORMATETC** ppCloneEnumFormatEtc)
{
if (ppCloneEnumFormatEtc == NULL)
return E_POINTER;

View file

@ -34,15 +34,15 @@ class EnumFormatEtcImpl : public IEnumFORMATETC
EnumFormatEtcImpl(const StorageArray& ArrFE);
//IUnknown members
STDMETHOD(QueryInterface)(REFIID, void FAR* FAR*);
STDMETHOD(QueryInterface)(REFIID, void**);
STDMETHOD_(ULONG, AddRef)(void);
STDMETHOD_(ULONG, Release)(void);
//IEnumFORMATETC members
STDMETHOD(Next)(ULONG, LPFORMATETC, ULONG FAR *);
STDMETHOD(Next)(ULONG, LPFORMATETC, ULONG*);
STDMETHOD(Skip)(ULONG);
STDMETHOD(Reset)(void);
STDMETHOD(Clone)(IEnumFORMATETC FAR * FAR*);
STDMETHOD(Clone)(IEnumFORMATETC**);
};
///////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -742,7 +742,7 @@ struct SpecialFolderPath : public ShellPath
{
SpecialFolderPath(int folder, HWND hwnd)
{
HRESULT hr = SHGetSpecialFolderLocation(hwnd, folder, &_p);
/*HRESULT hr = */SHGetSpecialFolderLocation(hwnd, folder, &_p);
}
};

View file

@ -42,25 +42,40 @@
#include <malloc.h> // for alloca()
#include <assert.h>
#include <stdlib.h> // for _MAX_DIR, ...
#include <stdio.h> // for sprintf()
#include <time.h>
#ifndef _MAX_PATH
#define _MAX_DRIVE 3
#define _MAX_FNAME 256
#define _MAX_DIR _MAX_FNAME
#define _MAX_EXT _MAX_FNAME
#define _MAX_PATH 260
#endif
#ifndef BTNS_BUTTON
#define BTNS_BUTTON TBSTYLE_BUTTON //missing in old mingw headers
#define BTNS_SEP TBSTYLE_SEP
#define BTNS_NOPREFIX TBSTYLE_NOPREFIX
#endif
#ifndef TB_HITTEST //missing in mingw headers
#define TB_HITTEST (WM_USER+69)
#endif
#ifndef TB_GETBUTTONINFO //missing in mingw headers
#define TB_GETBUTTONINFO (WM_USER+65)
#endif
#ifndef __WINE__
#ifndef SFGAO_HIDDEN //SFGAO_GHOSTED wrong defined, SFGAO_HIDDEN missing in mingw headers
#define SFGAO_HIDDEN 0x00080000L
#undef SFGAO_GHOSTED
#define SFGAO_GHOSTED 0x00008000L
#endif
#endif
@ -438,6 +453,22 @@ extern "C" {
#endif
#ifdef __WINE__
#ifdef UNICODE
extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
#else
extern void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext);
#endif
#endif
#ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040
#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
#endif
#define SetDlgCtrlID(hwnd, id) SetWindowLong(hwnd, GWL_ID, id)
#define SetWindowStyle(hwnd, val) (DWORD)SetWindowLong(hwnd, GWL_STYLE, val)
#define SetWindowExStyle(h, val) (DWORD)SetWindowLong(hwnd, GWL_EXSTYLE, val)

View file

@ -473,7 +473,7 @@ struct ToolTip : public WindowHandle
void add(HWND hparent, HWND htool, LPCTSTR txt=LPSTR_TEXTCALLBACK)
{
TOOLINFO ti = {
sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND/*|TTF_TRANSPARENT*/, hparent, (UINT)htool, 0, 0, 0, 0, 0, 0, 0
sizeof(TOOLINFO), TTF_SUBCLASS|TTF_IDISHWND/*|TTF_TRANSPARENT*/, hparent, (UINT)htool, {0,0,0,0}, 0, 0, 0
};
ti.lpszText = (LPTSTR) txt;