mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
Import r67258 of the wxWidgets trunk, which I expect will before
long become wxWidgets 2.9.2, which in turn is expected to be the last 2.9 release before the 3.0 stable release. Since the full wxWidgets distribution is rather large, I have imported only the parts that we use, on a subdirectory basis: art include/wx/*.* include/wx/aui include/wx/cocoa include/wx/generic include/wx/gtk include/wx/meta include/wx/msw include/wx/osx include/wx/persist include/wx/private include/wx/protocol include/wx/unix src/aui src/common src/generic src/gtk src/msw src/osx src/unix git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7380 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
33
Externals/wxWidgets3/include/wx/gtk/private/gdkconv.h
vendored
Normal file
33
Externals/wxWidgets3/include/wx/gtk/private/gdkconv.h
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/gdkconv.h
|
||||
// Purpose: Helper functions for converting between GDK and wx types
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-11-10
|
||||
// RCS-ID: $Id: gdkconv.h 64140 2010-04-25 21:33:16Z FM $
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _GTK_PRIVATE_GDKCONV_H_
|
||||
#define _GTK_PRIVATE_GDKCONV_H_
|
||||
|
||||
namespace wxGTKImpl
|
||||
{
|
||||
|
||||
inline wxRect wxRectFromGDKRect(const GdkRectangle *r)
|
||||
{
|
||||
return wxRect(r->x, r->y, r->width, r->height);
|
||||
}
|
||||
|
||||
inline void wxRectToGDKRect(const wxRect& rect, GdkRectangle& r)
|
||||
{
|
||||
r.x = rect.x;
|
||||
r.y = rect.y;
|
||||
r.width = rect.width;
|
||||
r.height = rect.height;
|
||||
}
|
||||
|
||||
} // namespace wxGTKImpl
|
||||
|
||||
#endif // _GTK_PRIVATE_GDKCONV_H_
|
||||
|
45
Externals/wxWidgets3/include/wx/gtk/private/messagetype.h
vendored
Normal file
45
Externals/wxWidgets3/include/wx/gtk/private/messagetype.h
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/messagetype.h
|
||||
// Purpose: translate between wx and GtkMessageType
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-09-27
|
||||
// RCS-ID: $Id: messagetype.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _GTK_PRIVATE_MSGTYPE_H_
|
||||
#define _GTK_PRIVATE_MSGTYPE_H_
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
namespace wxGTKImpl
|
||||
{
|
||||
|
||||
// Convert the given wx style to GtkMessageType, return true if succeeded or
|
||||
// false if failed.
|
||||
inline bool ConvertMessageTypeFromWX(int style, GtkMessageType *type)
|
||||
{
|
||||
#ifdef __WXGTK210__
|
||||
if ( gtk_check_version(2, 10, 0) == NULL && (style & wxICON_NONE))
|
||||
*type = GTK_MESSAGE_OTHER;
|
||||
else
|
||||
#endif // __WXGTK210__
|
||||
if (style & wxICON_EXCLAMATION)
|
||||
*type = GTK_MESSAGE_WARNING;
|
||||
else if (style & wxICON_ERROR)
|
||||
*type = GTK_MESSAGE_ERROR;
|
||||
else if (style & wxICON_INFORMATION)
|
||||
*type = GTK_MESSAGE_INFO;
|
||||
else if (style & wxICON_QUESTION)
|
||||
*type = GTK_MESSAGE_QUESTION;
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace wxGTKImpl
|
||||
|
||||
#endif // _GTK_PRIVATE_MSGTYPE_H_
|
||||
|
39
Externals/wxWidgets3/include/wx/gtk/private/mnemonics.h
vendored
Normal file
39
Externals/wxWidgets3/include/wx/gtk/private/mnemonics.h
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/mnemonics.h
|
||||
// Purpose: helper functions for dealing with GTK+ mnemonics
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-11-12
|
||||
// RCS-ID: $Id: mnemonics.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _GTK_PRIVATE_MNEMONICS_H_
|
||||
#define _GTK_PRIVATE_MNEMONICS_H_
|
||||
|
||||
#if wxUSE_CONTROLS || wxUSE_MENUS
|
||||
|
||||
#include "wx/string.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// functions to convert between wxWidgets and GTK+ string containing mnemonics
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// remove all mnemonics from a string
|
||||
wxString wxGTKRemoveMnemonics(const wxString& label);
|
||||
|
||||
// convert a wx string with '&' to GTK+ string with '_'s
|
||||
wxString wxConvertMnemonicsToGTK(const wxString& label);
|
||||
|
||||
// convert a wx string with '&' to indicate mnemonics as well as HTML entities
|
||||
// to a GTK+ string with "&" used instead of '&', i.e. suitable for use
|
||||
// with GTK+ functions using markup strings
|
||||
wxString wxConvertMnemonicsToGTKMarkup(const wxString& label);
|
||||
|
||||
// convert GTK+ string with '_'s to wx string with '&'s
|
||||
wxString wxConvertMnemonicsFromGTK(const wxString& label);
|
||||
|
||||
#endif // wxUSE_CONTROLS || wxUSE_MENUS
|
||||
|
||||
#endif // _GTK_PRIVATE_MNEMONICS_H_
|
||||
|
36
Externals/wxWidgets3/include/wx/gtk/private/object.h
vendored
Normal file
36
Externals/wxWidgets3/include/wx/gtk/private/object.h
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/object.h
|
||||
// Purpose: wxGtkObject class declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2008-08-27
|
||||
// RCS-ID: $Id: object.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_OBJECT_H_
|
||||
#define _WX_GTK_PRIVATE_OBJECT_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Convenience class for calling g_object_unref() automatically
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
template <typename T>
|
||||
class wxGtkObject
|
||||
{
|
||||
public:
|
||||
explicit wxGtkObject(T *p) : m_ptr(p) { }
|
||||
~wxGtkObject() { g_object_unref(m_ptr); }
|
||||
|
||||
operator T *() const { return m_ptr; }
|
||||
|
||||
private:
|
||||
T * const m_ptr;
|
||||
|
||||
// copying could be implemented by using g_object_ref() but for now there
|
||||
// is no need for it so don't implement it
|
||||
wxDECLARE_NO_COPY_CLASS(wxGtkObject);
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_OBJECT_H_
|
||||
|
121
Externals/wxWidgets3/include/wx/gtk/private/string.h
vendored
Normal file
121
Externals/wxWidgets3/include/wx/gtk/private/string.h
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/string.h
|
||||
// Purpose: wxGtkString class declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2006-10-19
|
||||
// RCS-ID: $Id: string.h 65680 2010-09-30 11:44:45Z VZ $
|
||||
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_STRING_H_
|
||||
#define _WX_GTK_PRIVATE_STRING_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Convenience class for g_freeing a gchar* on scope exit automatically
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxGtkString
|
||||
{
|
||||
public:
|
||||
explicit wxGtkString(gchar *s) : m_str(s) { }
|
||||
~wxGtkString() { g_free(m_str); }
|
||||
|
||||
const gchar *c_str() const { return m_str; }
|
||||
|
||||
operator gchar *() const { return m_str; }
|
||||
|
||||
private:
|
||||
gchar *m_str;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGtkString);
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// list for sorting collated strings
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/string.h"
|
||||
#include "wx/vector.h"
|
||||
#include "wx/sharedptr.h"
|
||||
|
||||
class wxGtkCollatableString
|
||||
{
|
||||
public:
|
||||
wxGtkCollatableString( const wxString &label, gchar *key )
|
||||
{
|
||||
m_label = label;
|
||||
m_key = key;
|
||||
}
|
||||
|
||||
~wxGtkCollatableString()
|
||||
{
|
||||
if (m_key)
|
||||
g_free( m_key );
|
||||
}
|
||||
|
||||
wxString m_label;
|
||||
gchar *m_key;
|
||||
};
|
||||
|
||||
class wxGtkCollatedArrayString
|
||||
{
|
||||
public:
|
||||
wxGtkCollatedArrayString() { }
|
||||
|
||||
int Add( const wxString &new_label )
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
gchar *new_key_lower = g_utf8_casefold( new_label.utf8_str(), -1);
|
||||
gchar *new_key = g_utf8_collate_key( new_key_lower, -1);
|
||||
g_free( new_key_lower );
|
||||
|
||||
wxSharedPtr<wxGtkCollatableString> new_ptr( new wxGtkCollatableString( new_label, new_key ) );
|
||||
|
||||
wxVector< wxSharedPtr<wxGtkCollatableString> >::iterator iter;
|
||||
for (iter = m_list.begin(); iter != m_list.end(); ++iter)
|
||||
{
|
||||
wxSharedPtr<wxGtkCollatableString> ptr = *iter;
|
||||
|
||||
gchar *key = ptr->m_key;
|
||||
if (strcmp(key,new_key) >= 0)
|
||||
{
|
||||
m_list.insert( iter, new_ptr );
|
||||
return index;
|
||||
}
|
||||
index ++;
|
||||
}
|
||||
|
||||
m_list.push_back( new_ptr );
|
||||
return index;
|
||||
}
|
||||
|
||||
size_t GetCount()
|
||||
{
|
||||
return m_list.size();
|
||||
}
|
||||
|
||||
wxString At( size_t index )
|
||||
{
|
||||
return m_list[index]->m_label;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
m_list.clear();
|
||||
}
|
||||
|
||||
void RemoveAt( size_t index )
|
||||
{
|
||||
m_list.erase( m_list.begin() + index );
|
||||
}
|
||||
|
||||
private:
|
||||
wxVector< wxSharedPtr<wxGtkCollatableString> > m_list;
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_STRING_H_
|
||||
|
36
Externals/wxWidgets3/include/wx/gtk/private/timer.h
vendored
Normal file
36
Externals/wxWidgets3/include/wx/gtk/private/timer.h
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/timer.h
|
||||
// Purpose: wxTimerImpl for wxGTK
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id: timer.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_TIMER_H_
|
||||
#define _WX_GTK_PRIVATE_TIMER_H_
|
||||
|
||||
#if wxUSE_TIMER
|
||||
|
||||
#include "wx/private/timer.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTimer
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGTKTimerImpl : public wxTimerImpl
|
||||
{
|
||||
public:
|
||||
wxGTKTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { m_sourceId = 0; };
|
||||
|
||||
virtual bool Start( int millisecs = -1, bool oneShot = false );
|
||||
virtual void Stop();
|
||||
virtual bool IsRunning() const { return m_sourceId != 0; }
|
||||
|
||||
protected:
|
||||
int m_sourceId;
|
||||
};
|
||||
|
||||
#endif // wxUSE_TIMER
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_TIMER_H_
|
38
Externals/wxWidgets3/include/wx/gtk/private/win_gtk.h
vendored
Normal file
38
Externals/wxWidgets3/include/wx/gtk/private/win_gtk.h
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/* ///////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/win_gtk.h
|
||||
// Purpose: native GTK+ widget for wxWindow
|
||||
// Author: Robert Roebling
|
||||
// Id: $Id: win_gtk.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////// */
|
||||
|
||||
#ifndef _WX_GTK_PIZZA_H_
|
||||
#define _WX_GTK_PIZZA_H_
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define WX_PIZZA(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, wxPizza::type(), wxPizza)
|
||||
#define WX_IS_PIZZA(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, wxPizza::type())
|
||||
|
||||
struct WXDLLIMPEXP_CORE wxPizza
|
||||
{
|
||||
// borders styles which can be used with wxPizza
|
||||
enum { BORDER_STYLES =
|
||||
wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN | wxBORDER_THEME };
|
||||
|
||||
static GtkWidget* New(long windowStyle = 0);
|
||||
static GType type();
|
||||
void move(GtkWidget* widget, int x, int y);
|
||||
void put(GtkWidget* widget, int x, int y);
|
||||
void scroll(int dx, int dy);
|
||||
void get_border_widths(int& x, int& y);
|
||||
|
||||
GtkFixed m_fixed;
|
||||
int m_scroll_x;
|
||||
int m_scroll_y;
|
||||
int m_border_style;
|
||||
bool m_is_scrollable;
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_PIZZA_H_
|
Reference in New Issue
Block a user