remove redundant declarations of WorkAreai and other small things.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3692 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-03-07 15:45:52 +00:00
parent 332ed25f55
commit 3b8b29831f
6 changed files with 9 additions and 126 deletions

View File

@ -1,3 +1,11 @@
2002-03-07 Angus Leeming <a.leeming@ic.ac.uk>
* LyXSendto.C: remove.
* LyXView.C (c-tor): clean-up Jürgen's #if 0 correctly.
* lyx_gui.C: remove now-redundant comment.
* ColorHandler.h: remove forward declaration of class WorkArea.
* lyxfunc.C: remove #include "WorkArea.h".
2002-03-07 Juergen Vigna <jug@sad.it>
* undo_funcs.C (textHandleUndo): fix problems when the paragraph

View File

@ -23,7 +23,6 @@
#include "PainterBase.h"
class LyXFont;
class WorkArea;
/**
* This is a factory class that can produce GCs with a specific

View File

@ -1,113 +0,0 @@
#include <config.h>
#include FORMS_H_LOCATION
#include "print_form.h"
#include "lyx_main.h"
#include "lyxrc.h"
#include "LString.h"
#include "buffer.h"
#include "gettext.h"
#include "bufferview_funcs.h"
#include "exporter.h"
#include "BufferView.h"
#include "support/filetools.h"
#include "support/lstrings.h"
#include "support/path.h"
#include "support/systemcall.h"
extern FD_form_sendto * fd_form_sendto;
extern BufferView * current_view;
extern int MakeLaTeXOutput(Buffer * buffer);
extern bool CreatePostscript(Buffer * buffer, bool wait);
// Whereas this feature is under the menu item File->Export->Custom,
// I kept the old name sendto in the code because I am lazy (JMarc)
void MenuSendto()
{
static int ow = -1;
static int oh;
// do this only if the command is empty
if (!fl_get_input(fd_form_sendto->input_cmd) &&
!lyxrc.custom_export_command.empty())
fl_set_input(fd_form_sendto->input_cmd,
lyxrc.custom_export_command.c_str());
if (fd_form_sendto->form_sendto->visible) {
fl_raise_form(fd_form_sendto->form_sendto);
} else {
fl_show_form(fd_form_sendto->form_sendto,
FL_PLACE_MOUSE | FL_FREE_SIZE, FL_TRANSIENT,
_("Send Document to Command"));
if (ow < 0) {
ow = fd_form_sendto->form_sendto->w;
oh = fd_form_sendto->form_sendto->h;
}
fl_set_form_minsize(fd_form_sendto->form_sendto, ow, oh);
}
}
void SendtoApplyCB(FL_OBJECT *, long)
{
if (!current_view->available())
return;
string command = fl_get_input(fd_form_sendto->input_cmd);
if (command.empty())
return;
Buffer * buffer = current_view->buffer();
string ftypeext;
if (fl_get_button(fd_form_sendto->radio_ftype_lyx))
ftypeext = ".lyx";
else if (fl_get_button(fd_form_sendto->radio_ftype_latex))
ftypeext = ".tex";
else if (fl_get_button(fd_form_sendto->radio_ftype_dvi))
ftypeext = ".dvi";
else if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
ftypeext = ".txt";
else {
ftypeext = ".ps";
if (!Exporter::Export(buffer, "ps", true))
return;
}
string const fname = OnlyFilename(ChangeExtension(buffer->getLatexName(),
ftypeext));
if (!contains(command, "$$FName"))
command = "( " + command + " ) <$$FName";
command = subst(command, "$$FName", fname);
command += " &"; // execute in background
// push directorypath, if necessary
string path = buffer->filePath();
if (lyxrc.use_tempdir || !IsDirWriteable(path)) {
path = buffer->tmppath;
}
Path p(path);
// save the .lyx file in tmp_dir if this filetype is requested
if (fl_get_button(fd_form_sendto->radio_ftype_lyx))
buffer->writeFile(fname, true);
// if the .tex file is requested save it to the tempdir
// as now we don't do the MakeLaTeXOutput anymore
if (fl_get_button(fd_form_sendto->radio_ftype_latex))
buffer->makeLaTeXFile(fname, path, false);
// create the .txt file in tmp_dir if this filetype is requested
if (fl_get_button(fd_form_sendto->radio_ftype_ascii))
buffer->writeFileAscii(fname, lyxrc.ascii_linelen);
Systemcall one;
one.startscript(Systemcall::Wait, command);
}
void SendtoCancelCB(FL_OBJECT *, long)
{
fl_hide_form(fd_form_sendto->form_sendto);
}
void SendtoOKCB(FL_OBJECT * ob, long data)
{
SendtoCancelCB(ob, data);
SendtoApplyCB(ob, data);
}

View File

@ -58,12 +58,7 @@ LyXView::LyXView()
autosave_timeout = new Timeout(5000);
dialogs_ = new Dialogs(this);
#if 0
dialogs_->hideBufferDependent
.connect(SigC::slot(&CloseAllBufferRelatedDialogs));
Dialogs::redrawGUI.connect(SigC::slot(this, &LyXView::redraw));
Dialogs::redrawGUI.connect(SigC::slot(&RedrawAllBufferRelatedDialogs));
#endif
}

View File

@ -264,10 +264,6 @@ void LyXGUI::create_forms()
// From here down should be done by somebody else. (Lgb)
//
// Create forms
//
// This is probably as good a time as any to map the xform colours,
// should a mapping exist.
string const filename = AddName(user_lyxdir, "preferences.xform");

View File

@ -33,7 +33,6 @@
#include "Lsstream.h"
#include "trans_mgr.h"
#include "layout.h"
#include "WorkArea.h"
#include "bufferview_funcs.h"
#include "minibuffer.h"
#include "vspace.h"
@ -113,7 +112,6 @@ using std::back_inserter;
extern BufferList bufferlist;
extern LyXServer * lyxserver;
extern bool selection_possible;
extern void MenuSendto();
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
@ -1118,7 +1116,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
case LFUN_EXPORT:
if (argument == "custom")
owner->getDialogs()->showSendto();//MenuSendto();
owner->getDialogs()->showSendto();
else
Exporter::Export(owner->buffer(), argument, false);
break;