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