#include <algorithm>
#include <iostream>
-#include "LString.h"
+//#include "LString.h"
#include FORMS_H_LOCATION
#include "lyx.h"
#include "layout_forms.h"
#include "support/filetools.h"
#include "support/path.h"
#include "lyxserver.h"
-#include "FontLoader.h"
#include "lyxrc.h"
#include "lyxtext.h"
#include "CutAndPaste.h"
-#include "TextCache.h"
+#include "exporter.h"
using std::ifstream;
using std::copy;
extern FD_form_preamble * fd_form_preamble;
extern FD_form_table * fd_form_table;
extern FD_form_figure * fd_form_figure;
-extern FD_form_screen * fd_form_screen;
extern FD_form_bullet * fd_form_bullet;
extern BufferView * current_view; // called too many times in this file...
void ShowMessage(Buffer * buf,
string const & msg1,
- string const & msg2 = string(),
- string const & msg3 = string(), int delay = 6)
+ string const & msg2,
+ string const & msg3, int delay)
{
if (lyxrc.use_gui) {
buf->getUser()->owner()->getMiniBuffer()->Set(msg1, msg2,
return true;
}
-
+#ifndef NEW_EXPORT
int MenuRunLaTeX(Buffer * buffer)
{
int ret = 0;
}
return ret;
}
-
+#endif
int MenuBuildProg(Buffer * buffer)
{
return ret;
}
-
+#ifndef NEW_EXPORT
int MakeLaTeXOutput(Buffer * buffer)
{
// Who cares?
AllowInput(current_view);
return ret;
}
-
+#endif
void MenuFax(Buffer * buffer)
{
//if (!bv->text)
// return;
+#ifdef NEW_EXPORT
+ // Generate postscript file
+ if (!Exporter::Export(buffer, "ps", true))
+ return;
+
+ // Send fax
+ string ps = OnlyFilename(ChangeExtension (buffer->fileName(),
+ ".ps"));
+#else
// Generate postscript file
if (!CreatePostscript(buffer, true)) {
return;
// Send fax
string ps = OnlyFilename(ChangeExtension (buffer->fileName(),
".ps_tmp"));
+#endif
string path = OnlyPath (buffer->fileName());
if (lyxrc.use_tempdir || (IsDirWriteable(path) < 1)) {
path = buffer->tmppath;
}
+#ifndef NEW_EXPORT
// Returns false if we fail
bool PreviewDVI(Buffer * buffer)
{
ShowMessage(buffer, _("Unknown export type: ") + extyp);
}
}
+#endif
void QuitLyX()
tmp.c_str());
}
-
+#ifndef NEW_EXPORT
/*
* SGML Linuxdoc support:
* (flag == 0) make TeX output
current_view->buffer()->redraw();
return errorcode;
}
-
+#endif
void MenuLayoutCharacter()
{
}
}
-
+#ifdef USE_OLD_DOCUMENT_LAYOUT
inline
void DeactivateDocumentButtons ()
{
}
}
}
+#endif
bool UpdateLayoutPreamble()
}
+#ifdef USE_OLD_DOCUMENT_LAYOUT
/* callbacks for form form_document */
-
void UpdateDocumentButtons(BufferParams const & params)
{
fl_set_choice(fd_form_document->choice_pagestyle, 1);
// bullet callbacks etc. in bullet_panel.C -- ARRae
}
-
/* callbacks for form form_quotes */
extern "C" void QuotesApplyCB(FL_OBJECT *, long)
QuotesApplyCB(ob, data);
QuotesCancelCB(ob, data);
}
-
+#else
+// this is needed for now!
+extern "C" void ChoiceClassCB(FL_OBJECT *, long) {}
+extern "C" void DocumentDefskipCB(FL_OBJECT *, long) {}
+extern "C" void DocumentSpacingCB(FL_OBJECT *, long) {}
+extern "C" void DocumentApplyCB(FL_OBJECT *, long) {}
+extern "C" void DocumentCancelCB(FL_OBJECT *, long) {}
+extern "C" void DocumentOKCB(FL_OBJECT *, long) {}
+extern "C" void DocumentBulletsCB(FL_OBJECT *, long) {}
+extern "C" void QuotesApplyCB(FL_OBJECT *, long) {}
+extern "C" void QuotesCancelCB(FL_OBJECT *, long) {}
+extern "C" void QuotesOKCB(FL_OBJECT *, long) {}
+#endif
/* callbacks for form form_preamble */
}
-extern "C" void ScreenApplyCB(FL_OBJECT *, long)
-{
- lyxrc.roman_font_name = fl_get_input(fd_form_screen->input_roman);
- lyxrc.sans_font_name = fl_get_input(fd_form_screen->input_sans);
- lyxrc.typewriter_font_name = fl_get_input(fd_form_screen->input_typewriter);
- lyxrc.font_norm = fl_get_input(fd_form_screen->input_font_norm);
- lyxrc.set_font_norm_type();
- lyxrc.zoom = atoi(fl_get_input(fd_form_screen->intinput_size));
- fontloader.update();
-
- // Of course we should only to the resize and the textcahce.clear
- // if values really changed...but not very important right now. (Lgb)
-
- // All buffers will need resize
- bufferlist.resize();
- // We also need to empty the textcache so that
- // the buffer will be formatted correctly after
- // a zoom change.
- textcache.clear();
-
- current_view->owner()->getMiniBuffer()->Set(_("Screen options set"));
-}
-
-
-extern "C" void ScreenCancelCB(FL_OBJECT *, long)
-{
- fl_hide_form(fd_form_screen->form_screen);
-}
-
-
-extern "C" void ScreenOKCB(FL_OBJECT * ob, long data)
-{
- ScreenCancelCB(ob, data);
- ScreenApplyCB(ob, data);
-}
-
-
// This function runs "configure" and then rereads lyx.defaults to
// reconfigure the automatic settings.
void Reconfigure(BufferView * bv)