--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: gtk/dataform.h
+// Purpose: declaration of the wxDataFormat class
+// Author: David Webster (lifted from dnd.h)
+// Modified by:
+// Created: 10/21/99
+// RCS-ID: $Id$
+// Copyright: (c) 1999 David Webster
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_OS2_DATAFORM_H
+#define _WX_OS2_DATAFORM_H
+
+class wxDataFormat
+{
+public:
+ // the clipboard formats under GDK are GdkAtoms
+ typedef unsigned short NativeFormat;
+
+ wxDataFormat();
+ wxDataFormat( wxDataFormatId type );
+ wxDataFormat( const wxString &id );
+ wxDataFormat( const wxChar *id );
+ wxDataFormat( NativeFormat format );
+
+ wxDataFormat& operator=(NativeFormat format)
+ { SetId(format); return *this; }
+
+ // comparison (must have both versions)
+ bool operator==(NativeFormat format) const
+ { return m_format == (NativeFormat)format; }
+ bool operator!=(NativeFormat format) const
+ { return m_format != (NativeFormat)format; }
+
+ // explicit and implicit conversions to NativeFormat which is one of
+ // standard data types (implicit conversion is useful for preserving the
+ // compatibility with old code)
+ NativeFormat GetFormatId() const { return m_format; }
+ operator NativeFormat() const { return m_format; }
+
+ void SetId( NativeFormat format );
+
+ // string ids are used for custom types - this SetId() must be used for
+ // application-specific formats
+ wxString GetId() const;
+ void SetId( const wxChar *id );
+
+ // implementation
+ wxDataFormatId GetType() const;
+
+private:
+ wxDataFormatId m_type;
+ NativeFormat m_format;
+
+ void PrepareFormats();
+ void SetType( wxDataFormatId type );
+};
+
+#endif // _WX_GTK_DATAFORM_H
class WXDLLEXPORT wxDropSource;
-//-------------------------------------------------------------------------
-// wxDataFormat (internal)
-//-------------------------------------------------------------------------
-
-class wxDataFormat : public wxObject
-{
- DECLARE_CLASS( wxDataFormat )
-
-public:
- wxDataFormat();
- wxDataFormat( wxDataFormatId type );
- wxDataFormat( const wxString &id );
- wxDataFormat( const wxChar *id );
- wxDataFormat( const wxDataFormat &format );
-
- void SetType( wxDataFormatId type );
- wxDataFormatId GetType() const;
-
- /* the string Id identifies the format of clipboard or DnD data. a word
- * processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
- * to the clipboard - the latter with the Id "application/wxword", an
- * image manipulation program would put a wxBitmapDataObject and a
- * wxPrivateDataObject to the clipboard - the latter with "image/png". */
-
- wxString GetId() const;
- void SetId( const wxChar *id );
-
- // implicit conversion to wxDataFormatId
- operator wxDataFormatId() const { return m_type; }
-
- bool operator==(wxDataFormatId type) const { return m_type == type; }
- bool operator!=(wxDataFormatId type) const { return m_type != type; }
-
-private:
- wxDataFormatId m_type;
- wxString m_id;
-};
-
//-------------------------------------------------------------------------
// wxDataBroker (internal)
//-------------------------------------------------------------------------
// wxDataObject
//-------------------------------------------------------------------------
-class WXDLLEXPORT wxDataObject: public wxObject
+class WXDLLEXPORT wxDataObject: public wxDataObjectBase
{
public:
// all data formats (values are the same as in windows.h, do not change!)
// get the (total) size of data
virtual size_t GetDataSize() const = 0;
// copy raw data to provided pointer
- virtual void GetDataHere(void *pBuf) const = 0;
-
-};
-
-// ----------------------------------------------------------------------------
-// wxTextDataObject is a specialization of wxDataObject for text data
-// ----------------------------------------------------------------------------
-
-class WXDLLEXPORT wxTextDataObject : public wxDataObject
-{
-public:
- // ctors
- wxTextDataObject() { }
- wxTextDataObject(const wxString& strText) : m_strText(strText) { }
- void Init(const wxString& strText) { m_strText = strText; }
-
- // implement base class pure virtuals
- virtual wxDataFormat GetPreferredFormat() const
- { return wxDF_TEXT; }
- virtual bool IsSupportedFormat(wxDataFormat format) const
- { return format == wxDF_TEXT; }
- virtual size_t GetDataSize() const
- { return m_strText.Len() + 1; } // +1 for trailing '\0'of course
- virtual void GetDataHere(void *pBuf) const
- { memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
-
-private:
- wxString m_strText;
+ virtual bool GetDataHere(void *pBuf) const = 0;
};
virtual wxDataFormat GetPreferredFormat() const
{ return wxDF_FILENAME; }
virtual bool IsSupportedFormat(wxDataFormat format) const
- { return format == wxDF_FILENAME; }
+ { return format == (unsigned short)wxDF_FILENAME; }
virtual size_t GetDataSize() const
{ return m_files.Len() + 1; } // +1 for trailing '\0'of course
- virtual void GetDataHere(void *pBuf) const
+ virtual bool GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_files.c_str(), GetDataSize()); }
private:
..\common\$D\config.obj \
..\common\$D\ctrlcmn.obj \
..\common\$D\date.obj \
- ..\common\$D\datastrm.obj \
- ..\common\$D\dcbase.obj \
+ ..\common\$D\datstrm.obj \
..\common\$D\db.obj \
..\common\$D\dbtable.obj \
+ ..\common\$D\dcbase.obj \
..\common\$D\dlgcmn.obj \
+ ..\common\$D\dobjcmn.obj \
..\common\$D\docmdi.obj \
..\common\$D\docview.obj \
- ..\common\$D\docmdi.obj \
..\common\$D\dynarray.obj \
..\common\$D\dynlib.obj \
..\common\$D\event.obj \
..\common\$D\imagpcx.obj \
..\common\$D\imagpng.obj \
..\common\$D\imagpnm.obj \
- ..\common\$D\init.obj \
..\common\$D\intl.obj \
..\common\$D\ipcbase.obj \
..\common\$D\layout.obj \
..\common\$D\prntbase.obj \
..\common\$D\process.obj \
..\common\$D\protocol.obj \
- ..\common\$D\resourc2.obj \
..\common\$D\resource.obj \
..\common\$D\sckaddr.obj \
..\common\$D\sckfile.obj \
..\common\$D\string.obj \
..\common\$D\tbarbase.obj \
..\common\$D\tbarsmpl.obj \
- ..\common\$D\textfile.obj \
- ..\common\$D\textsmpl.obj \
..\common\$D\textcmn.obj \
..\common\$D\textfile.obj \
..\common\$D\time.obj \
config.obj \
ctrlcmn.obj \
date.obj \
- datastrm.obj \
- dcbase.obj \
+ datstrm.obj \
db.obj \
dbtable.obj \
+ dcbase.obj \
dlgcmn.obj \
+ dobjcmn.obj \
docmdi.obj \
docview.obj \
- docmdi.obj \
dynarray.obj \
dynlib.obj \
event.obj \
imagpcx.obj \
imagpng.obj \
imagpnm.obj \
- init.obj \
intl.obj \
ipcbase.obj \
- layout.obj
+ layout.obj \
+ list.obj \
+ log.obj
COMLIBOBJS2 = \
- list.obj \
- log.obj \
longlong.obj \
matrix.obj \
memory.obj \
prntbase.obj \
process.obj \
protocol.obj \
- resourc2.obj \
resource.obj \
sckaddr.obj \
sckfile.obj \
string.obj \
tbarbase.obj \
tbarsmpl.obj \
- textfile.obj \
- textsmpl.obj \
textcmn.obj \
textfile.obj \
time.obj \
wxexpr.obj \
y_tab.obj \
zipstrm.obj \
- zstream.obj \
+ zstream.obj
OS2OBJS = \
..\os2\$D\accel.obj \
copy ..\common\$D\config.obj
copy ..\common\$D\ctrlcmn.obj
copy ..\common\$D\date.obj
- copy ..\common\$D\datastrm.obj
- copy ..\common\$D\dcbase.obj
+ copy ..\common\$D\datstrm.obj
copy ..\common\$D\db.obj
copy ..\common\$D\dbtable.obj
+ copy ..\common\$D\dcbase.obj
copy ..\common\$D\dlgcmn.obj
+ copy ..\common\$D\dobjcmn.obj
copy ..\common\$D\docmdi.obj
copy ..\common\$D\docview.obj
- copy ..\common\$D\docmdi.obj
copy ..\common\$D\dynarray.obj
copy ..\common\$D\dynlib.obj
copy ..\common\$D\event.obj
copy ..\common\$D\imagpcx.obj
copy ..\common\$D\imagpng.obj
copy ..\common\$D\imagpnm.obj
- copy ..\common\$D\init.obj
copy ..\common\$D\intl.obj
copy ..\common\$D\ipcbase.obj
copy ..\common\$D\layout.obj
-
-$(COMLIBOBJS2):
copy ..\common\$D\list.obj
copy ..\common\$D\log.obj
- copy ..\common\$D\longlong.obj
- copy ..\common\$D\matrix.obj
- copy ..\common\$D\memory.obj
- copy ..\common\$D\mimetype.obj
- copy ..\common\$D\module.obj
- copy ..\common\$D\mstream.obj
- copy ..\common\$D\object.obj
- copy ..\common\$D\objstrm.obj
- copy ..\common\$D\odbc.obj
- copy ..\common\$D\paper.obj
- copy ..\common\$D\prntbase.obj
- copy ..\common\$D\process.obj
- copy ..\common\$D\protocol.obj
- copy ..\common\$D\resourc2.obj
- copy ..\common\$D\resource.obj
- copy ..\common\$D\sckaddr.obj
- copy ..\common\$D\sckfile.obj
- copy ..\common\$D\sckipc.obj
- copy ..\common\$D\sckstrm.obj
- copy ..\common\$D\serbase.obj
- copy ..\common\$D\sizer.obj
- copy ..\common\$D\socket.obj
- copy ..\common\$D\strconv.obj
- copy ..\common\$D\stream.obj
- copy ..\common\$D\string.obj
- copy ..\common\$D\tbarbase.obj
- copy ..\common\$D\tbarsmpl.obj
- copy ..\common\$D\textfile.obj
- copy ..\common\$D\textsmpl.obj
- copy ..\common\$D\textcmn.obj
- copy ..\common\$D\textfile.obj
- copy ..\common\$D\time.obj
- copy ..\common\$D\timercmn.obj
- copy ..\common\$D\tokenzr.obj
- copy ..\common\$D\txtstrm.obj
- copy ..\common\$D\unzip.obj
- copy ..\common\$D\url.obj
- copy ..\common\$D\utilscmn.obj
- copy ..\common\$D\valgen.obj
- copy ..\common\$D\validate.obj
- copy ..\common\$D\valtext.obj
- copy ..\common\$D\variant.obj
- copy ..\common\$D\wfstream.obj
- copy ..\common\$D\wincmn.obj
- copy ..\common\$D\wxchar.obj
- copy ..\common\$D\wxexpr.obj
- copy ..\common\$D\y_tab.obj
- copy ..\common\$D\zipstrm.obj
+
+$(COMLIBOBJS2):
+ copy ..\common\$D\longlong.obj \
+ copy ..\common\$D\matrix.obj \
+ copy ..\common\$D\memory.obj \
+ copy ..\common\$D\mimetype.obj \
+ copy ..\common\$D\module.obj \
+ copy ..\common\$D\mstream.obj \
+ copy ..\common\$D\object.obj \
+ copy ..\common\$D\objstrm.obj \
+ copy ..\common\$D\odbc.obj \
+ copy ..\common\$D\paper.obj \
+ copy ..\common\$D\prntbase.obj \
+ copy ..\common\$D\process.obj \
+ copy ..\common\$D\protocol.obj \
+ copy ..\common\$D\resource.obj \
+ copy ..\common\$D\sckaddr.obj \
+ copy ..\common\$D\sckfile.obj \
+ copy ..\common\$D\sckipc.obj \
+ copy ..\common\$D\sckstrm.obj \
+ copy ..\common\$D\serbase.obj \
+ copy ..\common\$D\sizer.obj \
+ copy ..\common\$D\socket.obj \
+ copy ..\common\$D\strconv.obj \
+ copy ..\common\$D\stream.obj \
+ copy ..\common\$D\string.obj \
+ copy ..\common\$D\tbarbase.obj \
+ copy ..\common\$D\tbarsmpl.obj \
+ copy ..\common\$D\textcmn.obj \
+ copy ..\common\$D\textfile.obj \
+ copy ..\common\$D\time.obj \
+ copy ..\common\$D\timercmn.obj \
+ copy ..\common\$D\tokenzr.obj \
+ copy ..\common\$D\txtstrm.obj \
+ copy ..\common\$D\unzip.obj \
+ copy ..\common\$D\url.obj \
+ copy ..\common\$D\utilscmn.obj \
+ copy ..\common\$D\valgen.obj \
+ copy ..\common\$D\validate.obj \
+ copy ..\common\$D\valtext.obj \
+ copy ..\common\$D\variant.obj \
+ copy ..\common\$D\wfstream.obj \
+ copy ..\common\$D\wincmn.obj \
+ copy ..\common\$D\wxchar.obj \
+ copy ..\common\$D\wxexpr.obj \
+ copy ..\common\$D\y_tab.obj \
+ copy ..\common\$D\zipstrm.obj \
copy ..\common\$D\zstream.obj
$(GENLIBOBJS):