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-11-04 01:40:20 +00:00
|
|
|
extern BufferView * current_view;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
InsetParent::InsetParent(string fn, Buffer * owner): InsetCommand("lyxparent")
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
|
|
|
if (owner)
|
|
|
|
setContents(MakeAbsPath(fn, OnlyPath(owner->getFileName())));
|
|
|
|
else
|
|
|
|
setContents(fn);
|
|
|
|
}
|
|
|
|
|
|
|
|
void InsetParent::Edit(int, int)
|
|
|
|
{
|
1999-11-09 22:53:41 +00:00
|
|
|
current_view->owner()->getLyXFunc()->Dispatch(LFUN_CHILDOPEN,
|
1999-09-27 18:44:28 +00:00
|
|
|
getContents().c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
// LaTeX must just ignore this command
|
1999-11-04 01:40:20 +00:00
|
|
|
int InsetParent::Latex(FILE * file, signed char fragile)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
|
|
|
fprintf(file, "%%#{lyx}");
|
|
|
|
InsetCommand::Latex(file, fragile);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// LaTeX must just ignore this command
|
1999-11-04 01:40:20 +00:00
|
|
|
int InsetParent::Latex(string & file, signed char fragile)
|
1999-09-27 18:44:28 +00:00
|
|
|
{
|
|
|
|
file += "%%#{lyx}";
|
|
|
|
InsetCommand::Latex(file, fragile);
|
|
|
|
return 0;
|
|
|
|
}
|