mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-22 06:05:36 +08:00
Renamed wxStream::StreamSize() to wxStream::GetSize()
Add wxStream bool operator !(). Made wxTextStream safe for conversion from/to Mac/DOS/Unix Added wxFrame::Iconize() Applied patch for stippled brushes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -91,11 +91,11 @@ public:
|
||||
virtual void MakeModal(bool modal = TRUE);
|
||||
|
||||
virtual void SetIcon( const wxIcon &icon );
|
||||
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
||||
virtual bool IsIconized() const { return FALSE; }
|
||||
bool Iconized() const { return IsIconized(); }
|
||||
virtual void Maximize(bool WXUNUSED(maximize)) {}
|
||||
virtual void Restore() {}
|
||||
virtual void Maximize( bool maximize );
|
||||
virtual void Restore();
|
||||
virtual void Iconize( bool iconize );
|
||||
virtual bool IsIconized() const;
|
||||
|
||||
virtual void Command( int id );
|
||||
|
||||
|
||||
@@ -91,11 +91,11 @@ public:
|
||||
virtual void MakeModal(bool modal = TRUE);
|
||||
|
||||
virtual void SetIcon( const wxIcon &icon );
|
||||
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
||||
virtual bool IsIconized() const { return FALSE; }
|
||||
bool Iconized() const { return IsIconized(); }
|
||||
virtual void Maximize(bool WXUNUSED(maximize)) {}
|
||||
virtual void Restore() {}
|
||||
virtual void Maximize( bool maximize );
|
||||
virtual void Restore();
|
||||
virtual void Iconize( bool iconize );
|
||||
virtual bool IsIconized() const;
|
||||
|
||||
virtual void Command( int id );
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class wxMemoryInputStream: public wxInputStream {
|
||||
public:
|
||||
wxMemoryInputStream(const char *data, size_t length);
|
||||
virtual ~wxMemoryInputStream();
|
||||
virtual size_t StreamSize() const { return m_length; }
|
||||
virtual size_t GetSize() const { return m_length; }
|
||||
|
||||
char Peek();
|
||||
|
||||
@@ -41,7 +41,7 @@ class wxMemoryOutputStream: public wxOutputStream {
|
||||
public:
|
||||
wxMemoryOutputStream(char *data = NULL, size_t length = 0);
|
||||
virtual ~wxMemoryOutputStream();
|
||||
virtual size_t StreamSize() const { return m_o_streambuf->GetLastAccess(); }
|
||||
virtual size_t GetSize() const { return m_o_streambuf->GetLastAccess(); }
|
||||
|
||||
wxStreamBuffer *OutputStreamBuffer() const { return m_o_streambuf; }
|
||||
|
||||
|
||||
+4
-3
@@ -55,8 +55,9 @@ class WXDLLEXPORT wxStreamBase {
|
||||
wxStreamBase();
|
||||
virtual ~wxStreamBase();
|
||||
|
||||
bool operator!() const { return (LastError() != wxSTR_NOERROR); }
|
||||
wxStreamError LastError() const { return m_lasterror; }
|
||||
virtual size_t StreamSize() const { return ~((size_t)0); }
|
||||
virtual size_t GetSize() const { return ~((size_t)0); }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -147,7 +148,7 @@ class WXDLLEXPORT wxFilterInputStream: public wxInputStream {
|
||||
char Peek() { return m_parent_i_stream->Peek(); }
|
||||
|
||||
wxStreamError LastError() const { return m_parent_i_stream->LastError(); }
|
||||
size_t StreamSize() const { return m_parent_i_stream->StreamSize(); }
|
||||
size_t GetSize() const { return m_parent_i_stream->GetSize(); }
|
||||
|
||||
protected:
|
||||
wxInputStream *m_parent_i_stream;
|
||||
@@ -160,7 +161,7 @@ class WXDLLEXPORT wxFilterOutputStream: public wxOutputStream {
|
||||
~wxFilterOutputStream();
|
||||
|
||||
wxStreamError LastError() const { return m_parent_o_stream->LastError(); }
|
||||
size_t StreamSize() const { return m_parent_o_stream->StreamSize(); }
|
||||
size_t GetSize() const { return m_parent_o_stream->GetSize(); }
|
||||
|
||||
protected:
|
||||
wxOutputStream *m_parent_o_stream;
|
||||
|
||||
@@ -43,6 +43,9 @@ public:
|
||||
|
||||
protected:
|
||||
wxInputStream *m_input;
|
||||
|
||||
wxChar NextNonWhiteSpace();
|
||||
void SkipIfEndOfLine( wxChar c );
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxTextOutputStream {
|
||||
@@ -55,7 +58,7 @@ class WXDLLEXPORT wxTextOutputStream {
|
||||
void Write8(wxUint8 i);
|
||||
void WriteDouble(double d);
|
||||
void WriteString(const wxString& string);
|
||||
|
||||
|
||||
wxTextOutputStream& operator<<(const wxChar *string);
|
||||
wxTextOutputStream& operator<<(const wxString& string);
|
||||
wxTextOutputStream& operator<<(wxChar c);
|
||||
|
||||
@@ -33,7 +33,7 @@ class wxFileInputStream: public wxInputStream {
|
||||
~wxFileInputStream();
|
||||
|
||||
char Peek();
|
||||
size_t StreamSize() const;
|
||||
size_t GetSize() const;
|
||||
|
||||
bool Ok() const { return m_file->IsOpened(); }
|
||||
|
||||
@@ -61,7 +61,7 @@ class wxFileOutputStream: public wxOutputStream {
|
||||
// { return wxOutputStream::Write(buffer, size); }
|
||||
|
||||
void Sync();
|
||||
size_t StreamSize() const;
|
||||
size_t GetSize() const;
|
||||
|
||||
bool Ok() const { return m_file->IsOpened(); }
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ void jpeg_wxio_src( j_decompress_ptr cinfo, wxInputStream& infile )
|
||||
src = (my_src_ptr) cinfo->src;
|
||||
}
|
||||
src = (my_src_ptr) cinfo->src;
|
||||
src->pub.bytes_in_buffer = infile.StreamSize(); /* forces fill_input_buffer on first read */
|
||||
src->buffer = (JOCTET *) malloc (infile.StreamSize());
|
||||
src->pub.bytes_in_buffer = infile.GetSize(); /* forces fill_input_buffer on first read */
|
||||
src->buffer = (JOCTET *) malloc (infile.GetSize());
|
||||
src->pub.next_input_byte = src->buffer; /* until buffer loaded */
|
||||
infile.Read(src->buffer, infile.StreamSize());
|
||||
infile.Read(src->buffer, infile.GetSize());
|
||||
|
||||
src->pub.init_source = my_init_source;
|
||||
src->pub.fill_input_buffer = my_fill_input_buffer;
|
||||
|
||||
@@ -104,8 +104,8 @@ size_t wxMemoryOutputStream::CopyTo(char *buffer, size_t len) const
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
if (len > StreamSize())
|
||||
len = StreamSize();
|
||||
if (len > GetSize())
|
||||
len = GetSize();
|
||||
|
||||
memcpy(buffer, m_o_streambuf->GetBufferStart(), len);
|
||||
return len;
|
||||
|
||||
+299
-169
File diff suppressed because it is too large
Load Diff
@@ -67,7 +67,7 @@ char wxFileInputStream::Peek()
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t wxFileInputStream::StreamSize() const
|
||||
size_t wxFileInputStream::GetSize() const
|
||||
{
|
||||
return m_file->Length();
|
||||
}
|
||||
@@ -161,7 +161,7 @@ void wxFileOutputStream::Sync()
|
||||
m_file->Flush();
|
||||
}
|
||||
|
||||
size_t wxFileOutputStream::StreamSize() const
|
||||
size_t wxFileOutputStream::GetSize() const
|
||||
{
|
||||
return m_file->Length();
|
||||
}
|
||||
|
||||
@@ -1010,7 +1010,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->Ok()))
|
||||
{
|
||||
if (m_brush.GetStipple()->GetPixmap())
|
||||
gdk_gc_set_stipple( m_brushGC, m_brush.GetStipple()->GetPixmap() );
|
||||
gdk_gc_set_tile( m_brushGC, m_brush.GetStipple()->GetPixmap() );
|
||||
else
|
||||
gdk_gc_set_stipple( m_brushGC, m_brush.GetStipple()->GetBitmap() );
|
||||
}
|
||||
@@ -1055,9 +1055,12 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
|
||||
|
||||
gdk_gc_set_fill( m_bgGC, fillStyle );
|
||||
|
||||
if (m_backgroundBrush.GetStyle() == wxSTIPPLE)
|
||||
if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->Ok()))
|
||||
{
|
||||
gdk_gc_set_stipple( m_bgGC, m_backgroundBrush.GetStipple()->GetPixmap() );
|
||||
if (m_brush.GetStipple()->GetPixmap())
|
||||
gdk_gc_set_tile( m_bgGC, m_brush.GetStipple()->GetPixmap() );
|
||||
else
|
||||
gdk_gc_set_stipple( m_bgGC, m_brush.GetStipple()->GetBitmap() );
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_backgroundBrush.GetStyle()))
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
#include "gdk/gdkx.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
@@ -1043,3 +1044,25 @@ void wxFrame::SetIcon( const wxIcon &icon )
|
||||
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
|
||||
}
|
||||
|
||||
void wxFrame::Maximize(bool WXUNUSED(maximize))
|
||||
{
|
||||
}
|
||||
|
||||
void wxFrame::Restore()
|
||||
{
|
||||
}
|
||||
|
||||
void wxFrame::Iconize( bool iconize )
|
||||
{
|
||||
if (iconize)
|
||||
{
|
||||
XIconifyWindow( GDK_WINDOW_XDISPLAY( m_widget->window ),
|
||||
GDK_WINDOW_XWINDOW( m_widget->window ),
|
||||
DefaultScreen( GDK_DISPLAY() ) );
|
||||
}
|
||||
}
|
||||
|
||||
bool wxFrame::IsIconized() const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1010,7 +1010,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
|
||||
if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->Ok()))
|
||||
{
|
||||
if (m_brush.GetStipple()->GetPixmap())
|
||||
gdk_gc_set_stipple( m_brushGC, m_brush.GetStipple()->GetPixmap() );
|
||||
gdk_gc_set_tile( m_brushGC, m_brush.GetStipple()->GetPixmap() );
|
||||
else
|
||||
gdk_gc_set_stipple( m_brushGC, m_brush.GetStipple()->GetBitmap() );
|
||||
}
|
||||
@@ -1055,9 +1055,12 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
|
||||
|
||||
gdk_gc_set_fill( m_bgGC, fillStyle );
|
||||
|
||||
if (m_backgroundBrush.GetStyle() == wxSTIPPLE)
|
||||
if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->Ok()))
|
||||
{
|
||||
gdk_gc_set_stipple( m_bgGC, m_backgroundBrush.GetStipple()->GetPixmap() );
|
||||
if (m_brush.GetStipple()->GetPixmap())
|
||||
gdk_gc_set_tile( m_bgGC, m_brush.GetStipple()->GetPixmap() );
|
||||
else
|
||||
gdk_gc_set_stipple( m_bgGC, m_brush.GetStipple()->GetBitmap() );
|
||||
}
|
||||
|
||||
if (IS_HATCH(m_backgroundBrush.GetStyle()))
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "gtk/gtk.h"
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
#include "gdk/gdkkeysyms.h"
|
||||
#include "gdk/gdkx.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
@@ -1043,3 +1044,25 @@ void wxFrame::SetIcon( const wxIcon &icon )
|
||||
gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
|
||||
}
|
||||
|
||||
void wxFrame::Maximize(bool WXUNUSED(maximize))
|
||||
{
|
||||
}
|
||||
|
||||
void wxFrame::Restore()
|
||||
{
|
||||
}
|
||||
|
||||
void wxFrame::Iconize( bool iconize )
|
||||
{
|
||||
if (iconize)
|
||||
{
|
||||
XIconifyWindow( GDK_WINDOW_XDISPLAY( m_widget->window ),
|
||||
GDK_WINDOW_XWINDOW( m_widget->window ),
|
||||
DefaultScreen( GDK_DISPLAY() ) );
|
||||
}
|
||||
}
|
||||
|
||||
bool wxFrame::IsIconized() const
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user