Remove stray whitespaces
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -61,12 +61,12 @@ static const char *wxArtIDToStock(const wxArtID& id)
|
||||
{
|
||||
#define ART(wxid, gtkid) \
|
||||
if (id == wxid) return gtkid;
|
||||
|
||||
|
||||
ART(wxART_ERROR, GTK_STOCK_DIALOG_ERROR)
|
||||
ART(wxART_INFORMATION, GTK_STOCK_DIALOG_INFO)
|
||||
ART(wxART_WARNING, GTK_STOCK_DIALOG_WARNING)
|
||||
ART(wxART_QUESTION, GTK_STOCK_DIALOG_QUESTION)
|
||||
|
||||
|
||||
//ART(wxART_HELP_SIDE_PANEL, )
|
||||
ART(wxART_HELP_SETTINGS, GTK_STOCK_SELECT_FONT)
|
||||
//ART(wxART_HELP_BOOK, )
|
||||
@@ -121,9 +121,9 @@ static const char *wxArtIDToStock(const wxArtID& id)
|
||||
ART(wxART_FIND, GTK_STOCK_FIND)
|
||||
ART(wxART_FIND_AND_REPLACE, GTK_STOCK_FIND_AND_REPLACE)
|
||||
#endif
|
||||
|
||||
|
||||
return NULL;
|
||||
|
||||
|
||||
#undef ART
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ static GtkIconSize FindClosestIconSize(const wxSize& size)
|
||||
// only use larger bitmaps, scaling down looks better than scaling up:
|
||||
if (size.x > s_sizes[i].x || size.y > s_sizes[i].y)
|
||||
continue;
|
||||
|
||||
|
||||
unsigned dist = (size.x - s_sizes[i].x) * (size.x - s_sizes[i].x) +
|
||||
(size.y - s_sizes[i].y) * (size.y - s_sizes[i].y);
|
||||
if (dist == 0)
|
||||
@@ -183,7 +183,7 @@ static GtkIconSize FindClosestIconSize(const wxSize& size)
|
||||
{
|
||||
distance = dist;
|
||||
best = s_sizes[i].icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
@@ -196,11 +196,11 @@ static GdkPixbuf *CreateStockIcon(const char *stockid, GtkIconSize size)
|
||||
// FIXME: This code is not 100% correct, because stock pixmap are
|
||||
// context-dependent and may be affected by theme engine, the
|
||||
// correct value can only be obtained for given GtkWidget object.
|
||||
//
|
||||
//
|
||||
// Fool-proof implementation of stock bitmaps would extend wxBitmap
|
||||
// with "stock-id" representation (in addition to pixmap and pixbuf
|
||||
// ones) and would convert it to pixbuf when rendered.
|
||||
|
||||
|
||||
if (gs_gtkStyle == NULL)
|
||||
{
|
||||
GtkWidget *widget = gtk_button_new();
|
||||
@@ -229,7 +229,7 @@ static GdkPixbuf *CreateThemeIcon(const char *iconname,
|
||||
{
|
||||
gtk_icon_size_lookup(iconsize, &size.x, &size.y);
|
||||
}
|
||||
|
||||
|
||||
return gtk_icon_theme_load_icon(
|
||||
gtk_icon_theme_get_default(),
|
||||
iconname,
|
||||
@@ -244,7 +244,7 @@ wxBitmap wxGTK2ArtProvider::CreateBitmap(const wxArtID& id,
|
||||
{
|
||||
wxCharBuffer stockid = wxArtIDToStock(id);
|
||||
GtkIconSize stocksize = (size == wxDefaultSize) ?
|
||||
wxArtClientToIconSize(client) :
|
||||
wxArtClientToIconSize(client) :
|
||||
FindClosestIconSize(size);
|
||||
|
||||
// we must have some size, this is arbitrary
|
||||
@@ -277,7 +277,7 @@ wxBitmap wxGTK2ArtProvider::CreateBitmap(const wxArtID& id,
|
||||
pixbuf = p2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!pixbuf)
|
||||
return wxNullBitmap;
|
||||
|
||||
|
@@ -45,7 +45,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
|
||||
if (!cb->m_hasVMT) return;
|
||||
|
||||
if (g_blockEventsOnDrag) return;
|
||||
|
||||
|
||||
if (cb->m_blockEvent) return;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
@@ -64,7 +64,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
|
||||
bool inconsistent = gtk_toggle_button_get_inconsistent(toggle);
|
||||
|
||||
cb->m_blockEvent = true;
|
||||
|
||||
|
||||
if (!active && !inconsistent)
|
||||
{
|
||||
// checked -> undetermined
|
||||
@@ -85,7 +85,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
|
||||
{
|
||||
wxFAIL_MSG(_T("3state wxCheckBox in unexpected state!"));
|
||||
}
|
||||
|
||||
|
||||
cb->m_blockEvent = false;
|
||||
}
|
||||
else
|
||||
@@ -277,7 +277,7 @@ void wxCheckBox::OnInternalIdle()
|
||||
g_delayedFocus = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (wxUpdateUIEvent::CanUpdate(this))
|
||||
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ wxCheckListBox::wxCheckListBox() : wxListBox()
|
||||
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int nStrings,
|
||||
int nStrings,
|
||||
const wxString *choices,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
|
@@ -115,7 +115,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
|
||||
wxT("selection received for targets, format %s"),
|
||||
format.GetId().c_str() );
|
||||
|
||||
// printf( "format %s requested %s\n",
|
||||
// printf( "format %s requested %s\n",
|
||||
// gdk_atom_name( atoms[i] ),
|
||||
// gdk_atom_name( clipboard->m_targetRequested ) );
|
||||
|
||||
@@ -262,7 +262,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
|
||||
wxString::FromAscii(gdk_atom_name(selection_data->selection)).c_str()
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
if (!data->IsSupportedFormat( format )) return;
|
||||
|
||||
int size = data->GetDataSize( format );
|
||||
@@ -450,9 +450,9 @@ bool wxClipboard::AddData( wxDataObject *data )
|
||||
wxT("wxClipboard now supports atom %s"),
|
||||
array[i].GetId().c_str() );
|
||||
|
||||
// printf( "added %s\n",
|
||||
// printf( "added %s\n",
|
||||
// gdk_atom_name( array[i].GetFormatId() ) );
|
||||
|
||||
|
||||
gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
|
||||
clipboard,
|
||||
array[i],
|
||||
|
@@ -77,9 +77,9 @@ wxDataFormat::wxDataFormat( NativeFormat format )
|
||||
void wxDataFormat::SetType( wxDataFormatId type )
|
||||
{
|
||||
PrepareFormats();
|
||||
|
||||
|
||||
m_type = type;
|
||||
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
if (m_type == wxDF_UNICODETEXT)
|
||||
m_format = g_textAtom;
|
||||
@@ -141,7 +141,7 @@ void wxDataFormat::SetId( const wxChar *id )
|
||||
PrepareFormats();
|
||||
m_type = wxDF_PRIVATE;
|
||||
wxString tmp( id );
|
||||
m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE );
|
||||
m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE );
|
||||
}
|
||||
|
||||
void wxDataFormat::PrepareFormats()
|
||||
@@ -182,17 +182,17 @@ wxDataObject::~wxDataObject()
|
||||
bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const
|
||||
{
|
||||
size_t nFormatCount = GetFormatCount(dir);
|
||||
if ( nFormatCount == 1 )
|
||||
if ( nFormatCount == 1 )
|
||||
{
|
||||
return format == GetPreferredFormat();
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
wxDataFormat *formats = new wxDataFormat[nFormatCount];
|
||||
GetAllFormats(formats,dir);
|
||||
|
||||
size_t n;
|
||||
for ( n = 0; n < nFormatCount; n++ )
|
||||
for ( n = 0; n < nFormatCount; n++ )
|
||||
{
|
||||
if ( formats[n] == format )
|
||||
break;
|
||||
|
@@ -26,7 +26,7 @@ wxMemoryDC::wxMemoryDC() : wxWindowDC()
|
||||
m_ok = FALSE;
|
||||
|
||||
m_cmap = gtk_widget_get_default_colormap();
|
||||
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_context = gdk_pango_context_get();
|
||||
// Note: The Sun customised version of Pango shipping with Solaris 10
|
||||
@@ -43,7 +43,7 @@ wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
||||
m_ok = FALSE;
|
||||
|
||||
m_cmap = gtk_widget_get_default_colormap();
|
||||
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_context = gdk_pango_context_get();
|
||||
pango_context_set_language( m_context, gtk_get_default_language() );
|
||||
@@ -115,7 +115,7 @@ void wxMemoryDC::SetBrush( const wxBrush& brushOrig )
|
||||
wxWindowDC::SetBrush( brush );
|
||||
}
|
||||
|
||||
void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
|
||||
void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
|
||||
{
|
||||
wxBrush brush(brushOrig);
|
||||
|
||||
|
@@ -53,7 +53,7 @@ bool wxGauge::Create( wxWindow *parent,
|
||||
|
||||
PostCreation(size);
|
||||
SetBestSize(size);
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ bool GSocketGUIFunctionsTableConcrete::OnInit(void)
|
||||
void GSocketGUIFunctionsTableConcrete::OnExit(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool GSocketGUIFunctionsTableConcrete::Init_Socket(GSocket *socket)
|
||||
{
|
||||
gint *m_id;
|
||||
|
@@ -77,7 +77,7 @@ gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
|
||||
|
||||
// see above
|
||||
event.SetInt( (int)ceil(win->m_adjust->value) );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
@@ -116,12 +116,12 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
m_adjust = (GtkAdjustment*) gtk_adjustment_new( initial, min, max, 1.0, 5.0, 0.0);
|
||||
|
||||
m_widget = gtk_spin_button_new( m_adjust, 1, 0 );
|
||||
|
||||
|
||||
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget),
|
||||
(int)(m_windowStyle & wxSP_WRAP) );
|
||||
|
||||
GtkEnableEvents();
|
||||
|
||||
|
||||
m_parent->DoAddChild( this );
|
||||
|
||||
PostCreation(size);
|
||||
@@ -148,7 +148,7 @@ void wxSpinCtrl::GtkEnableEvents()
|
||||
"value_changed",
|
||||
GTK_SIGNAL_FUNC(gtk_spinctrl_callback),
|
||||
(gpointer) this );
|
||||
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(m_widget),
|
||||
"changed",
|
||||
GTK_SIGNAL_FUNC(gtk_spinctrl_text_changed_callback),
|
||||
@@ -290,7 +290,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return TRUE;
|
||||
|
||||
|
||||
if (GTK_SPIN_BUTTON(m_widget)->panel == window) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
@@ -83,7 +83,7 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
|
||||
GdkBitmap *mask = (GdkBitmap *) NULL;
|
||||
if (m_bitmap.GetMask())
|
||||
mask = m_bitmap.GetMask()->GetBitmap();
|
||||
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
if (m_bitmap.HasPixbuf())
|
||||
{
|
||||
|
@@ -67,7 +67,7 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
// effect of changing the control size which might not be desirable
|
||||
wxControl::SetLabel(label);
|
||||
m_widget = gtk_label_new( wxGTK_CONV( m_label ) );
|
||||
|
||||
|
||||
GtkJustification justify;
|
||||
if ( style & wxALIGN_CENTER )
|
||||
justify = GTK_JUSTIFY_CENTER;
|
||||
@@ -86,7 +86,7 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
m_parent->DoAddChild( this );
|
||||
|
||||
PostCreation(size);
|
||||
|
||||
|
||||
// the bug below only happens with GTK 2
|
||||
#ifdef __WXGTK20__
|
||||
if ( justify != GTK_JUSTIFY_LEFT )
|
||||
@@ -183,7 +183,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
|
||||
// GetBestSize is supposed to return unwrapped size
|
||||
gtk_label_set_line_wrap( GTK_LABEL(m_widget), FALSE );
|
||||
|
||||
|
||||
GtkRequisition req;
|
||||
req.width = -1;
|
||||
req.height = -1;
|
||||
@@ -191,7 +191,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
(m_widget, &req );
|
||||
|
||||
gtk_label_set_line_wrap( GTK_LABEL(m_widget), TRUE );
|
||||
|
||||
|
||||
return wxSize (req.width, req.height);
|
||||
}
|
||||
|
||||
|
@@ -33,17 +33,17 @@ wxTaskBarIconAreaBase::wxTaskBarIconAreaBase()
|
||||
{
|
||||
m_widget = GTK_WIDGET(egg_tray_icon_new("systray icon"));
|
||||
gtk_window_set_resizable(GTK_WINDOW(m_widget), false);
|
||||
|
||||
|
||||
wxLogTrace(_T("systray"), _T("using freedesktop.org systray spec"));
|
||||
}
|
||||
|
||||
|
||||
wxTopLevelWindow::Create(
|
||||
NULL, wxID_ANY, _T("systray icon"),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR | wxSIMPLE_BORDER |
|
||||
wxFRAME_SHAPED,
|
||||
wxEmptyString /*eggtray doesn't like setting wmclass*/);
|
||||
|
||||
|
||||
m_invokingWindow = NULL;
|
||||
}
|
||||
|
||||
@@ -54,16 +54,16 @@ bool wxTaskBarIconAreaBase::IsProtocolSupported()
|
||||
{
|
||||
Display *display = GDK_DISPLAY();
|
||||
Screen *screen = DefaultScreenOfDisplay(display);
|
||||
|
||||
|
||||
wxString name;
|
||||
name.Printf(_T("_NET_SYSTEM_TRAY_S%d"), XScreenNumberOfScreen(screen));
|
||||
Atom atom = XInternAtom(display, name.ToAscii(), False);
|
||||
|
||||
|
||||
Window manager = XGetSelectionOwner(display, atom);
|
||||
|
||||
|
||||
s_supported = (manager != None);
|
||||
}
|
||||
|
||||
|
||||
return (bool)s_supported;
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
enum thread_state
|
||||
enum thread_state
|
||||
{
|
||||
STATE_IDLE = 0,
|
||||
STATE_RUNNING,
|
||||
@@ -84,7 +84,7 @@ wxMutexError wxMutex::TryLock()
|
||||
wxMutexError wxMutex::Unlock()
|
||||
{
|
||||
if (m_locked == 0)
|
||||
return wxMUTEX_UNLOCKED;
|
||||
return wxMUTEX_UNLOCKED;
|
||||
release_lock(&(p_internal->p_mutex));
|
||||
m_locked--;
|
||||
return wxMUTEX_NO_ERROR;
|
||||
@@ -251,7 +251,7 @@ private:
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
|
||||
|
||||
bool wxThreadModule::OnInit()
|
||||
bool wxThreadModule::OnInit()
|
||||
{
|
||||
wxMainMutex = new wxMutex();
|
||||
wxThreadGuiInit();
|
||||
|
@@ -28,13 +28,13 @@ static gint timeout_callback( gpointer data )
|
||||
wxTimer *timer = (wxTimer*)data;
|
||||
|
||||
// Don't change the order of anything in this callback!
|
||||
|
||||
|
||||
if (timer->IsOneShot())
|
||||
{
|
||||
// This sets m_tag to -1
|
||||
timer->Stop();
|
||||
}
|
||||
|
||||
|
||||
// When getting called from GDK's timer handler we
|
||||
// are no longer within GDK's grab on the GUI
|
||||
// thread so we must lock it here ourselves.
|
||||
|
@@ -25,11 +25,11 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr
|
||||
{
|
||||
wxString filename( file );
|
||||
if (filename.IsEmpty()) filename = wxT(".wxWindows");
|
||||
|
||||
|
||||
wxFileConfig conf( wxTheApp->GetAppName(), wxTheApp->GetVendorName(), filename );
|
||||
|
||||
|
||||
conf.SetPath( section );
|
||||
|
||||
|
||||
return conf.Write( entry, value );
|
||||
}
|
||||
|
||||
|
@@ -2693,10 +2693,10 @@ wxMouseState wxGetMouseState()
|
||||
ms.SetShiftDown(mask & GDK_SHIFT_MASK);
|
||||
ms.SetAltDown(mask & GDK_MOD1_MASK);
|
||||
ms.SetMetaDown(mask & GDK_MOD2_MASK);
|
||||
|
||||
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -61,12 +61,12 @@ static const char *wxArtIDToStock(const wxArtID& id)
|
||||
{
|
||||
#define ART(wxid, gtkid) \
|
||||
if (id == wxid) return gtkid;
|
||||
|
||||
|
||||
ART(wxART_ERROR, GTK_STOCK_DIALOG_ERROR)
|
||||
ART(wxART_INFORMATION, GTK_STOCK_DIALOG_INFO)
|
||||
ART(wxART_WARNING, GTK_STOCK_DIALOG_WARNING)
|
||||
ART(wxART_QUESTION, GTK_STOCK_DIALOG_QUESTION)
|
||||
|
||||
|
||||
//ART(wxART_HELP_SIDE_PANEL, )
|
||||
ART(wxART_HELP_SETTINGS, GTK_STOCK_SELECT_FONT)
|
||||
//ART(wxART_HELP_BOOK, )
|
||||
@@ -121,9 +121,9 @@ static const char *wxArtIDToStock(const wxArtID& id)
|
||||
ART(wxART_FIND, GTK_STOCK_FIND)
|
||||
ART(wxART_FIND_AND_REPLACE, GTK_STOCK_FIND_AND_REPLACE)
|
||||
#endif
|
||||
|
||||
|
||||
return NULL;
|
||||
|
||||
|
||||
#undef ART
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ static GtkIconSize FindClosestIconSize(const wxSize& size)
|
||||
// only use larger bitmaps, scaling down looks better than scaling up:
|
||||
if (size.x > s_sizes[i].x || size.y > s_sizes[i].y)
|
||||
continue;
|
||||
|
||||
|
||||
unsigned dist = (size.x - s_sizes[i].x) * (size.x - s_sizes[i].x) +
|
||||
(size.y - s_sizes[i].y) * (size.y - s_sizes[i].y);
|
||||
if (dist == 0)
|
||||
@@ -183,7 +183,7 @@ static GtkIconSize FindClosestIconSize(const wxSize& size)
|
||||
{
|
||||
distance = dist;
|
||||
best = s_sizes[i].icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
@@ -196,11 +196,11 @@ static GdkPixbuf *CreateStockIcon(const char *stockid, GtkIconSize size)
|
||||
// FIXME: This code is not 100% correct, because stock pixmap are
|
||||
// context-dependent and may be affected by theme engine, the
|
||||
// correct value can only be obtained for given GtkWidget object.
|
||||
//
|
||||
//
|
||||
// Fool-proof implementation of stock bitmaps would extend wxBitmap
|
||||
// with "stock-id" representation (in addition to pixmap and pixbuf
|
||||
// ones) and would convert it to pixbuf when rendered.
|
||||
|
||||
|
||||
if (gs_gtkStyle == NULL)
|
||||
{
|
||||
GtkWidget *widget = gtk_button_new();
|
||||
@@ -229,7 +229,7 @@ static GdkPixbuf *CreateThemeIcon(const char *iconname,
|
||||
{
|
||||
gtk_icon_size_lookup(iconsize, &size.x, &size.y);
|
||||
}
|
||||
|
||||
|
||||
return gtk_icon_theme_load_icon(
|
||||
gtk_icon_theme_get_default(),
|
||||
iconname,
|
||||
@@ -244,7 +244,7 @@ wxBitmap wxGTK2ArtProvider::CreateBitmap(const wxArtID& id,
|
||||
{
|
||||
wxCharBuffer stockid = wxArtIDToStock(id);
|
||||
GtkIconSize stocksize = (size == wxDefaultSize) ?
|
||||
wxArtClientToIconSize(client) :
|
||||
wxArtClientToIconSize(client) :
|
||||
FindClosestIconSize(size);
|
||||
|
||||
// we must have some size, this is arbitrary
|
||||
@@ -277,7 +277,7 @@ wxBitmap wxGTK2ArtProvider::CreateBitmap(const wxArtID& id,
|
||||
pixbuf = p2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!pixbuf)
|
||||
return wxNullBitmap;
|
||||
|
||||
|
@@ -45,7 +45,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
|
||||
if (!cb->m_hasVMT) return;
|
||||
|
||||
if (g_blockEventsOnDrag) return;
|
||||
|
||||
|
||||
if (cb->m_blockEvent) return;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
@@ -64,7 +64,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
|
||||
bool inconsistent = gtk_toggle_button_get_inconsistent(toggle);
|
||||
|
||||
cb->m_blockEvent = true;
|
||||
|
||||
|
||||
if (!active && !inconsistent)
|
||||
{
|
||||
// checked -> undetermined
|
||||
@@ -85,7 +85,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb)
|
||||
{
|
||||
wxFAIL_MSG(_T("3state wxCheckBox in unexpected state!"));
|
||||
}
|
||||
|
||||
|
||||
cb->m_blockEvent = false;
|
||||
}
|
||||
else
|
||||
@@ -277,7 +277,7 @@ void wxCheckBox::OnInternalIdle()
|
||||
g_delayedFocus = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (wxUpdateUIEvent::CanUpdate(this))
|
||||
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ wxCheckListBox::wxCheckListBox() : wxListBox()
|
||||
wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int nStrings,
|
||||
int nStrings,
|
||||
const wxString *choices,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
|
@@ -115,7 +115,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget),
|
||||
wxT("selection received for targets, format %s"),
|
||||
format.GetId().c_str() );
|
||||
|
||||
// printf( "format %s requested %s\n",
|
||||
// printf( "format %s requested %s\n",
|
||||
// gdk_atom_name( atoms[i] ),
|
||||
// gdk_atom_name( clipboard->m_targetRequested ) );
|
||||
|
||||
@@ -262,7 +262,7 @@ selection_handler( GtkWidget *WXUNUSED(widget),
|
||||
wxString::FromAscii(gdk_atom_name(selection_data->selection)).c_str()
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
if (!data->IsSupportedFormat( format )) return;
|
||||
|
||||
int size = data->GetDataSize( format );
|
||||
@@ -450,9 +450,9 @@ bool wxClipboard::AddData( wxDataObject *data )
|
||||
wxT("wxClipboard now supports atom %s"),
|
||||
array[i].GetId().c_str() );
|
||||
|
||||
// printf( "added %s\n",
|
||||
// printf( "added %s\n",
|
||||
// gdk_atom_name( array[i].GetFormatId() ) );
|
||||
|
||||
|
||||
gtk_selection_add_target( GTK_WIDGET(m_clipboardWidget),
|
||||
clipboard,
|
||||
array[i],
|
||||
|
@@ -77,9 +77,9 @@ wxDataFormat::wxDataFormat( NativeFormat format )
|
||||
void wxDataFormat::SetType( wxDataFormatId type )
|
||||
{
|
||||
PrepareFormats();
|
||||
|
||||
|
||||
m_type = type;
|
||||
|
||||
|
||||
#if wxUSE_UNICODE
|
||||
if (m_type == wxDF_UNICODETEXT)
|
||||
m_format = g_textAtom;
|
||||
@@ -141,7 +141,7 @@ void wxDataFormat::SetId( const wxChar *id )
|
||||
PrepareFormats();
|
||||
m_type = wxDF_PRIVATE;
|
||||
wxString tmp( id );
|
||||
m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE );
|
||||
m_format = gdk_atom_intern( (const char*) tmp.ToAscii(), FALSE );
|
||||
}
|
||||
|
||||
void wxDataFormat::PrepareFormats()
|
||||
@@ -182,17 +182,17 @@ wxDataObject::~wxDataObject()
|
||||
bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction dir) const
|
||||
{
|
||||
size_t nFormatCount = GetFormatCount(dir);
|
||||
if ( nFormatCount == 1 )
|
||||
if ( nFormatCount == 1 )
|
||||
{
|
||||
return format == GetPreferredFormat();
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
wxDataFormat *formats = new wxDataFormat[nFormatCount];
|
||||
GetAllFormats(formats,dir);
|
||||
|
||||
size_t n;
|
||||
for ( n = 0; n < nFormatCount; n++ )
|
||||
for ( n = 0; n < nFormatCount; n++ )
|
||||
{
|
||||
if ( formats[n] == format )
|
||||
break;
|
||||
|
@@ -26,7 +26,7 @@ wxMemoryDC::wxMemoryDC() : wxWindowDC()
|
||||
m_ok = FALSE;
|
||||
|
||||
m_cmap = gtk_widget_get_default_colormap();
|
||||
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_context = gdk_pango_context_get();
|
||||
// Note: The Sun customised version of Pango shipping with Solaris 10
|
||||
@@ -43,7 +43,7 @@ wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
||||
m_ok = FALSE;
|
||||
|
||||
m_cmap = gtk_widget_get_default_colormap();
|
||||
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_context = gdk_pango_context_get();
|
||||
pango_context_set_language( m_context, gtk_get_default_language() );
|
||||
@@ -115,7 +115,7 @@ void wxMemoryDC::SetBrush( const wxBrush& brushOrig )
|
||||
wxWindowDC::SetBrush( brush );
|
||||
}
|
||||
|
||||
void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
|
||||
void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
|
||||
{
|
||||
wxBrush brush(brushOrig);
|
||||
|
||||
|
@@ -53,7 +53,7 @@ bool wxGauge::Create( wxWindow *parent,
|
||||
|
||||
PostCreation(size);
|
||||
SetBestSize(size);
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ bool GSocketGUIFunctionsTableConcrete::OnInit(void)
|
||||
void GSocketGUIFunctionsTableConcrete::OnExit(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool GSocketGUIFunctionsTableConcrete::Init_Socket(GSocket *socket)
|
||||
{
|
||||
gint *m_id;
|
||||
|
@@ -77,7 +77,7 @@ gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
|
||||
|
||||
// see above
|
||||
event.SetInt( (int)ceil(win->m_adjust->value) );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
@@ -116,12 +116,12 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
m_adjust = (GtkAdjustment*) gtk_adjustment_new( initial, min, max, 1.0, 5.0, 0.0);
|
||||
|
||||
m_widget = gtk_spin_button_new( m_adjust, 1, 0 );
|
||||
|
||||
|
||||
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget),
|
||||
(int)(m_windowStyle & wxSP_WRAP) );
|
||||
|
||||
GtkEnableEvents();
|
||||
|
||||
|
||||
m_parent->DoAddChild( this );
|
||||
|
||||
PostCreation(size);
|
||||
@@ -148,7 +148,7 @@ void wxSpinCtrl::GtkEnableEvents()
|
||||
"value_changed",
|
||||
GTK_SIGNAL_FUNC(gtk_spinctrl_callback),
|
||||
(gpointer) this );
|
||||
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(m_widget),
|
||||
"changed",
|
||||
GTK_SIGNAL_FUNC(gtk_spinctrl_text_changed_callback),
|
||||
@@ -290,7 +290,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return TRUE;
|
||||
|
||||
|
||||
if (GTK_SPIN_BUTTON(m_widget)->panel == window) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
@@ -83,7 +83,7 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
|
||||
GdkBitmap *mask = (GdkBitmap *) NULL;
|
||||
if (m_bitmap.GetMask())
|
||||
mask = m_bitmap.GetMask()->GetBitmap();
|
||||
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
if (m_bitmap.HasPixbuf())
|
||||
{
|
||||
|
@@ -67,7 +67,7 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
// effect of changing the control size which might not be desirable
|
||||
wxControl::SetLabel(label);
|
||||
m_widget = gtk_label_new( wxGTK_CONV( m_label ) );
|
||||
|
||||
|
||||
GtkJustification justify;
|
||||
if ( style & wxALIGN_CENTER )
|
||||
justify = GTK_JUSTIFY_CENTER;
|
||||
@@ -86,7 +86,7 @@ bool wxStaticText::Create(wxWindow *parent,
|
||||
m_parent->DoAddChild( this );
|
||||
|
||||
PostCreation(size);
|
||||
|
||||
|
||||
// the bug below only happens with GTK 2
|
||||
#ifdef __WXGTK20__
|
||||
if ( justify != GTK_JUSTIFY_LEFT )
|
||||
@@ -183,7 +183,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
|
||||
// GetBestSize is supposed to return unwrapped size
|
||||
gtk_label_set_line_wrap( GTK_LABEL(m_widget), FALSE );
|
||||
|
||||
|
||||
GtkRequisition req;
|
||||
req.width = -1;
|
||||
req.height = -1;
|
||||
@@ -191,7 +191,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
(m_widget, &req );
|
||||
|
||||
gtk_label_set_line_wrap( GTK_LABEL(m_widget), TRUE );
|
||||
|
||||
|
||||
return wxSize (req.width, req.height);
|
||||
}
|
||||
|
||||
|
@@ -33,17 +33,17 @@ wxTaskBarIconAreaBase::wxTaskBarIconAreaBase()
|
||||
{
|
||||
m_widget = GTK_WIDGET(egg_tray_icon_new("systray icon"));
|
||||
gtk_window_set_resizable(GTK_WINDOW(m_widget), false);
|
||||
|
||||
|
||||
wxLogTrace(_T("systray"), _T("using freedesktop.org systray spec"));
|
||||
}
|
||||
|
||||
|
||||
wxTopLevelWindow::Create(
|
||||
NULL, wxID_ANY, _T("systray icon"),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR | wxSIMPLE_BORDER |
|
||||
wxFRAME_SHAPED,
|
||||
wxEmptyString /*eggtray doesn't like setting wmclass*/);
|
||||
|
||||
|
||||
m_invokingWindow = NULL;
|
||||
}
|
||||
|
||||
@@ -54,16 +54,16 @@ bool wxTaskBarIconAreaBase::IsProtocolSupported()
|
||||
{
|
||||
Display *display = GDK_DISPLAY();
|
||||
Screen *screen = DefaultScreenOfDisplay(display);
|
||||
|
||||
|
||||
wxString name;
|
||||
name.Printf(_T("_NET_SYSTEM_TRAY_S%d"), XScreenNumberOfScreen(screen));
|
||||
Atom atom = XInternAtom(display, name.ToAscii(), False);
|
||||
|
||||
|
||||
Window manager = XGetSelectionOwner(display, atom);
|
||||
|
||||
|
||||
s_supported = (manager != None);
|
||||
}
|
||||
|
||||
|
||||
return (bool)s_supported;
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "gdk/gdk.h"
|
||||
#include "gtk/gtk.h"
|
||||
|
||||
enum thread_state
|
||||
enum thread_state
|
||||
{
|
||||
STATE_IDLE = 0,
|
||||
STATE_RUNNING,
|
||||
@@ -84,7 +84,7 @@ wxMutexError wxMutex::TryLock()
|
||||
wxMutexError wxMutex::Unlock()
|
||||
{
|
||||
if (m_locked == 0)
|
||||
return wxMUTEX_UNLOCKED;
|
||||
return wxMUTEX_UNLOCKED;
|
||||
release_lock(&(p_internal->p_mutex));
|
||||
m_locked--;
|
||||
return wxMUTEX_NO_ERROR;
|
||||
@@ -251,7 +251,7 @@ private:
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
|
||||
|
||||
bool wxThreadModule::OnInit()
|
||||
bool wxThreadModule::OnInit()
|
||||
{
|
||||
wxMainMutex = new wxMutex();
|
||||
wxThreadGuiInit();
|
||||
|
@@ -28,13 +28,13 @@ static gint timeout_callback( gpointer data )
|
||||
wxTimer *timer = (wxTimer*)data;
|
||||
|
||||
// Don't change the order of anything in this callback!
|
||||
|
||||
|
||||
if (timer->IsOneShot())
|
||||
{
|
||||
// This sets m_tag to -1
|
||||
timer->Stop();
|
||||
}
|
||||
|
||||
|
||||
// When getting called from GDK's timer handler we
|
||||
// are no longer within GDK's grab on the GUI
|
||||
// thread so we must lock it here ourselves.
|
||||
|
@@ -25,11 +25,11 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr
|
||||
{
|
||||
wxString filename( file );
|
||||
if (filename.IsEmpty()) filename = wxT(".wxWindows");
|
||||
|
||||
|
||||
wxFileConfig conf( wxTheApp->GetAppName(), wxTheApp->GetVendorName(), filename );
|
||||
|
||||
|
||||
conf.SetPath( section );
|
||||
|
||||
|
||||
return conf.Write( entry, value );
|
||||
}
|
||||
|
||||
|
@@ -2693,10 +2693,10 @@ wxMouseState wxGetMouseState()
|
||||
ms.SetShiftDown(mask & GDK_SHIFT_MASK);
|
||||
ms.SetAltDown(mask & GDK_MOD1_MASK);
|
||||
ms.SetMetaDown(mask & GDK_MOD2_MASK);
|
||||
|
||||
|
||||
return ms;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWindowGTK
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user