summaryrefslogtreecommitdiff
path: root/src/PSEditor.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/PSEditor.cxx')
-rw-r--r--src/PSEditor.cxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/PSEditor.cxx b/src/PSEditor.cxx
index bc50b59..20e9de2 100644
--- a/src/PSEditor.cxx
+++ b/src/PSEditor.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: PSEditor.cxx,v 1.4 2004/07/09 22:51:39 hofmann Exp $"
+// "$Id: PSEditor.cxx,v 1.5 2004/07/18 20:49:43 hofmann Exp $"
//
// PSEditor routines.
//
@@ -29,6 +29,7 @@
PSEditor::PSEditor(int X,int Y,int W, int H) : PSEditWidget(X, Y, W, H) {
loaded = 0;
mod = 0;
+ ps_level = 1;
}
int PSEditor::handle(int event) {
@@ -137,7 +138,13 @@ int PSEditor::save(const char* savefile) {
FILE *fp = fdopen(tmp_fd, "r");
rewind(fp);
FILE *sfp = fopen(savefile, "w");
- PSWriter *pw = new PSLevel2Writer(this);
+ PSWriter *pw;
+
+ if (ps_level == 2) {
+ pw = new PSLevel2Writer(this);
+ } else {
+ pw = new PSLevel1Writer(this);
+ }
pw->write(fp, sfp);
@@ -147,3 +154,15 @@ int PSEditor::save(const char* savefile) {
mod = 0;
return 0;
}
+
+int PSEditor::get_ps_level() {
+ return ps_level;
+}
+
+void PSEditor::set_ps_level(int l) {
+ if (l == 2) {
+ ps_level = 2;
+ } else {
+ ps_level = 1;
+ }
+}