1999-09-27 18:44:28 +00:00
|
|
|
/* This file is part of*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright 1997-2000 The LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Created by asierra 970813
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetparent.h"
|
1999-10-02 16:21:10 +00:00
|
|
|
#include "support/filetools.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
#include "BufferView.h"
|
|
|
|
#include "LyXView.h"
|
|
|
|
#include "lyxfunc.h"
|
|
|
|
#include "commandtags.h"
|
|
|
|
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
InsetParent::InsetParent(string const & fn, Buffer * owner)
|
|
|
|
: InsetCommand("lyxparent")
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
1999-12-07 00:44:53 +00:00
|
|
|
if (owner)
|
1999-12-10 00:07:59 +00:00
|
|
|
setContents(MakeAbsPath(fn, OnlyPath(owner->fileName())));
|
1999-12-07 00:44:53 +00:00
|
|
|
else
|
|
|
|
setContents(fn);
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
|
2000-02-25 12:06:15 +00:00
|
|
|
void InsetParent::Edit(BufferView * bv, int, int, unsigned int)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
2000-02-25 12:06:15 +00:00
|
|
|
bv->owner()->getLyXFunc()->
|
|
|
|
Dispatch(LFUN_CHILDOPEN, getContents().c_str());
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
// LaTeX must just ignore this command
|
2000-03-09 03:36:48 +00:00
|
|
|
int InsetParent::Latex(ostream & os, signed char fragile, bool free_spc) const
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
1999-12-07 00:44:53 +00:00
|
|
|
os << "%%#{lyx}";
|
2000-03-09 03:36:48 +00:00
|
|
|
InsetCommand::Latex(os, fragile, free_spc);
|
1999-12-07 00:44:53 +00:00
|
|
|
return 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
|
2000-03-02 02:19:43 +00:00
|
|
|
#ifndef USE_OSTREAM_ONLY
|
1999-09-27 18:44:28 +00:00
|
|
|
// LaTeX must just ignore this command
|
2000-03-09 03:36:48 +00:00
|
|
|
int InsetParent::Latex(string & file, signed char fragile, bool free_spc) const
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
1999-12-07 00:44:53 +00:00
|
|
|
file += "%%#{lyx}";
|
2000-03-09 03:36:48 +00:00
|
|
|
InsetCommand::Latex(file, fragile, free_spc);
|
1999-12-07 00:44:53 +00:00
|
|
|
return 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|
2000-03-02 02:19:43 +00:00
|
|
|
#endif
|