now MSW stuff is complete

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1998-05-20 14:21:00 +00:00
parent 2bda0e1738
commit bbf1f0e5cf
118 changed files with 9265 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
/*-----------------------------------------------------------------------
| CTL3D.DLL
|
| Adds 3d effects to Windows controls
|
| See ctl3d.doc for info
|
-----------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
BOOL WINAPI Ctl3dSubclassDlg(HWND, WORD);
BOOL WINAPI Ctl3dSubclassDlgEx(HWND, DWORD);
WORD WINAPI Ctl3dGetVer(void);
BOOL WINAPI Ctl3dEnabled(void);
HBRUSH WINAPI Ctl3dCtlColor(HDC, LONG); // ARCHAIC, use Ctl3dCtlColorEx
HBRUSH WINAPI Ctl3dCtlColorEx(UINT wm, WPARAM wParam, LPARAM lParam);
BOOL WINAPI Ctl3dColorChange(void);
BOOL WINAPI Ctl3dSubclassCtl(HWND);
LONG WINAPI Ctl3dDlgFramePaint(HWND, UINT, WPARAM, LPARAM);
BOOL WINAPI Ctl3dAutoSubclass(HANDLE);
BOOL WINAPI Ctl3dRegister(HANDLE);
BOOL WINAPI Ctl3dUnregister(HANDLE);
//begin DBCS: far east short cut key support
VOID WINAPI Ctl3dWinIniChange(void);
//end DBCS
/* Ctl3dSubclassDlg3d flags */
#define CTL3D_BUTTONS 0x0001
#define CTL3D_LISTBOXES 0x0002
#define CTL3D_EDITS 0x0004
#define CTL3D_COMBOS 0x0008
#define CTL3D_STATICTEXTS 0x0010
#define CTL3D_STATICFRAMES 0x0020
#define CTL3D_NODLGWINDOW 0x00010000
#define CTL3D_ALL 0xffff
#define WM_DLGBORDER (WM_USER+3567)
/* WM_DLGBORDER *(int FAR *)lParam return codes */
#define CTL3D_NOBORDER 0
#define CTL3D_BORDER 1
#define WM_DLGSUBCLASS (WM_USER+3568)
/* WM_DLGSUBCLASS *(int FAR *)lParam return codes */
#define CTL3D_NOSUBCLASS 0
#define CTL3D_SUBCLASS 1
/* Resource ID for 3dcheck.bmp (for .lib version of ctl3d) */
#define CTL3D_3DCHECK 26567
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,113 @@
///////////////////////////////////////////////////////////////////////////////
// Name: ole/droptgt.h
// Purpose: declaration of the wxDropTarget class
// Author: Vadim Zeitlin
// Modified by:
// Created: 06.03.98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// prolog
// ============================================================================
#ifndef _OLEDROPTGT_H
#define _OLEDROPTGT_H
#ifdef __GNUG__
#pragma interface "droptgt.h"
#endif
#if !USE_DRAG_AND_DROP
#error "You should #define USE_DRAG_AND_DROP to 1 to compile this file!"
#endif //WX_DRAG_DROP
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class wxIDropTarget;
struct IDataObject;
typedef unsigned short wxDataFormat;
// ----------------------------------------------------------------------------
// An instance of the class wxDropTarget may be associated with any wxWindow
// derived object via SetDropTarget() function. If this is done, the virtual
// methods of wxDropTarget are called when something is dropped on the window.
//
// Note that wxDropTarget is an abstract base class (ABC) and you should derive
// your own class from it implementing pure virtual function in order to use it
// (all of them, including protected ones which are called by the class itself)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxDropTarget
{
public:
// ctor & dtor
wxDropTarget();
virtual ~wxDropTarget();
// normally called by wxWindow on window creation/destruction, but might be
// called `manually' as well. Register() returns true on success.
bool Register(WXHWND hwnd);
void Revoke(WXHWND hwnd);
// do we accept this kind of data?
virtual bool IsAcceptedData(IDataObject *pIDataSource) const;
// called when mouse enters/leaves the window: might be used to give
// some visual feedback to the user
virtual void OnEnter() { }
virtual void OnLeave() { }
// this function is called when data is dropped.
// (x, y) are the coordinates of the drop
virtual bool OnDrop(long x, long y, const void *pData) = 0;
protected:
// Override these to indicate what kind of data you support: the first
// format to which data can be converted is used. The classes below show
// how it can be done in the simplest cases.
// how many different (clipboard) formats do you support?
virtual size_t GetFormatCount() const = 0;
// return the n-th supported format
virtual wxDataFormat GetFormat(size_t n) const = 0;
private:
wxIDropTarget *m_pIDropTarget; // the pointer to COM interface
};
// ----------------------------------------------------------------------------
// A simple wxDropTarget derived class for text data: you only need to
// override OnDropText() to get something working
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxTextDropTarget : public wxDropTarget
{
public:
virtual bool OnDrop(long x, long y, const void *pData);
virtual bool OnDropText(long x, long y, const char *psz) = 0;
protected:
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
};
// ----------------------------------------------------------------------------
// A drop target which accepts files (dragged from File Manager or Explorer)
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFileDropTarget : public wxDropTarget
{
public:
virtual bool OnDrop(long x, long y, const void *pData);
// params: the number of files and the array of file names
virtual bool OnDropFiles(long x, long y,
size_t nFiles, const char * const aszFiles[]) = 0;
protected:
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
};
// ============================================================================
#endif //_OLEDROPTGT_H

View File

@@ -0,0 +1,145 @@
///////////////////////////////////////////////////////////////////////////////
// Name: oleutils.h
// Purpose: OLE helper routines, OLE debugging support &c
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.02.1998
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
#ifndef _OLEUTILS_H
#define _OLEUTILS_H
#ifdef __GNUG__
#pragma interface "oleutils.h"
#endif
// ============================================================================
// General purpose functions and macros
// ============================================================================
// ----------------------------------------------------------------------------
// misc helper functions/macros
// ----------------------------------------------------------------------------
// release the interface pointer (if !NULL)
inline void ReleaseInterface(IUnknown *pIUnk)
{
if ( pIUnk != NULL )
pIUnk->Release();
}
// release the interface pointer (if !NULL) and make it NULL
#define RELEASE_AND_NULL(p) if ( (p) != NULL ) { p->Release(); p = NULL; };
// return TRUE if the iid is in the array
bool IsIidFromList(REFIID riid, const IID *aIids[], size_t nCount);
// ============================================================================
// IUnknown implementation helpers
// ============================================================================
/*
The most dumb implementation of IUnknown methods. We don't support
aggregation nor containment, but for 99% of cases this simple
implementation is quite enough.
Usage is trivial: here is all you should have
1) DECLARE_IUNKNOWN_METHOS in your (IUnknown derived!) class declaration
2) BEGIN/END_IID_TABLE with ADD_IID in between for all interfaces you
support (at least all for which you intent to return 'this' from QI,
i.e. you should derive from IFoo if you have ADD_IID(Foo)) somewhere else
3) IMPLEMENT_IUNKNOWN_METHOS somewhere also
These macros are quite simple: AddRef and Release are trivial and QI does
lookup in a static member array of IIDs and returns 'this' if it founds
the requested interface in it or E_NOINTERFACE if not.
*/
// declare the methods and the member variable containing reference count
// you must also define the ms_aIids array somewhere with BEGIN_IID_TABLE
// and friends (see below)
#define DECLARE_IUNKNOWN_METHODS \
public: \
STDMETHODIMP QueryInterface(REFIID, void **); \
STDMETHODIMP_(ULONG) AddRef(); \
STDMETHODIMP_(ULONG) Release(); \
private: \
static const IID *ms_aIids[]; \
ULONG m_cRef
// macros for declaring supported interfaces
// NB: you should write ADD_INTERFACE(Foo) and not ADD_INTERFACE(IID_IFoo)!
#define BEGIN_IID_TABLE(cname) const IID *cname::ms_aIids[] = {
#define ADD_IID(iid) &IID_I##iid,
#define END_IID_TABLE }
// implementation is as straightforward as possible
// Parameter: classname - the name of the class
#define IMPLEMENT_IUNKNOWN_METHODS(classname) \
STDMETHODIMP classname::QueryInterface(REFIID riid, void **ppv) \
{ \
wxLogQueryInterface(#classname, riid); \
\
if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) { \
*ppv = this; \
AddRef(); \
\
return S_OK; \
} \
else { \
*ppv = NULL; \
\
return (HRESULT) E_NOINTERFACE; \
} \
} \
\
STDMETHODIMP_(ULONG) classname::AddRef() \
{ \
wxLogAddRef(#classname, m_cRef); \
\
return ++m_cRef; \
} \
\
STDMETHODIMP_(ULONG) classname::Release() \
{ \
wxLogRelease(#classname, m_cRef); \
\
if ( --m_cRef == 0 ) { \
delete this; \
return 0; \
} \
else \
return m_cRef; \
}
// ============================================================================
// Debugging support
// ============================================================================
#ifdef __DEBUG__
// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// All OLE specific log functions have DebugTrace level (as LogTrace)
// ----------------------------------------------------------------------------
// tries to translate riid into a symbolic name, if possible
void wxLogQueryInterface(const char *szInterface, REFIID riid);
// these functions print out the new value of reference counter
void wxLogAddRef (const char *szInterface, ULONG cRef);
void wxLogRelease(const char *szInterface, ULONG cRef);
#else //!DEBUG
#define wxLogQueryInterface(szInterface, riid)
#define wxLogAddRef(szInterface, cRef)
#define wxLogRelease(szInterface, cRef)
#endif //DEBUG
#endif //_OLEUTILS_H

91
include/wx/msw/ole/uuid.h Normal file
View File

@@ -0,0 +1,91 @@
///////////////////////////////////////////////////////////////////////////////
// Name: ole/uuid.h
// Purpose: encapsulates an UUID with some added helper functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 11.07.97
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows license
//
// Notes: you should link your project with RPCRT4.LIB!
///////////////////////////////////////////////////////////////////////////////
#ifndef _OLEUUID_H
#define _OLEUUID_H
#ifdef __GNUG__
#pragma interface "uuid.h"
#endif
// ------------------------------------------------------------------
// UUID (Universally Unique IDentifier) definition
// ------------------------------------------------------------------
// ----- taken from RPC.H
#ifndef UUID_DEFINED // in some cases RPC.H will be already
#ifdef __WIN32__ // included, so avoid redefinition
typedef struct
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} UUID; // UUID = GUID = CLSID = LIBID = IID
#else // WIN16
#error "Don't know about UUIDs on this platform"
#endif // WIN32
#endif // UUID_DEFINED
#ifndef GUID_DEFINED
typedef UUID GUID;
#define UUID_DEFINED // prevent redefinition
#endif // GUID_DEFINED
typedef unsigned char uchar;
// ------------------------------------------------------------------
// a class to store UUID and it's string representation
// ------------------------------------------------------------------
// uses RPC functions to create/convert Universally Unique Identifiers
class Uuid
{
private:
UUID m_uuid;
uchar *m_pszUuid; // this string is alloc'd and freed by RPC
char *m_pszCForm; // this string is allocated in Set/Create
void UuidToCForm();
// function used to set initial state by all ctors
void Init() { m_pszUuid = NULL; m_pszCForm = NULL; }
public:
// ctors & dtor
Uuid() { Init(); }
Uuid(const char *pc) { Init(); Set(pc); }
Uuid(const UUID &uuid) { Init(); Set(uuid); }
~Uuid();
// copy ctor and assignment operator needed for this class
Uuid(const Uuid& uuid);
Uuid& operator=(const Uuid& uuid);
// create a brand new UUID
void Create();
// set value of UUID
bool Set(const char *pc); // from a string, returns true if ok
void Set(const UUID& uuid); // from another UUID (never fails)
// accessors
operator const UUID*() const { return &m_uuid; }
operator const char*() const { return (char *)(m_pszUuid); }
// return string representation of the UUID in the C form
// (as in DEFINE_GUID macro)
const char *CForm() const { return m_pszCForm; }
};
#endif // _OLEUUID_H