mkdir ~/wxgtk_dist/wxGTK/include/wx/gtk
cd gtk
cp *.h ~/wxgtk_dist/wxGTK/include/wx/gtk
+cp *.xpm ~/wxgtk_dist/wxGTK/include/wx/gtk
rm ~/wxgtk_dist/wxGTK/include/wx/gtk/setup.h
cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/gtk
cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/gtk
cp Makefile.in ~/wxgtk_dist/wxGTK/src/gtk
cp *.xbm ~/wxgtk_dist/wxGTK/src/gtk
cp *.c ~/wxgtk_dist/wxGTK/src/gtk
-cp *.inc ~/wxgtk_dist/wxGTK/src/gtk
cp *.cpp ~/wxgtk_dist/wxGTK/src/gtk
cd ..
cp lexer.l ~/wxgtk_dist/wxGTK/src/common
cp parser.y ~/wxgtk_dist/wxGTK/src/common
cp extended.c ~/wxgtk_dist/wxGTK/src/common
+cp unzip.* ~/wxgtk_dist/wxGTK/src/common
cp *.cpp ~/wxgtk_dist/wxGTK/src/common
cd ..
cd unix
mkdir ~/wxgtk_dist/wxGTK/src/unix
cp *.cpp ~/wxgtk_dist/wxGTK/src/unix
+cp *.h ~/wxgtk_dist/wxGTK/src/unix
+cp *.c ~/wxgtk_dist/wxGTK/src/unix
cd ..
cd html
cp * ~/wxgtk_dist/wxGTK/samples/help/doc
cd ../..
+echo HTML samples..
+
+cd html
+mkdir ~/wxgtk_dist/wxGTK/samples/html
+cp Makefile.* ~/wxgtk_dist/wxGTK/samples/html
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/about
+cp about/Makefile.* ~/wxgtk_dist/wxGTK/samples/html/about
+cp about/about.* ~/wxgtk_dist/wxGTK/samples/html/about
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/about/data
+cp about/data/*.* ~/wxgtk_dist/wxGTK/samples/html/about/data
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/help
+cp help/Makefile.* ~/wxgtk_dist/wxGTK/samples/html/help
+cp help/help.* ~/wxgtk_dist/wxGTK/samples/html/help
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/help/helpfiles
+cp help/helpfiles/*.* ~/wxgtk_dist/wxGTK/samples/html/help/helpfiles
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/printing
+cp printing/*.* ~/wxgtk_dist/wxGTK/samples/html/printing
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/test
+cp test/*.* ~/wxgtk_dist/wxGTK/samples/html/test
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/virtual
+cp virtual/*.* ~/wxgtk_dist/wxGTK/samples/html/virtual
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/widget
+cp widget/*.* ~/wxgtk_dist/wxGTK/samples/html/widget
+
+mkdir ~/wxgtk_dist/wxGTK/samples/html/zip
+cp zip/*.* ~/wxgtk_dist/wxGTK/samples/html/zip
+cd ..
+
echo Image sample..
cd image
cp missing ~/wxmotif_dist/wxMotif
cp mkinstalldirs ~/wxmotif_dist/wxMotif
cp wx-config.in ~/wxmotif_dist/wxMotif
+cp makefile.unx.in ~/wxmotif_dist/wxMotif
cp setup.h.in ~/wxmotif_dist/wxMotif
cp stamp-h.in ~/wxmotif_dist/wxMotif
cp Makefile.in ~/wxmotif_dist/wxMotif
cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/generic
cd ..
-mkdir ~/wxgtk_dist/wxGTK/include/wx/html
+mkdir ~/wxmotif_dist/wxMotif/include/wx/html
cd html
-cp *.h ~/wxgtk_dist/wxGTK/include/wx/html
-cp Makefile.am ~/wxgtk_dist/wxGTK/include/wx/html
-cp Makefile.in ~/wxgtk_dist/wxGTK/include/wx/html
+cp *.h ~/wxmotif_dist/wxMotif/include/wx/html
+cp Makefile.am ~/wxmotif_dist/wxMotif/include/wx/html
+cp Makefile.in ~/wxmotif_dist/wxMotif/include/wx/html
cd ..
mkdir ~/wxmotif_dist/wxMotif/include/wx/unix
cp Makefile.in ~/wxmotif_dist/wxMotif/src/motif
cp *.xbm ~/wxmotif_dist/wxMotif/src/motif
cp *.c ~/wxmotif_dist/wxMotif/src/motif
-cp *.inc ~/wxmotif_dist/wxMotif/src/motif
cp *.cpp ~/wxmotif_dist/wxMotif/src/motif
cd ..
cp lexer.l ~/wxmotif_dist/wxMotif/src/common
cp parser.y ~/wxmotif_dist/wxMotif/src/common
cp extended.c ~/wxmotif_dist/wxMotif/src/common
+cp unzip.* ~/wxmotif_dist/wxMotif/src/common
cp *.cpp ~/wxmotif_dist/wxMotif/src/common
cd ..
cd html
-mkdir ~/wxgtk_dist/wxGTK/src/html
-cp *.cpp ~/wxgtk_dist/wxGTK/src/html
-cp *.h ~/wxgtk_dist/wxGTK/src/html
+mkdir ~/wxmotif_dist/wxMotif/src/html
+cp *.cpp ~/wxmotif_dist/wxMotif/src/html
+cp *.h ~/wxmotif_dist/wxMotif/src/html
cd bitmaps
-mkdir ~/wxgtk_dist/wxGTK/src/html/bitmaps
-cp *.xpm ~/wxgtk_dist/wxGTK/src/html/bitmaps
+mkdir ~/wxmotif_dist/wxMotif/src/html/bitmaps
+cp *.xpm ~/wxmotif_dist/wxMotif/src/html/bitmaps
cd ../..
cd unix
mkdir ~/wxmotif_dist/wxMotif/src/unix
cp *.cpp ~/wxmotif_dist/wxMotif/src/unix
+cp *.h ~/wxmotif_dist/wxMotif/src/unix
+cp *.c ~/wxmotif_dist/wxMotif/src/unix
cd ..
cd generic
cp * ~/wxmotif_dist/wxMotif/samples/help/doc
cd ../..
+echo HTML samples..
+
+cd html
+mkdir ~/wxmotif_dist/wxMotif/samples/html
+cp Makefile.* ~/wxmotif_dist/wxMotif/samples/html
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/about
+cp about/Makefile.* ~/wxmotif_dist/wxMotif/samples/html/about
+cp about/about.* ~/wxmotif_dist/wxMotif/samples/html/about
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/about/data
+cp about/data/*.* ~/wxmotif_dist/wxMotif/samples/html/about/data
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/help
+cp help/Makefile.* ~/wxmotif_dist/wxMotif/samples/html/help
+cp help/help.* ~/wxmotif_dist/wxMotif/samples/html/help
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/help/helpfiles
+cp help/helpfiles/*.* ~/wxmotif_dist/wxMotif/samples/html/help/helpfiles
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/printing
+cp printing/*.* ~/wxmotif_dist/wxMotif/samples/html/printing
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/test
+cp test/*.* ~/wxmotif_dist/wxMotif/samples/html/test
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/virtual
+cp virtual/*.* ~/wxgtk_dist/wxGTK/samples/html/virtual
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/widget
+cp widget/*.* ~/wxmotif_dist/wxMotif/samples/html/widget
+
+mkdir ~/wxmotif_dist/wxMotif/samples/html/zip
+cp zip/*.* ~/wxmotif_dist/wxMotif/samples/html/zip
+cd ..
+
echo Image sample..
cd image
$wxHTML{$fields[0]} = $fields[2];
} elsif ( $fields[1] eq "U" ) {
$wxUNIX{$fields[0]} = $fields[2];
+ } elsif ( $fields[1] eq "I" ) {
+ $wxINCLUDE{$fields[0]} = $fields[2];
} else {
warn "Unknown file type $fields[1] for $fields[0], ignoring.\n";
next line;
# U /src/unix
# R /src/gtk
# H /src/html
+# I /include/wx, /include/wx/gtk, /include/wx/msw, etc.
#
# The third column may be empty or contain some additional info about this
# file (only compile it in 16bit mode, don't compile it with this or that
# O OLE file (needs Win32 and a decent compiler)
# S Socket file (currently doesn't compile under Win16 nor with GNU)
# R Not required for the GTK port
+# WX Base header
+# GTK GTK header
+# MSW MSW header
+# MAC Mac header
+# MOT Motif header
+# PM OS/2 header
+# GEN Generic header
+# PRO Protocol header
+# HTM wxHtml header
+# UNX Unix header
###############################################################################
# File name Type Flags
mod_tables.cpp H
search.cpp H
+arrimpl.cpp I WX
+listimpl.cpp I WX
+accel.h I WX
+app.h I WX
+bitmap.h I WX
+bmpbuttn.h I WX
+brush.h I WX
+buffer.h I WX
+busyinfo.h I WX
+button.h I WX
+caret.h I WX
+checkbox.h I WX
+checklst.h I WX
+choicdlg.h I WX
+choice.h I WX
+clipbrd.h I WX
+cmndata.h I WX
+colordlg.h I WX
+colour.h I WX
+combobox.h I WX
+confbase.h I WX
+config.h I WX
+control.h I WX
+cursor.h I WX
+dataobj.h I WX
+date.h I WX
+datstrm.h I WX
+db.h I WX
+dbtable.h I WX
+dc.h I WX
+dcclient.h I WX
+dcmemory.h I WX
+dcprint.h I WX
+dcps.h I WX
+dcscreen.h I WX
+dde.h I WX
+debug.h I WX
+defs.h I WX
+dialog.h I WX
+dirdlg.h I WX
+dnd.h I WX
+docmdi.h I WX
+docview.h I WX
+dragimag.h I WX
+dynarray.h I WX
+dynlib.h I WX
+event.h I WX
+expr.h I WX
+extdlg.h I WX
+ffile.h I WX
+file.h I WX
+fileconf.h I WX
+filedlg.h I WX
+filefn.h I WX
+filesys.h I WX
+font.h I WX
+fontdlg.h I WX
+frame.h I WX
+fs_inet.h I WX
+fs_zip.h I WX
+gauge.h I WX
+gdicmn.h I WX
+gdiobj.h I WX
+grid.h I WX
+hash.h I WX
+help.h I WX
+helpbase.h I WX
+helphtml.h I WX
+helpwin.h I WX
+helpxlp.h I WX
+icon.h I WX
+image.h I WX
+imaglist.h I WX
+intl.h I WX
+ioswrap.h I WX
+ipcbase.h I WX
+joystick.h I WX
+layout.h I WX
+laywin.h I WX
+list.h I WX
+listbox.h I WX
+listctrl.h I WX
+log.h I WX
+longlong.h I WX
+matrix.h I WX
+mdi.h I WX
+memory.h I WX
+menu.h I WX
+menuitem.h I WX
+metafile.h I WX
+mimetype.h I WX
+minifram.h I WX
+module.h I WX
+msgdlg.h I WX
+mstream.h I WX
+notebook.h I WX
+object.h I WX
+objstrm.h I WX
+odbc.h I WX
+ownerdrw.h I WX
+palette.h I WX
+panel.h I WX
+paper.h I WX
+pen.h I WX
+pnghand.h I WX
+print.h I WX
+printdlg.h I WX
+prntbase.h I WX
+process.h I WX
+progdlg.h I WX
+prop.h I WX
+propform.h I WX
+proplist.h I WX
+radiobox.h I WX
+radiobut.h I WX
+region.h I WX
+resource.h I WX
+sashwin.h I WX
+sckaddr.h I WX
+sckipc.h I WX
+sckstrm.h I WX
+scrolbar.h I WX
+scrolwin.h I WX
+serbase.h I WX
+settings.h I WX
+setup.h I WX
+slider.h I WX
+socket.h I WX
+spinbutt.h I WX
+splitter.h I WX
+statbmp.h I WX
+statbox.h I WX
+statline.h I WX
+stattext.h I WX
+statusbr.h I WX
+stream.h I WX
+string.h I WX
+tab.h I WX
+tabctrl.h I WX
+taskbar.h I WX
+tbar95.h I WX
+tbarbase.h I WX
+tbarmsw.h I WX
+tbarsmpl.h I WX
+textctrl.h I WX
+textdlg.h I WX
+textfile.h I WX
+txtstrm.h I WX
+thread.h I WX
+time.h I WX
+timer.h I WX
+tipdlg.h I WX
+tokenzr.h I WX
+toolbar.h I WX
+tooltip.h I WX
+treectrl.h I WX
+types.h I WX
+url.h I WX
+utils.h I WX
+valgen.h I WX
+validate.h I WX
+valtext.h I WX
+variant.h I WX
+version.h I WX
+wave.h I WX
+wfstream.h I WX
+window.h I WX
+wx.h I WX
+wx_cw.h I WX
+wx_cw_cm.h I WX
+wx_cw_d.h I WX
+wxchar.h I WX
+wxexpr.h I WX
+wxhtml.h I WX
+wxprec.h I WX
+xpmhand.h I WX
+zipstream.h I WX
+zstream.h I WX
+
+accel.h I GTK
+app.h I GTK
+bitmap.h I GTK
+bmpbuttn.h I GTK
+brush.h I GTK
+button.h I GTK
+checkbox.h I GTK
+checklst.h I GTK
+choice.h I GTK
+choicdlg.h I GTK
+clipbrd.h I GTK
+colour.h I GTK
+combobox.h I GTK
+control.h I GTK
+cursor.h I GTK
+dataobj.h I GTK
+dc.h I GTK
+dcclient.h I GTK
+dcmemory.h I GTK
+dcscreen.h I GTK
+dialog.h I GTK
+dnd.h I GTK
+filedlg.h I GTK
+font.h I GTK
+frame.h I GTK
+gauge.h I GTK
+gdiobj.h I GTK
+icon.h I GTK
+joystick.h I GTK
+listbox.h I GTK
+mdi.h I GTK
+menu.h I GTK
+menuitem.h I GTK
+msgdlg.h I GTK
+minifram.h I GTK
+notebook.h I GTK
+palette.h I GTK
+pen.h I GTK
+radiobox.h I GTK
+radiobut.h I GTK
+region.h I GTK
+scrolbar.h I GTK
+settings.h I GTK
+slider.h I GTK
+spinbutt.h I GTK
+statbmp.h I GTK
+statbox.h I GTK
+statline.h I GTK
+stattext.h I GTK
+tbargtk.h I GTK
+textctrl.h I GTK
+textdlg.h I GTK
+timer.h I GTK
+tooltip.h I GTK
+treectrl.h I GTK
+wave.h I GTK
+win_gtk.h I GTK
+window.h I GTK
+
# vi: set noet ts=16 nolist:
$file =~ s/cp?p?$/\o/;
$project{"WXUNIXOBJS"} .= $file . " "
}
+
#$}
+#
+# I want this to be:
+# $(INSTALL_DATA) $(INCDIR)/wx/window.h $(includedir)/wx/window.h
+#
+# foreach $file (sort keys %wxINCLUDE) {
+# next if $wxINCLUDE{$file} =~ /\b(GTK|MSW|MOT|PM|MAC|GEN|HTM|UNX)\b/;
+#
+# $project{"WXINSTALLWX"} .= "$(INSTALL_DATA)" . " " . "\$(INCDIR)/wx/" . $file . " \$(includedir)/wx/" . $file . "\n"
+# }
+#
+#
+#
# This file was automatically generated by tmake at #$ Now()
# DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T!
JPEGDIR = $(WXDIR)/src/jpeg
ZLIBDIR = $(WXDIR)/src/zlib
GTKDIR = $(WXDIR)/src/gtk
+INCDIR = $(WXDIR)/include
DOCDIR = $(WXDIR)\docs
sed -e "s/unput/PROIO_unput/g" > lexer.c
@$(RM) lex.yy.c
+install: $(WXLIB)
+ #$ ExpandList("WXINSTALLWX");
+
clean:
rm -f *.o
rm -f *.lo
virtual ostream& SaveObject(ostream& stream);
virtual istream& LoadObject(istream& stream);
#else
- virtual bool SaveObject(wxOutputStream& stream);
- virtual bool LoadObject(wxInputStream& stream);
+ virtual wxOutputStream& SaveObject(wxOutputStream& stream);
+ virtual wxInputStream& LoadObject(wxInputStream& stream);
#endif
// Called by wxWindows
// wxStream: base classes
// ---------------------------------------------------------------------------
-#define wxStream_NOERROR wxSTR_NOERROR
-#define wxStream_EOF wxSTR_EOF
-#define wxStream_WRITE_ERR wxSTR_WRITE_ERROR
-#define wxStream_READ_ERR wxSTR_READ_ERROR
+#define wxStream_NOERROR wxSTREAM_NOERROR
+#define wxStream_EOF wxSTREAM_EOF
+#define wxStream_WRITE_ERR wxSTREAM_WRITE_ERROR
+#define wxStream_READ_ERR wxSTREAM_READ_ERROR
typedef enum {
wxStream_NOERROR = 0,
wxStreamBase();
virtual ~wxStreamBase();
- bool operator!() const { return (LastError() != wxSTR_NOERROR); }
+ bool operator!() const { return (LastError() != wxSTREAM_NOERROR); }
wxStreamError LastError() const { return m_lasterror; }
virtual size_t GetSize() const { return ~((size_t)0); }
size_t StreamSize() const { return GetSize(); }
ostream& DrawingDocument::SaveObject(ostream& stream)
{
wxDocument::SaveObject(stream);
-
- stream << doodleSegments.Number() << '\n';
+
+ wxInt32 n = doodleSegments.Number();
+ stream << n << '\n';
+
wxNode *node = doodleSegments.First();
while (node)
{
node = node->Next();
}
+
return stream;
}
#else
-bool DrawingDocument::SaveObject(wxOutputStream &stream)
+wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
{
wxDocument::SaveObject(stream);
-
+
wxTextOutputStream text_stream( stream );
wxInt32 n = doodleSegments.Number();
- text_stream << n << "\n";
+ text_stream << n << '\n';
wxNode *node = doodleSegments.First();
while (node)
{
DoodleSegment *segment = (DoodleSegment *)node->Data();
segment->SaveObject(stream);
- text_stream << "\n";
+ text_stream << '\n';
node = node->Next();
}
- return TRUE;
+
+ return stream;
}
#endif
istream& DrawingDocument::LoadObject(istream& stream)
{
wxDocument::LoadObject(stream);
-
- int n = 0;
+
+ wxInt32 n = 0;
stream >> n;
for (int i = 0; i < n; i++)
return stream;
}
#else
-bool DrawingDocument::LoadObject(wxInputStream& stream)
+wxInputStream& DrawingDocument::LoadObject(wxInputStream& stream)
{
wxDocument::LoadObject(stream);
wxTextInputStream text_stream( stream );
-
+
wxInt32 n = 0;
text_stream >> n;
doodleSegments.Append(segment);
}
- return TRUE;
+ return stream;
}
#endif
#if wxUSE_STD_IOSTREAM
ostream& DoodleSegment::SaveObject(ostream& stream)
{
- stream << lines.Number() << '\n';
+ wxInt32 n = lines.Number();
+ stream << n << '\n';
+
wxNode *node = lines.First();
while (node)
{
DoodleLine *line = (DoodleLine *)node->Data();
- stream << line->x1 << " " << line->y1 << " " << line->x2 << " " << line->y2 << "\n";
+ stream << line->x1 << " " <<
+ line->y1 << " " <<
+ line->x2 << " " <<
+ line->y2 << "\n";
node = node->Next();
}
+
return stream;
}
#else
-bool DoodleSegment::SaveObject(wxOutputStream& stream)
+wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
{
wxTextOutputStream text_stream( stream );
wxInt32 n = lines.Number();
- text_stream << n << "\n";
+ text_stream << n << '\n';
wxNode *node = lines.First();
while (node)
line->y2 << "\n";
node = node->Next();
}
- return TRUE;
+
+ return stream;
}
#endif
#if wxUSE_STD_IOSTREAM
istream& DoodleSegment::LoadObject(istream& stream)
{
- int n = 0;
+ wxInt32 n = 0;
stream >> n;
for (int i = 0; i < n; i++)
{
DoodleLine *line = new DoodleLine;
- stream >> line->x1 >> line->y1 >> line->x2 >> line->y2;
+ stream >> line->x1 >>
+ line->y1 >>
+ line->x2 >>
+ line->y2;
lines.Append(line);
}
+
return stream;
}
#else
-bool DoodleSegment::LoadObject(wxInputStream& stream)
+wxInputStream &DoodleSegment::LoadObject(wxInputStream& stream)
{
wxTextInputStream text_stream( stream );
-
+
wxInt32 n = 0;
text_stream >> n;
line->y2;
lines.Append(line);
}
- return TRUE;
+
+ return stream;
}
#endif
void Draw(wxDC *dc);
#if wxUSE_STD_IOSTREAM
- ostream& SaveObject(ostream& stream);
- istream& LoadObject(istream& stream);
+ ostream& SaveObject(ostream& text_stream);
+ istream& LoadObject(istream& text_stream);
#else
- bool SaveObject(wxOutputStream& stream);
- bool LoadObject(wxInputStream& stream);
+ wxOutputStream& SaveObject(wxOutputStream& stream);
+ wxInputStream& LoadObject(wxInputStream& stream);
#endif
};
~DrawingDocument(void);
#if wxUSE_STD_IOSTREAM
- ostream& SaveObject(ostream& stream);
- istream& LoadObject(istream& stream);
+ ostream& SaveObject(ostream& text_stream);
+ istream& LoadObject(istream& text_stream);
#else
- bool SaveObject(wxOutputStream& stream);
- bool LoadObject(wxInputStream& stream);
+ wxOutputStream& SaveObject(wxOutputStream& stream);
+ wxInputStream& LoadObject(wxInputStream& stream);
#endif
inline wxList& GetDoodleSegments(void) const { return (wxList&) doodleSegments; };
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
+#include "wx/txtstrm.h"
#if !wxUSE_DOC_VIEW_ARCHITECTURE
#error You must set wxUSE_DOC_VIEW_ARCHITECTURE to 1 in setup.h!
doodleSegments.DeleteContents(TRUE);
}
+#if wxUSE_STD_IOSTREAM
ostream& DrawingDocument::SaveObject(ostream& stream)
{
wxDocument::SaveObject(stream);
-
- stream << doodleSegments.Number() << '\n';
+
+ wxInt32 n = doodleSegments.Number();
+ stream << n << '\n';
+
wxNode *node = doodleSegments.First();
while (node)
{
node = node->Next();
}
+
return stream;
}
+#else
+wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
+{
+ wxDocument::SaveObject(stream);
+
+ wxTextOutputStream text_stream( stream );
+ wxInt32 n = doodleSegments.Number();
+ text_stream << n << '\n';
+
+ wxNode *node = doodleSegments.First();
+ while (node)
+ {
+ DoodleSegment *segment = (DoodleSegment *)node->Data();
+ segment->SaveObject(stream);
+ text_stream << '\n';
+
+ node = node->Next();
+ }
+
+ return stream;
+}
+#endif
+
+#if wxUSE_STD_IOSTREAM
istream& DrawingDocument::LoadObject(istream& stream)
{
wxDocument::LoadObject(stream);
-
- int n = 0;
+
+ wxInt32 n = 0;
stream >> n;
for (int i = 0; i < n; i++)
return stream;
}
+#else
+wxInputStream& DrawingDocument::LoadObject(wxInputStream& stream)
+{
+ wxDocument::LoadObject(stream);
+
+ wxTextInputStream text_stream( stream );
+
+ wxInt32 n = 0;
+ text_stream >> n;
+
+ for (int i = 0; i < n; i++)
+ {
+ DoodleSegment *segment = new DoodleSegment;
+ segment->LoadObject(stream);
+ doodleSegments.Append(segment);
+ }
+ return stream;
+}
+#endif
DoodleSegment::DoodleSegment(void)
{
}
lines.DeleteContents(TRUE);
}
+#if wxUSE_STD_IOSTREAM
ostream& DoodleSegment::SaveObject(ostream& stream)
{
- stream << lines.Number() << '\n';
+ wxInt32 n = lines.Number();
+ stream << n << '\n';
+
wxNode *node = lines.First();
while (node)
{
DoodleLine *line = (DoodleLine *)node->Data();
- stream << line->x1 << " " << line->y1 << " " << line->x2 << " " << line->y2 << "\n";
+ stream << line->x1 << " " <<
+ line->y1 << " " <<
+ line->x2 << " " <<
+ line->y2 << "\n";
node = node->Next();
}
+
return stream;
}
+#else
+wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
+{
+ wxTextOutputStream text_stream( stream );
+
+ wxInt32 n = lines.Number();
+ text_stream << n << '\n';
+
+ wxNode *node = lines.First();
+ while (node)
+ {
+ DoodleLine *line = (DoodleLine *)node->Data();
+ text_stream << line->x1 << " " <<
+ line->y1 << " " <<
+ line->x2 << " " <<
+ line->y2 << "\n";
+ node = node->Next();
+ }
+ return stream;
+}
+#endif
+
+#if wxUSE_STD_IOSTREAM
istream& DoodleSegment::LoadObject(istream& stream)
{
- int n = 0;
+ wxInt32 n = 0;
stream >> n;
for (int i = 0; i < n; i++)
{
DoodleLine *line = new DoodleLine;
- stream >> line->x1 >> line->y1 >> line->x2 >> line->y2;
+ stream >> line->x1 >>
+ line->y1 >>
+ line->x2 >>
+ line->y2;
lines.Append(line);
}
+
return stream;
}
+#else
+wxInputStream &DoodleSegment::LoadObject(wxInputStream& stream)
+{
+ wxTextInputStream text_stream( stream );
+ wxInt32 n = 0;
+ text_stream >> n;
+
+ for (int i = 0; i < n; i++)
+ {
+ DoodleLine *line = new DoodleLine;
+ text_stream >> line->x1 >>
+ line->y1 >>
+ line->x2 >>
+ line->y2;
+ lines.Append(line);
+ }
+
+ return stream;
+}
+#endif
void DoodleSegment::Draw(wxDC *dc)
{
wxNode *node = lines.First();
class DoodleLine: public wxObject
{
public:
- long x1;
- long y1;
- long x2;
- long y2;
+ wxInt32 x1;
+ wxInt32 y1;
+ wxInt32 x2;
+ wxInt32 y2;
};
// Contains a list of lines: represents a mouse-down doodle
~DoodleSegment(void);
void Draw(wxDC *dc);
- ostream& SaveObject(ostream& stream);
- istream& LoadObject(istream& stream);
+
+#if wxUSE_STD_IOSTREAM
+ ostream& SaveObject(ostream& text_stream);
+ istream& LoadObject(istream& text_stream);
+#else
+ wxOutputStream& SaveObject(wxOutputStream& stream);
+ wxInputStream& LoadObject(wxInputStream& stream);
+#endif
};
class DrawingDocument: public wxDocument
DrawingDocument(void);
~DrawingDocument(void);
- ostream& SaveObject(ostream& stream);
- istream& LoadObject(istream& stream);
+#if wxUSE_STD_IOSTREAM
+ ostream& SaveObject(ostream& text_stream);
+ istream& LoadObject(istream& text_stream);
+#else
+ wxOutputStream& SaveObject(wxOutputStream& stream);
+ wxInputStream& LoadObject(wxInputStream& stream);
+#endif
inline wxList& GetDoodleSegments(void) const { return (wxList&) doodleSegments; };
};
// Saving error
return FALSE;
}
- if (SaveObject(store)==FALSE)
+ if (!SaveObject(store))
{
(void)wxMessageBox(_("Sorry, could not save this file."), msgTitle, wxOK | wxICON_EXCLAMATION,
GetDocumentWindow());
GetDocumentWindow());
return FALSE;
}
- if (LoadObject(store)==FALSE)
+ if (!LoadObject(store))
{
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
GetDocumentWindow());
#if wxUSE_STD_IOSTREAM
istream& wxDocument::LoadObject(istream& stream)
+#else
+wxInputStream& wxDocument::LoadObject(wxInputStream& stream)
+#endif
{
return stream;
}
+#if wxUSE_STD_IOSTREAM
ostream& wxDocument::SaveObject(ostream& stream)
-{
- return stream;
-}
#else
-bool wxDocument::LoadObject(wxInputStream& stream)
-{
- return TRUE;
-}
-
-bool wxDocument::SaveObject(wxOutputStream& stream)
+wxOutputStream& wxDocument::SaveObject(wxOutputStream& stream)
+#endif
{
- return TRUE;
+ return stream;
}
-#endif
bool wxDocument::Revert()
{
assert(socket != NULL);
socket->m_timeout = millisec;
+ /* Neither GLIBC 2.0 nor the kernel 2.0.36 define SO_SNDTIMEO or
+ SO_RCVTIMEO. The man pages, that these flags should exist but
+ are read only. RR. */
+#ifndef __LINUX__
if (socket->m_fd != -1) {
struct timeval tval;
setsockopt(socket->m_fd, SOL_SOCKET, SO_SNDTIMEO, &tval, sizeof(tval));
setsockopt(socket->m_fd, SOL_SOCKET, SO_RCVTIMEO, &tval, sizeof(tval));
}
+#endif
}
/*