wxMotif compilation fixes for wxDataObject and PROCESS_EVENTS (wxSocket)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -412,7 +412,7 @@ private:
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/ole/dataobj2.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dataobj2.h"
|
||||
// #include "wx/motif/dataobj2.h" -- not yet
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dataobj2.h"
|
||||
#endif
|
||||
|
@@ -53,6 +53,7 @@ public:
|
||||
// implementation
|
||||
|
||||
GdkAtom GetMatchingPair();
|
||||
|
||||
void RegisterWidget( GtkWidget *widget );
|
||||
void UnregisterWidget( GtkWidget *widget );
|
||||
|
||||
|
@@ -53,6 +53,7 @@ public:
|
||||
// implementation
|
||||
|
||||
GdkAtom GetMatchingPair();
|
||||
|
||||
void RegisterWidget( GtkWidget *widget );
|
||||
void UnregisterWidget( GtkWidget *widget );
|
||||
|
||||
|
@@ -1,9 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: clipbrd.h
|
||||
// Purpose: Clipboard functionality.
|
||||
// Note: this functionality is under review, and
|
||||
// is derived from wxWindows 1.xx code. Please contact
|
||||
// the wxWindows developers for further information.
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 17/09/98
|
||||
@@ -16,14 +13,12 @@
|
||||
#define _WX_CLIPBRD_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "clipbrd.h"
|
||||
#pragma interface "clipbrd.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
#include "wx/dataobj.h"
|
||||
|
||||
#include "wx/module.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
bool WXDLLEXPORT wxOpenClipboard();
|
||||
bool WXDLLEXPORT wxClipboardOpen();
|
||||
@@ -52,19 +47,27 @@ public:
|
||||
// close the clipboard after SetData() and GetData()
|
||||
virtual void Close();
|
||||
|
||||
// can be called several times
|
||||
// opened?
|
||||
virtual bool IsOpened() const { return m_open; }
|
||||
|
||||
// replaces the data on the clipboard with data
|
||||
virtual bool SetData( wxDataObject *data );
|
||||
|
||||
// adds data to the clipboard
|
||||
virtual bool AddData( wxDataObject *data );
|
||||
|
||||
// format available on the clipboard ?
|
||||
// supply ID if private format, the same as wxPrivateDataObject::SetId()
|
||||
virtual bool IsSupported( wxDataFormat format );
|
||||
virtual bool IsSupported( const wxDataFormat& format );
|
||||
|
||||
// fill data with data on the clipboard (if available)
|
||||
virtual bool GetData( wxDataObject *data );
|
||||
virtual bool GetData( wxDataObject& data );
|
||||
|
||||
// clears wxTheClipboard and the system's clipboard if possible
|
||||
virtual void Clear();
|
||||
|
||||
virtual void UsePrimarySelection(bool primary = TRUE)
|
||||
{ m_usePrimary = primary; }
|
||||
|
||||
// implementation from now on
|
||||
|
||||
bool m_open;
|
||||
@@ -75,9 +78,6 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||
};
|
||||
|
||||
/* The clipboard */
|
||||
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
||||
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
||||
#endif
|
||||
|
@@ -15,6 +15,8 @@
|
||||
class wxDataFormat
|
||||
{
|
||||
public:
|
||||
typedef unsigned long /* Atom */ NativeFormat;
|
||||
|
||||
wxDataFormat();
|
||||
wxDataFormat( wxDataFormatId type );
|
||||
wxDataFormat( const wxString &id );
|
||||
@@ -23,7 +25,7 @@ public:
|
||||
wxDataFormat( const Atom atom );
|
||||
|
||||
void SetType( wxDataFormatId type );
|
||||
wxDataFormatId GetType() const;
|
||||
NativeFormat GetType() const { return m_type; }
|
||||
|
||||
/* the string Id identifies the format of clipboard or DnD data. a word
|
||||
* processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
|
||||
@@ -31,20 +33,20 @@ public:
|
||||
* image manipulation program would put a wxBitmapDataObject and a
|
||||
* wxPrivateDataObject to the clipboard - the latter with "image/png". */
|
||||
|
||||
wxString GetId() const;
|
||||
wxString GetId() const { return m_id; }
|
||||
void SetId( const wxChar *id );
|
||||
|
||||
Atom GetAtom();
|
||||
void SetAtom(Atom atom) { m_hasAtom = TRUE; m_atom = atom; }
|
||||
|
||||
// implicit conversion to wxDataFormatId
|
||||
operator wxDataFormatId() const { return m_type; }
|
||||
operator NativeFormat() const { return m_type; }
|
||||
|
||||
bool operator==(wxDataFormatId type) const { return m_type == type; }
|
||||
bool operator!=(wxDataFormatId type) const { return m_type != type; }
|
||||
bool operator==(NativeFormat type) const { return m_type == type; }
|
||||
bool operator!=(NativeFormat type) const { return m_type != type; }
|
||||
|
||||
private:
|
||||
wxDataFormatId m_type;
|
||||
NativeFormat m_type;
|
||||
wxString m_id;
|
||||
bool m_hasAtom;
|
||||
Atom m_atom;
|
||||
|
@@ -1,149 +1,26 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dataobj.h
|
||||
// Purpose: declaration of the wxDataObject class
|
||||
// Name: wx/motif/dataobj.h
|
||||
// Purpose: declaration of the wxDataObject class for Motif
|
||||
// Author: Julian Smart
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DATAOBJ_H_
|
||||
#define _WX_DATAOBJ_H_
|
||||
#ifndef _WX_MOTIF_DATAOBJ_H_
|
||||
#define _WX_MOTIF_DATAOBJ_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dataobj.h"
|
||||
#pragma interface "dataobj.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/bitmap.h"
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataObject is the same as wxDataObjectBase under wxMotif
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// classes
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxDataFormat;
|
||||
class wxDataObject;
|
||||
class wxTextDataObject;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxDataFormat
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class wxDataFormat : public wxObject
|
||||
class wxDataObject : public wxDataObjectBase
|
||||
{
|
||||
DECLARE_CLASS( wxDataFormat )
|
||||
|
||||
public:
|
||||
wxDataFormat();
|
||||
wxDataFormat( wxDataFormatId type );
|
||||
wxDataFormat( const wxString &id );
|
||||
wxDataFormat( const wxChar *id );
|
||||
wxDataFormat( const wxDataFormat &format );
|
||||
wxDataFormat( const Atom atom );
|
||||
|
||||
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 );
|
||||
|
||||
Atom GetAtom();
|
||||
void SetAtom(Atom atom) { m_hasAtom = TRUE; m_atom = atom; }
|
||||
|
||||
// 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;
|
||||
bool m_hasAtom;
|
||||
Atom m_atom;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxDataObject to be placed in wxDataBroker
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class wxDataObject : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS( wxDataObject )
|
||||
|
||||
public:
|
||||
|
||||
/* constructor */
|
||||
wxDataObject();
|
||||
|
||||
/* destructor */
|
||||
~wxDataObject();
|
||||
|
||||
/* write data to dest */
|
||||
virtual void WriteData( void *dest ) const = 0;
|
||||
|
||||
/* get size of data */
|
||||
virtual size_t GetSize() const = 0;
|
||||
|
||||
/* implementation */
|
||||
|
||||
wxDataFormat &GetFormat();
|
||||
|
||||
wxDataFormatId GetFormatType() const;
|
||||
wxString GetFormatId() const;
|
||||
Atom GetFormatAtom() const;
|
||||
|
||||
wxDataFormat m_format;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxTextDataObject is a specialization of wxDataObject for text data
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class wxTextDataObject : public wxDataObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS( wxTextDataObject )
|
||||
|
||||
public:
|
||||
|
||||
/* default constructor. call SetText() later or override
|
||||
WriteData() and GetSize() for working on-demand */
|
||||
wxTextDataObject();
|
||||
|
||||
/* constructor */
|
||||
wxTextDataObject( const wxString& data );
|
||||
|
||||
/* set current text data */
|
||||
void SetText( const wxString& data );
|
||||
|
||||
/* get current text data */
|
||||
wxString GetText() const;
|
||||
|
||||
/* by default calls WriteString() with string set by constructor or
|
||||
by SetText(). can be overridden for working on-demand */
|
||||
virtual void WriteData( void *dest ) const;
|
||||
|
||||
/* by default, returns length of string as set by constructor or
|
||||
by SetText(). can be overridden for working on-demand */
|
||||
virtual size_t GetSize() const;
|
||||
|
||||
/* write string to dest */
|
||||
void WriteString( const wxString &str, void *dest ) const;
|
||||
|
||||
/* implementation */
|
||||
|
||||
wxString m_data;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
//_WX_DATAOBJ_H_
|
||||
#endif //_WX_MOTIF_DATAOBJ_H_
|
||||
|
||||
|
Reference in New Issue
Block a user