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
|
|
|
|
*
|
1999-11-04 01:40:20 +00:00
|
|
|
* Copyright (C) 1997-1999 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-02-18 22:22:42 +00:00
|
|
|
int InsetParent::Latex(ostream & os, signed char fragile) const
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
1999-12-07 00:44:53 +00:00
|
|
|
os << "%%#{lyx}";
|
|
|
|
InsetCommand::Latex(os, fragile);
|
|
|
|
return 0;
|
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-02-18 22:22:42 +00:00
|
|
|
int InsetParent::Latex(string & file, signed char fragile) const
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
1999-12-07 00:44:53 +00:00
|
|
|
file += "%%#{lyx}";
|
|
|
|
InsetCommand::Latex(file, fragile);
|
|
|
|
return 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
}
|