// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1997-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#ifndef BACK_STACK_H
#define BACK_STACK_H
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
maximum_height - work_area->h);
#if FL_REVISION > 85
double lineh = buffer_->text->DefaultHeight();
- fl_set_slider_increment(scrollbar,work_area->h-lineh,lineh);
+ fl_set_slider_increment(scrollbar, work_area->h-lineh, lineh);
#endif
if (maxfloat>0){
if ((hfloat/maxfloat) * float(height2) < 3)
AllowInput();
// Now if the title form still exist kill it
- TimerCB(0,0);
+ TimerCB(0, 0);
return 0;
}
if (!buffer_->text->GotoNextError()) {
if (buffer_->text->cursor.pos
- || buffer_->text->cursor.par !=
+ || buffer_->text->cursor.par !=
buffer_->text->FirstParagraph()) {
tmp = buffer_->text->cursor;
- buffer_->text->cursor.par =
+ buffer_->text->cursor.par =
buffer_->text->FirstParagraph();
buffer_->text->cursor.pos = 0;
if (!buffer_->text->GotoNextError()) {
}
}
buffer_->update(0);
- buffer_->text->sel_cursor =
+ buffer_->text->sel_cursor =
buffer_->text->cursor;
}
// a hack for the figinsets (Matthias)
// This one first, then it will probably be invisible. (Lgb)
- ::figinset_canvas = figinset_canvas = obj =
+ ::figinset_canvas = figinset_canvas = obj =
fl_add_canvas(FL_NORMAL_CANVAS,
xpos + 1,
- ypos + 1,1,1,"");
- fl_set_object_boxtype(obj,FL_NO_BOX);
+ ypos + 1, 1, 1, "");
+ fl_set_object_boxtype(obj, FL_NO_BOX);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthWestGravity, NorthWestGravity);
// a box
obj = fl_add_box(FL_BORDER_BOX, xpos, ypos,
width - 15,
- height,"");
+ height, "");
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthWestGravity, SouthEastGravity);
work_area = obj = fl_add_free(FL_INPUT_FREE,
xpos +bw, ypos+bw,
width-15-2*bw /* scrollbarwidth */,
- height-2*bw,"",
+ height-2*bw, "",
C_BufferView_work_area_handler);
obj->wantkey = FL_KEY_TAB;
obj->u_vdata = this; /* This is how we pass the BufferView
to the work_area_handler. */
- fl_set_object_boxtype(obj,FL_DOWN_BOX);
+ fl_set_object_boxtype(obj, FL_DOWN_BOX);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthWestGravity, SouthEastGravity);
button_up = obj = fl_add_pixmapbutton(FL_TOUCH_BUTTON,
width-15+4*bw,
ypos,
- 15,15,"");
- fl_set_object_boxtype(obj,FL_UP_BOX);
- fl_set_object_color(obj,FL_MCOL,FL_BLUE);
+ 15, 15, "");
+ fl_set_object_boxtype(obj, FL_UP_BOX);
+ fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_resize(obj, FL_RESIZE_ALL);
- fl_set_object_gravity(obj,NorthEastGravity, NorthEastGravity);
+ fl_set_object_gravity(obj, NorthEastGravity, NorthEastGravity);
fl_set_object_callback(obj, C_BufferView_UpCB, 0);
obj->u_vdata = this;
fl_set_pixmapbutton_data(obj, up_xpm);
#if FL_REVISION > 85
// Remove the blue feedback rectangle
- fl_set_pixmapbutton_focus_outline(obj,0);
+ fl_set_pixmapbutton_focus_outline(obj, 0);
#endif
// the scrollbar slider
scrollbar = obj = fl_add_slider(FL_VERT_SLIDER,
width-15+4*bw,
ypos + 15,
- 15,height-30,"");
- fl_set_object_color(obj,FL_COL1,FL_MCOL);
+ 15, height-30, "");
+ fl_set_object_color(obj, FL_COL1, FL_MCOL);
fl_set_object_boxtype(obj, FL_UP_BOX);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthEastGravity, SouthEastGravity);
button_down = obj = fl_add_pixmapbutton(FL_TOUCH_BUTTON,
width-15+4*bw,
ypos + height-15,
- 15,15,"");
- fl_set_object_boxtype(obj,FL_UP_BOX);
- fl_set_object_color(obj,FL_MCOL,FL_BLUE);
+ 15, 15, "");
+ fl_set_object_boxtype(obj, FL_UP_BOX);
+ fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, SouthEastGravity, SouthEastGravity);
fl_set_object_callback(obj, C_BufferView_DownCB, 0);
#if FL_REVISION >85
// Remove the blue feedback rectangle
- fl_set_pixmapbutton_focus_outline(obj,0);
+ fl_set_pixmapbutton_focus_outline(obj, 0);
#endif
//
// timer_cursor
timer_cursor = obj = fl_add_timer(FL_HIDDEN_TIMER,
- 0,0,0,0,"Timer");
- fl_set_object_callback(obj,C_BufferView_CursorToggleCB,0);
+ 0, 0, 0, 0, "Timer");
+ fl_set_object_callback(obj, C_BufferView_CursorToggleCB, 0);
obj->u_vdata = this;
}
view->workAreaExpose();
break;
case FL_PUSH:
- view->WorkAreaButtonPress(ob, 0,0,0,ev,0);
+ view->WorkAreaButtonPress(ob, 0, 0, 0, ev, 0);
break;
case FL_RELEASE:
- view->WorkAreaButtonRelease(ob, 0,0,0,ev,0);
+ view->WorkAreaButtonRelease(ob, 0, 0, 0, ev, 0);
break;
case FL_MOUSE:
if (ev->xmotion.x != x_old ||
x_old = ev->xmotion.x;
y_old = ev->xmotion.y;
scrollbar_value_old = view->current_scrollbar_value;
- view->WorkAreaMotionNotify(ob, 0,0,0,ev,0);
+ view->WorkAreaMotionNotify(ob, 0, 0, 0, ev, 0);
}
break;
// Done by the raw callback:
- // case FL_KEYBOARD: WorkAreaKeyPress(ob, 0,0,0,ev,0); break;
+ // case FL_KEYBOARD: WorkAreaKeyPress(ob, 0, 0, 0, ev, 0); break;
case FL_FOCUS:
if (!view->owner_->getMiniBuffer()->shows_no_match)
view->owner_->getMiniBuffer()->Init();
view->screen->HideCursor();
view->screen->ToggleSelection();
view->buffer_->text->CursorHome();
- view->buffer_->text->sel_cursor =
+ view->buffer_->text->sel_cursor =
view->buffer_->text->cursor;
view->buffer_->text->CursorEnd();
view->buffer_->text->SetSelection();
case FL_OTHER:
view->WorkAreaSelectionNotify(ob,
view->owner_->getForm()->window,
- 0,0,ev,0);
+ 0, 0, ev, 0);
break;
}
return 1;
c = buffer_->text->cursor.par->
GetChar(buffer_->text->cursor.pos);
}
- if (c == LYX_META_FOOTNOTE || c == LYX_META_MARGIN
- || c == LYX_META_FIG || c == LYX_META_TAB
- || c == LYX_META_WIDE_FIG || c == LYX_META_WIDE_TAB
- || c == LYX_META_ALGORITHM){
+ if (c == LyXParagraph::META_FOOTNOTE
+ || c == LyXParagraph::META_MARGIN
+ || c == LyXParagraph::META_FIG
+ || c == LyXParagraph::META_TAB
+ || c == LyXParagraph::META_WIDE_FIG
+ || c == LyXParagraph::META_WIDE_TAB
+ || c == LyXParagraph::META_ALGORITHM){
hit = true;
} else if (buffer_->text->cursor.pos - 1 >= 0) {
c = buffer_->text->cursor.par->
GetChar(buffer_->text->cursor.pos - 1);
- if (c == LYX_META_FOOTNOTE || c == LYX_META_MARGIN
- || c == LYX_META_FIG || c == LYX_META_TAB
- || c == LYX_META_WIDE_FIG
- || c == LYX_META_WIDE_TAB
- || c == LYX_META_ALGORITHM){
+ if (c == LyXParagraph::META_FOOTNOTE
+ || c == LyXParagraph::META_MARGIN
+ || c == LyXParagraph::META_FIG
+ || c == LyXParagraph::META_TAB
+ || c == LyXParagraph::META_WIDE_FIG
+ || c == LyXParagraph::META_WIDE_TAB
+ || c == LyXParagraph::META_ALGORITHM){
// We are one step too far to the right
buffer_->text->CursorLeft();
hit = true;
}
// Do we want to close a float? (click on the float-label)
- if (buffer_->text->cursor.row->par->footnoteflag ==
+ if (buffer_->text->cursor.row->par->footnoteflag ==
LyXParagraph::OPEN_FOOTNOTE
&& buffer_->text->cursor.pos == 0
&& buffer_->text->cursor.row->previous &&
LyXCursor cursor = buffer_->text->cursor;
if (cursor.pos < cursor.par->Last()
- && cursor.par->GetChar(cursor.pos) == LYX_META_INSET
+ && cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET
&& cursor.par->GetInset(cursor.pos)
&& cursor.par->GetInset(cursor.pos)->Editable()) {
return tmpinset;
}
} else if (cursor.pos - 1 >= 0
- && cursor.par->GetChar(cursor.pos - 1) == LYX_META_INSET
+ && cursor.par->GetChar(cursor.pos - 1) == LyXParagraph::META_INSET
&& cursor.par->GetInset(cursor.pos - 1)
&& cursor.par->GetInset(cursor.pos - 1)->Editable()) {
buffer_->text->CursorLeft();
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1998 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#ifndef BUFFER_VIEW_H
#define BUFFER_VIEW_H
class BufferView {
public:
///
- BufferView(LyXView *owner, int ,int ,int, int);
+ BufferView(LyXView *owner, int , int , int, int);
///
Buffer * buffer() const { return buffer_; }
///
* generate the bullets in the bullet-panel's.
*
* This file is part of
- *======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1997-1998 Allan Rae
* and the LyX Team
*
- *======================================================*/
+ * ====================================================== */
#include <config.h>
}
-const string & Bullet::bulletSize(const short & s)
+string const & Bullet::bulletSize(const short & s)
{
// use a parameter rather than hard code `size' in here
// in case some future function may want to retrieve
}
-const string & Bullet::bulletEntry(const short & f, const short & c)
+string const & Bullet::bulletEntry(const short & f, const short & c)
{
// Despite how this may at first appear the static local variables
// are only initialized once..
// -*- C++ -*-
/* This is the bullet class definition file.
* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
*
* This file Copyright 1997-1999
* Allan Rae
- * ======================================================*/
+ * ====================================================== */
#ifndef BULLET_H
#define BULLET_H
Bullet(const int f = -1, const int c = -1, const int s = -1);
///
- Bullet(const string &);
+ Bullet(string const &);
///
~Bullet();
///
void setSize(const int);
///
- void setText(const string &);
+ void setText(string const &);
///
int getCharacter() const;
///
///
void generateText();
///
- static const string & bulletSize(const short &);
+ static string const & bulletSize(const short &);
///
- static const string & bulletEntry(const short &, const short &);
+ static string const & bulletEntry(const short &, const short &);
///
short font;
/*----------------Inline Bullet Member Functions------------------*/
-inline Bullet::Bullet(const string & t)
+inline Bullet::Bullet(string const & t)
: font(MIN), character(MIN), size(MIN), user_text(1), text(t)
{
#ifdef DEBUG_AS_DEFAULT
}
-inline void Bullet::setText(const string & t)
+inline void Bullet::setText(string const & t)
{
font = character = size = MIN;
user_text = 1;
}
-inline const char * Bullet::c_str()
+inline char const * Bullet::c_str()
{
return this->getText().c_str();
}
static Bullet const ITEMIZE_DEFAULTS[4] = { Bullet( 0, 8 ),//"\\(\\bullet\\)"
Bullet( 0, 0 ),//"\\normalfont\\bfseries{--}"
Bullet( 0, 6 ),//"\\(\\ast\\)"
- Bullet( 0,10 ) };//"\\(\\cdot\\)"
+ Bullet( 0, 10 ) };//"\\(\\cdot\\)"
#endif /* BULLET_H_ */
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* This file is Copyright 1997-1998
* Asger Alstrup
*
- *======================================================
+ * ======================================================
*/
#include <config.h>
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* This file is Copyright 1997
* Asger Alstrup
*
- * ======================================================
+ * ======================================================
*/
#ifndef CHKTEX_H
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright (C) 1995 Matthias Ettrich
* This file is Copyright (C) 1996-1998
* Lars Gullik Bjønnes
*
- * ======================================================
+ * ======================================================
*/
#include <config.h>
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright (C) 1995 Matthias Ettrich
* This file is Copyright (C) 1996-1998
* Lars Gullik Bjønnes
*
- * ======================================================
+ * ======================================================
*/
#ifndef DEP_TABLE_H
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1997 Asger Alstrup
* and the LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include <cmath> // fabs()
int closestind = -1;
double error = 100000;
- for (int i=0; i<matches; i++) {
+ for (int i = 0; i<matches; i++) {
if (sizes[i] == 0) {
// Scalable font should not be considered close
} else if (sizes[i] == size) {
strings = new string[matches];
// We have matches. Run them through
- for(int i=0; i<matches; i++) {
+ for(int i = 0; i<matches; i++) {
string name(list[i]);
- sizes[i] = atoi(token(name, '-',7).c_str());
+ sizes[i] = atoi(token(name, '-', 7).c_str());
strings[i] = name;
if (sizes[i] == 0) {
if (scaleindex == -1) {
* Copyright (C) 1997 Asger Alstrup
* and the LyX Team.
*
- *======================================================*/
+ * ====================================================== */
-#ifndef _FONTINFO_H_
-#define _FONTINFO_H_
+#ifndef FONTINFO_H
+#define FONTINFO_H
#ifdef __GNUG__
#pragma interface
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1997 Asger Alstrup
* and the LyX Team.
*
- *======================================================*/
+ * ====================================================== */
#include <config.h>
#include <cmath> // fabs()
void FontLoader::reset()
{
// Clear font infos, font structs and font metrics
- for (int i1=0; i1<4; i1++)
- for (int i2=0; i2<2; i2++)
- for (int i3=0; i3<4; i3++) {
+ for (int i1 = 0; i1<4; i1++)
+ for (int i2 = 0; i2<2; i2++)
+ for (int i3 = 0; i3<4; i3++) {
fontinfo[i1][i2][i3] = 0;
- for (int i4=0; i4<10; i4++) {
+ for (int i4 = 0; i4<10; i4++) {
fontstruct[i1][i2][i3][i4] = 0;
}
}
void FontLoader::unload()
{
// Unload all fonts
- for (int i1=0; i1<4; i1++)
- for (int i2=0; i2<2; i2++)
- for (int i3=0; i3<4; i3++) {
+ for (int i1 = 0; i1<4; i1++)
+ for (int i2 = 0; i2<2; i2++)
+ for (int i3 = 0; i3<4; i3++) {
if (fontinfo[i1][i2][i3]) {
delete fontinfo[i1][i2][i3];
fontinfo[i1][i2][i3] = 0;
}
- for (int i4=0; i4<10; i4++) {
+ for (int i4 = 0; i4<10; i4++) {
if (fontstruct[i1][i2][i3][i4]) {
XFreeFont(fl_display, fontstruct[i1][i2][i3][i4]);
fontstruct[i1][i2][i3][i4] = 0;
FontInfo * fi = new FontInfo();
fontinfo[family][series][shape] = fi;
- for (int cfam=0; cfam < 2; cfam++) {
+ for (int cfam = 0; cfam < 2; cfam++) {
// Determine family name
switch (family) {
case LyXFont::ROMAN_FAMILY:
default: ;
}
- for (int cser=0; cser < 4; cser++) {
+ for (int cser = 0; cser < 4; cser++) {
// Determine series name
switch (series) {
case LyXFont::MEDIUM_SERIES:
default: ;
}
- for (int csha=0; csha < 2; csha++) {
+ for (int csha = 0; csha < 2; csha++) {
// Determine shape name
switch (shape) {
case LyXFont::UP_SHAPE:
LyXFont::FONT_SHAPE shape,
LyXFont::FONT_SIZE size)
{
- getFontinfo(family,series,shape);
+ getFontinfo(family, series, shape);
int fsize = int( (lyxrc->font_sizes[size] * lyxrc->dpi *
(lyxrc->zoom/100.0) ) / 72.27 + 0.5 );
* Copyright (C) 1997 Asger Alstrup
* and the LyX Team.
*
- *======================================================*/
+ * ====================================================== */
-#ifndef _FONTLOADER_H_
-#define _FONTLOADER_H_
+#ifndef FONTLOADER_H_
+#define FONTLOADER_H_
#ifdef __GNUG__
#pragma interface
LyXFont::FONT_SHAPE shape,
LyXFont::FONT_SIZE size)
{
- if (fontstruct[family][series][shape][size]!=0)
+ if (fontstruct[family][series][shape][size]!= 0)
return fontstruct[family][series][shape][size];
else
- return doLoad(family,series,shape,size);
+ return doLoad(family, series, shape, size);
};
private:
/// Array of font structs
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* This file is Copyright 1998
* Asger Alstrup
*
- *======================================================
+ * ======================================================
*/
#include <config.h>
string tmp = lyxrc->relyx_command + " -f " + file;
Systemcalls one;
Buffer * buf = 0;
- int result= one.startscript(Systemcalls::System, tmp);
- if (result==0) {
+ int result = one.startscript(Systemcalls::System, tmp);
+ if (result == 0) {
string filename = ChangeExtension(file, ".lyx", false);
// File was generated without problems. Load it.
buf = bufferlist.loadLyXFile(filename);
* This file is Copyright (C) 1998
* Asger Alstrup
*
- *======================================================
+ * ======================================================
*/
-#ifndef _IMPORTLATEX_H
-#define _IMPORTLATEX_H
+#ifndef IMPORTLATEX_H
+#define IMPORTLATEX_H
#ifdef __GNUG__
#pragma interface
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* This file is Copyright 1999
* Kayvan A. Sylvan
*
- * ======================================================
+ * ======================================================
*/
#include <config.h>
Systemcalls one;
Buffer * buf = 0;
int result= one.startscript(Systemcalls::System, tmp);
- if (result==0) {
+ if (result == 0) {
string filename = file + ".lyx";
// File was generated without problems. Load it.
buf = bufferlist.loadLyXFile(filename);
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* This file is Copyright (C) 1999
* Kayvan A. Sylvan
*
- *======================================================
+ * ======================================================
*/
#ifndef IMPORTNOWEB_H
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1999 The LyX Team.
*
- *======================================================*/
+ * ====================================================== */
#ifndef LSTRING_H
#define LSTRING_H
#ifndef USE_INCLUDED_STRING
#include <string>
using std::string;
-//using std::wstring;
#else
#include "support/lyxstring.h"
typedef lyxstring string;
-//typedef lyxwstring wstring;
#endif
#endif
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* This file is Copyright 1996-1999
* Lars Gullik Bjønnes
*
- * ======================================================
+ * ======================================================
*/
#include <config.h>
lyxerr[Debug::LATEX] << "Running MakeIndex." << endl;
minib->Set(_("Running MakeIndex."));
minib->Store();
- rerun=runMakeIndex(ChangeExtension(file,".idx",true));
+ rerun = runMakeIndex(ChangeExtension(file, ".idx", true));
}
// run bibtex
static cmdret do_popen(string const & cmd)
{
// One question is if we should use popen or
- // create our own popen based on fork,exec,pipe
+ // create our own popen based on fork, exec, pipe
// of course the best would be to have a
// pstream (process stream), with the
// variants ipstream, opstream and
return OnlyFilename(fil);
// No we try to find it using kpsewhich.
- string kpsecmd = "kpsewhich --format=" + format + " " + fil;
+ string kpsecmd = "kpsewhich --format= " + format + " " + fil;
cmdret c = do_popen(kpsecmd);
lyxerr << "kpse status = " << c.first << "\n"
l = data.substr(0, b - 0);
data.erase(0, b + 1);
}
- string full_l =
+ string full_l =
findtexfile(
- ChangeExtension(l,"bib",false),
+ ChangeExtension(l, "bib", false),
"bib");
lyxerr << "data = `"
<< full_l << "'" << endl;
string style = token.substr(a, b - a);
// token is now the style file
// pass it to the helper
- string full_l =
+ string full_l =
findtexfile(
ChangeExtension(style, "bst", false),
"bst");
}
if (using_bibtex) {
// run bibtex and
- string tmp= "bibtex ";
+ string tmp = "bibtex ";
tmp += ChangeExtension(file, string(), true);
Systemcalls one;
one.startscript(Systemcalls::System, tmp);
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* This file is Copyright (C) 1996-1999
* Lars Gullik Bjønnes
*
- *======================================================
+ * ======================================================
*/
#ifndef LATEX_H
/// unavail
LaTeX(LaTeX const &);
/// unavail
- LaTeX & operator=(LaTeX const &);
+ LaTeX & operator= (LaTeX const &);
///
void deplog(DepTable & head);
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
// color.sty
if (color) {
if (params.graphicsDriver == "default")
- packages +="\\usepackage{color}\n";
+ packages += "\\usepackage{color}\n";
else
packages += "\\usepackage["
+ params.graphicsDriver + "]{color}\n";
// -*- C++ -*-
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1999 the LyX Team.
*
-*======================================================*/
+* ====================================================== */
#ifndef LATEXFEATURES_H
#define LATEXFEATURES_H
fl_raise_form(fd_latex_log->LaTeXLog);
} else {
fl_show_form(fd_latex_log->LaTeXLog,
- FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
+ FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
use_build ? _("Build Program Log") : _("LaTeX Log"));
if (ow < 0) {
ow = fd_latex_log->LaTeXLog->w;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================
+ * ======================================================
*/
#include <config.h>
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright (C) 1995 Matthias Ettrich
*
- *======================================================
+ * ======================================================
*/
#ifndef LITERATE_H
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
{ "index-insert", LFUN_INDEX_INSERT },
{ "index-insert-last", LFUN_INDEX_INSERT_LAST },
{ "index-print", LFUN_INDEX_PRINT },
+#if 0
{ "inset-latex-insert", LFUN_INSERT_INSET_LATEX },
+#endif
{ "keymap-off", LFUN_KMAP_OFF },
{ "keymap-primary", LFUN_KMAP_PRIM },
{ "keymap-secondary", LFUN_KMAP_SEC },
field with attributes using these tags:
enum FUNC_ATTRIB {
- LFAT_NONE=0, // Nothing special
- LFAT_ISRO=1, // Is readonly (does not modify a buffer)
- LFAT_ISIA=2, // Is interactive (requires a GUI)
- LFAT_REQARG=4, // Requires argument
- LFAT_ISMO=8, // Only math mode
+ LFAT_NONE= 0, // Nothing special
+ LFAT_ISRO= 1, // Is readonly (does not modify a buffer)
+ LFAT_ISIA= 2, // Is interactive (requires a GUI)
+ LFAT_REQARG= 4, // Requires argument
+ LFAT_ISMO= 8, // Only math mode
LFAT_ETCETC
};
LFUN_INSERTFOOTNOTE,
LFUN_INSERT_BIBTEX,
LFUN_INSERT_CITATION,
+#if 0
LFUN_INSERT_INSET_LATEX,
+#endif
LFUN_INSERT_LABEL,
LFUN_INSERT_MATH,
LFUN_INSERT_MATRIX,
// This is wrong, so I'll just disable it for now.
// The problem is that we might free memory twice in some situations...
// It's better to leak a bit that to crash. (Asger)
-// for (int i=0; i < psd_idx; i++) {
+// for (int i= 0; i < psd_idx; i++) {
// free(lyx_func_args[i].name);
// }
delete[] lyx_func_args;
int LyXAction::searchActionArg(kb_action action, char const *arg)
{
kb_func_table *tb = &lyx_func_args[0];
- for (int i=0; i<psd_idx; i++) {
- if (action==tb->action && !strcmp(tb->name, arg)) {
+ for (int i= 0; i<psd_idx; i++) {
+ if (action == tb->action && !strcmp(tb->name, arg)) {
lyxerr[Debug::KEY] << "Pseudoaction already exist["
<< action << '|'
if (psdaction >= 0) return psdaction;
- if (psd_idx>=MAX_PSEUDO_ACTION) {
+ if (psd_idx>= MAX_PSEUDO_ACTION) {
lyxerr << "Lyx Error: No more pseudo-actions allowed"
<< " Tell the developers." << endl;
return -1;
while (l < r) {
last_action_idx = (l+r)/2;
k = strcmp(lyx_func_table[last_action_idx].name, func);
- if (k==0) {
+ if (k == 0) {
action = lyx_func_table[last_action_idx].action;
break;
} else
// why LFUN_LASTACTION -1? Because LFUN_LASTACTION is too
// large an because there is one internal command, hence
// lyx_func_table is 2 less then LFUN_LASTACTION (Lgb)
- for (int i=0; i < funcCount; i++) {
- if (lyx_func_table[i].action==action)
+ for (int i= 0; i < funcCount; i++) {
+ if (lyx_func_table[i].action == action)
return lyx_func_table[i].name;
}
// Hmm.. let's see whether this is a pseudoaction
action -= LFUN_LASTACTION;
- if (action>=0 && action<psd_idx) {
+ if (action>= 0 && action<psd_idx) {
return lyx_func_args[action].name;
}
char const *LyXAction::helpText(kb_action action) const
{
static bool is_sorted = false;
- static kb_func_table helpTexts[LFUN_LASTACTION] =
+ static kb_func_table helpTexts[LFUN_LASTACTION] =
{
{ _("Describe command"), LFUN_APROPOS },
{ _("Select previous char"), LFUN_LEFTSEL },
// Sort to make it faster
if (!is_sorted) {
- int i=0;
+ int i= 0;
while (i < LFUN_LASTACTION-1) {
if (helpTexts[i].action == 0) {
helpTexts[i].action = (kb_action)i;
is_sorted = true;
}
- if (action <=1 || action >=funcCount)
+ if (action <= 1 || action >= funcCount)
goto no_desc;
if (helpTexts[action].action == action) {
// Function to compare items from the attrib table.
extern "C" int actioncomp(const void *a, const void *b)
{
- int const *ia=(int const*)a, *ib=(int const*)b;
+ int const *ia= (int const*)a, *ib= (int const*)b;
return (*ia)-(*ib);
}
if (!is_sorted) {
qsort(func_attrib_table, fCount, sizeof(kb_action), actioncomp);
is_sorted = true;
-// for (int i=0; i<fCount; i++)
+// for (int i= 0; i<fCount; i++)
// fprintf(stdout, "%d: %d\n", i, func_attrib_table[i]);
}
while (l < r) {
m = (l+r)/2;
k = func_attrib_table[m] - action;
- if (k==0) {
+ if (k == 0) {
is_ro = true;
break;
} else
// -*- C++ -*-
-#ifndef _LYXACTION_H_
-#define _LYXACTION_H_
+#ifndef LYXACTION_H
+#define LYXACTION_H
#ifdef __GNUG__
#pragma interface
/// Command name - action
struct kb_func_table {
///
- char const *name;
+ char const * name;
///
kb_action action;
};
/** Returns an action tag from a string. Returns kb_action.
Include arguments in func_name ONLY if you
want to create new pseudo actions. */
- int LookupFunc(char const *func_name);
+ int LookupFunc(char const * func_name);
/** Returns an action tag which name is the most similar to a string.
Don't include arguments, they would be ignored. */
- int getApproxFunc(char const *func);
+ int getApproxFunc(char const * func);
/** Returns an action name the most similar to a string.
Don't include arguments, they would be ignored. */
- const char *getApproxFuncName(char const *func);
+ char const * getApproxFuncName(char const * func);
/// Returns a pseudo-action given an action and its argument.
- int getPseudoAction(kb_action action, char const *arg);
+ int getPseudoAction(kb_action action, char const * arg);
/// Retrieves the real action and its argument.
- int retrieveActionArg(int i, char const **arg);
+ int retrieveActionArg(int i, char const ** arg);
/// Search for an existent pseudoaction, return -1 if it doesn't exist.
- int searchActionArg(kb_action action, char const *arg);
+ int searchActionArg(kb_action action, char const * arg);
/// Check if a value is a pseudo-action.
bool isPseudoAction(int);
/// Not sure if this function should be here
- int bindKey(char const* seq, int action);
+ int bindKey(char const * seq, int action);
/// Return the name associated with command
- char const *getActionName(int action) const;
+ char const * getActionName(int action) const;
/// Return one line help text associated with command
- char const *helpText(kb_action action) const;
+ char const * helpText(kb_action action) const;
/// True if the command is Read Only (not allowed for RO buffers)
bool isFuncRO(kb_action action) const;
/// Number of commands
int funcCount;
/// Pseudoactions
- static kb_func_table *lyx_func_args;
+ static kb_func_table * lyx_func_args;
/// Pseudoaction index
static int psd_idx;
/// Last action index found
inline
bool LyXAction::isPseudoAction(int a)
{
- return (a >= (int)LFUN_LASTACTION);
+ return (a >= int(LFUN_LASTACTION));
}
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);
+ buffer->writeFile(fname, true);
// if the .tex file is requested save it to the tempdir
// as now we don't do the MakeDVIOutput anymore
if (fl_get_button(fd_form_sendto->radio_ftype_latex))
- buffer->makeLaTeXFile(fname,path,false);
+ 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);
void SendtoOKCB(FL_OBJECT *ob, long data)
{
- SendtoCancelCB(ob,data);
- SendtoApplyCB(ob,data);
+ SendtoCancelCB(ob, data);
+ SendtoApplyCB(ob, data);
}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
LyXView::LyXView(int width, int height)
{
- fd_form_main = create_form_form_main(width,height);
+ fd_form_main = create_form_form_main(width, height);
fl_set_form_atclose(_form, C_LyXView_atCloseMainFormCB, 0);
lyxerr[Debug::INIT] << "Initializing LyXFunc" << endl;
lyxfunc = new LyXFunc(this);
// timer_autosave
fdui->timer_autosave = obj = fl_add_timer(FL_HIDDEN_TIMER,
- 0,0,0,0,"Timer");
- fl_set_object_callback(obj,C_LyXView_AutosaveTimerCB,0);
+ 0, 0, 0, 0, "Timer");
+ fl_set_object_callback(obj, C_LyXView_AutosaveTimerCB, 0);
// timer_update
fdui->timer_update = obj = fl_add_timer(FL_HIDDEN_TIMER,
- 0,0,0,0,"Timer");
- fl_set_object_callback(obj,C_LyXView_UpdateTimerCB,0);
+ 0, 0, 0, 0, "Timer");
+ fl_set_object_callback(obj, C_LyXView_UpdateTimerCB, 0);
obj->u_vdata = this;
//
// this has a bi-effect that the layouts are not showed when no
// document is loaded.
- if (bufferview == 0 || bufferview->buffer()==0) {
+ if (bufferview == 0 || bufferview->buffer() == 0) {
toolbar->combox->clear();
toolbar->combox->Redraw();
return;
toolbar->combox->clear();
for (int i = 0;
textclasslist.NameOfLayout(buffer()->
- params.textclass, i) !="@@end@@";
+ params.textclass, i) != "@@end@@";
i++) {
LyXLayout const & layout = textclasslist.
Style(buffer()->params.textclass, i);
int i;
if (fd_form_document) {
fl_clear_choice(fd_form_document->choice_class);
- for (i = 0; textclasslist.DescOfClass (i)!="@@end@@"; i++) {
+ for (i = 0; textclasslist.DescOfClass (i)!= "@@end@@"; i++) {
fl_addto_choice(fd_form_document->choice_class,
textclasslist.DescOfClass(i).c_str());
}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void setPosition(int, int);
/// Show the main form.
- void show(int, int, char const * t= "LyX");
+ void show(int, int, char const * t = "LyX");
/// init (should probably be removed later) (Lgb)
void init();
credits_form.C \
credits_form.h \
debug.h \
- definitions.h \
figure.h \
filedlg.C \
filedlg.h \
trans_decl.h \
trans_mgr.C \
trans_mgr.h \
+ undo.C \
undo.h \
vc-backend.C \
vc-backend.h \
#include <cstdlib>
-#include "definitions.h"
#include FORMS_H_LOCATION
#include "layout_forms.h"
#include "lyx_main.h"
params->use_geometry);
fl_set_button(fd_form_paper->radio_portrait, 0);
fl_set_button(fd_form_paper->radio_landscape, 0);
- if (params->orientation == ORIENTATION_LANDSCAPE)
+ if (params->orientation == BufferParams::ORIENTATION_LANDSCAPE)
fl_set_button(fd_form_paper->radio_landscape, 1);
else
fl_set_button(fd_form_paper->radio_portrait, 1);
params->paperpackage = fl_get_choice(fd->choice_paperpackage)-1;
params->use_geometry = fl_get_button(fd_form_paper->push_use_geometry);
if (fl_get_button(fd_form_paper->radio_landscape))
- params->orientation = ORIENTATION_LANDSCAPE;
+ params->orientation = BufferParams::ORIENTATION_LANDSCAPE;
else
- params->orientation = ORIENTATION_PORTRAIT;
+ params->orientation = BufferParams::ORIENTATION_PORTRAIT;
params->paperwidth = fl_get_input(fd->input_custom_width);
params->paperheight = fl_get_input(fd->input_custom_height);
params->leftmargin = fl_get_input(fd->input_left_margin);
void PaperOKCB(FL_OBJECT * ob, long data)
{
- PaperCancelCB(ob,data);
- PaperApplyCB(ob,data);
+ PaperCancelCB(ob, data);
+ PaperApplyCB(ob, data);
}
checkMarginValues();
if (ob == fd->choice_papersize2) {
val = fl_get_choice(fd->choice_papersize2)-1;
- if (val == VM_PAPER_DEFAULT) {
+ if (val == BufferParams::VM_PAPER_DEFAULT) {
fl_set_button(fd->push_use_geometry, 0);
checkMarginValues();
} else {
- if ((val != VM_PAPER_USLETTER) && (val != VM_PAPER_USLEGAL) &&
- (val != VM_PAPER_USEXECUTIVE) && (val != VM_PAPER_A4) &&
- (val != VM_PAPER_A5) && (val != VM_PAPER_B5)) {
+ if (val != BufferParams::VM_PAPER_USLETTER
+ && val != BufferParams::VM_PAPER_USLEGAL
+ && val != BufferParams::VM_PAPER_USEXECUTIVE
+ && val != BufferParams::VM_PAPER_A4
+ && val != BufferParams::VM_PAPER_A5
+ && val != BufferParams::VM_PAPER_B5) {
fl_set_button(fd->push_use_geometry, 1);
}
- fl_set_choice(fd->choice_paperpackage, PACKAGE_NONE + 1);
+ fl_set_choice(fd->choice_paperpackage, BufferParams::PACKAGE_NONE + 1);
}
} else if (ob == fd->choice_paperpackage) {
val = fl_get_choice(fd->choice_paperpackage)-1;
- if (val != PACKAGE_NONE) {
- fl_set_choice(fd->choice_papersize2, VM_PAPER_DEFAULT + 1);
+ if (val != BufferParams::PACKAGE_NONE) {
+ fl_set_choice(fd->choice_papersize2,
+ BufferParams::VM_PAPER_DEFAULT + 1);
fl_set_button(fd->push_use_geometry, 0);
}
- } else if ((ob==fd->input_custom_width)
- || (ob==fd->input_custom_height)
- || (ob==fd->input_left_margin)
- || (ob==fd->input_right_margin)
- || (ob==fd->input_top_margin)
- || (ob==fd->input_bottom_margin)
- || (ob==fd->input_head_height)
- || (ob==fd->input_head_sep)
- || (ob==fd->input_foot_skip)) {
+ } else if (ob == fd->input_custom_width
+ || ob == fd->input_custom_height
+ || ob == fd->input_left_margin
+ || ob == fd->input_right_margin
+ || ob == fd->input_top_margin
+ || ob == fd->input_bottom_margin
+ || ob == fd->input_head_height
+ || ob == fd->input_head_sep
+ || ob == fd->input_foot_skip) {
str = fl_get_input(ob);
if (!str.empty() && !isValidLength(str)) {
fl_set_object_label(fd_form_paper->text_warning,
#include <config.h>
#include <cstdlib>
-#include "definitions.h"
#include FORMS_H_LOCATION
+
#include "layout_forms.h"
#include "LString.h"
#include "minibuffer.h"
#include "gettext.h"
#include "lyxtext.h"
-extern FD_form_paragraph_extra *fd_form_paragraph_extra;
-extern MiniBuffer *minibuffer;
-extern BufferView *current_view;
+extern FD_form_paragraph_extra * fd_form_paragraph_extra;
+extern MiniBuffer * minibuffer;
+extern BufferView * current_view;
extern void BeforeChange();
static bool CheckInputWidth();
inline void DeactivateParagraphExtraButtons ()
{
- fl_deactivate_object (fd_form_paragraph_extra->button_ok);
- fl_deactivate_object (fd_form_paragraph_extra->button_apply);
- fl_set_object_lcol (fd_form_paragraph_extra->button_ok, FL_INACTIVE);
- fl_set_object_lcol (fd_form_paragraph_extra->button_apply, FL_INACTIVE);
+ fl_deactivate_object(fd_form_paragraph_extra->button_ok);
+ fl_deactivate_object(fd_form_paragraph_extra->button_apply);
+ fl_set_object_lcol(fd_form_paragraph_extra->button_ok, FL_INACTIVE);
+ fl_set_object_lcol(fd_form_paragraph_extra->button_apply, FL_INACTIVE);
}
inline void ActivateParagraphExtraButtons ()
{
- fl_activate_object (fd_form_paragraph_extra->button_ok);
- fl_activate_object (fd_form_paragraph_extra->button_apply);
- fl_set_object_lcol (fd_form_paragraph_extra->button_ok, FL_BLACK);
- fl_set_object_lcol (fd_form_paragraph_extra->button_apply, FL_BLACK);
+ fl_activate_object(fd_form_paragraph_extra->button_ok);
+ fl_activate_object(fd_form_paragraph_extra->button_apply);
+ fl_set_object_lcol(fd_form_paragraph_extra->button_ok, FL_BLACK);
+ fl_set_object_lcol(fd_form_paragraph_extra->button_apply, FL_BLACK);
}
inline void DisableParagraphExtra ()
{
DeactivateParagraphExtraButtons();
- fl_deactivate_object (fd_form_paragraph_extra->input_pextra_width);
- fl_deactivate_object (fd_form_paragraph_extra->input_pextra_widthp);
- fl_deactivate_object (fd_form_paragraph_extra->group_alignment);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_top);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_middle);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_bottom);
- fl_deactivate_object (fd_form_paragraph_extra->text_warning);
- fl_deactivate_object (fd_form_paragraph_extra->group_extraopt);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_indent);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_minipage);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_floatflt);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_hfill);
- fl_deactivate_object (fd_form_paragraph_extra->radio_pextra_startmp);
+ fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
+ fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
+ fl_deactivate_object(fd_form_paragraph_extra->group_alignment);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
+ fl_deactivate_object(fd_form_paragraph_extra->text_warning);
+ fl_deactivate_object(fd_form_paragraph_extra->group_extraopt);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_indent);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_minipage);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_floatflt);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_hfill);
+ fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_startmp);
}
inline void EnableParagraphExtra ()
{
ActivateParagraphExtraButtons();
- fl_activate_object (fd_form_paragraph_extra->input_pextra_width);
- fl_activate_object (fd_form_paragraph_extra->input_pextra_widthp);
- fl_activate_object (fd_form_paragraph_extra->group_alignment);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_top);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_middle);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_bottom);
- fl_activate_object (fd_form_paragraph_extra->text_warning);
- fl_activate_object (fd_form_paragraph_extra->group_extraopt);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_indent);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_minipage);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_floatflt);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_hfill);
- fl_activate_object (fd_form_paragraph_extra->radio_pextra_startmp);
+ fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
+ fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
+ fl_activate_object(fd_form_paragraph_extra->group_alignment);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom);
+ fl_activate_object(fd_form_paragraph_extra->text_warning);
+ fl_activate_object(fd_form_paragraph_extra->group_extraopt);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_indent);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_minipage);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_floatflt);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_hfill);
+ fl_activate_object(fd_form_paragraph_extra->radio_pextra_startmp);
}
bool UpdateParagraphExtra()
fl_set_input(fd_form_paragraph_extra->input_pextra_widthp,
par->pextra_widthp.c_str());
switch(par->pextra_alignment) {
- case MINIPAGE_ALIGN_TOP:
- fl_set_button(fd_form_paragraph_extra->radio_pextra_top,1);
+ case LyXParagraph::MINIPAGE_ALIGN_TOP:
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_top, 1);
break;
- case MINIPAGE_ALIGN_MIDDLE:
- fl_set_button(fd_form_paragraph_extra->radio_pextra_middle,1);
+ case LyXParagraph::MINIPAGE_ALIGN_MIDDLE:
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_middle, 1);
break;
- case MINIPAGE_ALIGN_BOTTOM:
- fl_set_button(fd_form_paragraph_extra->radio_pextra_bottom,1);
+ case LyXParagraph::MINIPAGE_ALIGN_BOTTOM:
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_bottom, 1);
break;
}
fl_set_button(fd_form_paragraph_extra->radio_pextra_hfill,
fl_set_button(fd_form_paragraph_extra->radio_pextra_startmp,
par->pextra_start_minipage);
CheckInputWidth();
- if (par->pextra_type == PEXTRA_INDENT) {
- fl_set_button(fd_form_paragraph_extra->radio_pextra_indent,1);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt,0);
+ if (par->pextra_type == LyXParagraph::PEXTRA_INDENT) {
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 1);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
- } else if (par->pextra_type == PEXTRA_MINIPAGE) {
- fl_set_button(fd_form_paragraph_extra->radio_pextra_indent,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage,1);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt,0);
+ } else if (par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) {
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 1);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
fl_activate_object(fd_form_paragraph_extra->radio_pextra_middle);
fl_activate_object(fd_form_paragraph_extra->radio_pextra_bottom);
- } else if (par->pextra_type == PEXTRA_FLOATFLT) {
- fl_set_button(fd_form_paragraph_extra->radio_pextra_indent,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt,1);
+ } else if (par->pextra_type == LyXParagraph::PEXTRA_FLOATFLT) {
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 1);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
} else {
- fl_set_button(fd_form_paragraph_extra->radio_pextra_indent,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage,0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_width);
fl_deactivate_object(fd_form_paragraph_extra->input_pextra_widthp);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_middle);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_bottom);
}
- if (par->pextra_type == PEXTRA_NONE)
+ if (par->pextra_type == LyXParagraph::PEXTRA_NONE)
ActivateParagraphExtraButtons();
}
fl_hide_object(fd_form_paragraph_extra->text_warning);
if (current_view->buffer()->isReadonly()) {
DisableParagraphExtra();
fl_set_object_label(fd_form_paragraph_extra->text_warning,
- _("Document is read-only. No changes to layout permitted."));
+ _("Document is read-only. "
+ "No changes to layout permitted."));
fl_show_object(fd_form_paragraph_extra->text_warning);
}
if (!update && fd_form_paragraph_extra->form_paragraph_extra->visible) {
return update;
}
+
void ParagraphExtraOpen(FL_OBJECT *, long)
{
if (UpdateParagraphExtra()) {
}
}
+
void ParagraphExtraApplyCB(FL_OBJECT *, long)
{
if (current_view->getScreen() && current_view->available()) {
FD_form_paragraph_extra const * fd = fd_form_paragraph_extra;
- const char * width = fl_get_input(fd->input_pextra_width);
- const char * widthp = fl_get_input(fd->input_pextra_widthp);
+ char const * width = fl_get_input(fd->input_pextra_width);
+ char const * widthp = fl_get_input(fd->input_pextra_widthp);
LyXText * text = current_view->buffer()->text;
- int type = PEXTRA_NONE;
- int alignment = 0;
+ int type = LyXParagraph::PEXTRA_NONE;
+ LyXParagraph::MINIPAGE_ALIGNMENT alignment =
+ LyXParagraph::MINIPAGE_ALIGN_TOP;
bool
hfill = false,
start_minipage = false;
if (fl_get_button(fd_form_paragraph_extra->radio_pextra_indent)) {
- type = PEXTRA_INDENT;
+ type = LyXParagraph::PEXTRA_INDENT;
} else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage)) {
- type = PEXTRA_MINIPAGE;
+ type = LyXParagraph::PEXTRA_MINIPAGE;
hfill = fl_get_button(fd_form_paragraph_extra->radio_pextra_hfill);
- start_minipage =
+ start_minipage =
fl_get_button(fd_form_paragraph_extra->radio_pextra_startmp);
if (fl_get_button(fd_form_paragraph_extra->radio_pextra_top))
- alignment = MINIPAGE_ALIGN_TOP;
+ alignment = LyXParagraph::MINIPAGE_ALIGN_TOP;
else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_middle))
- alignment = MINIPAGE_ALIGN_MIDDLE;
+ alignment = LyXParagraph::MINIPAGE_ALIGN_MIDDLE;
else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_bottom))
- alignment = MINIPAGE_ALIGN_BOTTOM;
+ alignment = LyXParagraph::MINIPAGE_ALIGN_BOTTOM;
} else if (fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt)) {
- type = PEXTRA_FLOATFLT;
+ type = LyXParagraph::PEXTRA_FLOATFLT;
}
- text->SetParagraphExtraOpt(type,width,widthp,alignment,hfill,
+ text->SetParagraphExtraOpt(type, width, widthp, alignment, hfill,
start_minipage);
current_view->buffer()->update(1);
minibuffer->Set(_("ParagraphExtra layout set"));
return;
}
+
void ParagraphExtraCancelCB(FL_OBJECT *, long)
{
fl_hide_form(fd_form_paragraph_extra->form_paragraph_extra);
}
-void ParagraphExtraOKCB(FL_OBJECT *ob, long data)
+
+void ParagraphExtraOKCB(FL_OBJECT * ob, long data)
{
- ParagraphExtraCancelCB(ob,data);
- ParagraphExtraApplyCB(ob,data);
+ ParagraphExtraCancelCB(ob, data);
+ ParagraphExtraApplyCB(ob, data);
}
-void CheckPExtraOptCB(FL_OBJECT *ob, long)
+
+void CheckPExtraOptCB(FL_OBJECT * ob, long)
{
- int
- n;
- string
- s1, s2;
-
ActivateParagraphExtraButtons();
CheckInputWidth();
if (ob == fd_form_paragraph_extra->radio_pextra_indent) {
- n = fl_get_button(fd_form_paragraph_extra->radio_pextra_indent);
+ int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_indent);
if (n) {
- fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt,0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
fl_deactivate_object(fd_form_paragraph_extra->radio_pextra_top);
ActivateParagraphExtraButtons();
}
} else if (ob == fd_form_paragraph_extra->radio_pextra_minipage) {
- n = fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage);
+ int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_minipage);
if (n) {
- fl_set_button(fd_form_paragraph_extra->radio_pextra_indent,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt,0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_floatflt, 0);
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
ActivateParagraphExtraButtons();
}
} else if (ob == fd_form_paragraph_extra->radio_pextra_floatflt) {
- n = fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt);
+ int n = fl_get_button(fd_form_paragraph_extra->radio_pextra_floatflt);
if (n) {
- fl_set_button(fd_form_paragraph_extra->radio_pextra_indent,0);
- fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage,0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_indent, 0);
+ fl_set_button(fd_form_paragraph_extra->radio_pextra_minipage, 0);
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
fl_activate_object(fd_form_paragraph_extra->radio_pextra_top);
return;
}
+
static bool CheckInputWidth()
{
- string
- s1,s2;
-
- s1 = fl_get_input(fd_form_paragraph_extra->input_pextra_width);
- s2 = fl_get_input(fd_form_paragraph_extra->input_pextra_widthp);
+ string s1 = fl_get_input(fd_form_paragraph_extra->input_pextra_width);
+ string s2 = fl_get_input(fd_form_paragraph_extra->input_pextra_widthp);
if (s1.empty() && s2.empty()) {
fl_activate_object(fd_form_paragraph_extra->input_pextra_width);
fl_activate_object(fd_form_paragraph_extra->input_pextra_widthp);
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#ifndef SPACING_H
#define SPACING_H
return space;
}
///
- void set(Spacing::Space sp, float val= 1.0)
+ void set(Spacing::Space sp, float val = 1.0)
{
space = sp;
if (sp == Other) {
- switch(int(val*1000 + 0.5)) {
+ switch(int(val * 1000 + 0.5)) {
case 1000: space = Single; break;
case 1250: space = Onehalf; break;
case 1667: space = Double; break;
}
}
///
- void set(Spacing::Space sp, char const* val)
+ void set(Spacing::Space sp, char const * val)
{
float fval;
- sscanf(val,"%f",&fval);
- set(sp,fval);
+ sscanf(val, "%f", &fval);
+ set(sp, fval);
}
///
- void writeFile(FILE *file);
+ void writeFile(FILE * file);
///
- friend bool operator!=(Spacing const &a, Spacing const &b)
+ friend bool operator!=(Spacing const & a, Spacing const & b)
{
if (a.space == b.space && a.getValue() == b.getValue())
return false;
#include <config.h>
#include <cstdlib>
-#include "definitions.h"
#include FORMS_H_LOCATION
+
#include "layout_forms.h"
#include "lyx_main.h"
#include "lyxrc.h"
extern void BeforeChange();
-/* Prototypes */
-extern FD_form_table_options *fd_form_table_options;
-extern FD_form_table_extra *fd_form_table_extra;
-extern BufferView *current_view;
+// Prototypes
+extern FD_form_table_options * fd_form_table_options;
+extern FD_form_table_extra * fd_form_table_extra;
+extern BufferView * current_view;
+
+static int Confirmed = false;
+static int ActCell;
-static int
- Confirmed = false,
- ActCell;
// hack to keep the cursor from jumping to the end of the text in the Extra
// form input fields during editing. The values in LyXTable itself is changed in
// real-time, but we have no callbacks for the input fields, so I simply
// store and restore the cursor position for now. (too much of a hazzle to
// do it proper; we'll trash all this code in 1.1 anyway)
- static int
- extra_col_cursor_x, // need no y's, one-line input fields
- extra_multicol_cursor_x;
+static int extra_col_cursor_x; // need no y's, one-line input fields
+static int extra_multicol_cursor_x;
// Joacim
bool UpdateLayoutTable(int flag)
update = false;
if (update && current_view->buffer()->text->cursor.par->table) {
- int
- align,
- column,row;
- char
- buf[12];
- string
- pwidth, special;
-
+ char buf[12];
+ string pwidth, special;
+
LyXTable * table = current_view->buffer()->text->cursor.par->table;
int cell = current_view->buffer()->text->
NumberOfCell(current_view->buffer()->text->cursor.par,
current_view->buffer()->text->cursor.pos);
ActCell = cell;
- column = table->column_of_cell(cell)+1;
- fl_set_object_label(fd_form_table_options->text_warning,"");
+ int column = table->column_of_cell(cell)+1;
+ fl_set_object_label(fd_form_table_options->text_warning, "");
Confirmed = false;
fl_activate_object(fd_form_table_extra->input_special_alignment);
fl_activate_object(fd_form_table_extra->input_special_multialign);
fl_activate_object(fd_form_table_options->input_column_width);
- sprintf(buf,"%d",column);
+ sprintf(buf, "%d", column);
fl_set_input(fd_form_table_options->input_table_column, buf);
fl_deactivate_object(fd_form_table_options->input_table_column);
- row = table->row_of_cell(cell)+1;
- sprintf(buf,"%d",row);
+ int row = table->row_of_cell(cell)+1;
+ sprintf(buf, "%d", row);
fl_set_input(fd_form_table_options->input_table_row, buf);
fl_deactivate_object(fd_form_table_options->input_table_row);
if (table->IsMultiColumn(cell))
fl_set_button(fd_form_table_options->radio_border_right, 1);
else
fl_set_button(fd_form_table_options->radio_border_right, 0);
- align = table->GetAlignment(cell);
+ int align = table->GetAlignment(cell);
fl_set_button(fd_form_table_options->radio_align_left, 0);
fl_set_button(fd_form_table_options->radio_align_right, 0);
fl_set_button(fd_form_table_options->radio_align_center, 0);
- special = table->GetAlignSpecial(cell,LyXTable::SET_SPECIAL_COLUMN);
+ special = table->GetAlignSpecial(cell, LyXTable::SET_SPECIAL_COLUMN);
if (flag)
{
fl_set_input(fd_form_table_extra->input_special_alignment,
}
if (current_view->buffer()->isReadonly())
fl_deactivate_object(fd_form_table_extra->input_special_alignment);
- special = table->GetAlignSpecial(cell,LyXTable::SET_SPECIAL_MULTI);
+ special = table->GetAlignSpecial(cell, LyXTable::SET_SPECIAL_MULTI);
if (flag)
{
fl_set_input(fd_form_table_extra->input_special_multialign,
fl_deactivate_object(fd_form_table_extra->input_special_multialign);
pwidth = table->GetPWidth(cell);
if (flag)
- fl_set_input(fd_form_table_options->input_column_width,pwidth.c_str());
+ fl_set_input(fd_form_table_options->input_column_width, pwidth.c_str());
if (current_view->buffer()->isReadonly())
fl_deactivate_object(fd_form_table_options->input_column_width);
if (!pwidth.empty()) {
fl_deactivate_object(fd_form_table_options->radio_linebreak_cell);
fl_set_object_lcol(fd_form_table_options->radio_linebreak_cell,
FL_INACTIVE);
- fl_set_button(fd_form_table_options->radio_linebreak_cell,0);
+ fl_set_button(fd_form_table_options->radio_linebreak_cell, 0);
}
if ((!pwidth.empty() && !table->IsMultiColumn(cell)) ||
(align == LYX_ALIGN_LEFT))
fl_set_object_lcol(fd_form_table_options->radio_align_center,
FL_BLACK);
}
- fl_set_button(fd_form_table_options->radio_longtable,table->IsLongTable());
+ fl_set_button(fd_form_table_options->radio_longtable, table->IsLongTable());
if (table->IsLongTable()) {
fl_activate_object(fd_form_table_options->radio_lt_firsthead);
fl_activate_object(fd_form_table_options->radio_lt_head);
fl_deactivate_object(fd_form_table_options->radio_lt_foot);
fl_deactivate_object(fd_form_table_options->radio_lt_lastfoot);
fl_deactivate_object(fd_form_table_options->radio_lt_newpage);
- fl_set_button(fd_form_table_options->radio_lt_firsthead,0);
- fl_set_button(fd_form_table_options->radio_lt_head,0);
- fl_set_button(fd_form_table_options->radio_lt_foot,0);
- fl_set_button(fd_form_table_options->radio_lt_lastfoot,0);
- fl_set_button(fd_form_table_options->radio_lt_newpage,0);
+ fl_set_button(fd_form_table_options->radio_lt_firsthead, 0);
+ fl_set_button(fd_form_table_options->radio_lt_head, 0);
+ fl_set_button(fd_form_table_options->radio_lt_foot, 0);
+ fl_set_button(fd_form_table_options->radio_lt_lastfoot, 0);
+ fl_set_button(fd_form_table_options->radio_lt_newpage, 0);
fl_set_object_lcol(fd_form_table_options->radio_lt_firsthead,
FL_INACTIVE);
fl_set_object_lcol(fd_form_table_options->radio_lt_head,
return update;
}
+
void OpenLayoutTableExtra()
{
- static int ow = -1, oh;
- if (fd_form_table_extra->form_table_extra->visible) {
- fl_raise_form(fd_form_table_extra->form_table_extra);
- } else {
- fl_show_form(fd_form_table_extra->form_table_extra,
- FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
- _("Table Extra Form"));
+ if (fd_form_table_extra->form_table_extra->visible) {
+ fl_raise_form(fd_form_table_extra->form_table_extra);
+ } else {
+ static int ow = -1, oh;
+ fl_show_form(fd_form_table_extra->form_table_extra,
+ FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
+ _("Table Extra Form"));
if (ow < 0) {
ow = fd_form_table_extra->form_table_extra->w;
oh = fd_form_table_extra->form_table_extra->h;
}
fl_set_form_minsize(fd_form_table_extra->form_table_extra,
- ow,oh);
- }
+ ow, oh);
+ }
}
+
void MenuLayoutTable(int flag)
{
if (UpdateLayoutTable(flag)) {
}
}
-void TableOptionsCB(FL_OBJECT *ob, long)
+
+void TableOptionsCB(FL_OBJECT * ob, long)
{
- LyXTable
- *table = 0;
+ LyXTable * table = 0;
int
s,
num = 0;
if (!current_view->available()
||
- !(table = current_view->buffer()->text->cursor.par->table))
- {
+ !(table = current_view->buffer()->text->cursor.par->table)) {
MenuLayoutTable(0);
return;
}
fl_set_object_label(fd_form_table_options->text_warning,
_("Warning: Wrong Cursor position, updated window"));
fl_show_object(fd_form_table_options->text_warning);
- extra_col_cursor_x=0; // would rather place it at the end, but...
- extra_multicol_cursor_x=0;
+ extra_col_cursor_x = 0; // would rather place it at the end, but...
+ extra_multicol_cursor_x = 0;
return;
}
// No point in processing directives that you can't do anything with
}
if (ob != fd_form_table_options->button_table_delete) {
- fl_set_object_label(fd_form_table_options->text_warning,"");
+ fl_set_object_label(fd_form_table_options->text_warning, "");
Confirmed = false;
}
str = fl_get_input(fd_form_table_options->input_column_width);
fl_show_object(fd_form_table_options->text_warning);
return;
}
- if (((ob==fd_form_table_options->button_delete_row) && (table->rows<=1)) ||
- ((ob==fd_form_table_options->button_delete_column) && (table->columns<=1)))
+ if (((ob == fd_form_table_options->button_delete_row) && (table->rows<= 1)) ||
+ ((ob == fd_form_table_options->button_delete_column) && (table->columns<= 1)))
ob = fd_form_table_options->button_table_delete;
if (ob == fd_form_table_options->button_append_row)
num = LyXTable::APPEND_ROW;
num = LyXTable::ALIGN_RIGHT;
else if (ob == fd_form_table_options->radio_align_center)
num = LyXTable::ALIGN_CENTER;
- else if ((ob==fd_form_table_options->button_table_delete) && !Confirmed) {
+ else if ((ob == fd_form_table_options->button_table_delete) && !Confirmed) {
fl_set_object_label(fd_form_table_options->text_warning,
_("Confirm: press Delete-Button again"));
Confirmed = true;
} else if (ob == fd_form_table_options->radio_multicolumn)
num = LyXTable::MULTICOLUMN;
else if (ob == fd_form_table_options->radio_longtable) {
- s=fl_get_button(fd_form_table_options->radio_longtable);
+ s = fl_get_button(fd_form_table_options->radio_longtable);
if (s) {
num = LyXTable::SET_LONGTABLE;
fl_activate_object(fd_form_table_options->radio_lt_firsthead);
fl_deactivate_object(fd_form_table_options->radio_lt_foot);
fl_deactivate_object(fd_form_table_options->radio_lt_lastfoot);
fl_deactivate_object(fd_form_table_options->radio_lt_newpage);
- fl_set_button(fd_form_table_options->radio_lt_firsthead,0);
- fl_set_button(fd_form_table_options->radio_lt_firsthead,0);
- fl_set_button(fd_form_table_options->radio_lt_firsthead,0);
- fl_set_button(fd_form_table_options->radio_lt_firsthead,0);
- fl_set_button(fd_form_table_options->radio_lt_firsthead,0);
+ fl_set_button(fd_form_table_options->radio_lt_firsthead, 0);
+ fl_set_button(fd_form_table_options->radio_lt_firsthead, 0);
+ fl_set_button(fd_form_table_options->radio_lt_firsthead, 0);
+ fl_set_button(fd_form_table_options->radio_lt_firsthead, 0);
+ fl_set_button(fd_form_table_options->radio_lt_firsthead, 0);
fl_set_object_lcol(fd_form_table_options->radio_lt_firsthead,
FL_INACTIVE);
fl_set_object_lcol(fd_form_table_options->radio_lt_head,
FL_INACTIVE);
}
} else if (ob == fd_form_table_options->radio_rotate_table) {
- s=fl_get_button(fd_form_table_options->radio_rotate_table);
+ s = fl_get_button(fd_form_table_options->radio_rotate_table);
if (s)
num = LyXTable::SET_ROTATE_TABLE;
else
num = LyXTable::UNSET_ROTATE_TABLE;
} else if (ob == fd_form_table_options->radio_rotate_cell) {
- s=fl_get_button(fd_form_table_options->radio_rotate_cell);
+ s = fl_get_button(fd_form_table_options->radio_rotate_cell);
if (s)
num = LyXTable::SET_ROTATE_CELL;
else
OpenLayoutTableExtra();
return;
} else if (ob == fd_form_table_extra->input_special_alignment) {
- special=fl_get_input(fd_form_table_extra->input_special_alignment);
+ special = fl_get_input(fd_form_table_extra->input_special_alignment);
int dummy;
fl_get_input_cursorpos(ob, &extra_col_cursor_x, &dummy);
num = LyXTable::SET_SPECIAL_COLUMN;
} else if (ob == fd_form_table_extra->input_special_multialign) {
- special=fl_get_input(fd_form_table_extra->input_special_multialign);
+ special = fl_get_input(fd_form_table_extra->input_special_multialign);
int dummy;
fl_get_input_cursorpos(ob, &extra_multicol_cursor_x, &dummy);
num = LyXTable::SET_SPECIAL_MULTI;
}
if ((num == LyXTable::SET_SPECIAL_COLUMN) ||
(num == LyXTable::SET_SPECIAL_MULTI))
- current_view->buffer()->text->TableFeatures(num,special);
+ current_view->buffer()->text->TableFeatures(num, special);
else
current_view->buffer()->text->TableFeatures(num);
current_view->buffer()->update(1);
void SetPWidthCB(FL_OBJECT *ob, long)
{
- fl_set_object_label(fd_form_table_options->text_warning,"");
+ fl_set_object_label(fd_form_table_options->text_warning, "");
Confirmed = false;
if (ob == fd_form_table_options->input_column_width) {
string
BeforeChange();
current_view->buffer()->update(-2);
}
- current_view->buffer()->text->TableFeatures(LyXTable::SET_PWIDTH,str);
+ current_view->buffer()->text->TableFeatures(LyXTable::SET_PWIDTH, str);
current_view->buffer()->update(1);
}
MenuLayoutTable(0); // update for alignment
* Description: A bitmap table uses a single bitmap to simulate a 2d array
* of bitmap buttons. It can be used to build bitmap menus.
*
- * Copyright 1995,1996 Alejandro Aguilar Sierra
+ * Copyright 1995, 1996 Alejandro Aguilar Sierra
*
* You are free to use and modify this code under the terms of
* the GNU General Public Licence version 2 or later.
{
FL_OBJECT *ob;
- ob = fl_create_bmtable(type, x, y, w,h, label);
+ ob = fl_create_bmtable(type, x, y, w, h, label);
fl_add_object(fl_current_form, ob);
return ob;
xx = FL_abs(ob->bw) - sp->bx + 1;
mx = ob->x + FL_abs(ob->bw) + 1;
} else {
- xx =0;
+ xx = 0;
mx = ob->x + sp->bx;
}
if (sp->by < FL_abs(ob->bw) + 1) {
yy = FL_abs(ob->bw) - sp->by + 1;
my = ob->y + FL_abs(ob->bw) + 1;
} else {
- yy =0;
+ yy = 0;
my = ob->y + sp->by;
}
ww = (mx + sp->bw < ob->x + ob->w - FL_abs(ob->bw)) ?
mx = ob->x + ob->w;
my = ob->y + ob->h;
ww = ob->w;
- for (yy=ob->y; yy<=my; yy+=sp->dy) {
- if (ob->boxtype!=FL_FLAT_BOX && (yy==ob->y || yy>my-sp->dy))
+ for (yy= ob->y; yy<= my; yy+= sp->dy) {
+ if (ob->boxtype!= FL_FLAT_BOX && (yy == ob->y || yy>my-sp->dy))
continue;
- if (lx>0 && yy>=my-sp->dy - sp->dy/2)
+ if (lx>0 && yy>= my-sp->dy - sp->dy/2)
ww = lx*sp->dx;
fl_diagline(ob->x, yy, ww, 1, FL_BOTTOM_BCOL);
fl_diagline(ob->x, yy+1, ww-2, 1, FL_TOP_BCOL);
}
hh = ob->h;
- for (xx=ob->x; xx<=mx; xx+=sp->dx) {
- if (ob->boxtype!=FL_FLAT_BOX && (xx==ob->x || xx>mx-sp->dx))
+ for (xx= ob->x; xx<= mx; xx+= sp->dx) {
+ if (ob->boxtype!= FL_FLAT_BOX && (xx == ob->x || xx>mx-sp->dx))
continue;
- if (lx>0 && xx>=ob->x+lx*sp->dx)
+ if (lx>0 && xx>= ob->x+lx*sp->dx)
hh = (sp->ny-1)*sp->dy;
fl_diagline(xx, ob->y, 1, hh, FL_RIGHT_BCOL);
fl_diagline(xx+1, ob->y+1, 1, hh-2, FL_LEFT_BCOL);
break;
}
i = (mx - ob->x)/sp->dx; j = (my - ob->y)/sp->dy;
- if (i>=0 && i< sp->nx && j>=0 && j< sp->ny) {
+ if (i>= 0 && i< sp->nx && j>= 0 && j< sp->ny) {
i += j*sp->nx;
if (i >= sp->maxi) i = -1;
if (sp->i != i) {
unsigned char *bdata;
if(XReadBitmapFileData(filename, &bw, &bh,
- &bdata, &xh, &yh)==BitmapSuccess)
+ &bdata, &xh, &yh) == BitmapSuccess)
fl_set_bmtable_data(ob, nx, ny, bw, bh, bdata);
XFlush(fl_display);
}
* Description: A bitmap table uses a single bitmap to simulate a 2d array
* of bitmap buttons. It can be used to build bitmap menus.
*
- * Copyright (C) 1995,1996 Alejandro Aguilar Sierra
+ * Copyright (C) 1995, 1996 Alejandro Aguilar Sierra
*
* You are free to use and modify this code under the terms of
* the GNU General Public Licence version 2 or later.
*
*/
-#ifndef __BMTABLE_H__
-#define __BMTABLE_H__
+#ifndef BMTABLE_H
+#define BMTABLE_H
#include FORMS_H_LOCATION
/** Free the current pixmap in preparation for installing a new one */
void fl_free_bmtable_pixmap(FL_OBJECT *ob);
-#endif /* __BMTABLE_H__ */
+#endif /* BMTABLE_H */
/* -*- C++ -*- */
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, the High Level Word Processor
*
-* Copyright (C) 1995,1996 Matthias Ettrich
+* Copyright (C) 1995, 1996 Matthias Ettrich
*
-*======================================================
+* ======================================================
broken_const.h -- inhibits the `const' keyword for compilation */
#ifdef const
/* -*- C++ -*- */
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1998 The LyX Team
-*======================================================
+* ======================================================
A few prototypes missing from Sun and SCO 3.2v4 header files */
#ifndef BROKEN_HEADERS_H
#endif
#ifndef HAVE_MEMMOVE
-void bcopy(unsigned char *b1, unsigned char *b2, int length);
+void bcopy(unsigned char * b1, unsigned char * b2, int length);
#endif
-int readlink(char const *path, char *buf, int bufsiz);
-int strcasecmp(char const *s1, char const *s2);
+int readlink(char const * path, char * buf, int bufsiz);
+int strcasecmp(char const * s1, char const * s2);
#ifdef __cplusplus
}
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* This file is Copyright 1996-1999
* Lars Gullik Bjønnes
*
- * ======================================================
+ * ======================================================
*/
// Change Log:
-// ===========
+// ===========
// 23/03/98 Heinrich Bauer (heinrich.bauer@t-mobil.de)
// Spots marked "changed Heinrich Bauer, 23/03/98" modified due to the
// following bug: dvi file export did not work after printing (or previewing)
#pragma implementation "buffer.h"
#endif
-#include "definitions.h"
#include "buffer.h"
#include "bufferlist.h"
#include "lyx_main.h"
#include "insets/inseturl.h"
#include "insets/insetinfo.h"
#include "insets/insetquotes.h"
+#if 0
#include "insets/insetlatex.h"
+#endif
#include "insets/insetlatexaccent.h"
#include "insets/insetbib.h"
#include "insets/insetindex.h"
extern void FreeUpdateTimer();
-Buffer::Buffer(string const & file, LyXRC *lyxrc, bool ronly)
+Buffer::Buffer(string const & file, LyXRC * lyxrc, bool ronly)
{
lyxerr[Debug::INFO] << "Buffer::Buffer()" << endl;
filename = file;
Buffer defaults = Buffer(fname);
// Use the current buffer's parameters as default
- defaults.params.Copy(params);
+ defaults.params = params;
+
// add an empty paragraph. Is this enough?
defaults.paragraph = new LyXParagraph;
- return defaults.writeFile(defaults.filename,false);
+ return defaults.writeFile(defaults.filename, false);
}
if (!fi.exist() || !fi.readable()) {
WriteAlert(_("Error!"),
_("Cannot open specified file:"),
- MakeDisplayPath(filename,50));
+ MakeDisplayPath(filename, 50));
return false;
}
if (!myfile()) {
WriteAlert(_("Error!"),
_("Cannot open specified file:"),
- MakeDisplayPath(filename,50));
+ MakeDisplayPath(filename, 50));
return false;
}
LyXLex lex(0, 0);
// if par = 0 normal behavior
// else insert behavior
// Returns false if "\the_end" is not read for formats >= 2.13. (Asger)
-bool Buffer::readLyXformat2(LyXLex &lex, LyXParagraph * par)
+bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
{
string tmptok;
Inset * inset = 0;
LyXParagraph::footnote_kind footnotekind = LyXParagraph::FOOTNOTE;
bool the_end_read = false;
- LyXParagraph *return_par = 0;
+ LyXParagraph * return_par = 0;
LyXFont font = LyXFont(LyXFont::ALL_INHERIT);
// If we are inserting, we cheat and get a token in advance
if(!par) {
par = new LyXParagraph;
-#ifdef NEW_TEXT
- par->text.reserve(500);
-#endif
} else {
text->BreakParagraph();
return_par = text->FirstParagraph();
- pos=0;
+ pos = 0;
markDirty();
// We don't want to adopt the parameters from the
// document we insert, so we skip until the text begins:
continue;
else if (token[0] != '\\') {
int n = token.length();
- for (int i=0; i < n; i++) {
+ for (int i = 0; i < n; i++) {
par->InsertChar(pos, token[i]);
par->SetFont(pos, font);
pos++;
} else if (token == "\\i") {
inset = new InsetLatexAccent;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
if (!return_par)
return_par = par;
else {
-#ifdef NEW_TEXT
par->text.resize(par->text.size());
-#endif
par = new LyXParagraph(par);
-#ifdef NEW_TEXT
- par->text.reserve(500);
-#endif
}
pos = 0;
lex.EatLine();
if (!return_par)
return_par = par;
else {
-#ifdef NEW_TEXT
par->text.resize(par->text.size());
-#endif
par = new LyXParagraph(par);
-#ifdef NEW_TEXT
- par->text.reserve(500);
-#endif
}
footnotekind = LyXParagraph::FOOTNOTE;
footnoteflag = LyXParagraph::NO_FOOTNOTE;
params.readPreamble(lex);
} else if (token == "\\textclass") {
lex.EatLine();
- pair<bool, LyXTextClassList::ClassList::size_type> pp =
+ pair<bool, LyXTextClassList::ClassList::size_type> pp =
textclasslist.NumberOfClass(lex.GetString());
if (pp.first) {
params.textclass = pp.second;
tmpret = lex.FindToken(string_paragraph_separation);
if (tmpret == -1) tmpret++;
if (tmpret != LYX_LAYOUT_DEFAULT)
- params.paragraph_separation = tmpret;
+ params.paragraph_separation =
+ static_cast<BufferParams::PARSEP>(tmpret);
} else if (token == "\\defskip") {
lex.nextToken();
params.defskip = VSpace(lex.GetString());
tmpret = lex.FindToken(string_quotes_language);
if (tmpret == -1) tmpret++;
if (tmpret != LYX_LAYOUT_DEFAULT) {
- InsetQuotes::quote_language tmpl =
+ InsetQuotes::quote_language tmpl =
InsetQuotes::EnglishQ;
switch(tmpret) {
case 0:
break;
}
} else if (token == "\\papersize") {
+#if 0
if (format > 2.13)
+#endif
tmpret = lex.FindToken(string_papersize);
+#if 0
else
tmpret = lex.FindToken(string_oldpapersize);
+#endif
if (tmpret == -1)
tmpret++;
else
tmpret = lex.FindToken(string_paperpackages);
if (tmpret == -1) {
tmpret++;
- params.paperpackage = PACKAGE_NONE;
+ params.paperpackage = BufferParams::PACKAGE_NONE;
} else
params.paperpackage = tmpret;
} else if (token == "\\use_geometry") {
tmpret = lex.FindToken(string_orientation);
if (tmpret == -1) tmpret++;
if (tmpret != LYX_LAYOUT_DEFAULT)
- params.orientation = tmpret;
+ params.orientation = static_cast<BufferParams::PAPER_ORIENTATION>(tmpret);
} else if (token == "\\paperwidth") {
lex.next();
params.paperwidth = lex.GetString();
if (tmptok == "Quotes") {
inset = new InsetQuotes;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
+#if 0 // should not be used any more
} else if (tmptok == "Latex") {
// This one is on its way out
lex.EatLine();
if (tmptok[0] == '\\') {
// then this latex is a
// latex command
- InsetCommand *tmpinset =
+ InsetCommand *tmpinset =
new InsetCommand();
tmpinset->scanCommand(tmptok);
inset = tmpinset;
// the paragraph and mark it as tex.
inset = new InsetLatex(tmptok);
}
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
+#endif
+#if 0 // should not be used any more
} else if (tmptok == "LatexDel") {
// This one is on its way out...
lex.EatLine();
inset = new InsetRef(tmptok, this);
} else if (contains(tmptok, "\\url{")
|| contains(tmptok, "\\htmlurl{")) {
- string cont,opt,tmptmptok,cmdname;
+ string cont, opt, tmptmptok, cmdname;
lex.next();
while(lex.IsOK() && lex.GetString() != "\\end_inset" ) {
lex.next();
}
lex.next();
while(lex.IsOK()) {
- tmptmptok=lex.GetString();
+ tmptmptok = lex.GetString();
if(tmptmptok[0] == '\\') {
if( tmptmptok == "\\backslash")
opt += '\\';
}
lex.next();
while(lex.IsOK()) {
- tmptmptok=lex.GetString();
+ tmptmptok = lex.GetString();
if(tmptmptok[0] == '\\') {
if( tmptmptok == "\\backslash")
cont += '\\';
cmdname = string("htmlurl");
cont = strip(cont);
opt = strip(opt);
- inset = new InsetUrl(cmdname,cont,opt);
+ inset = new InsetUrl(cmdname, cont, opt);
} else if (tmptok[0] == '\\') {
// then this latex del is a
// latex command
- InsetCommand *tmpinset =
+ InsetCommand * tmpinset =
new InsetCommand();
tmpinset->scanCommand(tmptok);
inset = tmpinset;
}
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
+#endif
} else if (tmptok == "\\i") {
inset = new InsetLatexAccent;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (tmptok == "FormulaMacro") {
inset = new InsetFormulaMacro;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (tmptok == "Formula") {
inset = new InsetFormula;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (tmptok == "Figure") {
- inset = new InsetFig(100,100, this);
+ inset = new InsetFig(100, 100, this);
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
tmp += lex.GetString();
tmp += '}';
inset = new InsetLabel(tmp);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (tmptok == "Info") {
inset = new InsetInfo;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (tmptok == "Include") {
inset = new InsetInclude(string(), this);
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (tmptok == "LatexCommand") {
InsetCommand inscmd;
inscmd.Read(lex);
- if (inscmd.getCmdName()=="cite") {
+ if (inscmd.getCmdName() == "cite") {
inset = new InsetCitation(inscmd.getContents(), inscmd.getOptions());
- } else if (inscmd.getCmdName()=="bibitem") {
+ } else if (inscmd.getCmdName() == "bibitem") {
lex.printError("Wrong place for bibitem");
inset = inscmd.Clone();
- } else if (inscmd.getCmdName()=="BibTeX") {
+ } else if (inscmd.getCmdName() == "BibTeX") {
inset = new InsetBibtex(inscmd.getContents(), inscmd.getOptions(), this);
- } else if (inscmd.getCmdName()=="index") {
+ } else if (inscmd.getCmdName() == "index") {
inset = new InsetIndex(inscmd.getContents());
- } else if (inscmd.getCmdName()=="include") {
+ } else if (inscmd.getCmdName() == "include") {
inset = new InsetInclude(inscmd.getContents(), this);
- } else if (inscmd.getCmdName()=="label") {
+ } else if (inscmd.getCmdName() == "label") {
inset = new InsetLabel(inscmd.getCommand());
- } else if (inscmd.getCmdName()=="url"
- || inscmd.getCmdName()=="htmlurl") {
+ } else if (inscmd.getCmdName() == "url"
+ || inscmd.getCmdName() == "htmlurl") {
inset = new InsetUrl(inscmd.getCommand());
} else if (inscmd.getCmdName() == "ref"
|| inscmd.getCmdName() == "pageref") {
to the latexdel ref inset that was transformed to an empty ref
inset plus the body surronded by latexdel insets */
else {
- string cont,opt,tmptmptok,cmdname;
+ string cont, opt, tmptmptok, cmdname;
lex.next();
while(lex.IsOK() && lex.GetString() != "\\end_inset" ) {
lex.next();
}
lex.next();
while(lex.IsOK()) {
- tmptmptok=lex.GetString();
+ tmptmptok = lex.GetString();
if(tmptmptok[0] == '\\') {
if( tmptmptok == "\\backslash")
opt += '\\';
}
lex.next();
while(lex.IsOK()) {
- tmptmptok=lex.GetString();
+ tmptmptok = lex.GetString();
if(tmptmptok[0] == '\\') {
if( tmptmptok == "\\backslash")
cont += '\\';
cmdname = "\\" + inscmd.getCmdName();
cmdname += "[" + cont + "]";
cmdname += "{" + opt + "}";
- inset = new InsetRef(cmdname,this);
+ inset = new InsetRef(cmdname, this);
}
- } else if (inscmd.getCmdName()=="tableofcontents") {
+ } else if (inscmd.getCmdName() == "tableofcontents") {
inset = new InsetTOC(this);
- } else if (inscmd.getCmdName()=="listoffigures") {
+ } else if (inscmd.getCmdName() == "listoffigures") {
inset = new InsetLOF(this);
- } else if (inscmd.getCmdName()=="listofalgorithms") {
+ } else if (inscmd.getCmdName() == "listofalgorithms") {
inset = new InsetLOA(this);
- } else if (inscmd.getCmdName()=="listoftables") {
+ } else if (inscmd.getCmdName() == "listoftables") {
inset = new InsetLOT(this);
- } else if (inscmd.getCmdName()=="printindex") {
+ } else if (inscmd.getCmdName() == "printindex") {
inset = new InsetPrintIndex(this);
- } else if (inscmd.getCmdName()=="lyxparent") {
- inset = new InsetParent(inscmd.getContents(),this);
+ } else if (inscmd.getCmdName() == "lyxparent") {
+ inset = new InsetParent(inscmd.getContents(), this);
} else
// The following three are only for compatibility
- if (inscmd.getCmdName()=="-") {
+ if (inscmd.getCmdName() == "-") {
inset = new InsetSpecialChar(InsetSpecialChar::HYPHENATION);
- } else if (inscmd.getCmdName()=="@.") {
+ } else if (inscmd.getCmdName() == "@.") {
inset = new InsetSpecialChar(InsetSpecialChar::END_OF_SENTENCE);
- } else if (inscmd.getCmdName()=="ldots") {
+ } else if (inscmd.getCmdName() == "ldots") {
inset = new InsetSpecialChar(InsetSpecialChar::LDOTS);
} else
inset = inscmd.Clone();
if (inset) {
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (token == "\\InsetQuotes") {
inset = new InsetQuotes;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
+#if 0
} else if (token == "\\InsetLatex") {
inset = new InsetLatex;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (token == "\\InsetLatexDel") {
lex.printError(_("Warning: Ignoring Old Inset"));
+#endif
} else if (token == "\\InsetFormula") {
inset = new InsetFormula;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (token == "\\SpecialChar") {
inset = new InsetSpecialChar;
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (token == "\\Figure") {
- inset = new InsetFig(100,100, this);
+ inset = new InsetFig(100, 100, this);
inset->Read(lex);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, inset);
par->SetFont(pos, font);
pos++;
} else if (token == "\\newline") {
- par->InsertChar(pos, LYX_META_NEWLINE);
+ par->InsertChar(pos, LyXParagraph::META_NEWLINE);
par->SetFont(pos, font);
pos++;
} else if (token == "\\LyXTable") {
par->table = new LyXTable(lex);
} else if (token == "\\hfill") {
- par->InsertChar(pos, LYX_META_HFILL);
+ par->InsertChar(pos, LyXParagraph::META_HFILL);
par->SetFont(pos, font);
pos++;
} else if (token == "\\protected_separator") {
- par->InsertChar(pos, LYX_META_PROTECTED_SEPARATOR);
+ par->InsertChar(pos, LyXParagraph::META_PROTECTED_SEPARATOR);
par->SetFont(pos, font);
pos++;
} else if (token == "\\bibitem") { // ale970302
lex.printError("Unknown token `$$Token'. "
"Inserting as text.");
int n = token.length();
- for (int i=0; i < n; i++) {
+ for (int i = 0; i < n; i++) {
par->InsertChar(pos, token[i]);
par->SetFont(pos, font);
pos++;
// Formats >= 2.13 support "\the_end" marker
if (format < 2.13)
the_end = true;
+#if 0
// Formats >= 2.14 changed papersize stuff
if (format < 2.14) {
setOldPaperStuff();
} else {
+#endif
setPaperStuff();
+#if 0
}
+#endif
if (!the_end)
WriteAlert(_("Warning!"),
_("Reading of document is not complete"),
lyxerr << _("Error! Document is read-only: ")
<< filename << endl;
else
- WriteAlert(_("Error! Document is read-only: "), filename);
+ WriteAlert(_("Error! Document is read-only: "),
+ filename);
return false;
}
lyxerr << _("Error! Cannot write file: ")
<< filename << endl;
else
- WriteFSAlert(_("Error! Cannot write file: "), filename);
+ WriteFSAlert(_("Error! Cannot write file: "),
+ filename);
return false;
}
lyxerr << _("Error! Cannot write file: ")
<< filename << endl;
else
- WriteFSAlert(_("Error! Cannot write file: "), filename);
+ WriteFSAlert(_("Error! Cannot write file: "),
+ filename);
return false;
}
// The top of the file should not be written by params.
fname1,
tmp;
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
-#else
- int i;
-#endif
int
- j,h,
- ltype=0,
- ltype_depth=0,
- noparbreak=0,
- islatex=0,
- *clen=0,
- actcell=0,
- actpos=0,
- cell=0,
- cells=0,
- currlinelen=0;
+ j, h,
+ ltype = 0,
+ ltype_depth = 0,
+ noparbreak = 0,
+ islatex = 0,
+ * clen = 0,
+ actcell = 0,
+ actpos = 0,
+ cell = 0,
+ cells = 0,
+ currlinelen = 0;
long
- fpos=0;
+ fpos = 0;
bool
ref_printed = false;
WriteFSAlert(_("Error: Cannot write file:"), filename);
return;
}
- fname1=TmpFileName();
+ fname1 = TmpFileName();
while (par) {
noparbreak = 0;
islatex = 0;
if (footnoteflag != par->footnoteflag) {
footnoteflag = par->footnoteflag;
if (footnoteflag) {
- j=strlen(string_footnotekinds[par->footnotekind])+4;
+ j = strlen(string_footnotekinds[par->footnotekind])+4;
if (currlinelen+j > linelen)
- fprintf(file,"\n");
+ fprintf(file, "\n");
fprintf(file, "([%s] ",
string_footnotekinds[par->footnotekind]);
currlinelen += j;
}
/* First write the layout */
- tmp = textclasslist.NameOfLayout(params.textclass,par->layout);
+ tmp = textclasslist.NameOfLayout(params.textclass, par->layout);
if (tmp == "Itemize") {
ltype = 1;
ltype_depth = depth+1;
- } else if (tmp =="Enumerate") {
+ } else if (tmp == "Enumerate") {
ltype = 2;
ltype_depth = depth+1;
- } else if (strstr(tmp.c_str(),"ection")) {
+ } else if (strstr(tmp.c_str(), "ection")) {
ltype = 3;
ltype_depth = depth+1;
- } else if (strstr(tmp.c_str(),"aragraph")) {
+ } else if (strstr(tmp.c_str(), "aragraph")) {
ltype = 4;
ltype_depth = depth+1;
} else if (tmp == "Description") {
if (par->table){
if (!lyxrc->ascii_roff_command.empty() &&
lyxrc->ascii_roff_command != "none") {
- RoffAsciiTable(file,par);
+ RoffAsciiTable(file, par);
par = par->next;
continue;
}
actcell = 0;
cells = par->table->columns;
clen = new int [cells];
- memset(clen,0,sizeof(int)*cells);
-#ifdef NEW_TEXT
+ memset(clen, 0, sizeof(int)*cells);
for (i = 0, j = 0, h = 1; i < par->size(); ++i, ++h) {
-#else
- for (i = 0, j = 0, h=1; i < par->last; i++, h++) {
-#endif
c = par->GetChar(i);
- if (c == LYX_META_INSET) {
+ if (c == LyXParagraph::META_INSET) {
if ((inset = par->GetInset(i))) {
FilePtr fp(fname1,
FilePtr::write);
h += ftell(fp) - 1;
remove(fname1.c_str());
}
- } else if (c == LYX_META_NEWLINE) {
+ } else if (c == LyXParagraph::META_NEWLINE) {
if (clen[j] < h)
clen[j] = h;
h = 0;
}
font1 = LyXFont(LyXFont::ALL_INHERIT);
- actcell=0;
-#ifdef NEW_TEXT
+ actcell = 0;
for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) {
-#else
- for (i = 0,actpos=1; i < par->last; i++, actpos++) {
-#endif
if (!i && !footnoteflag && !noparbreak){
fprintf(file, "\n\n");
- for(j=0; j<depth; j++)
+ for(j = 0; j<depth; j++)
fprintf(file, " ");
currlinelen = depth*2;
switch(ltype) {
}
break;
default:
- fprintf(file,"%s ",par->labelstring.c_str());
+ fprintf(file, "%s ", par->labelstring.c_str());
break;
}
if (ltype_depth > depth) {
- for(j=ltype_depth-1; j>depth; j--)
+ for(j = ltype_depth-1; j>depth; j--)
fprintf(file, " ");
currlinelen += (ltype_depth-depth)*2;
}
if (par->table) {
- for(j=0;j<cells;j++) {
- fputc('+',file);
- for(h=0; h<(clen[j]+1); h++)
- fputc('-',file);
+ for(j = 0;j<cells;j++) {
+ fputc('+', file);
+ for(h = 0; h<(clen[j]+1); h++)
+ fputc('-', file);
}
- fprintf(file,"+\n");
- for(j=0; j<depth; j++)
+ fprintf(file, "+\n");
+ for(j = 0; j<depth; j++)
fprintf(file, " ");
currlinelen = depth*2;
if (ltype_depth > depth) {
- for(j=ltype_depth; j>depth; j--)
+ for(j = ltype_depth; j>depth; j--)
fprintf(file, " ");
currlinelen += (ltype_depth-depth)*2;
}
- fprintf(file,"| ");
+ fprintf(file, "| ");
}
}
font2 = par->GetFontSettings(i);
if (islatex)
continue;
switch (c) {
- case LYX_META_INSET:
+ case LyXParagraph::META_INSET:
if ((inset = par->GetInset(i))) {
fpos = ftell(file);
inset->Latex(file,-1);
actpos += (ftell(file) - fpos) - 1;
}
break;
- case LYX_META_NEWLINE:
+ case LyXParagraph::META_NEWLINE:
if (par->table) {
if (par->table->NumberOfCellsInRow(actcell) <= cell) {
- for(j=actpos;j<clen[cell-1];j++)
- fputc(' ',file);
- fprintf(file," |\n");
- for(j=0; j<depth; j++)
+ for(j = actpos;j<clen[cell-1];j++)
+ fputc(' ', file);
+ fprintf(file, " |\n");
+ for(j = 0; j<depth; j++)
fprintf(file, " ");
currlinelen = depth*2;
if (ltype_depth > depth) {
- for(j=ltype_depth; j>depth; j--)
+ for(j = ltype_depth; j>depth; j--)
fprintf(file, " ");
currlinelen += (ltype_depth-depth)*2;
}
- for(j=0;j<cells;j++) {
- fputc('+',file);
- for(h=0; h<(clen[j]+1); h++)
- fputc('-',file);
+ for(j = 0;j<cells;j++) {
+ fputc('+', file);
+ for(h = 0; h<(clen[j]+1); h++)
+ fputc('-', file);
}
- fprintf(file,"+\n");
- for(j=0; j<depth; j++)
+ fprintf(file, "+\n");
+ for(j = 0; j<depth; j++)
fprintf(file, " ");
currlinelen = depth*2;
if (ltype_depth > depth) {
- for(j=ltype_depth; j>depth; j--)
+ for(j = ltype_depth; j>depth; j--)
fprintf(file, " ");
currlinelen += (ltype_depth-depth)*2;
}
- fprintf(file,"| ");
+ fprintf(file, "| ");
cell = 1;
} else {
- for(j=actpos; j<clen[cell-1]; j++)
- fputc(' ',file);
+ for(j = actpos; j<clen[cell-1]; j++)
+ fputc(' ', file);
fprintf(file, " | ");
cell++;
}
currlinelen = actpos = 0;
} else {
fprintf(file, "\n");
- for(j=0; j<depth; j++)
+ for(j = 0; j<depth; j++)
fprintf(file, " ");
currlinelen = depth*2;
if (ltype_depth > depth) {
- for(j=ltype_depth; j>depth; j--)
+ for(j = ltype_depth; j>depth; j--)
fprintf(file, " ");
currlinelen += (ltype_depth-depth)*2;
}
}
break;
- case LYX_META_HFILL:
+ case LyXParagraph::META_HFILL:
fprintf(file, "\t");
break;
- case LYX_META_PROTECTED_SEPARATOR:
+ case LyXParagraph::META_PROTECTED_SEPARATOR:
fprintf(file, " ");
break;
case '\\':
fprintf(file, "\\");
break;
default:
-#ifdef NEW_TEXT
if (currlinelen > linelen - 10
&& c == ' ' && i + 2 < par->size()) {
-#else
- if (currlinelen > (linelen-10) \
- && c==' ' && (i+2 < par->last)) {
-#endif
fprintf(file, "\n");
for(j = 0; j < depth; ++j)
fprintf(file, " ");
}
}
if (par->table) {
- for(j=actpos;j<clen[cell-1];j++)
- fputc(' ',file);
- fprintf(file," |\n");
- for(j=0; j<depth; j++)
+ for(j = actpos;j<clen[cell-1];j++)
+ fputc(' ', file);
+ fprintf(file, " |\n");
+ for(j = 0; j<depth; j++)
fprintf(file, " ");
currlinelen = depth*2;
if (ltype_depth > depth) {
- for(j=ltype_depth; j>depth; j--)
+ for(j = ltype_depth; j>depth; j--)
fprintf(file, " ");
currlinelen += (ltype_depth-depth)*2;
}
- for(j=0;j<cells;j++) {
- fputc('+',file);
- for(h=0; h<(clen[j]+1); h++)
- fputc('-',file);
+ for(j = 0;j<cells;j++) {
+ fputc('+', file);
+ for(h = 0; h<(clen[j]+1); h++)
+ fputc('-', file);
}
- fprintf(file,"+\n");
+ fprintf(file, "+\n");
delete [] clen;
}
par = par->next;
tex_code_break_column = lyxrc->ascii_linelen;
- LyXTextClass const & tclass = textclasslist.TextClass(params.textclass);
+ LyXTextClass const & tclass =
+ textclasslist.TextClass(params.textclass);
FilePtr file(filename, FilePtr::write);
if (!file()) {
- WriteFSAlert(_("Error: Cannot write file:"),filename);
+ WriteFSAlert(_("Error: Cannot write file:"), filename);
return;
}
string options; // the document class options.
- if (tokenPos(tclass.opt_fontsize(), '|',params.fontsize) >= 0) {
+ if (tokenPos(tclass.opt_fontsize(), '|', params.fontsize) >= 0) {
// only write if existing in list (and not default)
options += params.fontsize;
options += "pt,";
if (!params.use_geometry &&
- (params.paperpackage == PACKAGE_NONE)) {
+ (params.paperpackage == BufferParams::PACKAGE_NONE)) {
switch (params.papersize) {
- case PAPER_A4PAPER:
+ case BufferParams::PAPER_A4PAPER:
options += "a4paper,";
break;
- case PAPER_USLETTER:
+ case BufferParams::PAPER_USLETTER:
options += "letterpaper,";
break;
- case PAPER_A5PAPER:
+ case BufferParams::PAPER_A5PAPER:
options += "a5paper,";
break;
- case PAPER_B5PAPER:
+ case BufferParams::PAPER_B5PAPER:
options += "b5paper,";
break;
- case PAPER_EXECUTIVEPAPER:
+ case BufferParams::PAPER_EXECUTIVEPAPER:
options += "executivepaper,";
break;
- case PAPER_LEGALPAPER:
+ case BufferParams::PAPER_LEGALPAPER:
options += "legalpaper,";
break;
}
options += "onecolumn,";
}
- if (!params.use_geometry && params.orientation == ORIENTATION_LANDSCAPE)
+ if (!params.use_geometry && params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
options += "landscape,";
// language should be a parameter to \documentclass
}
/* at the very beginning the text parameters */
- if (params.paperpackage != PACKAGE_NONE) {
+ if (params.paperpackage != BufferParams::PACKAGE_NONE) {
switch (params.paperpackage) {
- case PACKAGE_A4:
+ case BufferParams::PACKAGE_A4:
LFile += "\\usepackage{a4}\n";
texrow.newline();
break;
- case PACKAGE_A4WIDE:
+ case BufferParams::PACKAGE_A4WIDE:
LFile += "\\usepackage{a4wide}\n";
texrow.newline();
break;
- case PACKAGE_WIDEMARGINSA4:
+ case BufferParams::PACKAGE_WIDEMARGINSA4:
LFile += "\\usepackage[widemargins]{a4}\n";
texrow.newline();
break;
LFile += "\\usepackage{geometry}\n";
texrow.newline();
LFile += "\\geometry{verbose";
- if (params.orientation == ORIENTATION_LANDSCAPE)
+ if (params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
LFile += ",landscape";
switch (params.papersize2) {
- case VM_PAPER_CUSTOM:
+ case BufferParams::VM_PAPER_CUSTOM:
if (!params.paperwidth.empty())
- LFile += ",paperwidth="
+ LFile += ",paperwidth= "
+ params.paperwidth;
if (!params.paperheight.empty())
- LFile += ",paperheight="
+ LFile += ",paperheight= "
+ params.paperheight;
break;
- case VM_PAPER_USLETTER:
+ case BufferParams::VM_PAPER_USLETTER:
LFile += ",letterpaper";
break;
- case VM_PAPER_USLEGAL:
+ case BufferParams::VM_PAPER_USLEGAL:
LFile += ",legalpaper";
break;
- case VM_PAPER_USEXECUTIVE:
+ case BufferParams::VM_PAPER_USEXECUTIVE:
LFile += ",executivepaper";
break;
- case VM_PAPER_A3:
+ case BufferParams::VM_PAPER_A3:
LFile += ",a3paper";
break;
- case VM_PAPER_A4:
+ case BufferParams::VM_PAPER_A4:
LFile += ",a4paper";
break;
- case VM_PAPER_A5:
+ case BufferParams::VM_PAPER_A5:
LFile += ",a5paper";
break;
- case VM_PAPER_B3:
+ case BufferParams::VM_PAPER_B3:
LFile += ",b3paper";
break;
- case VM_PAPER_B4:
+ case BufferParams::VM_PAPER_B4:
LFile += ",b4paper";
break;
- case VM_PAPER_B5:
+ case BufferParams::VM_PAPER_B5:
LFile += ",b5paper";
break;
default:
- // default papersize ie VM_PAPER_DEFAULT
+ // default papersize ie BufferParams::VM_PAPER_DEFAULT
switch (lyxrc->default_papersize) {
- case PAPER_DEFAULT: // keep compiler happy
- case PAPER_USLETTER:
+ case BufferParams::PAPER_DEFAULT: // keep compiler happy
+ case BufferParams::PAPER_USLETTER:
LFile += ",letterpaper";
break;
- case PAPER_LEGALPAPER:
+ case BufferParams::PAPER_LEGALPAPER:
LFile += ",legalpaper";
break;
- case PAPER_EXECUTIVEPAPER:
+ case BufferParams::PAPER_EXECUTIVEPAPER:
LFile += ",executivepaper";
break;
- case PAPER_A3PAPER:
+ case BufferParams::PAPER_A3PAPER:
LFile += ",a3paper";
break;
- case PAPER_A4PAPER:
+ case BufferParams::PAPER_A4PAPER:
LFile += ",a4paper";
break;
- case PAPER_A5PAPER:
+ case BufferParams::PAPER_A5PAPER:
LFile += ",a5paper";
break;
- case PAPER_B5PAPER:
+ case BufferParams::PAPER_B5PAPER:
LFile += ",b5paper";
break;
}
}
if (!params.topmargin.empty())
- LFile += ",tmargin=" + params.topmargin;
+ LFile += ",tmargin= " + params.topmargin;
if (!params.bottommargin.empty())
- LFile += ",bmargin=" + params.bottommargin;
+ LFile += ",bmargin= " + params.bottommargin;
if (!params.leftmargin.empty())
- LFile += ",lmargin=" + params.leftmargin;
+ LFile += ",lmargin= " + params.leftmargin;
if (!params.rightmargin.empty())
- LFile += ",rmargin=" + params.rightmargin;
+ LFile += ",rmargin= " + params.rightmargin;
if (!params.headheight.empty())
- LFile += ",headheight=" + params.headheight;
+ LFile += ",headheight= " + params.headheight;
if (!params.headsep.empty())
- LFile += ",headsep=" + params.headsep;
+ LFile += ",headsep= " + params.headsep;
if (!params.footskip.empty())
- LFile += ",footskip=" + params.footskip;
+ LFile += ",footskip= " + params.footskip;
LFile += "}\n";
texrow.newline();
}
LFile += "\\usepackage{amsmath}\n";
}
- if (tokenPos(tclass.opt_pagestyle(), '|',params.pagestyle) >= 0) {
+ if (tokenPos(tclass.opt_pagestyle(), '|', params.pagestyle) >= 0) {
if (params.pagestyle == "fancy") {
LFile += "\\usepackage{fancyhdr}\n";
texrow.newline();
// flag this with ftcount
ftcount = -1;
if (layout.isEnvironment()
- || par->pextra_type != PEXTRA_NONE) {
+ || par->pextra_type != LyXParagraph::PEXTRA_NONE) {
par = par->TeXEnvironment(LFile, texrow,
ftnote, ft_texrow, ftcount);
} else {
}
-bool Buffer::isLatex()
+bool Buffer::isLatex() const
{
return textclasslist.TextClass(params.textclass).outputType() == LATEX;
}
-bool Buffer::isLinuxDoc()
+bool Buffer::isLinuxDoc() const
{
return textclasslist.TextClass(params.textclass).outputType() == LINUXDOC;
}
-bool Buffer::isLiterate()
+bool Buffer::isLiterate() const
{
return textclasslist.TextClass(params.textclass).outputType() == LITERATE;
}
-bool Buffer::isDocBook()
+bool Buffer::isDocBook() const
{
return textclasslist.TextClass(params.textclass).outputType() == DOCBOOK;
}
-bool Buffer::isSGML()
+bool Buffer::isSGML() const
{
return textclasslist.TextClass(params.textclass).outputType() == LINUXDOC ||
textclasslist.TextClass(params.textclass).outputType() == DOCBOOK;
void Buffer::sgmlOpenTag(FILE * file, int depth, string const & latexname) const
{
- static char *space[] = {" "," "," "," "," "," "," ",
- " "," "," "," "};
+ static char * space[] = {" "," ", " ", " ", " ", " ", " ",
+ " ", " ", " ", " "};
fprintf(file, "%s<%s>\n", space[depth], latexname.c_str());
}
-void Buffer::sgmlCloseTag(FILE * file, int depth, string const & latexname) const
+void Buffer::sgmlCloseTag(FILE * file, int depth,
+ string const & latexname) const
{
- static char *space[] = {" "," "," "," "," "," "," ",
- " "," "," "," "};
+ static char * space[] = {" ", " ", " ", " ", " ", " ", " ",
+ " ", " ", " ", " "};
fprintf(file, "%s</%s>\n", space[depth], latexname.c_str());
}
{
LyXParagraph * par = paragraph;
- string top_element=textclasslist.LatexnameOfClass(params.textclass);
+ string top_element = textclasslist.LatexnameOfClass(params.textclass);
string environment_stack[10];
string item_name;
return;
}
- //ResetTexRow();
texrow.reset();
if (params.preamble.empty()) {
}
string userName(getUserName());
- fprintf(file, "<!-- LinuxDoc file was created by LyX 1.0 (C) 1995-1999 ");
+ fprintf(file,
+ "<!-- LinuxDoc file was created by LyX 1.0 (C) 1995-1999 ");
fprintf(file, "by <%s> %s -->\n", userName.c_str(), (char *)date());
if(params.options.empty())
- sgmlOpenTag(file,0,top_element);
+ sgmlOpenTag(file, 0, top_element);
else {
string top = top_element;
top += " ";
top += params.options;
- sgmlOpenTag(file,0,top);
+ sgmlOpenTag(file, 0, top);
}
while (par) {
- int desc_on=0; /* description mode*/
- LyXLayout const & style=textclasslist.Style(GetCurrentTextClass(), par->layout);
+ int desc_on = 0; /* description mode*/
+ LyXLayout const & style =
+ textclasslist.Style(GetCurrentTextClass(),
+ par->layout);
par->AutoDeleteInsets();
/* treat <toc> as a special case for compatibility with old code */
- if (par->GetChar(0) == LYX_META_INSET) {
+ if (par->GetChar(0) == LyXParagraph::META_INSET) {
Inset *inset = par->GetInset(0);
char lyx_code = inset->LyxCode();
- if (lyx_code ==Inset::TOC_CODE){
- string temp= "toc";
+ if (lyx_code == Inset::TOC_CODE){
+ string temp = "toc";
sgmlOpenTag(file, depth, temp);
par = par->next;
/* environment tag closing */
for( ;depth > par->depth; depth--) {
- sgmlCloseTag(file,depth,environment_stack[depth]);
+ sgmlCloseTag(file, depth, environment_stack[depth]);
environment_stack[depth].clear();
}
case LATEX_PARAGRAPH:
if(depth == par->depth
&& !environment_stack[depth].empty()) {
- sgmlCloseTag(file,depth,environment_stack[depth]);
+ sgmlCloseTag(file, depth, environment_stack[depth]);
environment_stack[depth].clear();
if(depth)
depth--;
else
- fprintf(file,"</p>");
+ fprintf(file, "</p>");
}
- sgmlOpenTag(file,depth,style.latexname());
+ sgmlOpenTag(file, depth, style.latexname());
break;
case LATEX_COMMAND:
- if (depth!=0)
+ if (depth!= 0)
LinuxDocError(par, 0, _("Error : Wrong depth for LatexType Command.\n"));
if (!environment_stack[depth].empty()){
- sgmlCloseTag(file,depth,environment_stack[depth]);
+ sgmlCloseTag(file, depth, environment_stack[depth]);
fprintf(file, "</p>");
}
environment_stack[depth].clear();
- sgmlOpenTag(file,depth, style.latexname());
+ sgmlOpenTag(file, depth, style.latexname());
break;
case LATEX_ENVIRONMENT:
&& environment_stack[depth] != style.latexname()
&& !environment_stack[depth].empty()) {
- sgmlCloseTag(file,depth,environment_stack[depth]);
+ sgmlCloseTag(file, depth,
+ environment_stack[depth]);
environment_stack[depth].clear();
}
if (depth < par->depth) {
environment_stack[depth].clear();
}
if (environment_stack[depth] != style.latexname()) {
- if(depth==0) {
- string temp="p";
- sgmlOpenTag(file,depth,temp);
+ if(depth == 0) {
+ string temp = "p";
+ sgmlOpenTag(file, depth, temp);
}
environment_stack[depth] = style.latexname();
- sgmlOpenTag(file,depth,environment_stack[depth]);
+ sgmlOpenTag(file, depth, environment_stack[depth]);
}
if(style.latextype == LATEX_ENVIRONMENT) break;
- desc_on =(style.labeltype == LABEL_MANUAL);
+ desc_on = (style.labeltype == LABEL_MANUAL);
if(desc_on)
- item_name="tag";
+ item_name = "tag";
else
- item_name="item";
+ item_name = "item";
- sgmlOpenTag(file,depth+1,item_name);
+ sgmlOpenTag(file, depth+1, item_name);
break;
default:
sgmlOpenTag(file, depth, style.latexname());
SimpleLinuxDocOnePar(file, par, desc_on, depth);
par = par->next;
- linuxDocHandleFootnote(file,par,depth);
+ linuxDocHandleFootnote(file, par, depth);
}
while(par && par->IsDummy());
- fprintf(file,"\n");
+ fprintf(file, "\n");
/* write closing SGML tags */
switch(style.latextype) {
case LATEX_COMMAND:
sgmlCloseTag(file, depth, style.latexname());
break;
}
-
-
}
-
/* Close open tags */
for(;depth>0;depth--)
- sgmlCloseTag(file,depth,environment_stack[depth]);
+ sgmlCloseTag(file, depth, environment_stack[depth]);
if(!environment_stack[depth].empty())
- sgmlCloseTag(file,depth,environment_stack[depth]);
+ sgmlCloseTag(file, depth, environment_stack[depth]);
fprintf(file, "\n\n");
- sgmlCloseTag(file,0,top_element);
+ sgmlCloseTag(file, 0, top_element);
if (file.close()) {
WriteFSAlert(_("Error! Could not close file properly:"),
filename);
- }
+ }
}
-void Buffer::linuxDocHandleFootnote(FILE *file,LyXParagraph* &par, int const depth)
+void Buffer::linuxDocHandleFootnote(FILE * file, LyXParagraph * & par,
+ int const depth)
{
- string tag="footnote";
+ string tag = "footnote";
while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
- sgmlOpenTag(file,depth+1,tag);
- SimpleLinuxDocOnePar(file, par, 0,depth+1);
- sgmlCloseTag(file,depth+1,tag);
+ sgmlOpenTag(file, depth+1, tag);
+ SimpleLinuxDocOnePar(file, par, 0, depth+1);
+ sgmlCloseTag(file, depth+1, tag);
par = par->next;
}
}
-void Buffer::DocBookHandleCaption(FILE *file, string &inner_tag,
+void Buffer::DocBookHandleCaption(FILE * file, string & inner_tag,
int const depth, int desc_on,
- LyXParagraph* &par)
+ LyXParagraph * & par)
{
- LyXParagraph *tpar = par;
+ LyXParagraph * tpar = par;
string tmp_par, extra_par;
while (tpar && (tpar->footnoteflag != LyXParagraph::NO_FOOTNOTE) &&
- (tpar->layout != textclasslist.NumberOfLayout(params.textclass,"Caption").second))
+ (tpar->layout != textclasslist.NumberOfLayout(params.textclass, "Caption").second))
tpar = tpar->next;
if (tpar &&
- tpar->layout==textclasslist.NumberOfLayout(params.textclass,"Caption").second) {
- sgmlOpenTag(file,depth+1,inner_tag);
- SimpleDocBookOnePar(tmp_par,extra_par,tpar,desc_on,depth+2);
+ tpar->layout == textclasslist.NumberOfLayout(params.textclass,
+ "Caption").second) {
+ sgmlOpenTag(file, depth+1, inner_tag);
+ SimpleDocBookOnePar(tmp_par, extra_par, tpar, desc_on, depth+2);
tmp_par = strip(tmp_par);
tmp_par = frontStrip(tmp_par);
- fprintf(file,"%s",tmp_par.c_str());
- sgmlCloseTag(file,depth+1,inner_tag);
+ fprintf(file, "%s", tmp_par.c_str());
+ sgmlCloseTag(file, depth+1, inner_tag);
if(!extra_par.empty())
- fprintf(file,"%s",extra_par.c_str());
+ fprintf(file, "%s", extra_par.c_str());
}
}
-void Buffer::DocBookHandleFootnote(FILE *file,LyXParagraph* &par, int const depth)
+void Buffer::DocBookHandleFootnote(FILE * file, LyXParagraph * & par,
+ int const depth)
{
- string tag,inner_tag;
- string tmp_par,extra_par;
+ string tag, inner_tag;
+ string tmp_par, extra_par;
bool inner_span = false;
- int desc_on=4;
+ int desc_on = 4;
// This is not how I like to see enums. They should not be anonymous
// and variables of its type should not be declared right after the
MARGIN_LIKE,
FIG_LIKE,
TAB_LIKE
- } last=NO_ONE, present=FOOTNOTE_LIKE;
+ } last = NO_ONE, present = FOOTNOTE_LIKE;
while (par && par->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
- if(last==present) {
+ if(last == present) {
if(inner_span) {
if(!tmp_par.empty()) {
- fprintf(file,"%s",tmp_par.c_str());
+ fprintf(file, "%s", tmp_par.c_str());
tmp_par.clear();
- sgmlCloseTag(file,depth+1,inner_tag);
- sgmlOpenTag(file,depth+1,inner_tag);
+ sgmlCloseTag(file, depth+1, inner_tag);
+ sgmlOpenTag(file, depth+1, inner_tag);
}
}
else
- fprintf(file,"\n");
+ fprintf(file, "\n");
} else {
- fprintf(file,"%s",tmp_par.c_str());
- if(!inner_tag.empty()) sgmlCloseTag(file,depth+1,inner_tag);
- if(!extra_par.empty()) fprintf(file,"%s",extra_par.c_str());
- if(!tag.empty()) sgmlCloseTag(file,depth,tag);
+ fprintf(file, "%s", tmp_par.c_str());
+ if(!inner_tag.empty()) sgmlCloseTag(file, depth+1, inner_tag);
+ if(!extra_par.empty()) fprintf(file, "%s", extra_par.c_str());
+ if(!tag.empty()) sgmlCloseTag(file, depth, tag);
extra_par.clear();
switch (par->footnotekind) {
case LyXParagraph::FOOTNOTE:
case LyXParagraph::ALGORITHM:
- tag="footnote";
- inner_tag="para";
- present=FOOTNOTE_LIKE;
- inner_span=true;
+ tag = "footnote";
+ inner_tag = "para";
+ present = FOOTNOTE_LIKE;
+ inner_span = true;
break;
case LyXParagraph::MARGIN:
- tag="sidebar";
- inner_tag="para";
- present=MARGIN_LIKE;
- inner_span=true;
+ tag = "sidebar";
+ inner_tag = "para";
+ present = MARGIN_LIKE;
+ inner_span = true;
break;
case LyXParagraph::FIG:
case LyXParagraph::WIDE_FIG:
- tag="figure";
- inner_tag="title";
- present=FIG_LIKE;
- inner_span=false;
+ tag = "figure";
+ inner_tag = "title";
+ present = FIG_LIKE;
+ inner_span = false;
break;
case LyXParagraph::TAB:
case LyXParagraph::WIDE_TAB:
- tag="table";
- inner_tag="title";
- present=TAB_LIKE;
- inner_span=false;
+ tag = "table";
+ inner_tag = "title";
+ present = TAB_LIKE;
+ inner_span = false;
break;
}
- sgmlOpenTag(file,depth,tag);
+ sgmlOpenTag(file, depth, tag);
if ((present == TAB_LIKE) || (present == FIG_LIKE)) {
DocBookHandleCaption(file, inner_tag, depth,
desc_on, par);
inner_tag.clear();
} else {
- sgmlOpenTag(file,depth+1,inner_tag);
+ sgmlOpenTag(file, depth+1, inner_tag);
}
}
// ignore all caption here, we processed them above!!!
if (par->layout != textclasslist.NumberOfLayout(params.textclass,
"Caption").second) {
- SimpleDocBookOnePar(tmp_par,extra_par,par,
- desc_on,depth+2);
+ SimpleDocBookOnePar(tmp_par, extra_par, par,
+ desc_on, depth+2);
}
tmp_par = frontStrip(strip(tmp_par));
- last=present;
+ last = present;
par = par->next;
}
- fprintf(file,"%s",tmp_par.c_str());
- if(!inner_tag.empty()) sgmlCloseTag(file,depth+1,inner_tag);
- if(!extra_par.empty()) fprintf(file,"%s",extra_par.c_str());
- if(!tag.empty()) sgmlCloseTag(file,depth,tag);
+ fprintf(file, "%s", tmp_par.c_str());
+ if(!inner_tag.empty()) sgmlCloseTag(file, depth+1, inner_tag);
+ if(!extra_par.empty()) fprintf(file, "%s", extra_par.c_str());
+ if(!tag.empty()) sgmlCloseTag(file, depth, tag);
}
/* push a tag in a style stack */
-void Buffer::push_tag(FILE *file, char const *tag,
- int& pos, char stack[5][3])
+void Buffer::push_tag(FILE * file, char const * tag,
+ int & pos, char stack[5][3])
{
int j;
/* pop all previous tags */
- for (j=pos; j>=0; j--)
+ for (j = pos; j >= 0; j--)
fprintf(file, "</%s>", stack[j]);
/* add new tag */
sprintf(stack[++pos], "%s", tag);
/* push all tags */
- for (j=0; j<=pos; j++)
+ for (j= 0; j<= pos; j++)
fprintf(file, "<%s>", stack[j]);
}
// pop a tag from a style stack
-void Buffer::pop_tag(FILE *file, char const * tag,
- int& pos, char stack[5][3])
+void Buffer::pop_tag(FILE * file, char const * tag,
+ int & pos, char stack[5][3])
{
int j;
// pop all tags till specified one
- for (j=pos; (j>=0) && (strcmp(stack[j], tag)); j--)
+ for (j= pos; (j>= 0) && (strcmp(stack[j], tag)); j--)
fprintf(file, "</%s>", stack[j]);
// closes the tag
fprintf(file, "</%s>", tag);
// push all tags, but the specified one
- for (j=j+1; j<=pos; j++) {
+ for (j= j+1; j<= pos; j++) {
fprintf(file, "<%s>", stack[j]);
strcpy(stack[j-1], stack[j]);
}
// checks, if newcol chars should be put into this line
// writes newline, if necessary.
static
-void linux_doc_line_break(FILE *file, unsigned int &colcount, const unsigned int newcol)
+void linux_doc_line_break(FILE * file, unsigned int & colcount,
+ const unsigned int newcol)
{
colcount += newcol;
if (colcount > lyxrc->ascii_linelen) {
}
-void Buffer::SimpleLinuxDocOnePar(FILE *file, LyXParagraph *par, int desc_on, int const depth)
+void Buffer::SimpleLinuxDocOnePar(FILE * file, LyXParagraph * par,
+ int desc_on, int const depth)
{
- LyXFont font1,font2;
+ LyXFont font1, font2;
char c;
Inset * inset;
-#ifdef NEW_TEXT
LyXParagraph::size_type main_body;
int j;
-#else
- int main_body, j;
-#endif
- LyXLayout const & style = textclasslist.Style(params.textclass, par->GetLayout());
+ LyXLayout const & style = textclasslist.Style(params.textclass,
+ par->GetLayout());
char family_type = 0; // family font flag
bool is_bold = false; // series font flag
/* parsing main loop */
-#ifdef NEW_TEXT
for (LyXParagraph::size_type i = 0;
i < par->size(); ++i) {
-#else
- for (int i = 0; i < par->last; i++) {
-#endif
/* handle quote tag */
if (i == main_body && !par->IsDummy()) {
case 0:
if (font2.family() == LyXFont::TYPEWRITER_FAMILY) {
push_tag(file, "tt", stack_num, stack);
- family_type=1;
+ family_type= 1;
}
else if (font2.family() == LyXFont::SANS_FAMILY) {
push_tag(file, "sf", stack_num, stack);
- family_type=2;
+ family_type= 2;
}
break;
case 1:
pop_tag(file, "tt", stack_num, stack);
if (font2.family() == LyXFont::SANS_FAMILY) {
push_tag(file, "sf", stack_num, stack);
- family_type=2;
+ family_type= 2;
}
else {
- family_type=0;
+ family_type= 0;
}
break;
case 2:
pop_tag(file, "sf", stack_num, stack);
if (font2.family() == LyXFont::TYPEWRITER_FAMILY) {
push_tag(file, "tt", stack_num, stack);
- family_type=1;
+ family_type= 1;
}
else {
- family_type=0;
+ family_type= 0;
}
}
}
case 0:
if (font2.shape() == LyXFont::ITALIC_SHAPE) {
push_tag(file, "it", stack_num, stack);
- shape_type=1;
+ shape_type= 1;
}
else if (font2.shape() == LyXFont::SLANTED_SHAPE) {
push_tag(file, "sl", stack_num, stack);
- shape_type=2;
+ shape_type= 2;
}
break;
case 1:
pop_tag(file, "it", stack_num, stack);
if (font2.shape() == LyXFont::SLANTED_SHAPE) {
push_tag(file, "sl", stack_num, stack);
- shape_type=2;
+ shape_type= 2;
}
else {
- shape_type=0;
+ shape_type= 0;
}
break;
case 2:
pop_tag(file, "sl", stack_num, stack);
if (font2.shape() == LyXFont::ITALIC_SHAPE) {
push_tag(file, "it", stack_num, stack);
- shape_type=1;
+ shape_type= 1;
}
else {
- shape_type=0;
+ shape_type= 0;
}
}
}
c = par->GetChar(i);
if (font2.latex() == LyXFont::ON) {
- // "TeX"-Mode on ==> SGML-Mode on.
- if (c!='\0')
+ // "TeX"-Mode on == > SGML-Mode on.
+ if (c!= '\0')
fprintf(file, "%c", c); // see LaTeX-Generation...
char_line_count++;
- } else if (c == LYX_META_INSET) {
+ } else if (c == LyXParagraph::META_INSET) {
inset = par->GetInset(i);
string tmp_out;
inset->Linuxdoc(tmp_out);
- fprintf(file,"%s",tmp_out.c_str());
+ fprintf(file, "%s", tmp_out.c_str());
}
else {
string sgml_string;
}
/* needed if there is an optional argument but no contents */
-#ifdef NEW_TEXT
if (main_body > 0 && main_body == par->size()) {
font1 = style.font;
}
-#else
- if (main_body > 0 && main_body == par->last) {
- font1 = style.font;
- }
-#endif
+
/* pop all defined Styles */
for (j = stack_num; j >= 0; j--) {
linux_doc_line_break(file,
/* insert an error marker in text */
new_inset = new InsetError(message);
- par->InsertChar(pos, LYX_META_INSET);
+ par->InsertChar(pos, LyXParagraph::META_INSET);
par->InsertInset(pos, new_inset);
}
{
LyXParagraph * par = paragraph;
- string top_element=textclasslist.LatexnameOfClass(params.textclass);
+ string top_element= textclasslist.LatexnameOfClass(params.textclass);
string environment_stack[MAX_NEST_LEVEL];
string environment_inner[MAX_NEST_LEVEL];
string command_stack[MAX_NEST_LEVEL];
- bool command_flag=false;
- int command_depth=0,command_base=0,cmd_depth=0;
+ bool command_flag= false;
+ int command_depth= 0, command_base= 0, cmd_depth= 0;
- string item_name,command_name;
- string c_depth,c_params,tmps;
+ string item_name, command_name;
+ string c_depth, c_params, tmps;
- int depth=0; /* paragraph depth */
+ int depth= 0; /* paragraph depth */
FilePtr file(filename, FilePtr::write);
tex_code_break_column = column;
if (params.preamble.empty())
fprintf(file, ">\n\n");
else
- fprintf(file, "\n [ %s \n]>\n\n",params.preamble.c_str() );
+ fprintf(file, "\n [ %s \n]>\n\n", params.preamble.c_str() );
string userName(getUserName());
fprintf(file,
fprintf(file, "by <%s> %s -->\n", userName.c_str(), (char *)date());
if(params.options.empty())
- sgmlOpenTag(file,0,top_element);
+ sgmlOpenTag(file, 0, top_element);
else {
string top = top_element;
top += " ";
top += params.options;
- sgmlOpenTag(file,0,top);
+ sgmlOpenTag(file, 0, top);
}
while (par) {
- int desc_on=0; /* description mode*/
+ int desc_on= 0; /* description mode*/
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(),
par->layout);
par->AutoDeleteInsets();
/* environment tag closing */
for( ;depth > par->depth; depth--) {
if(environment_inner[depth] != "!-- --") {
- item_name="listitem";
- sgmlCloseTag(file,command_depth+depth,
+ item_name= "listitem";
+ sgmlCloseTag(file, command_depth+depth,
item_name);
if( environment_inner[depth] == "varlistentry")
- sgmlCloseTag(file,depth+command_depth,
+ sgmlCloseTag(file, depth+command_depth,
environment_inner[depth]);
}
- sgmlCloseTag(file,depth+command_depth,
+ sgmlCloseTag(file, depth+command_depth,
environment_stack[depth]);
environment_stack[depth].clear();
environment_inner[depth].clear();
&& environment_stack[depth] != style.latexname()
&& !environment_stack[depth].empty()) {
if(environment_inner[depth] != "!-- --") {
- item_name="listitem";
- sgmlCloseTag(file,command_depth+depth,
+ item_name= "listitem";
+ sgmlCloseTag(file, command_depth+depth,
item_name);
if( environment_inner[depth] == "varlistentry")
- sgmlCloseTag(file,depth+command_depth,
+ sgmlCloseTag(file, depth+command_depth,
environment_inner[depth]);
}
- sgmlCloseTag(file,depth+command_depth,
+ sgmlCloseTag(file, depth+command_depth,
environment_stack[depth]);
environment_stack[depth].clear();
break;
case LATEX_COMMAND:
- if (depth!=0)
+ if (depth!= 0)
LinuxDocError(par, 0,
_("Error : Wrong depth for "
"LatexType Command.\n"));
tmps = style.latexparam();
c_params = split(tmps, c_depth,'|');
- cmd_depth=atoi(c_depth.c_str());
+ cmd_depth= atoi(c_depth.c_str());
if(command_flag) {
if(cmd_depth<command_base) {
for(int j = command_depth;
j >= command_base; j--)
if(!command_stack[j].empty())
- sgmlCloseTag(file,j,command_stack[j]);
- command_depth=command_base=cmd_depth;
+ sgmlCloseTag(file, j, command_stack[j]);
+ command_depth= command_base= cmd_depth;
}
- else if(cmd_depth<=command_depth) {
+ else if(cmd_depth<= command_depth) {
for(int j= command_depth;
j >= cmd_depth; j--)
if(!command_stack[j].empty())
- sgmlCloseTag(file,j,command_stack[j]);
- command_depth=cmd_depth;
+ sgmlCloseTag(file, j, command_stack[j]);
+ command_depth= cmd_depth;
}
else
- command_depth=cmd_depth;
+ command_depth= cmd_depth;
}
else {
command_depth = command_base = cmd_depth;
command_flag = true;
}
- command_stack[command_depth]=command_name;
+ command_stack[command_depth]= command_name;
// treat label as a special case for
// more WYSIWYM handling.
- if (par->GetChar(0) == LYX_META_INSET) {
+ if (par->GetChar(0) == LyXParagraph::META_INSET) {
Inset *inset = par->GetInset(0);
char lyx_code = inset->LyxCode();
- if (lyx_code ==Inset::LABEL_CODE){
- command_name+= " id=\"";
- command_name+=((InsetCommand *) inset)->getContents();
- command_name+="\"";
- desc_on=3;
+ if (lyx_code == Inset::LABEL_CODE){
+ command_name+= " id= \"";
+ command_name+= ((InsetCommand *) inset)->getContents();
+ command_name+= "\"";
+ desc_on= 3;
}
}
- sgmlOpenTag(file,depth+command_depth, command_name);
- item_name="title";
- sgmlOpenTag(file,depth+1+command_depth,item_name);
+ sgmlOpenTag(file, depth+command_depth, command_name);
+ item_name= "title";
+ sgmlOpenTag(file, depth+1+command_depth, item_name);
break;
case LATEX_ENVIRONMENT:
environment_stack[depth]);
} else {
if(environment_inner[depth] != "!-- --") {
- item_name="listitem";
+ item_name= "listitem";
sgmlCloseTag(file,
command_depth + depth,
item_name);
break;
}
- desc_on =(style.labeltype == LABEL_MANUAL);
+ desc_on = (style.labeltype == LABEL_MANUAL);
if(desc_on)
- environment_inner[depth]="varlistentry";
+ environment_inner[depth]= "varlistentry";
else
- environment_inner[depth]="listitem";
+ environment_inner[depth]= "listitem";
- sgmlOpenTag(file,depth+1+command_depth,
+ sgmlOpenTag(file, depth+1+command_depth,
environment_inner[depth]);
if(desc_on) {
- item_name="term";
- sgmlOpenTag(file,depth+1+command_depth,
+ item_name= "term";
+ sgmlOpenTag(file, depth+1+command_depth,
item_name);
}
else {
- item_name="para";
- sgmlOpenTag(file,depth+1+command_depth,
+ item_name= "para";
+ sgmlOpenTag(file, depth+1+command_depth,
item_name);
}
break;
}
do {
- string tmp_par,extra_par;
+ string tmp_par, extra_par;
- SimpleDocBookOnePar(tmp_par,extra_par, par, desc_on,
+ SimpleDocBookOnePar(tmp_par, extra_par, par, desc_on,
depth+1+command_depth);
- fprintf(file,"%s",tmp_par.c_str());
+ fprintf(file, "%s", tmp_par.c_str());
par = par->next;
- DocBookHandleFootnote(file,par, depth+1+command_depth);
+ DocBookHandleFootnote(file, par, depth+1+command_depth);
}
while(par && par->IsDummy());
style.latexparam());
break;
case LATEX_ITEM_ENVIRONMENT:
- if(desc_on==1) break;
- end_tag="para";
- sgmlCloseTag(file,depth+1+command_depth,end_tag);
+ if(desc_on == 1) break;
+ end_tag= "para";
+ sgmlCloseTag(file, depth+1+command_depth, end_tag);
break;
case LATEX_PARAGRAPH:
if(style.latexname() != "dummy")
style.latexname());
break;
default:
- sgmlCloseTag(file,depth+command_depth,
+ sgmlCloseTag(file, depth+command_depth,
style.latexname());
break;
}
}
// Close open tags
- for(;depth>=0;depth--) {
+ for(;depth>= 0;depth--) {
if(!environment_stack[depth].empty()) {
if(environment_inner[depth] != "!-- --") {
- item_name="listitem";
- sgmlCloseTag(file,command_depth+depth,
+ item_name= "listitem";
+ sgmlCloseTag(file, command_depth+depth,
item_name);
if( environment_inner[depth] == "varlistentry")
- sgmlCloseTag(file,depth+command_depth,
+ sgmlCloseTag(file, depth+command_depth,
environment_inner[depth]);
}
- sgmlCloseTag(file,depth+command_depth,
+ sgmlCloseTag(file, depth+command_depth,
environment_stack[depth]);
}
}
- for(int j=command_depth;j>=command_base;j--)
+ for(int j= command_depth;j>= command_base;j--)
if(!command_stack[j].empty())
- sgmlCloseTag(file,j,command_stack[j]);
+ sgmlCloseTag(file, j, command_stack[j]);
fprintf(file, "\n\n");
- sgmlCloseTag(file,0,top_element);
+ sgmlCloseTag(file, 0, top_element);
if (file.close()) {
WriteFSAlert(_("Error! Could not close file properly:"),
par->SimpleDocBookOneTablePar(file, extra, desc_on, depth);
return;
}
- LyXFont font1,font2;
+ LyXFont font1, font2;
char c;
Inset *inset;
-#ifdef NEW_TEXT
LyXParagraph::size_type main_body;
int j;
-#else
- int main_body, j;
-#endif
- string emph="emphasis";
- bool emph_flag=false;
- int char_line_count=0;
+ string emph= "emphasis";
+ bool emph_flag= false;
+ int char_line_count= 0;
- LyXLayout const & style = textclasslist.Style(params.textclass, par->GetLayout());
+ LyXLayout const & style = textclasslist.Style(params.textclass,
+ par->GetLayout());
if (style.labeltype != LABEL_MANUAL)
main_body = 0;
char_line_count = depth;
if(!style.free_spacing)
- for (j=0;j< depth;j++)
+ for (j= 0;j< depth;j++)
file += ' ';
/* parsing main loop */
-#ifdef NEW_TEXT
for (LyXParagraph::size_type i = 0;
i < par->size(); ++i) {
-#else
- for (int i = 0; i < par->last; i++) {
-#endif
font2 = par->getFont(i);
/* handle <emphasis> tag */
if (font1.emph() != font2.emph() && i) {
if (font2.emph() == LyXFont::ON) {
file += "<emphasis>";
- emph_flag=true;
+ emph_flag= true;
}else {
file += "</emphasis>";
- emph_flag=false;
+ emph_flag= false;
}
}
c = par->GetChar(i);
- if (c == LYX_META_INSET) {
+ if (c == LyXParagraph::META_INSET) {
inset = par->GetInset(i);
string tmp_out;
inset->DocBook(tmp_out);
// This code needs some explanation:
// Two insets are treated specially
// label if it is the first element in a command paragraph
- // desc_on==3
+ // desc_on == 3
// graphics inside tables or figure floats can't go on
// title (the equivalente in latex for this case is caption
// and title should come first
- // desc_on==4
+ // desc_on == 4
//
- if(desc_on!=3 || i!=0) {
- if(tmp_out[0]=='@') {
- if(desc_on==4)
+ if(desc_on!= 3 || i!= 0) {
+ if(tmp_out[0] == '@') {
+ if(desc_on == 4)
extra += frontStrip(tmp_out, '@');
else
file += frontStrip(tmp_out, '@');
file += tmp_out;
}
} else if (font2.latex() == LyXFont::ON) {
- // "TeX"-Mode on ==> SGML-Mode on.
- if (c!='\0')
+ // "TeX"-Mode on == > SGML-Mode on.
+ if (c!= '\0')
file += c;
char_line_count++;
}
}
/* needed if there is an optional argument but no contents */
-#ifdef NEW_TEXT
if (main_body > 0 && main_body == par->size()) {
font1 = style.font;
}
-#else
- if (main_body > 0 && main_body == par->last) {
- font1 = style.font;
- }
-#endif
if (emph_flag) {
file += "</emphasis>";
}
LyXCursor cursor = text->cursor;
// This is drastic, but it's the only fix, I could find. (Asger)
- AllFloats(1,0);
- AllFloats(1,1);
+ AllFloats(1, 0);
+ AllFloats(1, 1);
for (TeXErrors::Errors::const_iterator cit = terr.begin();
cit != terr.end();
font1 = LyXFont(LyXFont::ALL_INHERIT),
font2;
Inset * inset;
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
-#else
- int i;
-#endif
int
j,
cell = 0;
FILE
* fp, * fp2;
- string fname1 = TmpFileName(string(),"RAT1");
- string fname2 = TmpFileName(string(),"RAT2");
- if (!(fp=fopen(fname1.c_str(),"w"))) {
+ string fname1 = TmpFileName(string(), "RAT1");
+ string fname2 = TmpFileName(string(), "RAT2");
+ if (!(fp= fopen(fname1.c_str(), "w"))) {
WriteAlert(_("LYX_ERROR:"),
_("Cannot open temporary file:"), fname1);
return;
}
par->table->RoffEndOfCell(fp, -1);
-#ifdef NEW_TEXT
for (i = 0; i < par->size(); ++i) {
-#else
- for (i = 0; i < par->last; ++i) {
-#endif
c = par->GetChar(i);
if (par->table->IsContRow(cell)) {
- if (c == LYX_META_NEWLINE)
+ if (c == LyXParagraph::META_NEWLINE)
cell++;
continue;
}
continue;
}
switch (c) {
- case LYX_META_INSET:
+ case LyXParagraph::META_INSET:
if ((inset = par->GetInset(i))) {
- if (!(fp2=fopen(fname2.c_str(),"w+"))) {
+ if (!(fp2= fopen(fname2.c_str(), "w+"))) {
WriteAlert(_("LYX_ERROR:"),
_("Cannot open temporary file:"), fname2);
fclose(fp);
c = fgetc(fp2);
while(!feof(fp2)) {
if (c == '\\')
- fprintf(fp,"\\\\");
+ fprintf(fp, "\\\\");
else
- fputc(c,fp);
+ fputc(c, fp);
c = fgetc(fp2);
}
fclose(fp2);
}
break;
- case LYX_META_NEWLINE:
- if (par->table->CellHasContRow(cell)>=0)
- par->RoffContTableRows(fp, i+1,cell);
+ case LyXParagraph::META_NEWLINE:
+ if (par->table->CellHasContRow(cell)>= 0)
+ par->RoffContTableRows(fp, i+1, cell);
par->table->RoffEndOfCell(fp, cell);
cell++;
break;
- case LYX_META_HFILL:
+ case LyXParagraph::META_HFILL:
break;
- case LYX_META_PROTECTED_SEPARATOR:
+ case LyXParagraph::META_PROTECTED_SEPARATOR:
break;
case '\\':
fprintf(fp, "\\\\");
if (!(lyxerr.debugging(Debug::ROFF))) {
remove(fname1.c_str());
}
- if (!(fp=fopen(fname2.c_str(),"r"))) {
+ if (!(fp= fopen(fname2.c_str(), "r"))) {
WriteFSAlert(_("Error! Can't open temporary file:"), fname2);
return;
}
while(!feof(fp) && (c == '\n'))
c = fgetc(fp);
while(!feof(fp)) {
- for(j=0; j<par->depth; j++)
+ for(j= 0; j<par->depth; j++)
fprintf(file, " ");
while(!feof(fp) && (c != '\n')) {
- fputc(c,file);
+ fputc(c, file);
c = fgetc(fp);
}
- fputc('\n',file);
+ fputc('\n', file);
// overread trailing blank lines
while(!feof(fp) && (c == '\n'))
c = fgetc(fp);
users->updateScrollbar();
}
- if (f==1 || f==-1) {
+ if (f == 1 || f == -1) {
if (isLyxClean()) {
markDirty();
users->owner()->getMiniBuffer()->setTimer(4);
void Buffer::validate(LaTeXFeatures & features)
{
LyXParagraph * par = paragraph;
- LyXTextClass const & tclass =
+ LyXTextClass const & tclass =
textclasslist.TextClass(params.textclass);
// AMS Style is at document level
if (font == 1) {
features.amssymb = true;
}
- else if ((font >= 2 && font <=5)) {
+ else if ((font >= 2 && font <= 5)) {
features.pifont = true;
}
}
void Buffer::setPaperStuff()
{
- params.papersize = PAPER_DEFAULT;
+ params.papersize = BufferParams::PAPER_DEFAULT;
char c1 = params.paperpackage;
- if (c1 == PACKAGE_NONE) {
+ if (c1 == BufferParams::PACKAGE_NONE) {
char c2 = params.papersize2;
- if (c2 == VM_PAPER_USLETTER)
- params.papersize = PAPER_USLETTER;
- else if (c2 == VM_PAPER_USLEGAL)
- params.papersize = PAPER_LEGALPAPER;
- else if (c2 == VM_PAPER_USEXECUTIVE)
- params.papersize = PAPER_EXECUTIVEPAPER;
- else if (c2 == VM_PAPER_A3)
- params.papersize = PAPER_A3PAPER;
- else if (c2 == VM_PAPER_A4)
- params.papersize = PAPER_A4PAPER;
- else if (c2 == VM_PAPER_A5)
- params.papersize = PAPER_A5PAPER;
- else if ((c2 == VM_PAPER_B3) || (c2 == VM_PAPER_B4) ||
- (c2 == VM_PAPER_B5))
- params.papersize = PAPER_B5PAPER;
- } else if ((c1 == PACKAGE_A4) || (c1 == PACKAGE_A4WIDE) ||
- (c1 == PACKAGE_WIDEMARGINSA4))
- params.papersize = PAPER_A4PAPER;
+ if (c2 == BufferParams::VM_PAPER_USLETTER)
+ params.papersize = BufferParams::PAPER_USLETTER;
+ else if (c2 == BufferParams::VM_PAPER_USLEGAL)
+ params.papersize = BufferParams::PAPER_LEGALPAPER;
+ else if (c2 == BufferParams::VM_PAPER_USEXECUTIVE)
+ params.papersize = BufferParams::PAPER_EXECUTIVEPAPER;
+ else if (c2 == BufferParams::VM_PAPER_A3)
+ params.papersize = BufferParams::PAPER_A3PAPER;
+ else if (c2 == BufferParams::VM_PAPER_A4)
+ params.papersize = BufferParams::PAPER_A4PAPER;
+ else if (c2 == BufferParams::VM_PAPER_A5)
+ params.papersize = BufferParams::PAPER_A5PAPER;
+ else if ((c2 == BufferParams::VM_PAPER_B3) || (c2 == BufferParams::VM_PAPER_B4) ||
+ (c2 == BufferParams::VM_PAPER_B5))
+ params.papersize = BufferParams::PAPER_B5PAPER;
+ } else if ((c1 == BufferParams::PACKAGE_A4) || (c1 == BufferParams::PACKAGE_A4WIDE) ||
+ (c1 == BufferParams::PACKAGE_WIDEMARGINSA4))
+ params.papersize = BufferParams::PAPER_A4PAPER;
}
+#if 0
void Buffer::setOldPaperStuff()
{
char c = params.papersize = params.papersize2;
- params.papersize2 = VM_PAPER_DEFAULT;
- params.paperpackage = PACKAGE_NONE;
+ params.papersize2 = BufferParams::VM_PAPER_DEFAULT;
+ params.paperpackage = BufferParams::PACKAGE_NONE;
if (c == OLD_PAPER_A4PAPER)
- params.papersize2 = VM_PAPER_A4;
+ params.papersize2 = BufferParams::VM_PAPER_A4;
else if (c == OLD_PAPER_A4)
- params.paperpackage = PACKAGE_A4;
+ params.paperpackage = BufferParams::PACKAGE_A4;
else if (c == OLD_PAPER_A4WIDE)
- params.paperpackage = PACKAGE_A4WIDE;
+ params.paperpackage = BufferParams::PACKAGE_A4WIDE;
else if (c == OLD_PAPER_WIDEMARGINSA4)
- params.paperpackage = PACKAGE_WIDEMARGINSA4;
+ params.paperpackage = BufferParams::PACKAGE_WIDEMARGINSA4;
else if (c == OLD_PAPER_USLETTER)
- params.papersize2 = VM_PAPER_USLETTER;
+ params.papersize2 = BufferParams::VM_PAPER_USLETTER;
else if (c == OLD_PAPER_A5PAPER)
- params.papersize2 = VM_PAPER_A5;
+ params.papersize2 = BufferParams::VM_PAPER_A5;
else if (c == OLD_PAPER_B5PAPER)
- params.papersize2 = VM_PAPER_B5;
+ params.papersize2 = BufferParams::VM_PAPER_B5;
else if (c == OLD_PAPER_EXECUTIVEPAPER)
- params.papersize2 = VM_PAPER_USEXECUTIVE;
+ params.papersize2 = BufferParams::VM_PAPER_USEXECUTIVE;
else if (c == OLD_PAPER_LEGALPAPER)
- params.papersize2 = VM_PAPER_USLEGAL;
+ params.papersize2 = BufferParams::VM_PAPER_USLEGAL;
setPaperStuff();
}
-
+#endif
void Buffer::insertInset(Inset * inset, string const & lout,
bool no_table)
insertInset(new_inset);
text->CursorLeft();
update(1);
- new_inset->Edit(0,0);
+ new_inset->Edit(0, 0);
}
{
string lst;
LyXParagraph * par = paragraph;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos;
-#else
- int pos;
-#endif
Inset * inset;
while (par){
pos = -1;
while ((inset = par->ReturnNextInsetPointer(pos))){
- if (inset->LyxCode()==Inset::INCLUDE_CODE) {
- InsetInclude * insetinc =
+ if (inset->LyxCode() == Inset::INCLUDE_CODE) {
+ InsetInclude * insetinc =
static_cast<InsetInclude*>(inset);
if (insetinc->isInclude()
&& insetinc->isNoLoad()) {
}
LyXParagraph *par = paragraph;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos;
-#else
- int pos;
-#endif
Inset * inset;
string lst;
while (par){
par = paragraph;
while (par) {
Inset * inset;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = -1;
-#else
- int pos = -1;
-#endif
// Search for Bibtex or Include inset
while ((inset = par->ReturnNextInsetPointer(pos))) {
- if (inset-> LyxCode()==Inset::BIBTEX_CODE) {
+ if (inset-> LyxCode() == Inset::BIBTEX_CODE) {
if (!bibkeys.empty())
bibkeys += delim;
- bibkeys += ((InsetBibtex*)inset)->getKeys();
- } else if (inset-> LyxCode()==Inset::INCLUDE_CODE) {
- string bk = ((InsetInclude*)inset)->getKeys();
+ bibkeys += static_cast<InsetBibtex*>(inset)->getKeys();
+ } else if (inset-> LyxCode() == Inset::INCLUDE_CODE) {
+ string bk = static_cast<InsetInclude*>(inset)->getKeys();
if (!bk.empty()) {
if (!bibkeys.empty())
bibkeys += delim;
{
LyXParagraph * par = paragraph;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos;
-#else
- int pos;
-#endif
Inset * inset;
while (par) {
pos = -1;
while ((inset = par->ReturnNextInsetPointer(pos))){
for (int i = 0; i < inset->GetNumberOfLabels(); i++) {
- if (label==inset->getLabel(i)) {
+ if (label == inset->getLabel(i)) {
BeforeChange();
text->SetCursor(par, pos);
text->sel_cursor = text->cursor;
// -*- C++ -*-
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
* Copyright (C) 1995 Matthias Ettrich
* This file is Copyleft (C) 1996
* Lars Gullik Bjønnes
*
-*======================================================*/
+* ====================================================== */
// Change Log:
-// ===========
+// ===========
// 23/03/98 Heinrich Bauer (heinrich.bauer@t-mobil.de)
// Spots marked "changed Heinrich Bauer, 23/03/98" modified due to the
// following bug: dvi file export did not work after printing (or previewing)
/**@name Constructors and destructor */
//@{
///
- Buffer(string const & file, LyXRC * lyxrc = 0, bool b= false);
+ Buffer(string const & file, LyXRC * lyxrc = 0, bool b = false);
///
~Buffer();
Later this func will insert the BufferView into a real list,
not just setting a pointer.
*/
- void addUser(BufferView *u) { users = u; }
+ void addUser(BufferView * u) { users = u; }
/** Removes the BufferView from the users list.
Since we only can have one at the moment, we just reset it.
void update(signed char f);
///
- void redraw(void){
+ void redraw() {
users->redraw();
users->fitCursor();
- users->updateScrollbar(); }
+ users->updateScrollbar();
+ }
/// Open and lock an updatable inset
- void open_new_inset(UpdatableInset*);
+ void open_new_inset(UpdatableInset *);
///
void loadAutoSaveFile();
/** Reads a file.
Returns false if it fails.
If par is given, the file is inserted. */
- bool readFile(LyXLex &, LyXParagraph *par = 0);
+ bool readFile(LyXLex &, LyXParagraph * par = 0);
/** Reads a file without header.
Returns false, if file is not completely read.
If par is given, the file is inserted. */
- bool readLyXformat2(LyXLex &,LyXParagraph *par = 0);
+ bool readLyXformat2(LyXLex &, LyXParagraph * par = 0);
/// Inserts a lyx file at cursor position. Returns false if it fails.
bool insertLyXFile(string const & filename);
}
/// returns true if the buffer contains a LaTeX document
- bool isLatex();
+ bool isLatex() const;
/// returns true if the buffer contains a LinuxDoc document
- bool isLinuxDoc();
+ bool isLinuxDoc() const;
/// returns true if the buffer contains a DocBook document
- bool isDocBook();
+ bool isDocBook() const;
/// returns true if the buffer contains either a LinuxDoc or DocBook document
- bool isSGML();
+ bool isSGML() const;
/// returns true if the buffer contains a Wed document
- bool isLiterate();
+ bool isLiterate() const;
///
void setPaperStuff();
+#if 0
///
void setOldPaperStuff();
+#endif
/** Validate a buffer for LaTeX.
This validates the buffer, and returns a struct for use by
points to coresponding \labels). It should perhaps inset "error"
insets to help the user correct obvious mistakes.
*/
- void validate(LaTeXFeatures&); //the correct parameters to be
- //included later
+ void validate(LaTeXFeatures &); //the correct parameters to be
+ //included later
/** Insert an inset into the buffer
Insert inset into buffer, placing it in a layout of lout,
if no_table make sure that it doesn't end up in a table. */
- void insertInset(Inset *, string const &lout=string(),
+ void insertInset(Inset *, string const & lout = string(),
bool no_table = false);
///
void setCursorFromRow (int);
///
- string getIncludeonlyList(char delim=',');
+ string getIncludeonlyList(char delim = ',');
///
- string getReferenceList(char delim='|');
+ string getReferenceList(char delim = '|');
///
- string getBibkeyList(char delim='|');
+ string getBibkeyList(char delim = '|');
///
- bool gotoLabel(const string&);
+ bool gotoLabel(string const &);
/// removes all autodeletable insets
bool removeAutoInsets();
/** This will clearly have to change later. Later we can have more
than one user per buffer. */
- BufferView* getUser() const { return users; }
+ BufferView * getUser() const { return users; }
//@}
/** is a list of paragraphs.
*/
- LyXParagraph *paragraph;
+ LyXParagraph * paragraph;
/** This holds the mapping between buffer paragraphs and screen rows.
Should be moved to BufferView. (Asger)
*/
- LyXText *text;
+ LyXText * text;
///
- UpdatableInset* the_locking_inset;
+ UpdatableInset * the_locking_inset;
/// RCS object
LyXVC lyxvc;
void insertErrors(TeXErrors &);
///
- void linuxDocHandleFootnote(FILE *file,LyXParagraph* &par, int const depth);
+ void linuxDocHandleFootnote(FILE * file,
+ LyXParagraph * & par, int const depth);
///
- void DocBookHandleCaption(FILE *file, string &inner_tag,
+ void DocBookHandleCaption(FILE * file, string & inner_tag,
int const depth, int desc_on,
- LyXParagraph* &par);
+ LyXParagraph * &par);
///
- void DocBookHandleFootnote(FILE *file,LyXParagraph* &par, int const depth);
+ void DocBookHandleFootnote(FILE * file,
+ LyXParagraph * & par, int const depth);
///
- void sgmlOpenTag(FILE * file,int depth,string const & latexname) const;
+ void sgmlOpenTag(FILE * file, int depth,
+ string const & latexname) const;
///
- void sgmlCloseTag(FILE * file,int depth,string const & latexname) const;
+ void sgmlCloseTag(FILE * file, int depth,
+ string const & latexname) const;
///
- void LinuxDocError(LyXParagraph *par, int pos, char const *message);
+ void LinuxDocError(LyXParagraph * par, int pos, char const * message);
///
- void SimpleLinuxDocOnePar(FILE *file, LyXParagraph *par, int desc_on, int const depth);
+ void SimpleLinuxDocOnePar(FILE * file, LyXParagraph * par,
+ int desc_on, int const depth);
///
- void SimpleDocBookOnePar(string &file, string &extra, LyXParagraph *par, int & desc_on, int const depth);
+ void SimpleDocBookOnePar(string & file, string & extra,
+ LyXParagraph * par, int & desc_on,
+ int const depth);
/// LinuxDoc.
- void push_tag(FILE *file, char const *tag, int& pos, char stack[5][3]);
+ void push_tag(FILE * file, char const * tag,
+ int & pos, char stack[5][3]);
/// LinuxDoc.
- void pop_tag(FILE *file, char const * tag, int& pos, char stack[5][3]);
+ void pop_tag(FILE * file, char const * tag,
+ int & pos, char stack[5][3]);
///
- void RoffAsciiTable(FILE *file, LyXParagraph *par);
+ void RoffAsciiTable(FILE * file, LyXParagraph * par);
/// is save needed
bool lyx_clean;
/// is autosave needed
bool bak_clean;
- /// do we need to run LaTeX, changed 23/03/98, Heinrich Bauer
- /// We have to distinguish between TeX-runs executed in the original
- /// directory (in which the original LyX-file resides) and TeX-runs
- /// executed in a temporary directory. The first situation is valid
- /// for a dvi-export, the latter one for printing or previewing.
+ /** do we need to run LaTeX, changed 23/03/98, Heinrich Bauer
+ We have to distinguish between TeX-runs executed in the original
+ directory (in which the original LyX-file resides) and TeX-runs
+ executed in a temporary directory. The first situation is valid
+ for a dvi-export, the latter one for printing or previewing. */
bool dvi_clean_orgd;
bool dvi_clean_tmpd;
bool nw_clean;
/// is regenerating .tex necessary
- DEPCLEAN *dep_clean;
+ DEPCLEAN * dep_clean;
/// buffer is r/o
bool read_only;
buffer->lyx_gui->bufferview->updateLayoutChoice. Just ask each
of the buffers in the list of users to do a updateLayoutChoice.
*/
- BufferView *users;
+ BufferView * users;
///
friend class BufferList;
inline
-void Buffer::setParentName(string const &name)
+void Buffer::setParentName(string const & name)
{
params.parentname = name;
}
-
#endif
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Word Processor
*
* This file is Copyright 1996-1999
* Lars Gullik Bjønnes
*
- * ======================================================
+ * ======================================================
*/
#ifdef __GNUG__
BufferStorage::BufferStorage()
{
// Initialize the buffer array
- for (int i=NUMBER_OF_BUFFERS-1; i >=0; i--) {
+ for (int i = NUMBER_OF_BUFFERS-1; i >= 0; i--) {
buffer[i] = 0;
}
}
#ifndef NEW_STORE
bool BufferStorage::isEmpty()
{
- for (int i=NUMBER_OF_BUFFERS-1; i >=0; i--) {
+ for (int i = NUMBER_OF_BUFFERS-1; i >= 0; i--) {
if (buffer[i]) return false;
}
return true;
container.push_back(tmpbuf);
return tmpbuf;
#else
- int i=0;
+ int i = 0;
while (i < NUMBER_OF_BUFFERS - 1
&& buffer[i]) i++;
buffer[i] = new Buffer(s, lyxrc, ronly);
Buffer * BufferStorage_Iter::operator[] (int a)
{
- // a is >=1
+ // a is >= 1
if (a <= 0) return 0;
int i = 0;
break;
case 2: // No
askMoreConfirmation = true;
- unsaved += MakeDisplayPath((*it)->filename,50);
+ unsaved += MakeDisplayPath((*it)->filename, 50);
unsaved += "\n";
break;
case 3: // Cancel
while ((b = biter())) {
if (!b->isLyxClean()) {
switch(AskConfirmation(_("Changes in document:"),
- MakeDisplayPath(b->filename,50),
+ MakeDisplayPath(b->filename, 50),
_("Save document?"))) {
case 1: // Yes
MenuWrite(b);
break;
case 2: // No
askMoreConfirmation = true;
- unsaved += MakeDisplayPath(b->filename,50);
+ unsaved += MakeDisplayPath(b->filename, 50);
unsaved += "\n";
break;
case 3: // Cancel
bool BufferList::write(Buffer * buf, bool makeBackup)
{
minibuffer->Set(_("Saving document"),
- MakeDisplayPath(buf->filename),"...");
+ MakeDisplayPath(buf->filename), "...");
// We don't need autosaves in the immediate future. (Asger)
buf->resetAutosaveTimers();
if (finfo.exist()) {
mode_t fmode = finfo.getMode();
- struct utimbuf *times =
+ struct utimbuf *times =
(struct utimbuf*)new char[sizeof(struct utimbuf)];
times->actime = finfo.getAccessTime();
times->modtime = finfo.getModificationTime();
long blksize = finfo.getBlockSize();
lyxerr.debug() << "BlockSize: " << blksize << endl;
- FilePtr fin(buf->filename,FilePtr::read);
- FilePtr fout(s,FilePtr::truncate);
+ FilePtr fin(buf->filename, FilePtr::read);
+ FilePtr fout(s, FilePtr::truncate);
if (fin() && fout()) {
char * cbuf = new char[blksize+1];
size_t c_read = 0;
do {
c_read = fread(cbuf, 1, blksize, fin);
if (c_read != 0)
- c_write =
+ c_write =
fwrite(cbuf, 1, c_read, fout);
} while (c_read);
fin.close();
}
}
- if (buf->writeFile(buf->filename,false)) {
+ if (buf->writeFile(buf->filename, false)) {
buf->markLyxClean();
minibuffer->Set(_("Document saved as"),
if (buf->paragraph && !buf->isLyxClean() && !quitting) {
ProhibitInput();
switch(AskConfirmation(_("Changes in document:"),
- MakeDisplayPath(buf->filename,50),
+ MakeDisplayPath(buf->filename, 50),
_("Save document?"))){
case 1: // Yes
if (write(buf)) {
++ant;
}
#endif
- if (ant == 0) fl_addtopup(pup,_("No Documents Open!%t"));
+ if (ant == 0) fl_addtopup(pup, _("No Documents Open!%t"));
}
}
#else
BufferStorage_Iter biter(bstore);
- Buffer *b=0;
- while ((b=biter())) {
+ Buffer *b = 0;
+ while ((b = biter())) {
if (b->text && b->text->UpdateInset(inset)) {
if (mark_dirty)
b->markDirty();
if (!inset) return 1;
BufferStorage_Iter biter(bstore);
- Buffer *b=0;
- while ((b=biter())) {
+ Buffer *b = 0;
+ while ((b = biter())) {
if (b->the_locking_inset == inset) {
b->InsetUnlock();
return 0;
}
#else
BufferStorage_Iter biter(bstore);
- Buffer *b=0;
- while ((b=biter())) {
+ Buffer *b = 0;
+ while ((b = biter())) {
if (!b->isDepClean(mastertmpdir)) {
string writefile = mastertmpdir;
writefile += '/';
writefile += ChangeExtension(b->getFileName(), ".tex", true);
- b->makeLaTeXFile(writefile,mastertmpdir,false,true);
+ b->makeLaTeXFile(writefile, mastertmpdir, false, true);
b->markDepClean(mastertmpdir);
}
}
for (BufferStorage::iterator it = bstore.begin();
it != bstore.end(); ++it) {
if (!(*it)->isLyxClean()) {
- bool madeit=false;
+ bool madeit = false;
lyxerr <<_("lyx: Attempting to save"
" document ")
lyxerr << " " << i + 1 << ") " << s << endl;
- if ((*it)->writeFile(s,true)) {
+ if ((*it)->writeFile(s, true)) {
(*it)->markLyxClean();
lyxerr << _(" Save seems successful. "
"Phew.") << endl;
<< b->filename
<< _(" as...") << endl;
- for (int i=0; i<3 && !madeit; i++) {
+ for (int i = 0; i<3 && !madeit; i++) {
string s;
// We try to save three places:
lyxerr << " " << i + 1 << ") " << s << endl;
- if (b->writeFile(s,true)) {
+ if (b->writeFile(s, true)) {
b->markLyxClean();
lyxerr << _(" Save seems successful. Phew.") << endl;
madeit = true;
if (fileInfoE.getModificationTime()
> fileInfo2.getModificationTime()) {
if (AskQuestion(_("An emergency save of this document exists!"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Try to load that instead?"))) {
ts = e;
// the file is not saved if we load the
if (fileInfoA.getModificationTime()
> fileInfo2.getModificationTime()) {
if (AskQuestion(_("Autosave file is newer."),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Load that one instead?"))) {
ts = a;
// the file is not saved if we load the
}
if (!tname.empty() && IsLyXFilename(tname)){
bool templateok = false;
- LyXLex lex(0,0);
+ LyXLex lex(0, 0);
lex.setFile(tname);
if (lex.IsOK()) {
if (b->readFile(lex)) {
}
}
if (!templateok) {
- WriteAlert(_("Error!"),_("Unable to open template"),
+ WriteAlert(_("Error!"), _("Unable to open template"),
MakeDisplayPath(tname));
// no template, start with empty buffer
b->paragraph = new LyXParagraph;
-#ifdef NEW_TEXT
- b->paragraph->text.reserve(500);
-#endif
}
}
else { // start with empty buffer
b->paragraph = new LyXParagraph;
-#ifdef NEW_TEXT
- b->paragraph->text.reserve(500);
-#endif
}
b->markDirty();
s = ChangeExtension (s, ".lyx", false);
} else { // sgml2lyx failed
WriteAlert(_("Error!"),
- _("Could not convert file"),s);
+ _("Could not convert file"), s);
return 0;
}
} else {
// file already open?
if (exists(s)) {
if (AskQuestion(_("Document is already open:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to reload that document?"))) {
// Reload is accomplished by closing and then loading
if (!close(getBuffer(s))) {
bool ro = false;
switch (IsFileWriteable(s)) {
case 0:
- minibuffer->Set(_("File `")+MakeDisplayPath(s,50)+
+ minibuffer->Set(_("File `")+MakeDisplayPath(s, 50)+
_("' is read-only."));
ro = true;
// Fall through
lyxerr << "Do you want to checkout?" << endl;
}
if (AskQuestion(_("Cannot open specified file:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Create new document with this name?")))
{
// Find a free buffer
- b = newFile(s,string());
+ b = newFile(s, string());
}
break;
}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* This file is Copyright 1996
* Lars Gullik Bjønnes
*
- * ======================================================*/
+ * ====================================================== */
#ifndef BUFFER_LIST_H
#define BUFFER_LIST_H
///
void release(Buffer * buf);
///
- Buffer* newBuffer(string const & s, LyXRC *, bool =false);
+ Buffer* newBuffer(string const & s, LyXRC *, bool = false);
private:
enum {
/** The max number of buffers there are possible to have
public:
///
BufferStorage_Iter(BufferStorage const & bs)
- { cs =& bs; index = 0;}
+ { cs = & bs; index = 0;}
/// next
Buffer* operator() ();
///
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include <cstdlib>
BufferParams::BufferParams()
{
- paragraph_separation = LYX_PARSEP_INDENT;
+ paragraph_separation = PARSEP_INDENT;
defskip = VSpace(VSpace::MEDSKIP);
quotes_language = InsetQuotes::EnglishQ;
quotes_times = InsetQuotes::DoubleQ;
user_defined_bullets[iter] = temp_bullets[iter]
= ITEMIZE_DEFAULTS[iter];
}
- allowAccents=false;
+ allowAccents = false;
}
-void BufferParams::Copy(BufferParams const &p)
-{
- paragraph_separation = p.paragraph_separation;
- defskip = p.defskip;
- quotes_language = p.quotes_language;
- quotes_times = p.quotes_times;
- fontsize = p.fontsize;
- textclass = p.textclass;
- papersize = p.papersize;
- papersize2 = p.papersize2;
- paperpackage = p.paperpackage;
- orientation = p.orientation;
- use_geometry = p.use_geometry;
- paperwidth = p.paperwidth;
- paperheight = p.paperheight;
- leftmargin = p.leftmargin;
- topmargin = p.topmargin;
- rightmargin = p.rightmargin;
- bottommargin = p.bottommargin;
- headheight = p.headheight;
- headsep = p.headsep;
- footskip = p.footskip;
- graphicsDriver = p.graphicsDriver;
- fonts = p.fonts;
- spacing = p.spacing;
- secnumdepth = p.secnumdepth;
- tocdepth = p.tocdepth;
- language = p.language;
- inputenc = p.inputenc;
- preamble = p.preamble;
- options = p.options;
- float_placement = p.float_placement;
- columns = p.columns;
- sides = p.sides;
- pagestyle = p.pagestyle;
-
- // WARNING destructor will deallocate paragraph!!
- // this is not good and will cause an error somewhere else.
- //paragraph = p.paragraph;
-
- for (int i = 0; i < 4; ++i) {
- temp_bullets[i] = p.temp_bullets[i];
- user_defined_bullets[i] = p.user_defined_bullets[i];
- }
-
- allowAccents=p.allowAccents;
- use_amsmath = p.use_amsmath;
-}
-
-
-void BufferParams::writeFile(FILE *file)
+void BufferParams::writeFile(FILE * file)
{
// The top of the file is written by the buffer.
// Prints out the buffer info into the .lyx file given by file
fprintf(file, "\\papersize %s\n", string_papersize[papersize2]);
fprintf(file, "\\paperpackage %s\n",
string_paperpackages[paperpackage]);
- fprintf(file, "\\use_geometry %d\n",use_geometry);
- fprintf(file, "\\use_amsmath %d\n",use_amsmath);
+ fprintf(file, "\\use_geometry %d\n", use_geometry);
+ fprintf(file, "\\use_amsmath %d\n", use_amsmath);
fprintf(file, "\\paperorientation %s\n",
string_orientation[orientation]);
if (!paperwidth.empty())
}
-void BufferParams::readPreamble(LyXLex &lex)
+void BufferParams::readPreamble(LyXLex & lex)
{
if (lex.GetString() != "\\begin_preamble")
lyxerr << "Error (BufferParams::readPreamble):"
}
-void BufferParams::readLanguage(LyXLex &lex)
+void BufferParams::readLanguage(LyXLex & lex)
{
string tmptok;
string test;
}
-void BufferParams::readGraphicsDriver(LyXLex &lex)
+void BufferParams::readGraphicsDriver(LyXLex & lex)
{
string tmptok;
string test;
- int n=0;
+ int n = 0;
if (!lex.next()) return;
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
#include "Bullet.h"
#include "insets/insetquotes.h"
#include "layout.h"
+#include "support/block.h"
/**
This class contains all the parameters for this a buffer uses. Some
*/
class BufferParams {
public:
+ ///
+ enum PAPER_SIZE {
+ ///
+ PAPER_DEFAULT,
+ ///
+ PAPER_USLETTER,
+ ///
+ PAPER_LEGALPAPER,
+ ///
+ PAPER_EXECUTIVEPAPER,
+ ///
+ PAPER_A3PAPER,
+ ///
+ PAPER_A4PAPER,
+ ///
+ PAPER_A5PAPER,
+ ///
+ PAPER_B5PAPER
+ };
+ ///
+ enum PAPER_PACKAGES {
+ ///
+ PACKAGE_NONE,
+ ///
+ PACKAGE_A4,
+ ///
+ PACKAGE_A4WIDE,
+ ///
+ PACKAGE_WIDEMARGINSA4
+ };
+ ///
+ enum VMARGIN_PAPER_TYPE {
+ ///
+ VM_PAPER_DEFAULT,
+ ///
+ VM_PAPER_CUSTOM,
+ ///
+ VM_PAPER_USLETTER,
+ ///
+ VM_PAPER_USLEGAL,
+ ///
+ VM_PAPER_USEXECUTIVE,
+ ///
+ VM_PAPER_A3,
+ ///
+ VM_PAPER_A4,
+ ///
+ VM_PAPER_A5,
+ ///
+ VM_PAPER_B3,
+ ///
+ VM_PAPER_B4,
+ ///
+ VM_PAPER_B5
+ };
+ ///
+ enum PARSEP {
+ ///
+ PARSEP_INDENT,
+ ///
+ PARSEP_SKIP
+ };
+ ///
+ enum PAPER_ORIENTATION {
+ ///
+ ORIENTATION_PORTRAIT,
+ ///
+ ORIENTATION_LANDSCAPE
+ };
//@Man: Constructors and Deconstructors
//@{
///
BufferParams();
//@}
- /// Dummy destructor to shut up gcc
- virtual ~BufferParams() {}
-
///
void writeFile(FILE *);
/** Wether paragraphs are separated by using a indent like in
articles or by using a little skip like in letters.
*/
- char paragraph_separation; // add approp. signedness
+ PARSEP paragraph_separation;
///
InsetQuotes::quote_language quotes_language;
///
LyXTextClassList::ClassList::size_type textclass;
/* this are for the PaperLayout */
- ///
+ ///
char papersize; /* the general papersize (papersize2 or paperpackage */ // add approp. signedness
///
char papersize2; /* the selected Geometry papersize */ // add approp. signedness
///
char paperpackage; /* a special paperpackage .sty-file */ // add approp. signedness
///
- char orientation; // add approp. signedness
+ PAPER_ORIENTATION orientation; // add approp. signedness
///
bool use_geometry;
///
///
string pagestyle;
///
- Bullet temp_bullets[4];
- ///
- Bullet user_defined_bullets[4];
+ block<Bullet, 4> temp_bullets;
///
- void Copy(BufferParams const &p);
+ block<Bullet, 4> user_defined_bullets;
///
- virtual void readPreamble(LyXLex &);
+ void readPreamble(LyXLex &);
///
- virtual void readLanguage(LyXLex &);
+ void readLanguage(LyXLex &);
///
- virtual void readGraphicsDriver(LyXLex &);
+ void readGraphicsDriver(LyXLex &);
/// do we allow accents on all chars in this buffer
bool allowAccents;
///
fdui->form_bullet = fl_bgn_form(FL_NO_BOX, 370, 390);
fl_set_border_width(-1);
- obj = fl_add_box(FL_UP_BOX,0,0,370,390,"");
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 370, 390, "");
// make the border thick again to improve the bmtable looks
fl_set_border_width(-3);
}
fl_set_border_width(-1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,95,20,255,70,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,0,340,370,50,"");
- fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE,15,45,65,30,idex(_("Size|#z")));fl_set_button_shortcut(obj,scex(_("Size|#z")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP);
- fl_set_object_callback(obj,ChoiceBulletSizeCB,0);
- fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON,25,350,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,BulletOKCB,0);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,135,350,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,BulletApplyCB,0);
- fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON,245,350,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,BulletCancelCB,0);
- fdui->input_bullet_latex = obj = fl_add_input(FL_NORMAL_INPUT,80,300,275,30,idex(_("LaTeX|#L")));fl_set_button_shortcut(obj,scex(_("LaTeX|#L")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lstyle(obj,FL_FIXED_STYLE);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 95, 20, 255, 70, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 0, 340, 370, 50, "");
+ fdui->choice_bullet_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 15, 45, 65, 30, idex(_("Size|#z")));fl_set_button_shortcut(obj, scex(_("Size|#z")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP);
+ fl_set_object_callback(obj, ChoiceBulletSizeCB, 0);
+ fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 25, 350, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, BulletOKCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 135, 350, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, BulletApplyCB, 0);
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 245, 350, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, BulletCancelCB, 0);
+ fdui->input_bullet_latex = obj = fl_add_input(FL_NORMAL_INPUT, 80, 300, 275, 30, idex(_("LaTeX|#L")));fl_set_button_shortcut(obj, scex(_("LaTeX|#L")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lstyle(obj, FL_FIXED_STYLE);
fl_set_input_return(obj, FL_RETURN_CHANGED);
- fl_set_input_maxchars(obj,80);
- fl_set_object_callback(obj,InputBulletLaTeXCB,0);
+ fl_set_input_maxchars(obj, 80);
+ fl_set_object_callback(obj, InputBulletLaTeXCB, 0);
fdui->radio_bullet_depth = fl_bgn_group();
- fdui->radio_bullet_depth_1 = obj = fl_add_button(FL_RADIO_BUTTON,105,35,55,40,idex(_("1|#1")));fl_set_button_shortcut(obj,scex(_("1|#1")),1);
- fl_set_object_lsize(obj,FL_LARGE_SIZE);
- fl_set_object_callback(obj,BulletDepthCB,0);
+ fdui->radio_bullet_depth_1 = obj = fl_add_button(FL_RADIO_BUTTON, 105, 35, 55, 40, idex(_("1|#1")));fl_set_button_shortcut(obj, scex(_("1|#1")), 1);
+ fl_set_object_lsize(obj, FL_LARGE_SIZE);
+ fl_set_object_callback(obj, BulletDepthCB, 0);
fl_set_button(obj, 1);
- fdui->radio_bullet_depth_2 = obj = fl_add_button(FL_RADIO_BUTTON,165,35,55,40,idex(_("2|#2")));fl_set_button_shortcut(obj,scex(_("2|#2")),1);
- fl_set_object_lsize(obj,FL_LARGE_SIZE);
- fl_set_object_callback(obj,BulletDepthCB,1);
- fdui->radio_bullet_depth_3 = obj = fl_add_button(FL_RADIO_BUTTON,225,35,55,40,idex(_("3|#3")));fl_set_button_shortcut(obj,scex(_("3|#3")),1);
- fl_set_object_lsize(obj,FL_LARGE_SIZE);
- fl_set_object_callback(obj,BulletDepthCB,2);
- fdui->radio_bullet_depth_4 = obj = fl_add_button(FL_RADIO_BUTTON,285,35,55,40,idex(_("4|#4")));fl_set_button_shortcut(obj,scex(_("4|#4")),1);
- fl_set_object_lsize(obj,FL_LARGE_SIZE);
- fl_set_object_callback(obj,BulletDepthCB,3);
+ fdui->radio_bullet_depth_2 = obj = fl_add_button(FL_RADIO_BUTTON, 165, 35, 55, 40, idex(_("2|#2")));fl_set_button_shortcut(obj, scex(_("2|#2")), 1);
+ fl_set_object_lsize(obj, FL_LARGE_SIZE);
+ fl_set_object_callback(obj, BulletDepthCB, 1);
+ fdui->radio_bullet_depth_3 = obj = fl_add_button(FL_RADIO_BUTTON, 225, 35, 55, 40, idex(_("3|#3")));fl_set_button_shortcut(obj, scex(_("3|#3")), 1);
+ fl_set_object_lsize(obj, FL_LARGE_SIZE);
+ fl_set_object_callback(obj, BulletDepthCB, 2);
+ fdui->radio_bullet_depth_4 = obj = fl_add_button(FL_RADIO_BUTTON, 285, 35, 55, 40, idex(_("4|#4")));fl_set_button_shortcut(obj, scex(_("4|#4")), 1);
+ fl_set_object_lsize(obj, FL_LARGE_SIZE);
+ fl_set_object_callback(obj, BulletDepthCB, 3);
fl_end_group();
- obj = fl_add_text(FL_NORMAL_TEXT,105,10,85,20,_("Bullet Depth"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 105, 10, 85, 20, _("Bullet Depth"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fdui->radio_bullet_panel = fl_bgn_group();
- fdui->radio_bullet_panel_standard = obj = fl_add_button(FL_RADIO_BUTTON,15,105,65,30,idex(_("Standard|#S")));fl_set_button_shortcut(obj,scex(_("Standard|#S")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_bullet_panel_standard = obj = fl_add_button(FL_RADIO_BUTTON, 15, 105, 65, 30, idex(_("Standard|#S")));fl_set_button_shortcut(obj, scex(_("Standard|#S")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,BulletPanelCB,0);
+ fl_set_object_callback(obj, BulletPanelCB, 0);
fl_set_button(obj, 1);
- fdui->radio_bullet_panel_maths = obj = fl_add_button(FL_RADIO_BUTTON,15,135,65,30,idex(_("Maths|#M")));fl_set_button_shortcut(obj,scex(_("Maths|#M")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_bullet_panel_maths = obj = fl_add_button(FL_RADIO_BUTTON, 15, 135, 65, 30, idex(_("Maths|#M")));fl_set_button_shortcut(obj, scex(_("Maths|#M")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,BulletPanelCB,1);
- fdui->radio_bullet_panel_ding2 = obj = fl_add_button(FL_RADIO_BUTTON,15,195,65,30,idex(_("Ding 2|#i")));fl_set_button_shortcut(obj,scex(_("Ding 2|#i")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, BulletPanelCB, 1);
+ fdui->radio_bullet_panel_ding2 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 195, 65, 30, idex(_("Ding 2|#i")));fl_set_button_shortcut(obj, scex(_("Ding 2|#i")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,BulletPanelCB,3);
- fdui->radio_bullet_panel_ding3 = obj = fl_add_button(FL_RADIO_BUTTON,15,225,65,30,idex(_("Ding 3|#n")));fl_set_button_shortcut(obj,scex(_("Ding 3|#n")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, BulletPanelCB, 3);
+ fdui->radio_bullet_panel_ding3 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 225, 65, 30, idex(_("Ding 3|#n")));fl_set_button_shortcut(obj, scex(_("Ding 3|#n")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,BulletPanelCB,4);
- fdui->radio_bullet_panel_ding4 = obj = fl_add_button(FL_RADIO_BUTTON,15,255,65,30,idex(_("Ding 4|#g")));fl_set_button_shortcut(obj,scex(_("Ding 4|#g")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, BulletPanelCB, 4);
+ fdui->radio_bullet_panel_ding4 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 255, 65, 30, idex(_("Ding 4|#g")));fl_set_button_shortcut(obj, scex(_("Ding 4|#g")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,BulletPanelCB,5);
- fdui->radio_bullet_panel_ding1 = obj = fl_add_button(FL_RADIO_BUTTON,15,165,65,30,idex(_("Ding 1|#D")));fl_set_button_shortcut(obj,scex(_("Ding 1|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, BulletPanelCB, 5);
+ fdui->radio_bullet_panel_ding1 = obj = fl_add_button(FL_RADIO_BUTTON, 15, 165, 65, 30, idex(_("Ding 1|#D")));fl_set_button_shortcut(obj, scex(_("Ding 1|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,BulletPanelCB,2);
+ fl_set_object_callback(obj, BulletPanelCB, 2);
fl_end_group();
fl_end_form();
#include "lyx_gui_misc.h" // CancelCloseBoxCB + WriteAlert
extern int mono_video;
-extern BufferView *current_view;
-FD_form_bullet *fd_form_bullet;
+extern BufferView * current_view;
+FD_form_bullet * fd_form_bullet;
static int current_bullet_panel;
static int current_bullet_depth;
}
else {
fl_show_form(fd_form_bullet->form_bullet,
- FL_PLACE_MOUSE,FL_FULLBORDER,
+ FL_PLACE_MOUSE, FL_FULLBORDER,
_("Itemize Bullet Selection"));
}
}
#pragma implementation
#endif
+#include <fstream>
+
#include "chset.h"
#include "support/filetools.h"
-#include "lyxlex.h"
+#include "support/LRegex.h"
+#include "support/LSubstring.h"
#include "debug.h"
-
-CharacterSet::CharacterSet()
-{
- map_=0;
-}
-
-
-CharacterSet::~CharacterSet()
-{
- freeMap();
-}
-
-
-void CharacterSet::freeMap()
+bool CharacterSet::loadFile(string const & fname)
{
- Cdef* t;
- while(map_) {
- t=map_;
- map_=map_->next;
- delete t;
- }
-
+ map_.clear();
name_.clear();
-}
-
-
-bool CharacterSet::loadFile(const string& fname)
-{
- freeMap();
-
- if (fname.empty() || fname=="ascii")
+
+ if (fname.empty() || fname == "ascii")
return true; // ascii 7-bit
-
+
// open definition file
lyxerr[Debug::KBMAP]
- << "Opening keymap file " << fname << ".cdef" << endl;
+ << "Reading keymap file " << fname << ".cdef" << endl;
string filename = LibFileSearch("kbd", fname.c_str(), "cdef");
- FilePtr f(filename, FilePtr::read);
- if (filename.empty() || !f()) {
+ ifstream ifs(filename.c_str());
+ if (!ifs) {
lyxerr << "Unable to open keymap file" << endl;
return true; // no definition, use 7-bit ascii
}
-
- name_=fname;
-
- // now read the file
- LyXLex lex(0,0);
- lex.setFile(f());
-
- bool error=false;
+ name_ = fname;
+
string str;
int n;
-
- while(lex.IsOK() && !error) {
-
- switch(lex.lex()){
- case LyXLex::LEX_FEOF :
- lyxerr[Debug::KBMAP] << "End of parsing of .cdef file"
- << endl;
- break;
- default:
- // Get Integer
- n=lex.GetInteger();
- if (n<0) {
- error=true;
- continue;
- }
-
- // Get String
- lex.next(true);
- str=lex.GetString();
-
- Cdef* tempc=new Cdef;
- tempc->str=str;
- tempc->ic=n;
- tempc->next=map_;
- map_=tempc;
-
+ string line;
+ LRegex reg("^([12][0-9][0-9])[ \t]+\"([^ ]+)\".*");
+ while(getline(ifs, line)) {
+ if (reg.exact_match(line)) {
+ LRegex::SubMatches const & sub = reg.exec(line);
+ n = atoi(line.substr(sub[1].first,
+ sub[1].second).c_str());
+ str = LSubstring(line, sub[2].first, sub[2].second);
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "Chardef: " << n
- << " to [" << tempc->str << "]" << endl;
- break;
+ << " to [" << str << "]" << endl;
+ map_[str] = n;
}
}
-
+ lyxerr[Debug::KBMAP] << "End of parsing of .cdef file." << endl;
return false;
}
-bool CharacterSet::encodeString(string & str)
+bool CharacterSet::encodeString(string & str) const
{
- Cdef *t=map_;
-
- while(t) {
- if (t->str==str) {
- // Can this fail? Why is ic an unsigned char?
- str = char(t->ic);
- break;
- }
- t=t->next;
- }
- return (t!=0);
+ Cdef::const_iterator cit = map_.find(str);
+ if (cit != map_.end()) return true;
+ return false;
}
-string CharacterSet::getName()
+string const & CharacterSet::getName() const
{
return name_;
}
#pragma interface
#endif
+#include <map>
#include "LString.h"
+using std::map;
+
///
class CharacterSet {
public:
///
- CharacterSet();
- ///
- ~CharacterSet();
-
+ bool loadFile(string const &);
///
- bool loadFile(const string&);
+ string const & getName() const;
///
- string getName();
- ///
- bool encodeString(string&);
+ bool encodeString(string &) const;
private:
///
string name_;
-
- ///
- struct Cdef {
- ///
- unsigned char ic;
- ///
- string str;
- ///
- Cdef *next;
- };
-
///
- Cdef *map_;
+ typedef map<string, unsigned char> Cdef;
///
- void freeMap();
+ Cdef map_;
};
#endif
}
lyxerr.debug() << "Label: " << label << endl;
- if (label && label!=button) {
+ if (label && label!= button) {
fl_delete_object(label);
fl_free_object(label);
}
bool Combox::select_text(char const* t)
{
if (!browser || !t) return false;
- for (int i=1; i<=fl_get_browser_maxline(browser); i++) {
+ for (int i= 1; i<= fl_get_browser_maxline(browser); i++) {
if (!strcmp(t, fl_get_browser_line(browser, i))) {
select(i);
return true;
void Combox::select(int i)
{
if (!browser || !button) return;
- if (i>0 && i<=fl_get_browser_maxline(browser)) sel = i;
+ if (i>0 && i<= fl_get_browser_maxline(browser)) sel = i;
fl_deactivate_object(button);
if (type == FL_COMBOX_INPUT)
case FL_COMBOX_DROPLIST:
{
button = obj = fl_add_button(FL_NORMAL_BUTTON,
- x+w-22,y,22,hmin,"@2->");
- fl_set_object_color(obj,FL_MCOL, FL_MCOL);
+ x+w-22, y, 22, hmin, "@2->");
+ fl_set_object_color(obj, FL_MCOL, FL_MCOL);
fl_set_object_dblbuffer(obj, 1);
- fl_set_object_callback(obj,C_Combox_combo_cb,0);
- label = obj = fl_add_button(FL_NORMAL_TEXT,x,y,w-22,hmin,"");
- fl_set_object_boxtype(obj,FL_DOWN_BOX);
- fl_set_object_color(obj,FL_MCOL,FL_BLACK);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ fl_set_object_callback(obj, C_Combox_combo_cb, 0);
+ label = obj = fl_add_button(FL_NORMAL_TEXT, x, y, w-22, hmin, "");
+ fl_set_object_boxtype(obj, FL_DOWN_BOX);
+ fl_set_object_color(obj, FL_MCOL, FL_BLACK);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_set_object_dblbuffer(obj, 1);
- fl_set_object_callback(obj,C_Combox_combo_cb,0);
+ fl_set_object_callback(obj, C_Combox_combo_cb, 0);
break;
}
case FL_COMBOX_NORMAL:
{
- button = obj = fl_add_button(FL_NORMAL_BUTTON,x,y,w,hmin,"");
- fl_set_object_color(obj,FL_MCOL, FL_MCOL);
- fl_set_object_boxtype(obj,FL_DOWN_BOX);
- fl_set_object_callback(obj,C_Combox_combo_cb,0);
- fl_set_object_color(obj,FL_MCOL,FL_BLACK);
+ button = obj = fl_add_button(FL_NORMAL_BUTTON, x, y, w, hmin, "");
+ fl_set_object_color(obj, FL_MCOL, FL_MCOL);
+ fl_set_object_boxtype(obj, FL_DOWN_BOX);
+ fl_set_object_callback(obj, C_Combox_combo_cb, 0);
+ fl_set_object_color(obj, FL_MCOL, FL_BLACK);
label = button;
break;
}
case FL_COMBOX_INPUT:
{
button = obj = fl_add_button(FL_NORMAL_BUTTON,
- x+w-22,y,22,hmin,"@2->");
- fl_set_object_color(obj,FL_MCOL, FL_MCOL);
- fl_set_object_callback(obj,C_Combox_combo_cb,0);
- label = obj = fl_add_input(FL_NORMAL_INPUT,x,y,w-22,hmin,"");
- fl_set_object_boxtype(obj,FL_DOWN_BOX);
+ x+w-22, y, 22, hmin, "@2->");
+ fl_set_object_color(obj, FL_MCOL, FL_MCOL);
+ fl_set_object_callback(obj, C_Combox_combo_cb, 0);
+ label = obj = fl_add_input(FL_NORMAL_INPUT, x, y, w-22, hmin, "");
+ fl_set_object_boxtype(obj, FL_DOWN_BOX);
fl_set_object_return(obj, FL_RETURN_END_CHANGED);
- fl_set_object_callback(obj,C_Combox_input_cb,0);
- //fl_set_object_color(obj,FL_MCOL,FL_BLACK);
+ fl_set_object_callback(obj, C_Combox_input_cb, 0);
+ //fl_set_object_color(obj, FL_MCOL, FL_BLACK);
//fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
break;
}
bw = w+20; bh = hmax-hmin-12;
form = fl_bgn_form(FL_NO_BOX, bw, bh);
- browser = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, bw,bh,"");
- fl_set_object_boxtype(obj,FL_UP_BOX);
- fl_set_object_color(obj,FL_MCOL, FL_YELLOW);
+ browser = obj = fl_add_browser(FL_HOLD_BROWSER, 0, 0, bw, bh, "");
+ fl_set_object_boxtype(obj, FL_UP_BOX);
+ fl_set_object_color(obj, FL_MCOL, FL_YELLOW);
fl_set_object_gravity(obj, NorthWestGravity, NorthWestGravity);
- fl_set_object_callback(obj,C_Combox_combo_cb,2);
+ fl_set_object_callback(obj, C_Combox_combo_cb, 2);
fl_end_form();
browser->u_vdata = (void*)this;
form->u_vdata = browser;
XGrabPointer(fl_display, form->window, false,
ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
GrabModeAsync, GrabModeAsync,
- 0, 0,0);
+ 0, 0, 0);
XFlush(fl_display);
}
else
fl_set_object_label(label,
fl_get_browser_line(browser, sel));
- if (callback) callback(sel,cb_arg);
+ if (callback) callback(sel, cb_arg);
}
XUngrabPointer(fl_display, 0);
XFlush(fl_display);
extern "C" void C_Combox_combo_cb(FL_OBJECT *ob, long data)
{
- Combox::combo_cb(ob,data);
+ Combox::combo_cb(ob, data);
}
Combox *combo = (Combox*)ob->u_vdata;
#if FL_REVISION < 86
- if(((XEvent *)xev)->type==ButtonPress && !ob->belowmouse)
+ if(((XEvent *)xev)->type == ButtonPress && !ob->belowmouse)
#endif
#if FL_REVISION > 85
// I don't know why belowmouse does not work, but it doesn't. (Asger)
fl_get_browser_maxline(combo->browser))
fl_select_browser_line(combo->browser,
fl_get_browser(combo->browser)+1);
- if (fl_get_browser(combo->browser)>=
+ if (fl_get_browser(combo->browser)>=
fl_get_browser_topline(combo->browser) +
fl_get_browser_screenlines(combo->browser))
fl_set_browser_topline(combo->browser,
if (fl_get_browser(combo->browser) > 1)
fl_select_browser_line(combo->browser,
fl_get_browser(combo->browser)-1);
- if (fl_get_browser(combo->browser)>=
+ if (fl_get_browser(combo->browser)>=
fl_get_browser_topline(combo->browser) +
fl_get_browser_screenlines(combo->browser))
fl_set_browser_topline(combo->browser,
FD_test *fdui = (FD_test *) fl_calloc(1, sizeof(*fdui));
fdui->test = fl_bgn_form(FL_NO_BOX, 320, 190);
- obj = fl_add_box(FL_UP_BOX,0,0,320,190,"");
- obj = fl_add_box(FL_DOWN_BOX,10,50,300,110,"");
- obj = fl_add_button(FL_NORMAL_BUTTON,250,10,50,30,_("Done"));
- combo.add(10,15,120,25,135);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 320, 190, "");
+ obj = fl_add_box(FL_DOWN_BOX, 10, 50, 300, 110, "");
+ obj = fl_add_button(FL_NORMAL_BUTTON, 250, 10, 50, 30, _("Done"));
+ combo.add(10, 15, 120, 25, 135);
fl_end_form();
return fdui;
// combo.select(4);
/* show the first form */
- fl_show_form(fd_test->test,FL_PLACE_CENTER,FL_FULLBORDER,"test");
+ fl_show_form(fd_test->test, FL_PLACE_CENTER, FL_FULLBORDER, "test");
fl_do_forms();
return 0;
}
* and support for middle and right buttons, as XForms choice object.
*/
-#ifndef _COMBOX_H_
-#define _COMBOX_H_
+#ifndef COMBOX_H
+#define COMBOX_H
#ifdef __GNUG__
#pragma interface
#endif
#include FORMS_H_LOCATION
-#include <stdlib.h>
+#include <cstdlib>
///
enum combox_type {
class Combox {
public:
///
- Combox(combox_type t=FL_COMBOX_NORMAL);
+ Combox(combox_type t = FL_COMBOX_NORMAL);
///
~Combox();
void Combox::resize(unsigned r)
{
fl_set_object_resize(button, r);
- if (label!=button) fl_set_object_resize(label, r);
+ if (label!= button) fl_set_object_resize(label, r);
}
inline
void Combox::gravity(unsigned g1, unsigned g2)
{
fl_set_object_gravity(button, g1, g2);
- if (label!=button) fl_set_object_gravity(label, g1, g2);
+ if (label!= button) fl_set_object_gravity(label, g1, g2);
}
inline
void Combox::shortcut(char const* s, int i)
{
if (button)
- fl_set_object_shortcut(button,s,i);
+ fl_set_object_shortcut(button, s, i);
}
inline
inline
char const*Combox::getline()
{
- if (type==FL_COMBOX_INPUT)
+ if (type == FL_COMBOX_INPUT)
return fl_get_input(label);
else
return ((browser) ? fl_get_browser_line(browser, sel): (char const*)0);
LFUN_GETNAME,
LFUN_NOTIFY,
LFUN_GOTOFILEROW, // Edmar 12/23/98
+#if 0
LFUN_INSERT_INSET_LATEX,
+#endif
LFUN_INSERT_NOTE,
LFUN_KMAP_OFF,
LFUN_KMAP_PRIM,
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
fl_raise_form(fd_form_credits->form_credits);
} else {
fl_show_form(fd_form_credits->form_credits,
- FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
+ FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
_("Credits"));
}
}
FD_form_credits *fdui = (FD_form_credits *) fl_calloc(1, sizeof(FD_form_credits));
fdui->form_credits = fl_bgn_form(FL_NO_BOX, 500, 330);
- obj = fl_add_box(FL_UP_BOX,0,0,500,330,"");
- obj = fl_add_button(FL_RETURN_BUTTON,180,290,140,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 500, 330, "");
+ obj = fl_add_button(FL_RETURN_BUTTON, 180, 290, 140, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_South, FL_South);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,CreditsOKCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,10,40,480,30,_("Matthias"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_ITALIC_STYLE);
+ fl_set_object_callback(obj, CreditsOKCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 10, 40, 480, 30, _("Matthias"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_ITALIC_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
- obj = fl_add_text(FL_NORMAL_TEXT,10,10,480,30,_("All these people have contributed to the LyX project. Thanks,"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 10, 10, 480, 30, _("All these people have contributed to the LyX project. Thanks,"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
- fdui->browser_credits = obj = fl_add_browser(FL_NORMAL_BROWSER,10,80,480,200,"");
+ fdui->browser_credits = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 80, 480, 200, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
fl_end_form();
FD_copyright *fdui = (FD_copyright *) fl_calloc(1, sizeof(FD_copyright));
fdui->copyright = fl_bgn_form(FL_NO_BOX, 450, 430);
- obj = fl_add_box(FL_UP_BOX,0,0,450,430,"");
- obj = fl_add_text(FL_NORMAL_TEXT,10,10,430,50,_("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-1999 LyX Team"));
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 450, 430, "");
+ obj = fl_add_text(FL_NORMAL_TEXT, 10, 10, 430, 50, _("LyX is Copyright (C) 1995 by Matthias Ettrich,\n1995-1999 LyX Team"));
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
- obj = fl_add_text(FL_NORMAL_TEXT,10,70,430,110,_("This program is free software; you can redistribute it\nand/or modify it under the terms of the GNU General\nPublic License as published by the Free Software\nFoundation; either version 2 of the License, or\n(at your option) any later version."));
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
- obj = fl_add_button(FL_RETURN_BUTTON,160,390,140,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 10, 70, 430, 110, _("This program is free software; you can redistribute it\nand/or modify it under the terms of the GNU General\nPublic License as published by the Free Software\nFoundation; either version 2 of the License, or\n(at your option) any later version."));
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ obj = fl_add_button(FL_RETURN_BUTTON, 160, 390, 140, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_South, FL_South);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,CopyrightOKCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,10,190,430,190,_("LyX is distributed in the hope that it will\nbe useful, but WITHOUT ANY WARRANTY;\nwithout even the implied warranty of MERCHANTABILITY\nor FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of\nthe GNU General Public License\nalong with this program; if not, write to\nthe Free Software Foundation, Inc.,\n675 Mass Ave, Cambridge, MA 02139, USA."));
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ fl_set_object_callback(obj, CopyrightOKCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 10, 190, 430, 190, _("LyX is distributed in the hope that it will\nbe useful, but WITHOUT ANY WARRANTY;\nwithout even the implied warranty of MERCHANTABILITY\nor FITNESS FOR A PARTICULAR PURPOSE.\nSee the GNU General Public License for more details.\nYou should have received a copy of\nthe GNU General Public License\nalong with this program; if not, write to\nthe Free Software Foundation, Inc.,\n675 Mass Ave, Cambridge, MA 02139, USA."));
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
fl_end_form();
//fdui->copyright->fdui = fdui;
}
};
///
-inline void operator|=(Debug::type & d1, Debug::type d2)
+inline void operator|= (Debug::type & d1, Debug::type d2)
{
d1 = static_cast<Debug::type>(d1 | d2);
}
-// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright (C) 1995 Matthias Ettrich
- *
- *======================================================*/
-#ifndef _DEFINITIONS_H
-#define _DEFINITIONS_H
-
-// NOTE:
-// We are trying to get rid of the global enums below, so try to _not_
-// add any more of them. Preferably enums should be located inside classes.
-// (i.e. class FooBar {
-// enum some {
-// more,
-// thing
-// };
-// }
-// to be accesed as FooBar::more and FooBar::thing
-
-// ALL the enums below should be given names, this to get better typechecking.
-// some don't have names now because this cause warings when compiling.
-
-
-///
-enum { // no good name for this
- ///
- LYX_ENVIRONMENT_DEFAULT = 97,
- ///
- LYX_LAYOUT_DEFAULT = 99
-};
-// Could this cause confusion that both DUMMY_LAYOUT and LAYOUT_DEFAULT has
-// the same value? (Lgb)
-///
-#define LYX_DUMMY_LAYOUT 99
-
-///
-enum LYX_META_KIND {
- ///
- LYX_META_FOOTNOTE = 1,
- ///
- LYX_META_MARGIN,
- ///
- LYX_META_FIG,
- ///
- LYX_META_TAB,
- ///
- LYX_META_ALGORITHM,
- ///
- LYX_META_WIDE_FIG,
- ///
- LYX_META_WIDE_TAB,
- ///
- LYX_META_HFILL,
- ///
- LYX_META_NEWLINE,
- ///
- LYX_META_PROTECTED_SEPARATOR,
- ///
- LYX_META_INSET
-};
-
-///
-enum LYX_PARSEP {
- ///
- LYX_PARSEP_INDENT,
- ///
- LYX_PARSEP_SKIP
-};
-
-///
-enum OLD_LYX_PAPER_SIZE {
- ///
- OLD_PAPER_A4PAPER,
- ///
- OLD_PAPER_A4,
- ///
- OLD_PAPER_A4WIDE,
- ///
- OLD_PAPER_WIDEMARGINSA4,
- ///
- OLD_PAPER_USLETTER,
- ///
- OLD_PAPER_A5PAPER,
- ///
- OLD_PAPER_B5PAPER,
- ///
- OLD_PAPER_EXECUTIVEPAPER,
- ///
- OLD_PAPER_LEGALPAPER
-};
-
-///
-enum LYX_PAPER_SIZE {
- ///
- PAPER_DEFAULT,
- ///
- PAPER_USLETTER,
- ///
- PAPER_LEGALPAPER,
- ///
- PAPER_EXECUTIVEPAPER,
- ///
- PAPER_A3PAPER,
- ///
- PAPER_A4PAPER,
- ///
- PAPER_A5PAPER,
- ///
- PAPER_B5PAPER
-};
-
-///
-enum LYX_VMARGIN_PAPER_TYPE {
- ///
- VM_PAPER_DEFAULT,
- ///
- VM_PAPER_CUSTOM,
- ///
- VM_PAPER_USLETTER,
- ///
- VM_PAPER_USLEGAL,
- ///
- VM_PAPER_USEXECUTIVE,
- ///
- VM_PAPER_A3,
- ///
- VM_PAPER_A4,
- ///
- VM_PAPER_A5,
- ///
- VM_PAPER_B3,
- ///
- VM_PAPER_B4,
- ///
- VM_PAPER_B5
-};
-
-///
-enum LYX_PAPER_PACKAGES {
- ///
- PACKAGE_NONE,
- ///
- PACKAGE_A4,
- ///
- PACKAGE_A4WIDE,
- ///
- PACKAGE_WIDEMARGINSA4
-};
-
-///
-enum LYX_PAPER_ORIENTATION {
- ///
- ORIENTATION_PORTRAIT,
- ///
- ORIENTATION_LANDSCAPE
-};
-
-///
-enum LYX_PEXTRA_TYPE {
- ///
- PEXTRA_NONE,
- ///
- PEXTRA_INDENT,
- ///
- PEXTRA_MINIPAGE,
- ///
- PEXTRA_FLOATFLT
-};
-
-///
-enum LYX_MINIPAGE_ALIGNMENT {
- ///
- MINIPAGE_ALIGN_TOP,
- ///
- MINIPAGE_ALIGN_MIDDLE,
- ///
- MINIPAGE_ALIGN_BOTTOM
-};
-
-#endif
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#endif
#ifdef BROKEN_HEADERS
-extern "C" int gettimeofday(struct timeval *,struct timezone *);
+extern "C" int gettimeofday(struct timeval *, struct timezone *);
#define remove(a) unlink(a)
#endif
#include "support/filetools.h"
#include "filedlg.h"
-#include "definitions.h"
static const long SIX_MONTH_SEC = 6L * 30L * 24L * 60L * 60L; // six months, in seconds
static const long ONE_HOUR_SEC = 60L * 60L;
// *** User cache class implementation
// global instance (user cache root)
-UserCache lyxUserCache = UserCache(string(),0,0);
+UserCache lyxUserCache = UserCache(string(), 0, 0);
// some "C" wrappers around callbacks
extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT *, long lArgument);
extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT *, long);
extern "C" int C_LyXFileDlg_CancelCB(FL_FORM *, void *);
-extern "C" int C_LyXDirEntryC_ldeCompProc(const void* r1,
- const void* r2);
+extern "C" int C_LyXDirEntryC_ldeCompProc(const void * r1,
+ const void * r2);
// Add: creates a new user entry
UserCache * UserCache::Add(uid_t ID)
// *** Group cache class implementation
// global instance (group cache root)
-GroupCache lyxGroupCache = GroupCache(string(),0,0);
+GroupCache lyxGroupCache = GroupCache(string(), 0, 0);
// Add: creates a new group entry
GroupCache * GroupCache::Add(gid_t ID)
fileInfo.newFile(File, true);
fileInfo.modeString(szMode);
unsigned int nlink = fileInfo.getNumberOfLinks();
- string user = lyxUserCache.Find(fileInfo.getUid());
+ string user = lyxUserCache.Find(fileInfo.getUid());
string group = lyxGroupCache.Find(fileInfo.getGid());
time_t modtime = fileInfo.getModificationTime();
if ((isLink = fileInfo.isLink())) {
string Link;
- if (LyXReadLink(File,Link)) {
+ if (LyXReadLink(File, Link)) {
Buffer += " -> ";
Buffer += Link;
string temp = line + pCurrentNames[i].pszDisplayed;
fl_add_browser_line(pFileDlgForm->List, temp.c_str());
}
- fl_set_browser_topline(pFileDlgForm->List,iDepth);
+ fl_set_browser_topline(pFileDlgForm->List, iDepth);
fl_show_object(pFileDlgForm->List);
iLastSel = -1;
}
pFileDlgForm = create_form_FileDlg();
// Set callbacks. This means that we don't need a patch file
fl_set_object_callback(pFileDlgForm->DirBox,
- C_LyXFileDlg_FileDlgCB,0);
+ C_LyXFileDlg_FileDlgCB, 0);
fl_set_object_callback(pFileDlgForm->PatBox,
- C_LyXFileDlg_FileDlgCB,1);
+ C_LyXFileDlg_FileDlgCB, 1);
fl_set_object_callback(pFileDlgForm->List,
- C_LyXFileDlg_FileDlgCB,2);
+ C_LyXFileDlg_FileDlgCB, 2);
fl_set_object_callback(pFileDlgForm->Filename,
- C_LyXFileDlg_FileDlgCB,3);
+ C_LyXFileDlg_FileDlgCB, 3);
fl_set_object_callback(pFileDlgForm->Rescan,
- C_LyXFileDlg_FileDlgCB,10);
+ C_LyXFileDlg_FileDlgCB, 10);
fl_set_object_callback(pFileDlgForm->Home,
- C_LyXFileDlg_FileDlgCB,11);
+ C_LyXFileDlg_FileDlgCB, 11);
fl_set_object_callback(pFileDlgForm->User1,
- C_LyXFileDlg_FileDlgCB,12);
+ C_LyXFileDlg_FileDlgCB, 12);
fl_set_object_callback(pFileDlgForm->User2,
- C_LyXFileDlg_FileDlgCB,13);
+ C_LyXFileDlg_FileDlgCB, 13);
// Make sure pressing the close box doesn't crash LyX. (RvdK)
fl_set_form_atclose(pFileDlgForm->FileDlg,
C_LyXFileDlg_CancelCB, 0);
// Register doubleclick callback
fl_set_browser_dblclick_callback(pFileDlgForm->List,
- C_LyXFileDlg_DoubleClickCB,0);
+ C_LyXFileDlg_DoubleClickCB, 0);
}
fl_hide_object(pFileDlgForm->User1);
fl_hide_object(pFileDlgForm->User2);
isDir = false;
fl_set_input(pFileDlgForm->Filename, pszTemp.c_str());
}
- } else if (iSelect !=0) {
+ } else if (iSelect != 0) {
SetInfoLine(string());
} else
return true;
// mask was changed
pszTemp = fl_get_input(pFileDlgForm->PatBox);
- if (pszTemp!=pszMask) {
+ if (pszTemp!= pszMask) {
SetMask(pszTemp);
Reread();
return false;
// directory was changed
pszTemp = fl_get_input(pFileDlgForm->DirBox);
- if (pszTemp!=pszDirectory) {
+ if (pszTemp!= pszDirectory) {
SetDirectory(pszTemp);
Reread();
return false;
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#ifndef FILEDLG_H
#define FILEDLG_H
/* Form definition file generated with fdesign. */
#include FORMS_H_LOCATION
-#include <stdlib.h>
+#include <cstdlib>
#include "form1.h"
FD_KeyMap *create_form_KeyMap(void)
FD_KeyMap *fdui = (FD_KeyMap *) fl_calloc(1, sizeof(FD_KeyMap));
fdui->KeyMap = fl_bgn_form(FL_NO_BOX, 400, 400);
- obj = fl_add_box(FL_UP_BOX,0,0,400,400,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,200,210,190,140,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fdui->AcceptChset = obj = fl_add_button(FL_NORMAL_BUTTON,210,280,170,30,idex(_("Set Charset|#C")));fl_set_button_shortcut(obj,scex(_("Set Charset|#C")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->ChsetErr = obj = fl_add_text(FL_NORMAL_TEXT,210,310,170,30,_("Charset not found!"));
- fl_set_object_lcol(obj,FL_RED);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
- fdui->KeymapErr = obj = fl_add_text(FL_NORMAL_TEXT,290,60,100,90,_("Error:\n\nKeymap\nnot found"));
- fl_set_object_lcol(obj,FL_RED);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
- fdui->Charset = obj = fl_add_input(FL_NORMAL_INPUT,210,240,170,30,idex(_("Character set:|#H")));fl_set_button_shortcut(obj,scex(_("Character set:|#H")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,210,180,100,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,20,380,170,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 400, 400, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 200, 210, 190, 140, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fdui->AcceptChset = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 280, 170, 30, idex(_("Set Charset|#C")));fl_set_button_shortcut(obj, scex(_("Set Charset|#C")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->ChsetErr = obj = fl_add_text(FL_NORMAL_TEXT, 210, 310, 170, 30, _("Charset not found!"));
+ fl_set_object_lcol(obj, FL_RED);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
+ fdui->KeymapErr = obj = fl_add_text(FL_NORMAL_TEXT, 290, 60, 100, 90, _("Error:\n\nKeymap\nnot found"));
+ fl_set_object_lcol(obj, FL_RED);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE+FL_EMBOSSED_STYLE);
+ fdui->Charset = obj = fl_add_input(FL_NORMAL_INPUT, 210, 240, 170, 30, idex(_("Character set:|#H")));fl_set_button_shortcut(obj, scex(_("Character set:|#H")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 210, 180, 100, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 380, 170, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->Accept = obj = fl_add_button(FL_RETURN_BUTTON,130,360,120,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->OtherKeymap = obj = fl_add_input(FL_NORMAL_INPUT,120,70,160,30,idex(_("Other...|#O")));fl_set_button_shortcut(obj,scex(_("Other...|#O")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->Accept = obj = fl_add_button(FL_RETURN_BUTTON, 130, 360, 120, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->OtherKeymap = obj = fl_add_input(FL_NORMAL_INPUT, 120, 70, 160, 30, idex(_("Other...|#O")));fl_set_button_shortcut(obj, scex(_("Other...|#O")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->OtherKeymap2 = obj = fl_add_input(FL_NORMAL_INPUT,120,150,160,30,idex(_("Other...|#T")));fl_set_button_shortcut(obj,scex(_("Other...|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->OtherKeymap2 = obj = fl_add_input(FL_NORMAL_INPUT, 120, 150, 160, 30, idex(_("Other...|#T")));fl_set_button_shortcut(obj, scex(_("Other...|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,90,20,_("Language"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 90, 20, _("Language"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,200,80,20,_("Mapping"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 200, 80, 20, _("Mapping"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->KeyMapOn = fl_bgn_group();
- fdui->KeyOnBtn = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,250,180,30,idex(_("Primary key map|#r")));fl_set_button_shortcut(obj,scex(_("Primary key map|#r")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->KeyOffBtn = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,220,180,30,idex(_("No key mapping|#N")));fl_set_button_shortcut(obj,scex(_("No key mapping|#N")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->KeyOnBtn2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,280,180,30,idex(_("Secondary key map|#e")));fl_set_button_shortcut(obj,scex(_("Secondary key map|#e")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->KeyOnBtn = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 250, 180, 30, idex(_("Primary key map|#r")));fl_set_button_shortcut(obj, scex(_("Primary key map|#r")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->KeyOffBtn = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 220, 180, 30, idex(_("No key mapping|#N")));fl_set_button_shortcut(obj, scex(_("No key mapping|#N")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->KeyOnBtn2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 280, 180, 30, idex(_("Secondary key map|#e")));fl_set_button_shortcut(obj, scex(_("Secondary key map|#e")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- obj = fl_add_text(FL_NORMAL_TEXT,20,110,100,30,_("Secondary"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,30,100,30,_("Primary"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 110, 100, 30, _("Secondary"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 30, 100, 30, _("Primary"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
fl_end_form();
//fdui->KeyMap->fdui = fdui;
FD_Figure *fdui = (FD_Figure *) fl_calloc(1, sizeof(FD_Figure));
fdui->Figure = fl_bgn_form(FL_NO_BOX, 420, 390);
- obj = fl_add_box(FL_UP_BOX,0,0,420,390,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,230,220,180,80,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,230,60,180,140,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,244,200,56,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,60,200,160,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fdui->EpsFile = obj = fl_add_input(FL_NORMAL_INPUT,80,10,230,30,idex(_("EPS file|#E")));fl_set_button_shortcut(obj,scex(_("EPS file|#E")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,2);
- fdui->Preview = obj = fl_add_button(FL_NORMAL_BUTTON,270,350,140,30,idex(_("Full Screen Preview|#v")));fl_set_button_shortcut(obj,scex(_("Full Screen Preview|#v")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,1);
- fdui->Browse = obj = fl_add_button(FL_NORMAL_BUTTON,320,10,90,30,idex(_("Browse...|#B")));fl_set_button_shortcut(obj,scex(_("Browse...|#B")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,0);
- fdui->Width = obj = fl_add_input(FL_FLOAT_INPUT,20,180,80,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,2);
- fdui->Height = obj = fl_add_input(FL_FLOAT_INPUT,120,180,80,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,2);
- fdui->ApplyBtn = obj = fl_add_button(FL_NORMAL_BUTTON,100,350,60,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,7);
- fdui->OkBtn = obj = fl_add_button(FL_RETURN_BUTTON,10,350,70,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,8);
- fdui->CancelBtn = obj = fl_add_button(FL_NORMAL_BUTTON,180,350,70,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,9);
- fdui->Frame = obj = fl_add_checkbutton(FL_PUSH_BUTTON,230,230,180,30,idex(_("Display Frame|#F")));fl_set_button_shortcut(obj,scex(_("Display Frame|#F")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,53);
- fdui->Translations = obj = fl_add_checkbutton(FL_PUSH_BUTTON,230,260,180,30,idex(_("Do Translations|#r")));fl_set_button_shortcut(obj,scex(_("Do Translations|#r")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,54);
- obj = fl_add_text(FL_NORMAL_TEXT,240,210,70,20,_("Options"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->Angle = obj = fl_add_input(FL_FLOAT_INPUT,100,260,80,30,idex(_("Angle:|#L")));fl_set_button_shortcut(obj,scex(_("Angle:|#L")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,2);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 420, 390, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 220, 180, 80, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 60, 180, 140, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 244, 200, 56, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 60, 200, 160, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fdui->EpsFile = obj = fl_add_input(FL_NORMAL_INPUT, 80, 10, 230, 30, idex(_("EPS file|#E")));fl_set_button_shortcut(obj, scex(_("EPS file|#E")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 2);
+ fdui->Preview = obj = fl_add_button(FL_NORMAL_BUTTON, 270, 350, 140, 30, idex(_("Full Screen Preview|#v")));fl_set_button_shortcut(obj, scex(_("Full Screen Preview|#v")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 1);
+ fdui->Browse = obj = fl_add_button(FL_NORMAL_BUTTON, 320, 10, 90, 30, idex(_("Browse...|#B")));fl_set_button_shortcut(obj, scex(_("Browse...|#B")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 0);
+ fdui->Width = obj = fl_add_input(FL_FLOAT_INPUT, 20, 180, 80, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 2);
+ fdui->Height = obj = fl_add_input(FL_FLOAT_INPUT, 120, 180, 80, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 2);
+ fdui->ApplyBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 100, 350, 60, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 7);
+ fdui->OkBtn = obj = fl_add_button(FL_RETURN_BUTTON, 10, 350, 70, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 8);
+ fdui->CancelBtn = obj = fl_add_button(FL_NORMAL_BUTTON, 180, 350, 70, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 9);
+ fdui->Frame = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 230, 180, 30, idex(_("Display Frame|#F")));fl_set_button_shortcut(obj, scex(_("Display Frame|#F")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 53);
+ fdui->Translations = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 260, 180, 30, idex(_("Do Translations|#r")));fl_set_button_shortcut(obj, scex(_("Do Translations|#r")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 54);
+ obj = fl_add_text(FL_NORMAL_TEXT, 240, 210, 70, 20, _("Options"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->Angle = obj = fl_add_input(FL_FLOAT_INPUT, 100, 260, 80, 30, idex(_("Angle:|#L")));fl_set_button_shortcut(obj, scex(_("Angle:|#L")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 2);
fdui->HeightGrp = fl_bgn_group();
// xgettext:no-c-format
- fdui->page2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,110,130,110,30,idex(_("% of Page|#g")));fl_set_button_shortcut(obj,scex(_("% of Page|#g")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,23);
- fdui->Default2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,110,70,80,30,idex(_("Default|#t")));fl_set_button_shortcut(obj,scex(_("Default|#t")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,20);
- fdui->cm2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,110,90,60,30,idex(_("cm|#m")));fl_set_button_shortcut(obj,scex(_("cm|#m")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,21);
- fdui->in2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,110,110,80,30,idex(_("inches|#h")));fl_set_button_shortcut(obj,scex(_("inches|#h")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,22);
+ fdui->page2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 130, 110, 30, idex(_("% of Page|#g")));fl_set_button_shortcut(obj, scex(_("% of Page|#g")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 23);
+ fdui->Default2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 70, 80, 30, idex(_("Default|#t")));fl_set_button_shortcut(obj, scex(_("Default|#t")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 20);
+ fdui->cm2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 90, 60, 30, idex(_("cm|#m")));fl_set_button_shortcut(obj, scex(_("cm|#m")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 21);
+ fdui->in2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 110, 80, 30, idex(_("inches|#h")));fl_set_button_shortcut(obj, scex(_("inches|#h")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 22);
fl_end_group();
- obj = fl_add_text(FL_NORMAL_TEXT,237,50,53,20,_("Display"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->HeightLabel = obj = fl_add_text(FL_NORMAL_TEXT,120,50,60,20,_("Height"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->WidthLabel = obj = fl_add_text(FL_NORMAL_TEXT,20,50,60,20,_("Width"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,230,90,30,_("Rotation"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 237, 50, 53, 20, _("Display"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->HeightLabel = obj = fl_add_text(FL_NORMAL_TEXT, 120, 50, 60, 20, _("Height"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->WidthLabel = obj = fl_add_text(FL_NORMAL_TEXT, 20, 50, 60, 20, _("Width"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 230, 90, 30, _("Rotation"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->DisplayGrp = fl_bgn_group();
- fdui->Wysiwyg3 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,230,130,180,30,idex(_("Display in Color|#D")));fl_set_button_shortcut(obj,scex(_("Display in Color|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,63);
- fdui->Wysiwyg0 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,230,160,180,30,idex(_("Do not display this figure|#y")));fl_set_button_shortcut(obj,scex(_("Do not display this figure|#y")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,3);
- fdui->Wysiwyg2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,230,100,180,30,idex(_("Display as Grayscale|#i")));fl_set_button_shortcut(obj,scex(_("Display as Grayscale|#i")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,43);
- fdui->Wysiwyg1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,230,70,180,30,idex(_("Display as Monochrome|#s")));fl_set_button_shortcut(obj,scex(_("Display as Monochrome|#s")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,33);
+ fdui->Wysiwyg3 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 230, 130, 180, 30, idex(_("Display in Color|#D")));fl_set_button_shortcut(obj, scex(_("Display in Color|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 63);
+ fdui->Wysiwyg0 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 230, 160, 180, 30, idex(_("Do not display this figure|#y")));fl_set_button_shortcut(obj, scex(_("Do not display this figure|#y")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 3);
+ fdui->Wysiwyg2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 230, 100, 180, 30, idex(_("Display as Grayscale|#i")));fl_set_button_shortcut(obj, scex(_("Display as Grayscale|#i")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 43);
+ fdui->Wysiwyg1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 230, 70, 180, 30, idex(_("Display as Monochrome|#s")));fl_set_button_shortcut(obj, scex(_("Display as Monochrome|#s")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 33);
fl_end_group();
fdui->WidthGrp = fl_bgn_group();
- fdui->Default1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,70,80,30,idex(_("Default|#U")));fl_set_button_shortcut(obj,scex(_("Default|#U")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,10);
- fdui->cm1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,90,60,30,idex(_("cm|#c")));fl_set_button_shortcut(obj,scex(_("cm|#c")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,11);
- fdui->in1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,110,80,30,idex(_("inches|#n")));fl_set_button_shortcut(obj,scex(_("inches|#n")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,12);
+ fdui->Default1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 70, 80, 30, idex(_("Default|#U")));fl_set_button_shortcut(obj, scex(_("Default|#U")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 10);
+ fdui->cm1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 90, 60, 30, idex(_("cm|#c")));fl_set_button_shortcut(obj, scex(_("cm|#c")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 11);
+ fdui->in1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 110, 80, 30, idex(_("inches|#n")));fl_set_button_shortcut(obj, scex(_("inches|#n")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 12);
// xgettext:no-c-format
- fdui->page1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,130,110,30,idex(_("% of Page|#P")));fl_set_button_shortcut(obj,scex(_("% of Page|#P")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,13);
+ fdui->page1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 130, 110, 30, idex(_("% of Page|#P")));fl_set_button_shortcut(obj, scex(_("% of Page|#P")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 13);
// xgettext:no-c-format
- fdui->column1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,150,110,30,idex(_("% of Column|#o")));fl_set_button_shortcut(obj,scex(_("% of Column|#o")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,14);
+ fdui->column1 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 150, 110, 30, idex(_("% of Column|#o")));fl_set_button_shortcut(obj, scex(_("% of Column|#o")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 14);
fl_end_group();
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,310,400,30,"");
- fdui->Subcaption = obj = fl_add_input(FL_NORMAL_INPUT,150,310,260,30,idex(_("Caption|#k")));fl_set_button_shortcut(obj,scex(_("Caption|#k")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,2);
- fdui->Subfigure = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,310,90,30,idex(_("Subfigure|#q")));fl_set_button_shortcut(obj,scex(_("Subfigure|#q")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,GraphicsCB,70);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 310, 400, 30, "");
+ fdui->Subcaption = obj = fl_add_input(FL_NORMAL_INPUT, 150, 310, 260, 30, idex(_("Caption|#k")));fl_set_button_shortcut(obj, scex(_("Caption|#k")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 2);
+ fdui->Subfigure = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 310, 90, 30, idex(_("Subfigure|#q")));fl_set_button_shortcut(obj, scex(_("Subfigure|#q")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, GraphicsCB, 70);
fl_end_form();
//fdui->Figure->fdui = fdui;
FD_FileDlg *fdui = (FD_FileDlg *) fl_calloc(1, sizeof(FD_FileDlg));
fdui->FileDlg = fl_bgn_form(FL_NO_BOX, 440, 380);
- obj = fl_add_box(FL_UP_BOX,0,0,440,380,"");
- fdui->FileInfo = obj = fl_add_text(FL_NORMAL_TEXT,10,260,420,30,"");
- fl_set_object_boxtype(obj,FL_SHADOW_BOX);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 380, "");
+ fdui->FileInfo = obj = fl_add_text(FL_NORMAL_TEXT, 10, 260, 420, 30, "");
+ fl_set_object_boxtype(obj, FL_SHADOW_BOX);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->DirBox = obj = fl_add_input(FL_NORMAL_INPUT,100,10,330,30,idex(_("Directory:|#D")));fl_set_button_shortcut(obj,scex(_("Directory:|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->DirBox = obj = fl_add_input(FL_NORMAL_INPUT, 100, 10, 330, 30, idex(_("Directory:|#D")));fl_set_button_shortcut(obj, scex(_("Directory:|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->PatBox = obj = fl_add_input(FL_NORMAL_INPUT,100,40,330,30,idex(_("Pattern:|#P")));fl_set_button_shortcut(obj,scex(_("Pattern:|#P")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->PatBox = obj = fl_add_input(FL_NORMAL_INPUT, 100, 40, 330, 30, idex(_("Pattern:|#P")));fl_set_button_shortcut(obj, scex(_("Pattern:|#P")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->List = obj = fl_add_browser(FL_HOLD_BROWSER,10,80,320,170,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP);
+ fdui->List = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 80, 320, 170, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP);
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- fdui->Filename = obj = fl_add_input(FL_NORMAL_INPUT,100,300,330,30,idex(_("Filename:|#F")));fl_set_button_shortcut(obj,scex(_("Filename:|#F")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->Filename = obj = fl_add_input(FL_NORMAL_INPUT, 100, 300, 330, 30, idex(_("Filename:|#F")));fl_set_button_shortcut(obj, scex(_("Filename:|#F")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->Rescan = obj = fl_add_button(FL_NORMAL_BUTTON,340,80,90,30,idex(_("Rescan|#R#r")));fl_set_button_shortcut(obj,scex(_("Rescan|#R#r")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->Rescan = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 80, 90, 30, idex(_("Rescan|#R#r")));fl_set_button_shortcut(obj, scex(_("Rescan|#R#r")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
- fdui->Home = obj = fl_add_button(FL_NORMAL_BUTTON,340,120,90,30,idex(_("Home|#H#h")));fl_set_button_shortcut(obj,scex(_("Home|#H#h")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->Home = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 120, 90, 30, idex(_("Home|#H#h")));fl_set_button_shortcut(obj, scex(_("Home|#H#h")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
- fdui->User1 = obj = fl_add_button(FL_NORMAL_BUTTON,340,160,90,30,idex(_("User1|#1")));fl_set_button_shortcut(obj,scex(_("User1|#1")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->User1 = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 160, 90, 30, idex(_("User1|#1")));fl_set_button_shortcut(obj, scex(_("User1|#1")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
- fdui->User2 = obj = fl_add_button(FL_NORMAL_BUTTON,340,200,90,30,idex(_("User2|#2")));fl_set_button_shortcut(obj,scex(_("User2|#2")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->User2 = obj = fl_add_button(FL_NORMAL_BUTTON, 340, 200, 90, 30, idex(_("User2|#2")));fl_set_button_shortcut(obj, scex(_("User2|#2")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
- fdui->Ready = obj = fl_add_button(FL_RETURN_BUTTON,220,340,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->Ready = obj = fl_add_button(FL_RETURN_BUTTON, 220, 340, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fdui->Cancel = obj = fl_add_button(FL_NORMAL_BUTTON,330,340,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->Cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 330, 340, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fdui->timer = obj = fl_add_timer(FL_HIDDEN_TIMER,10,350,20,20,"");
+ fdui->timer = obj = fl_add_timer(FL_HIDDEN_TIMER, 10, 350, 20, 20, "");
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
fl_end_form();
FD_form_table *fdui = (FD_form_table *) fl_calloc(1, sizeof(FD_form_table));
fdui->form_table = fl_bgn_form(FL_NO_BOX, 310, 130);
- obj = fl_add_box(FL_UP_BOX,0,0,310,130,"");
- fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON,10,90,90,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOKCB,0);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,110,90,90,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableApplyCB,0);
- fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON,210,90,90,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableCancelCB,0);
- fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER,80,50,220,30,_("Columns"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 130, "");
+ fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 90, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOKCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 90, 90, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableApplyCB, 0);
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 90, 90, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableCancelCB, 0);
+ fdui->slider_columns = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 50, 220, 30, _("Columns"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->slider_rows = obj = fl_add_valslider(FL_HOR_SLIDER,80,10,220,30,_("Rows"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
+ fdui->slider_rows = obj = fl_add_valslider(FL_HOR_SLIDER, 80, 10, 220, 30, _("Rows"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_resize(obj, FL_RESIZE_X);
fl_end_form();
FD_form_search *fdui = (FD_form_search *) fl_calloc(1, sizeof(FD_form_search));
fdui->form_search = fl_bgn_form(FL_NO_BOX, 440, 160);
- obj = fl_add_box(FL_UP_BOX,0,0,440,160,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,300,10,130,80,"");
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 160, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 300, 10, 130, 80, "");
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
- fdui->input_search = obj = fl_add_input(FL_NORMAL_INPUT,110,10,180,30,idex(_("Find|#n")));fl_set_button_shortcut(obj,scex(_("Find|#n")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_search = obj = fl_add_input(FL_NORMAL_INPUT, 110, 10, 180, 30, idex(_("Find|#n")));fl_set_button_shortcut(obj, scex(_("Find|#n")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->input_replace = obj = fl_add_input(FL_NORMAL_INPUT,110,40,180,30,idex(_("Replace with|#W")));fl_set_button_shortcut(obj,scex(_("Replace with|#W")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_replace = obj = fl_add_input(FL_NORMAL_INPUT, 110, 40, 180, 30, idex(_("Replace with|#W")));fl_set_button_shortcut(obj, scex(_("Replace with|#W")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_button(FL_NORMAL_BUTTON,200,80,90,30,idex(_("@>|#F")));fl_set_button_shortcut(obj,scex(_("@>|#F")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 200, 80, 90, 30, idex(_("@>|#F")));fl_set_button_shortcut(obj, scex(_("@>|#F")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SearchForwardCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,110,80,90,30,idex(_("@<|#B")));fl_set_button_shortcut(obj,scex(_("@<|#B")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SearchForwardCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 110, 80, 90, 30, idex(_("@<|#B")));fl_set_button_shortcut(obj, scex(_("@<|#B")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SearchBackwardCB,0);
- fdui->replace_button = obj = fl_add_button(FL_NORMAL_BUTTON,110,120,90,30,idex(_("Replace|#R#r")));fl_set_button_shortcut(obj,scex(_("Replace|#R#r")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SearchBackwardCB, 0);
+ fdui->replace_button = obj = fl_add_button(FL_NORMAL_BUTTON, 110, 120, 90, 30, idex(_("Replace|#R#r")));fl_set_button_shortcut(obj, scex(_("Replace|#R#r")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SearchReplaceCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,350,120,80,30,idex(_("Close|^[")));fl_set_button_shortcut(obj,scex(_("Close|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SearchReplaceCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 350, 120, 80, 30, idex(_("Close|^[")));fl_set_button_shortcut(obj, scex(_("Close|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SearchCancelCB,0);
- fdui->btnCaseSensitive = obj = fl_add_checkbutton(FL_PUSH_BUTTON,300,20,150,30,idex(_("Case sensitive|#s#S")));fl_set_button_shortcut(obj,scex(_("Case sensitive|#s#S")),1);
+ fl_set_object_callback(obj, SearchCancelCB, 0);
+ fdui->btnCaseSensitive = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 20, 150, 30, idex(_("Case sensitive|#s#S")));fl_set_button_shortcut(obj, scex(_("Case sensitive|#s#S")), 1);
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
- fdui->btnMatchWord = obj = fl_add_checkbutton(FL_PUSH_BUTTON,300,50,150,30,idex(_("Match word|#M#m")));fl_set_button_shortcut(obj,scex(_("Match word|#M#m")),1);
+ fdui->btnMatchWord = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 50, 150, 30, idex(_("Match word|#M#m")));fl_set_button_shortcut(obj, scex(_("Match word|#M#m")), 1);
fl_set_object_gravity(obj, FL_NorthEast, FL_NorthEast);
- fdui->replaceall_button = obj = fl_add_button(FL_NORMAL_BUTTON,200,120,90,30,idex(_("Replace All|#A#a")));fl_set_button_shortcut(obj,scex(_("Replace All|#A#a")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->replaceall_button = obj = fl_add_button(FL_NORMAL_BUTTON, 200, 120, 90, 30, idex(_("Replace All|#A#a")));fl_set_button_shortcut(obj, scex(_("Replace All|#A#a")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SearchReplaceAllCB,0);
+ fl_set_object_callback(obj, SearchReplaceAllCB, 0);
fl_end_form();
//fdui->form_search->fdui = fdui;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
/*
* International support for LyX
#include "trans_mgr.h"
#include "support/lstrings.h"
-extern LyXRC* lyxrc;
+extern LyXRC * lyxrc;
// a wrapper around the callback static member.
-extern "C" void C_Intl_DispatchCallback(FL_OBJECT *ob,long code);
+extern "C" void C_Intl_DispatchCallback(FL_OBJECT * ob, long code);
Intl::Intl()
void Intl::update()
{
- int off,prim,sec;
+ int off, prim, sec;
- off=prim=sec=0;
+ off = prim = sec = 0;
if (!keymapon) {
- off=1;
+ off = 1;
} else {
if (primarykeymap) {
- prim=1;
+ prim = 1;
} else {
- sec=1;
+ sec = 1;
}
}
- fl_set_button(fd_form_keymap->KeyOffBtn,off);
- fl_set_button(fd_form_keymap->KeyOnBtn,prim);
- fl_set_button(fd_form_keymap->KeyOnBtn2,sec);
+ fl_set_button(fd_form_keymap->KeyOffBtn, off);
+ fl_set_button(fd_form_keymap->KeyOnBtn, prim);
+ fl_set_button(fd_form_keymap->KeyOnBtn2, sec);
}
void Intl::KeyMapSec()
{
- int i;
- string p;
-
fl_set_button(fd_form_keymap->KeyOffBtn, 0);
fl_set_button(fd_form_keymap->KeyOnBtn, 0);
fl_set_button(fd_form_keymap->KeyOnBtn2, 1);
/* read text from choice */
- i = Language2->get();
+ int i = Language2->get();
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "Table: " << tex_babel[i-1] << endl;
+ string p;
if (i == otherkeymap)
p = fl_get_input(fd_form_keymap->OtherKeymap2);
else
}
-void Intl::LCombo(int, void *v)
+void Intl::LCombo(int, void * v)
{
- Intl *itl = (Intl*) v;
+ Intl * itl = static_cast<Intl*>(v);
itl->Keymap(23);
return;
}
-void Intl::LCombo2(int, void *v)
+void Intl::LCombo2(int, void * v)
{
- Intl *itl = (Intl*) v;
+ Intl * itl = static_cast<Intl*>(v);
itl->Keymap(43);
return;
}
-void Intl::DispatchCallback(FL_OBJECT *ob,long code)
+void Intl::DispatchCallback(FL_OBJECT * ob, long code)
{
if (ob && (code == 0)) {
fl_hide_form(ob->form);
if (!ob || !(ob->u_vdata))
return;
- Intl *itl=(Intl *)ob->u_vdata;
+ Intl * itl = static_cast<Intl *>(ob->u_vdata);
- if (itl!=0) itl->Keymap(code);
+ if (itl!= 0) itl->Keymap(code);
}
-extern "C" void C_Intl_DispatchCallback(FL_OBJECT *ob,long code)
+extern "C" void C_Intl_DispatchCallback(FL_OBJECT * ob, long code)
{
- Intl::DispatchCallback(ob,code);
+ Intl::DispatchCallback(ob, code);
}
void Intl::InitKeyMapper(bool on)
Language = new Combox(FL_COMBOX_DROPLIST);
Language2 = new Combox(FL_COMBOX_DROPLIST);
- Language->setcallback(LCombo,this);
- Language2->setcallback(LCombo2,this);
+ Language->setcallback(LCombo, this);
+ Language2->setcallback(LCombo2, this);
fd_form_keymap = create_form_KeyMap();
// Add the Intl* pointer
- fd_form_keymap->AcceptChset->u_vdata=
- fd_form_keymap->Charset->u_vdata=
- fd_form_keymap->Accept->u_vdata=
- fd_form_keymap->OtherKeymap->u_vdata=
- fd_form_keymap->KeyOnBtn->u_vdata=
- fd_form_keymap->KeyOffBtn->u_vdata=
- fd_form_keymap->KeyOnBtn2->u_vdata=(void *)this;
+ fd_form_keymap->AcceptChset->u_vdata =
+ fd_form_keymap->Charset->u_vdata =
+ fd_form_keymap->Accept->u_vdata =
+ fd_form_keymap->OtherKeymap->u_vdata =
+ fd_form_keymap->KeyOnBtn->u_vdata =
+ fd_form_keymap->KeyOffBtn->u_vdata =
+ fd_form_keymap->KeyOnBtn2->u_vdata = this;
// add the callbacks.
fl_set_object_callback(fd_form_keymap->AcceptChset,
- C_Intl_DispatchCallback,27);
+ C_Intl_DispatchCallback, 27);
fl_set_object_callback(fd_form_keymap->Charset,
- C_Intl_DispatchCallback,26);
+ C_Intl_DispatchCallback, 26);
fl_set_object_callback(fd_form_keymap->Accept,
- C_Intl_DispatchCallback,0);
+ C_Intl_DispatchCallback, 0);
fl_set_object_callback(fd_form_keymap->KeyOnBtn,
- C_Intl_DispatchCallback,23);
+ C_Intl_DispatchCallback, 23);
fl_set_object_callback(fd_form_keymap->KeyOffBtn,
- C_Intl_DispatchCallback,3);
+ C_Intl_DispatchCallback, 3);
fl_set_object_callback(fd_form_keymap->KeyOnBtn2,
- C_Intl_DispatchCallback,43);
+ C_Intl_DispatchCallback, 43);
// Make sure pressing the close box does not kill LyX. (RvdK)
fl_set_form_atclose(fd_form_keymap->KeyMap, CancelCloseBoxCB, 0);
// Adds two comboxes to the keyboard map
fl_addto_form(fd_form_keymap->KeyMap);
- Language->add(120,30,160,30,300); // Primary
- Language2->add(120,110,160,30,300); // Secondary
+ Language->add(120, 30, 160, 30, 300); // Primary
+ Language2->add(120, 110, 160, 30, 300); // Secondary
fl_end_form();
- int n=0;
+ int n = 0;
while (true)
if (!strlen(tex_babel[n]))
void Intl::Keymap(long code)
{
- char const *p;
-
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "KeyMap callback: " << code << endl;
case 3:
case 23:
case 43:
- if (code==3) {
+ if (code == 3) {
KeyMapOn(false);
return;
}
code -= 19; // change to language change type code
case 4: // 4 and 24 will never be called directly, they will only be
- case 24: // called through 3,23,43 (lgb)
- if (code==4) {
+ case 24: // called through 3, 23, 43 (lgb)
+ if (code == 4) {
KeyMapPrim();
} else {
KeyMapSec();
}
break;
case 27: /* set new font norm */
- p = fl_get_input(fd_form_keymap->Charset);
+ char const * p = fl_get_input(fd_form_keymap->Charset);
if (trans->setCharset(p))
fl_show_object(fd_form_keymap->ChsetErr);
else
///
char *chsetcode;
///
- static void DispatchCallback(FL_OBJECT*,long);
+ static void DispatchCallback(FL_OBJECT*, long);
private:
///
//int SelectCharset(char const *code);
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include <cstring>
enum { ModsMask = ShiftMask | ControlMask | Mod1Mask};
-// === static functions ===================================================
+// === static functions ===================================================
/* ---F+------------------------------------------------------------------ *\
-// === kb_sequence methods ================================================
+// === kb_sequence methods ================================================
Returns : action or -1 if error (no map defined or key not found)
\* ---F------------------------------------------------------------------- */
-int kb_sequence::addkey(KeySym key, unsigned int mod, unsigned int nmod /*=0*/)
+int kb_sequence::addkey(KeySym key, unsigned int mod, unsigned int nmod /*= 0*/)
{
- if(length<0) length=0;
+ if(length<0) length = 0;
if(length+1 >= size) {
unsigned int *nseq = new unsigned int[size+KB_PREALLOC];
if(s[i] && (s[i]) <= ' ') i++;
if(!s[i]) break;
- if(s[i+1]=='-') { // is implicit that s[i]==true
+ if(s[i+1] == '-') { // is implicit that s[i] == true
switch(s[i]) {
case 's': case 'S':
mod |= ShiftMask;
- i+=2;
+ i+= 2;
continue;
case 'c': case 'C':
mod |= ControlMask;
- i+=2;
+ i+= 2;
continue;
case 'm': case 'M':
mod |= Mod1Mask;
- i+=2;
+ i+= 2;
continue;
default:
return i+1;
}
- } else if(s[i]=='~' && s[i+1] && s[i+2]=='-') {
+ } else if(s[i] == '~' && s[i+1] && s[i+2] == '-') {
switch(s[i+1]) {
case 's': case 'S':
nmod |= ShiftMask;
- i+=3;
+ i+= 3;
continue;
case 'c': case 'C':
nmod |= ControlMask;
- i+=3;
+ i+= 3;
continue;
case 'm': case 'M':
nmod |= Mod1Mask;
- i+=3;
+ i+= 3;
continue;
default:
return i+2;
#warning reimplement kb_sequence using string
#endif
char s[20];
- strcpy(s,_(" options: "));
+ strcpy(s, _(" options: "));
strcpy( buf, s);
buf += strlen(s);
maxlen -= strlen(s);
KeySym kb_sequence::getsym()
{
int l = length;
- if(l==0) return NoSymbol;
+ if(l == 0) return NoSymbol;
if(l<0) l = -l;
return sequence[l-1];
}
}
-// === kb_keymap methods ==================================================
+// === kb_keymap methods ==================================================
// This binds a key to an action
int kb_keymap::bind(char const *seq, int action)
Returns : 0 if ok.
\* ---F------------------------------------------------------------------- */
-int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*=0*/)
+int kb_keymap::defkey(kb_sequence *seq, int action, int idx /*= 0*/)
{
int tsize;
unsigned int code, modmsk;
// --- check if key is already there --------------------------------
kb_key *t;
- for(t = tab, tsize=1; t->code != NoSymbol; t++, tsize++) {
+ for(t = tab, tsize = 1; t->code != NoSymbol; t++, tsize++) {
if(code == t->code && modmsk == t->mod) { // -- overwrite binding ---
if(idx+1 == seq->length) {
char buf[20]; buf[0] = 0;
*ptab = nt;
delete[] tab;
tab = nt;
- if(size>=0) size = tsize+KB_PREALLOC;
+ if(size>= 0) size = tsize+KB_PREALLOC;
}
// --- add action ---------------------------------------------------
// --- convert list to hash table if necessary ----------------------
- if(size>=0 && tsize>=32) {
+ if(size>= 0 && tsize>= 32) {
kb_key *oldtab = tab;
kb_key **nht = new kb_key*[KB_HASHSIZE];
for(int i = 0; i < KB_HASHSIZE; i++)
{
if(!table) return;
if(size<0) {
- for(int i=0; i < KB_HASHSIZE; i++) {
+ for(int i = 0; i < KB_HASHSIZE; i++) {
if(htable[i]) {
for(kb_key *t = htable[i]; t->code != NoSymbol; t++)
if(t->table)
return res;
if (size<0) {
- for(int i=0; i < KB_HASHSIZE; i++) {
+ for(int i = 0; i < KB_HASHSIZE; i++) {
if(htable[i]) {
for(kb_key *t = htable[i]; t->code != NoSymbol; t++) {
if(t->table) {
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
num_files = no;
else {
lyxerr << "LyX: lastfiles: too many files\n"
- "\tdefault (=" << int(DEFAULTFILES)
+ "\tdefault (= " << int(DEFAULTFILES)
<< ") used." << endl;
num_files = DEFAULTFILES;
}
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
FD_LaTeXOptions *fdui = (FD_LaTeXOptions *) fl_calloc(1, sizeof(FD_LaTeXOptions));
fdui->LaTeXOptions = fl_bgn_form(FL_NO_BOX, 310, 90);
- obj = fl_add_box(FL_UP_BOX,0,0,310,90,"");
- fdui->accents = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,10,310,30,idex(_("Allow accents on ALL characters|#w")));fl_set_button_shortcut(obj,scex(_("Allow accents on ALL characters|#w")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- obj = fl_add_button(FL_RETURN_BUTTON,10,50,90,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,LaTeXOptionsOK,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,110,50,90,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,LaTeXOptionsApply,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,210,50,90,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,LaTeXOptionsCancel,0);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 310, 90, "");
+ fdui->accents = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 10, 310, 30, idex(_("Allow accents on ALL characters|#w")));fl_set_button_shortcut(obj, scex(_("Allow accents on ALL characters|#w")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ obj = fl_add_button(FL_RETURN_BUTTON, 10, 50, 90, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, LaTeXOptionsOK, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 110, 50, 90, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, LaTeXOptionsApply, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 210, 50, 90, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, LaTeXOptionsCancel, 0);
fl_end_form();
//fdui->LaTeXOptions->fdui = fdui;
FD_LaTeXLog *fdui = (FD_LaTeXLog *) fl_calloc(1, sizeof(FD_LaTeXLog));
fdui->LaTeXLog = fl_bgn_form(FL_NO_BOX, 470, 380);
- obj = fl_add_box(FL_UP_BOX,0,0,470,380,"");
- fdui->browser_latexlog = obj = fl_add_browser(FL_NORMAL_BROWSER,10,10,450,320,"");
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 470, 380, "");
+ fdui->browser_latexlog = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 10, 450, 320, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- obj = fl_add_button(FL_RETURN_BUTTON,270,340,90,30,_("Close"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_button(FL_RETURN_BUTTON, 270, 340, 90, 30, _("Close"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,LatexLogClose,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,370,340,90,30,idex(_("Update|#Uu")));fl_set_button_shortcut(obj,scex(_("Update|#Uu")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, LatexLogClose, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 370, 340, 90, 30, idex(_("Update|#Uu")));fl_set_button_shortcut(obj, scex(_("Update|#Uu")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,LatexLogUpdate,0);
+ fl_set_object_callback(obj, LatexLogUpdate, 0);
fl_end_form();
//fdui->LaTeXLog->fdui = fdui;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
using std::make_pair;
using std::sort;
-#include "definitions.h"
#include "layout.h"
#include "lyxlex.h"
#include "support/filetools.h"
if (lexrc.next()) {
if (tclass.hasLayout(lexrc.GetString())) {
string tmpname = name_;
- this->operator=(tclass.GetLayout(lexrc.GetString()));
+ this->operator= (tclass.GetLayout(lexrc.GetString()));
name_ = tmpname;
} else {
lexrc.printError("Cannot copy known "
if (lexrc.next()) {
if (tclass.hasLayout(lexrc.GetString())) {
string tmpname = name_;
- this->operator=(tclass.GetLayout(lexrc.GetString()));
+ this->operator= (tclass.GetLayout(lexrc.GetString()));
name_ = tmpname;
if (obsoleted_by().empty())
obsoleted_by_ = lexrc.GetString();
case LT_LATEXTYPE: // Latex style definition.
switch (lexrc.lex()) {
case LT_PARAGRAPH:
- latextype=LATEX_PARAGRAPH;
+ latextype= LATEX_PARAGRAPH;
break;
case LT_COMMAND:
- latextype=LATEX_COMMAND;
+ latextype= LATEX_COMMAND;
break;
case LT_ENVIRONMENT:
- latextype=LATEX_ENVIRONMENT;
+ latextype= LATEX_ENVIRONMENT;
break;
case LT_ITEM_ENVIRONMENT:
- latextype=LATEX_ITEM_ENVIRONMENT;
+ latextype= LATEX_ITEM_ENVIRONMENT;
break;
case LT_LIST_ENVIRONMENT:
- latextype=LATEX_LIST_ENVIRONMENT;
+ latextype= LATEX_LIST_ENVIRONMENT;
break;
default:
lexrc.printError("Unknown latextype `$$Token'");
case LT_FONT:
font.lyxRead(lexrc);
- labelfont=font;
+ labelfont= font;
break;
case LT_TEXTFONT:
} else {
LyXLayout lay;
lay.name(name);
- if (!(error =do_readStyle(lexrc, lay)))
+ if (!(error = do_readStyle(lexrc, lay)))
layoutlist.push_back(lay);
}
}
using std::vector;
using std::pair;
-#include "definitions.h"
#include "lyxlex.h"
#include "lyxfont.h"
#include "Spacing.h"
/// Reads the style files
extern void LyXSetStyle();
+///
+enum { // no good name for this
+ ///
+ LYX_ENVIRONMENT_DEFAULT = 97,
+ ///
+ LYX_LAYOUT_DEFAULT = 99
+};
+// Could this cause confusion that both DUMMY_LAYOUT and LAYOUT_DEFAULT has
+// the same value? (Lgb)
+///
+#define LYX_DUMMY_LAYOUT 99
+
/// The different output types
enum OutputType {
///
FD_form_document *fdui = (FD_form_document *) fl_calloc(1, sizeof(FD_form_document));
fdui->form_document = fl_bgn_form(FL_NO_BOX, 580, 430);
- obj = fl_add_box(FL_UP_BOX,0,0,580,430,"");
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 580, 430, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,290,110,120,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 290, 110, 120, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- obj = fl_add_text(FL_NORMAL_TEXT,300,100,100,20,_("Separation"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 300, 100, 100, 20, _("Separation"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fdui->group_radio_separation = fl_bgn_group();
- fdui->radio_indent = obj = fl_add_checkbutton(FL_RADIO_BUTTON,290,120,110,30,idex(_("Indent|#I")));fl_set_button_shortcut(obj,scex(_("Indent|#I")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_indent = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 120, 110, 30, idex(_("Indent|#I")));fl_set_button_shortcut(obj, scex(_("Indent|#I")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->radio_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON,290,150,110,30,idex(_("Skip|#K")));fl_set_button_shortcut(obj,scex(_("Skip|#K")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_skip = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 150, 110, 30, idex(_("Skip|#K")));fl_set_button_shortcut(obj, scex(_("Skip|#K")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_end_group();
- fdui->choice_class = obj = fl_add_choice(FL_NORMAL_CHOICE,120,20,160,30,idex(_("Class:|#C")));fl_set_button_shortcut(obj,scex(_("Class:|#C")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_class = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 20, 160, 30, idex(_("Class:|#C")));fl_set_button_shortcut(obj, scex(_("Class:|#C")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,ChoiceClassCB,0);
- fdui->choice_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE,120,60,160,30,idex(_("Pagestyle:|#P")));fl_set_button_shortcut(obj,scex(_("Pagestyle:|#P")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ChoiceClassCB, 0);
+ fdui->choice_pagestyle = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 60, 160, 30, idex(_("Pagestyle:|#P")));fl_set_button_shortcut(obj, scex(_("Pagestyle:|#P")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->choice_fonts = obj = fl_add_choice(FL_NORMAL_CHOICE,120,110,160,30,idex(_("Fonts:|#F")));fl_set_button_shortcut(obj,scex(_("Fonts:|#F")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_fonts = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 110, 160, 30, idex(_("Fonts:|#F")));fl_set_button_shortcut(obj, scex(_("Fonts:|#F")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->choice_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE,120,150,160,30,idex(_("Font Size:|#O")));fl_set_button_shortcut(obj,scex(_("Font Size:|#O")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_fontsize = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 150, 160, 30, idex(_("Font Size:|#O")));fl_set_button_shortcut(obj, scex(_("Font Size:|#O")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON,470,390,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 470, 390, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,DocumentCancelCB,0);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,360,390,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, DocumentCancelCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 360, 390, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,DocumentApplyCB,0);
- fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON,250,390,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, DocumentApplyCB, 0);
+ fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 250, 390, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,DocumentOKCB,0);
- fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT,450,195,120,30,idex(_("Float Placement:|#L")));fl_set_button_shortcut(obj,scex(_("Float Placement:|#L")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, DocumentOKCB, 0);
+ fdui->input_float_placement = obj = fl_add_input(FL_NORMAL_INPUT, 450, 195, 120, 30, idex(_("Float Placement:|#L")));fl_set_button_shortcut(obj, scex(_("Float Placement:|#L")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE,120,230,190,30,idex(_("PS Driver:|#S")));fl_set_button_shortcut(obj,scex(_("PS Driver:|#S")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_postscript_driver = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 230, 190, 30, idex(_("PS Driver:|#S")));fl_set_button_shortcut(obj, scex(_("PS Driver:|#S")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->choice_inputenc = obj = fl_add_choice(FL_NORMAL_CHOICE,120,270,190,30,idex(_("Encoding:|#D")));fl_set_button_shortcut(obj,scex(_("Encoding:|#D")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_inputenc = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 270, 190, 30, idex(_("Encoding:|#D")));fl_set_button_shortcut(obj, scex(_("Encoding:|#D")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,290,20,122,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 290, 20, 122, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,432,20,136,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 432, 20, 136, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fdui->group_radio_sides = fl_bgn_group();
- fdui->radio_sides_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON,290,30,120,30,idex(_("One|#n")));fl_set_button_shortcut(obj,scex(_("One|#n")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_sides_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 30, 120, 30, idex(_("One|#n")));fl_set_button_shortcut(obj, scex(_("One|#n")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->radio_sides_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON,290,60,120,30,idex(_("Two|#T")));fl_set_button_shortcut(obj,scex(_("Two|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_sides_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 290, 60, 120, 30, idex(_("Two|#T")));fl_set_button_shortcut(obj, scex(_("Two|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_end_group();
- obj = fl_add_text(FL_NORMAL_TEXT,300,10,60,20,_("Sides"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 300, 10, 60, 20, _("Sides"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- obj = fl_add_text(FL_NORMAL_TEXT,440,10,80,20,_("Columns"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 440, 10, 80, 20, _("Columns"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fdui->group_radio_columns = fl_bgn_group();
- fdui->radio_columns_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON,432,30,110,30,idex(_("One|#e")));fl_set_button_shortcut(obj,scex(_("One|#e")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_columns_one = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 432, 30, 110, 30, idex(_("One|#e")));fl_set_button_shortcut(obj, scex(_("One|#e")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->radio_columns_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON,432,60,110,30,idex(_("Two|#w")));fl_set_button_shortcut(obj,scex(_("Two|#w")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_columns_two = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 432, 60, 110, 30, idex(_("Two|#w")));fl_set_button_shortcut(obj, scex(_("Two|#w")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
fl_end_group();
- fdui->input_extra = obj = fl_add_input(FL_NORMAL_INPUT,450,235,120,30,idex(_("Extra Options:|#X")));fl_set_button_shortcut(obj,scex(_("Extra Options:|#X")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_extra = obj = fl_add_input(FL_NORMAL_INPUT, 450, 235, 120, 30, idex(_("Extra Options:|#X")));fl_set_button_shortcut(obj, scex(_("Extra Options:|#X")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->choice_language = obj = fl_add_box(FL_FRAME_BOX,120,190,190,30,_("Language:"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
+ fdui->choice_language = obj = fl_add_box(FL_FRAME_BOX, 120, 190, 190, 30, _("Language:"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->input_default_skip = obj = fl_add_input(FL_NORMAL_INPUT,220,310,90,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_default_skip = obj = fl_add_input(FL_NORMAL_INPUT, 220, 310, 90, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,DocumentDefskipCB,0);
- fdui->choice_default_skip = obj = fl_add_choice(FL_NORMAL_CHOICE,120,310,90,30,idex(_("Default Skip:|#u")));fl_set_button_shortcut(obj,scex(_("Default Skip:|#u")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, DocumentDefskipCB, 0);
+ fdui->choice_default_skip = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 310, 90, 30, idex(_("Default Skip:|#u")));fl_set_button_shortcut(obj, scex(_("Default Skip:|#u")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,DocumentDefskipCB,0);
- fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER,490,275,80,30,_("Section number depth"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
+ fl_set_object_callback(obj, DocumentDefskipCB, 0);
+ fdui->slider_secnumdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 490, 275, 80, 30, _("Section number depth"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER,490,315,80,30,_("Table of contents depth"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
+ fdui->slider_tocdepth = obj = fl_add_counter(FL_SIMPLE_COUNTER, 490, 315, 80, 30, _("Table of contents depth"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->choice_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE,120,350,120,30,idex(_("Spacing|#g")));fl_set_button_shortcut(obj,scex(_("Spacing|#g")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_spacing = obj = fl_add_choice(FL_NORMAL_CHOICE, 120, 350, 120, 30, idex(_("Spacing|#g")));fl_set_button_shortcut(obj, scex(_("Spacing|#g")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,DocumentSpacingCB,0);
- fdui->button_bullets = obj = fl_add_button(FL_NORMAL_BUTTON,430,110,130,30,idex(_("Bullet Shapes|#B")));fl_set_button_shortcut(obj,scex(_("Bullet Shapes|#B")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, DocumentSpacingCB, 0);
+ fdui->button_bullets = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 110, 130, 30, idex(_("Bullet Shapes|#B")));fl_set_button_shortcut(obj, scex(_("Bullet Shapes|#B")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,DocumentBulletsCB,0);
- fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON,430,145,120,30,idex(_("Use AMS Math|#M")));fl_set_button_shortcut(obj,scex(_("Use AMS Math|#M")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, DocumentBulletsCB, 0);
+ fdui->check_use_amsmath = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 430, 145, 120, 30, idex(_("Use AMS Math|#M")));fl_set_button_shortcut(obj, scex(_("Use AMS Math|#M")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fdui->input_spacing = obj = fl_add_input(FL_FLOAT_INPUT,250,350,95,30,"");
+ fdui->input_spacing = obj = fl_add_input(FL_FLOAT_INPUT, 250, 350, 95, 30, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_NONE);
- fl_set_object_callback(obj,DocumentSpacingCB,0);
+ fl_set_object_callback(obj, DocumentSpacingCB, 0);
fl_end_form();
//fdui->form_document->fdui = fdui;
FD_form_character *fdui = (FD_form_character *) fl_calloc(1, sizeof(FD_form_character));
fdui->form_character = fl_bgn_form(FL_NO_BOX, 300, 375);
- obj = fl_add_box(FL_UP_BOX,0,0,300,375,"");
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 300, 375, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,280,280,45,"");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 280, 280, 45, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,220,280,45,"");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 220, 280, 45, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,10,280,195,"");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 10, 280, 195, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->choice_family = obj = fl_add_choice(FL_NORMAL_CHOICE,94,15,191,30,idex(_("Family:|#F")));fl_set_button_shortcut(obj,scex(_("Family:|#F")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_family = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 15, 191, 30, idex(_("Family:|#F")));fl_set_button_shortcut(obj, scex(_("Family:|#F")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE,94,55,191,30,idex(_("Series:|#S")));fl_set_button_shortcut(obj,scex(_("Series:|#S")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_series = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 55, 191, 30, idex(_("Series:|#S")));fl_set_button_shortcut(obj, scex(_("Series:|#S")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE,94,95,191,30,idex(_("Shape:|#H")));fl_set_button_shortcut(obj,scex(_("Shape:|#H")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_shape = obj = fl_add_choice(FL_NORMAL_CHOICE, 94, 95, 191, 30, idex(_("Shape:|#H")));fl_set_button_shortcut(obj, scex(_("Shape:|#H")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE,95,230,191,30,idex(_("Size:|#Z")));fl_set_button_shortcut(obj,scex(_("Size:|#Z")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_size = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 230, 191, 30, idex(_("Size:|#Z")));fl_set_button_shortcut(obj, scex(_("Size:|#Z")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE,95,290,190,30,idex(_("Misc:|#M")));fl_set_button_shortcut(obj,scex(_("Misc:|#M")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->choice_bar = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 290, 190, 30, idex(_("Misc:|#M")));fl_set_button_shortcut(obj, scex(_("Misc:|#M")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,60,330,80,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 60, 330, 80, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,CharacterApplyCB,0);
- fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON,175,330,80,30,_("Close"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CharacterApplyCB, 0);
+ fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 175, 330, 80, 30, _("Close"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,CharacterCloseCB,0);
- fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE,95,135,191,30,idex(_("Color:|#C")));fl_set_button_shortcut(obj,scex(_("Color:|#C")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CharacterCloseCB, 0);
+ fdui->choice_color = obj = fl_add_choice(FL_NORMAL_CHOICE, 95, 135, 191, 30, idex(_("Color:|#C")));fl_set_button_shortcut(obj, scex(_("Color:|#C")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON,30,175,260,25,idex(_("Toggle on all these|#T")));fl_set_button_shortcut(obj,scex(_("Toggle on all these|#T")),1);
+ fdui->check_toggle_all = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 30, 175, 260, 25, idex(_("Toggle on all these|#T")));fl_set_button_shortcut(obj, scex(_("Toggle on all these|#T")), 1);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_text(FL_NORMAL_TEXT,20,210,210,20,_("These are never toggled"));
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 210, 210, 20, _("These are never toggled"));
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_text(FL_NORMAL_TEXT,20,270,215,20,_("These are always toggled"));
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 270, 215, 20, _("These are always toggled"));
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fl_end_form();
FD_form_paragraph *fdui = (FD_form_paragraph *) fl_calloc(1, sizeof(FD_form_paragraph));
fdui->form_paragraph = fl_bgn_form(FL_NO_BOX, 490, 290);
- obj = fl_add_box(FL_UP_BOX,0,0,490,290,"");
- fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON,127,250,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 490, 290, "");
+ fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 127, 250, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ParagraphOKCB,0);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,244,250,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphOKCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 244, 250, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ParagraphApplyCB,0);
- fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON,360,250,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphApplyCB, 0);
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 360, 250, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ParagraphCancelCB,0);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,360,110,120,50,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,110,340,90,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,360,20,120,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,210,20,140,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,20,190,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fdui->input_labelwidth = obj = fl_add_input(FL_NORMAL_INPUT,100,210,360,30,idex(_("Label Width:|#d")));fl_set_button_shortcut(obj,scex(_("Label Width:|#d")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphCancelCB, 0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 360, 110, 120, 50, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 110, 340, 90, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 360, 20, 120, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 210, 20, 140, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 190, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fdui->input_labelwidth = obj = fl_add_input(FL_NORMAL_INPUT, 100, 210, 360, 30, idex(_("Label Width:|#d")));fl_set_button_shortcut(obj, scex(_("Label Width:|#d")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_West, FL_East);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_text(FL_NORMAL_TEXT,370,100,60,20,_("Indent"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->check_lines_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON,230,30,120,30,idex(_("Above|#b")));fl_set_button_shortcut(obj,scex(_("Above|#b")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->check_lines_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON,230,60,120,30,idex(_("Below|#E")));fl_set_button_shortcut(obj,scex(_("Below|#E")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->check_pagebreaks_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON,360,30,120,30,idex(_("Above|#o")));fl_set_button_shortcut(obj,scex(_("Above|#o")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->check_pagebreaks_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON,360,60,120,30,idex(_("Below|#l")));fl_set_button_shortcut(obj,scex(_("Below|#l")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->check_noindent = obj = fl_add_checkbutton(FL_PUSH_BUTTON,360,120,120,30,idex(_("No Indent|#I")));fl_set_button_shortcut(obj,scex(_("No Indent|#I")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 370, 100, 60, 20, _("Indent"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->check_lines_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 30, 120, 30, idex(_("Above|#b")));fl_set_button_shortcut(obj, scex(_("Above|#b")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->check_lines_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 230, 60, 120, 30, idex(_("Below|#E")));fl_set_button_shortcut(obj, scex(_("Below|#E")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->check_pagebreaks_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 30, 120, 30, idex(_("Above|#o")));fl_set_button_shortcut(obj, scex(_("Above|#o")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->check_pagebreaks_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 60, 120, 30, idex(_("Below|#l")));fl_set_button_shortcut(obj, scex(_("Below|#l")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->check_noindent = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 360, 120, 120, 30, idex(_("No Indent|#I")));fl_set_button_shortcut(obj, scex(_("No Indent|#I")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->group_radio_alignment = fl_bgn_group();
- fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,30,80,30,idex(_("Right|#R")));fl_set_button_shortcut(obj,scex(_("Right|#R")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,60,80,30,idex(_("Left|#f")));fl_set_button_shortcut(obj,scex(_("Left|#f")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_align_block = obj = fl_add_checkbutton(FL_RADIO_BUTTON,100,30,80,30,idex(_("Block|#c")));fl_set_button_shortcut(obj,scex(_("Block|#c")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON,100,60,80,30,idex(_("Center|#n")));fl_set_button_shortcut(obj,scex(_("Center|#n")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 80, 30, idex(_("Right|#R")));fl_set_button_shortcut(obj, scex(_("Right|#R")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 80, 30, idex(_("Left|#f")));fl_set_button_shortcut(obj, scex(_("Left|#f")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_align_block = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 30, 80, 30, idex(_("Block|#c")));fl_set_button_shortcut(obj, scex(_("Block|#c")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 100, 60, 80, 30, idex(_("Center|#n")));fl_set_button_shortcut(obj, scex(_("Center|#n")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- fdui->input_space_above = obj = fl_add_input(FL_NORMAL_INPUT,180,120,90,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,ParagraphVSpaceCB,0);
- fdui->input_space_below = obj = fl_add_input(FL_NORMAL_INPUT,180,160,90,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,ParagraphVSpaceCB,0);
- fdui->choice_space_above = obj = fl_add_choice(FL_NORMAL_CHOICE,70,120,100,30,idex(_("Above:|#v")));fl_set_button_shortcut(obj,scex(_("Above:|#v")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,ParagraphVSpaceCB,0);
- fdui->choice_space_below = obj = fl_add_choice(FL_NORMAL_CHOICE,70,160,100,30,idex(_("Below:|#w")));fl_set_button_shortcut(obj,scex(_("Below:|#w")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,ParagraphVSpaceCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,370,10,100,20,_("Pagebreaks"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,230,10,50,20,_("Lines"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,80,20,_("Alignment"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,100,130,20,_("Vertical Spaces"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->button_pextra = obj = fl_add_button(FL_NORMAL_BUTTON,10,250,100,30,idex(_("ExtraOpt|#X")));fl_set_button_shortcut(obj,scex(_("ExtraOpt|#X")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_space_above = obj = fl_add_input(FL_NORMAL_INPUT, 180, 120, 90, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
+ fdui->input_space_below = obj = fl_add_input(FL_NORMAL_INPUT, 180, 160, 90, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
+ fdui->choice_space_above = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 120, 100, 30, idex(_("Above:|#v")));fl_set_button_shortcut(obj, scex(_("Above:|#v")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
+ fdui->choice_space_below = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 160, 100, 30, idex(_("Below:|#w")));fl_set_button_shortcut(obj, scex(_("Below:|#w")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphVSpaceCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 370, 10, 100, 20, _("Pagebreaks"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 230, 10, 50, 20, _("Lines"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 80, 20, _("Alignment"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 100, 130, 20, _("Vertical Spaces"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->button_pextra = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 250, 100, 30, idex(_("ExtraOpt|#X")));fl_set_button_shortcut(obj, scex(_("ExtraOpt|#X")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ParagraphExtraOpen,0);
- fdui->check_space_above = obj = fl_add_checkbutton(FL_PUSH_BUTTON,270,120,40,30,idex(_("Keep|#K")));fl_set_button_shortcut(obj,scex(_("Keep|#K")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->check_space_below = obj = fl_add_checkbutton(FL_PUSH_BUTTON,270,160,40,30,idex(_("Keep|#p")));fl_set_button_shortcut(obj,scex(_("Keep|#p")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphExtraOpen, 0);
+ fdui->check_space_above = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 120, 40, 30, idex(_("Keep|#K")));fl_set_button_shortcut(obj, scex(_("Keep|#K")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->check_space_below = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 270, 160, 40, 30, idex(_("Keep|#p")));fl_set_button_shortcut(obj, scex(_("Keep|#p")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form();
//fdui->form_paragraph->fdui = fdui;
FD_form_preamble *fdui = (FD_form_preamble *) fl_calloc(1, sizeof(FD_form_preamble));
fdui->form_preamble = fl_bgn_form(FL_NO_BOX, 380, 420);
- obj = fl_add_box(FL_UP_BOX,0,0,380,420,"");
- fdui->button_ok = obj = fl_add_button(FL_NORMAL_BUTTON,50,380,100,30,idex(_("OK|#O")));fl_set_button_shortcut(obj,scex(_("OK|#O")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 380, 420, "");
+ fdui->button_ok = obj = fl_add_button(FL_NORMAL_BUTTON, 50, 380, 100, 30, idex(_("OK|#O")));fl_set_button_shortcut(obj, scex(_("OK|#O")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,PreambleOKCB,0);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,160,380,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PreambleOKCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 160, 380, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,PreambleApplyCB,0);
- fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON,270,380,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PreambleApplyCB, 0);
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 270, 380, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,PreambleCancelCB,0);
- fdui->input_preamble = obj = fl_add_input(FL_MULTILINE_INPUT,10,10,360,360,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PreambleCancelCB, 0);
+ fdui->input_preamble = obj = fl_add_input(FL_MULTILINE_INPUT, 10, 10, 360, 360, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
fl_end_form();
FD_form_quotes *fdui = (FD_form_quotes *) fl_calloc(1, sizeof(FD_form_quotes));
fdui->form_quotes = fl_bgn_form(FL_NO_BOX, 340, 130);
- obj = fl_add_box(FL_UP_BOX,0,0,340,130,"");
- obj = fl_add_button(FL_RETURN_BUTTON,10,90,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,QuotesOKCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,120,90,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,QuotesApplyCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,230,90,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,QuotesCancelCB,0);
- fdui->choice_quotes_language = obj = fl_add_choice(FL_NORMAL_CHOICE,90,10,160,30,idex(_("Type:|#T")));fl_set_button_shortcut(obj,scex(_("Type:|#T")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 130, "");
+ obj = fl_add_button(FL_RETURN_BUTTON, 10, 90, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, QuotesOKCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 120, 90, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, QuotesApplyCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 230, 90, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, QuotesCancelCB, 0);
+ fdui->choice_quotes_language = obj = fl_add_choice(FL_NORMAL_CHOICE, 90, 10, 160, 30, idex(_("Type:|#T")));fl_set_button_shortcut(obj, scex(_("Type:|#T")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->group_radio_quotes_number = fl_bgn_group();
- fdui->radio_single = obj = fl_add_checkbutton(FL_RADIO_BUTTON,90,50,80,30,idex(_("Single|#S")));fl_set_button_shortcut(obj,scex(_("Single|#S")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_double = obj = fl_add_checkbutton(FL_RADIO_BUTTON,170,50,80,30,idex(_("Double|#D")));fl_set_button_shortcut(obj,scex(_("Double|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_single = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 90, 50, 80, 30, idex(_("Single|#S")));fl_set_button_shortcut(obj, scex(_("Single|#S")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_double = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 170, 50, 80, 30, idex(_("Double|#D")));fl_set_button_shortcut(obj, scex(_("Double|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- obj = fl_add_text(FL_NORMAL_TEXT,290,230,10,10,_("Text"));
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 290, 230, 10, 10, _("Text"));
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
fl_end_form();
//fdui->form_quotes->fdui = fdui;
FD_form_paper *fdui = (FD_form_paper *) fl_calloc(1, sizeof(FD_form_paper));
fdui->form_paper = fl_bgn_form(FL_NO_BOX, 440, 430);
- obj = fl_add_box(FL_UP_BOX,0,0,440,430,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,230,100,200,100,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- fdui->choice_paperpackage = obj = fl_add_choice(FL_NORMAL_CHOICE,290,20,140,30,idex(_("Special:|#S")));fl_set_button_shortcut(obj,scex(_("Special:|#S")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,230,220,200,130,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,180,190,170,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- obj = fl_add_text(FL_NORMAL_TEXT,20,170,70,20,_("Margins"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,240,210,160,20,_("Foot/Head Margins"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON,320,390,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperCancelCB,0);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,210,390,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperApplyCB,0);
- fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON,100,390,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperOKCB,0);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,440,360,10,10,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,440,350,10,10,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,100,190,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,90,95,20,_("Orientation"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 440, 430, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 100, 200, 100, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fdui->choice_paperpackage = obj = fl_add_choice(FL_NORMAL_CHOICE, 290, 20, 140, 30, idex(_("Special:|#S")));fl_set_button_shortcut(obj, scex(_("Special:|#S")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 230, 220, 200, 130, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 180, 190, 170, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 170, 70, 20, _("Margins"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 240, 210, 160, 20, _("Foot/Head Margins"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 320, 390, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperCancelCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 390, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperApplyCB, 0);
+ fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 100, 390, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperOKCB, 0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 440, 360, 10, 10, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 440, 350, 10, 10, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 100, 190, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 90, 95, 20, _("Orientation"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->greoup_radio_orientation = fl_bgn_group();
- fdui->radio_portrait = obj = fl_add_checkbutton(FL_RADIO_BUTTON,20,105,120,30,idex(_("Portrait|#o")));fl_set_button_shortcut(obj,scex(_("Portrait|#o")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_landscape = obj = fl_add_checkbutton(FL_RADIO_BUTTON,20,135,120,30,idex(_("Landscape|#L")));fl_set_button_shortcut(obj,scex(_("Landscape|#L")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_portrait = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 105, 120, 30, idex(_("Portrait|#o")));fl_set_button_shortcut(obj, scex(_("Portrait|#o")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_landscape = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 20, 135, 120, 30, idex(_("Landscape|#L")));fl_set_button_shortcut(obj, scex(_("Landscape|#L")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- fdui->choice_papersize2 = obj = fl_add_choice(FL_NORMAL_CHOICE,70,20,160,30,idex(_("Papersize:|#P")));fl_set_button_shortcut(obj,scex(_("Papersize:|#P")),1);
- fl_set_object_boxtype(obj,FL_FRAME_BOX);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,240,90,150,20,_("Custom Papersize"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->push_use_geometry = obj = fl_add_checkbutton(FL_PUSH_BUTTON,20,55,170,30,idex(_("Use Geometry Package|#U")));fl_set_button_shortcut(obj,scex(_("Use Geometry Package|#U")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->input_custom_width = obj = fl_add_input(FL_NORMAL_INPUT,330,115,90,30,idex(_("Width:|#W")));fl_set_button_shortcut(obj,scex(_("Width:|#W")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_custom_height = obj = fl_add_input(FL_NORMAL_INPUT,330,155,90,30,idex(_("Height:|#H")));fl_set_button_shortcut(obj,scex(_("Height:|#H")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_top_margin = obj = fl_add_input(FL_NORMAL_INPUT,100,190,90,30,idex(_("Top:|#T")));fl_set_button_shortcut(obj,scex(_("Top:|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_bottom_margin = obj = fl_add_input(FL_NORMAL_INPUT,100,230,90,30,idex(_("Bottom:|#B")));fl_set_button_shortcut(obj,scex(_("Bottom:|#B")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_left_margin = obj = fl_add_input(FL_NORMAL_INPUT,100,270,90,30,idex(_("Left:|#e")));fl_set_button_shortcut(obj,scex(_("Left:|#e")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_right_margin = obj = fl_add_input(FL_NORMAL_INPUT,100,310,90,30,idex(_("Right:|#R")));fl_set_button_shortcut(obj,scex(_("Right:|#R")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_head_height = obj = fl_add_input(FL_NORMAL_INPUT,330,230,90,30,idex(_("Headheight:|#i")));fl_set_button_shortcut(obj,scex(_("Headheight:|#i")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_head_sep = obj = fl_add_input(FL_NORMAL_INPUT,330,270,90,30,idex(_("Headsep:|#d")));fl_set_button_shortcut(obj,scex(_("Headsep:|#d")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->input_foot_skip = obj = fl_add_input(FL_NORMAL_INPUT,330,310,90,30,idex(_("Footskip:|#F")));fl_set_button_shortcut(obj,scex(_("Footskip:|#F")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PaperMarginsCB,0);
- fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT,10,360,420,20,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ fdui->choice_papersize2 = obj = fl_add_choice(FL_NORMAL_CHOICE, 70, 20, 160, 30, idex(_("Papersize:|#P")));fl_set_button_shortcut(obj, scex(_("Papersize:|#P")), 1);
+ fl_set_object_boxtype(obj, FL_FRAME_BOX);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 240, 90, 150, 20, _("Custom Papersize"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->push_use_geometry = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 20, 55, 170, 30, idex(_("Use Geometry Package|#U")));fl_set_button_shortcut(obj, scex(_("Use Geometry Package|#U")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->input_custom_width = obj = fl_add_input(FL_NORMAL_INPUT, 330, 115, 90, 30, idex(_("Width:|#W")));fl_set_button_shortcut(obj, scex(_("Width:|#W")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_custom_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 155, 90, 30, idex(_("Height:|#H")));fl_set_button_shortcut(obj, scex(_("Height:|#H")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_top_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 190, 90, 30, idex(_("Top:|#T")));fl_set_button_shortcut(obj, scex(_("Top:|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_bottom_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 230, 90, 30, idex(_("Bottom:|#B")));fl_set_button_shortcut(obj, scex(_("Bottom:|#B")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_left_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 270, 90, 30, idex(_("Left:|#e")));fl_set_button_shortcut(obj, scex(_("Left:|#e")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_right_margin = obj = fl_add_input(FL_NORMAL_INPUT, 100, 310, 90, 30, idex(_("Right:|#R")));fl_set_button_shortcut(obj, scex(_("Right:|#R")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_head_height = obj = fl_add_input(FL_NORMAL_INPUT, 330, 230, 90, 30, idex(_("Headheight:|#i")));fl_set_button_shortcut(obj, scex(_("Headheight:|#i")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_head_sep = obj = fl_add_input(FL_NORMAL_INPUT, 330, 270, 90, 30, idex(_("Headsep:|#d")));fl_set_button_shortcut(obj, scex(_("Headsep:|#d")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->input_foot_skip = obj = fl_add_input(FL_NORMAL_INPUT, 330, 310, 90, 30, idex(_("Footskip:|#F")));fl_set_button_shortcut(obj, scex(_("Footskip:|#F")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PaperMarginsCB, 0);
+ fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 360, 420, 20, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form();
//fdui->form_paper->fdui = fdui;
FD_form_table_options *fdui = (FD_form_table_options *) fl_calloc(1, sizeof(FD_form_table_options));
fdui->form_table_options = fl_bgn_form(FL_NO_BOX, 540, 310);
- obj = fl_add_box(FL_UP_BOX,0,0,540,310,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,300,120,110,60,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,300,20,110,90,"");
- fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT,20,275,330,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON,430,270,100,30,_("Close"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptCloseCB,0);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,20,20,145,105,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- obj = fl_add_text(FL_NORMAL_TEXT,30,10,70,20,_("Borders"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->radio_border_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON,75,45,25,25,idex(_("Top|#T")));fl_set_button_shortcut(obj,scex(_("Top|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON,75,75,25,25,idex(_("Bottom|#B")));fl_set_button_shortcut(obj,scex(_("Bottom|#B")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_BOTTOM_LEFT);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON,55,60,25,25,idex(_("Left|#L")));fl_set_button_shortcut(obj,scex(_("Left|#L")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON,95,60,25,25,idex(_("Right|#R")));fl_set_button_shortcut(obj,scex(_("Right|#R")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT);
- fl_set_object_callback(obj,TableOptionsCB,0);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,175,20,105,105,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_text(FL_NORMAL_TEXT,180,10,90,20,_("Alignment"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,300,10,100,20,_("Special Cell"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->radio_multicolumn = obj = fl_add_checkbutton(FL_PUSH_BUTTON,300,30,95,25,idex(_("Multicolumn|#M")));fl_set_button_shortcut(obj,scex(_("Multicolumn|#M")),1);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->button_append_column = obj = fl_add_button(FL_NORMAL_BUTTON,10,170,120,30,idex(_("Append Column|#A")));fl_set_button_shortcut(obj,scex(_("Append Column|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->button_delete_column = obj = fl_add_button(FL_NORMAL_BUTTON,140,170,120,30,idex(_("Delete Column|#O")));fl_set_button_shortcut(obj,scex(_("Delete Column|#O")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->button_append_row = obj = fl_add_button(FL_NORMAL_BUTTON,10,200,120,30,idex(_("Append Row|#p")));fl_set_button_shortcut(obj,scex(_("Append Row|#p")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->button_delete_row = obj = fl_add_button(FL_NORMAL_BUTTON,140,200,120,30,idex(_("Delete Row|#w")));fl_set_button_shortcut(obj,scex(_("Delete Row|#w")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->button_table_delete = obj = fl_add_button(FL_NORMAL_BUTTON,10,240,250,30,idex(_("Delete Table|#D")));fl_set_button_shortcut(obj,scex(_("Delete Table|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->input_table_column = obj = fl_add_input(FL_NORMAL_INPUT,290,240,60,30,_("Column"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- fdui->input_table_row = obj = fl_add_input(FL_NORMAL_INPUT,360,240,60,30,_("Row"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- fdui->button_set_borders = obj = fl_add_button(FL_NORMAL_BUTTON,10,140,120,30,idex(_("Set Borders|#S")));fl_set_button_shortcut(obj,scex(_("Set Borders|#S")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->button_unset_borders = obj = fl_add_button(FL_NORMAL_BUTTON,140,140,120,30,idex(_("Unset Borders|#U")));fl_set_button_shortcut(obj,scex(_("Unset Borders|#U")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_longtable = obj = fl_add_checkbutton(FL_PUSH_BUTTON,300,130,90,25,_("Longtable"));
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->input_column_width = obj = fl_add_input(FL_NORMAL_INPUT,330,190,95,30,_("Width"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,SetPWidthCB,0);
- fdui->radio_rotate_table = obj = fl_add_checkbutton(FL_PUSH_BUTTON,300,155,90,25,idex(_("Rotate 90°|#9")));fl_set_button_shortcut(obj,scex(_("Rotate 90°|#9")),1);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_linebreak_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON,300,55,95,25,idex(_("Linebreaks|#N")));fl_set_button_shortcut(obj,scex(_("Linebreaks|#N")),1);
- fl_set_object_callback(obj,TableOptionsCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,300,110,100,20,_("Spec. Table"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,420,20,100,160,"");
- obj = fl_add_text(FL_NORMAL_TEXT,425,10,85,20,_("Longtable"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->radio_lt_firsthead = obj = fl_add_checkbutton(FL_PUSH_BUTTON,420,30,90,25,_("First Head"));
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_lt_head = obj = fl_add_checkbutton(FL_PUSH_BUTTON,420,60,90,25,_("Head"));
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_lt_foot = obj = fl_add_checkbutton(FL_PUSH_BUTTON,420,90,90,25,_("Foot"));
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_lt_lastfoot = obj = fl_add_checkbutton(FL_PUSH_BUTTON,420,120,90,25,_("Last Foot"));
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_lt_newpage = obj = fl_add_checkbutton(FL_PUSH_BUTTON,420,150,90,25,_("New Page"));
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_rotate_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON,300,80,95,25,_("Rotate 90°"));
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->button_table_extra = obj = fl_add_button(FL_NORMAL_BUTTON,430,235,100,30,idex(_("Extra|#X")));fl_set_button_shortcut(obj,scex(_("Extra|#X")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON,175,30,80,25,idex(_("Left|#e")));fl_set_button_shortcut(obj,scex(_("Left|#e")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON,175,55,80,25,idex(_("Right|#i")));fl_set_button_shortcut(obj,scex(_("Right|#i")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
- fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON,175,80,80,25,idex(_("Center|#C")));fl_set_button_shortcut(obj,scex(_("Center|#C")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,TableOptionsCB,0);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 540, 310, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 300, 120, 110, 60, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 300, 20, 110, 90, "");
+ fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 20, 275, 330, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 430, 270, 100, 30, _("Close"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptCloseCB, 0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 20, 20, 145, 105, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 30, 10, 70, 20, _("Borders"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->radio_border_top = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 45, 25, 25, idex(_("Top|#T")));fl_set_button_shortcut(obj, scex(_("Top|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_border_bottom = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 75, 75, 25, 25, idex(_("Bottom|#B")));fl_set_button_shortcut(obj, scex(_("Bottom|#B")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_BOTTOM_LEFT);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_border_left = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 55, 60, 25, 25, idex(_("Left|#L")));fl_set_button_shortcut(obj, scex(_("Left|#L")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_border_right = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 95, 60, 25, 25, idex(_("Right|#R")));fl_set_button_shortcut(obj, scex(_("Right|#R")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 175, 20, 105, 105, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_text(FL_NORMAL_TEXT, 180, 10, 90, 20, _("Alignment"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 300, 10, 100, 20, _("Special Cell"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->radio_multicolumn = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 30, 95, 25, idex(_("Multicolumn|#M")));fl_set_button_shortcut(obj, scex(_("Multicolumn|#M")), 1);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->button_append_column = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 170, 120, 30, idex(_("Append Column|#A")));fl_set_button_shortcut(obj, scex(_("Append Column|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->button_delete_column = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 170, 120, 30, idex(_("Delete Column|#O")));fl_set_button_shortcut(obj, scex(_("Delete Column|#O")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->button_append_row = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 200, 120, 30, idex(_("Append Row|#p")));fl_set_button_shortcut(obj, scex(_("Append Row|#p")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->button_delete_row = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 200, 120, 30, idex(_("Delete Row|#w")));fl_set_button_shortcut(obj, scex(_("Delete Row|#w")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->button_table_delete = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 240, 250, 30, idex(_("Delete Table|#D")));fl_set_button_shortcut(obj, scex(_("Delete Table|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->input_table_column = obj = fl_add_input(FL_NORMAL_INPUT, 290, 240, 60, 30, _("Column"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fdui->input_table_row = obj = fl_add_input(FL_NORMAL_INPUT, 360, 240, 60, 30, _("Row"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fdui->button_set_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 10, 140, 120, 30, idex(_("Set Borders|#S")));fl_set_button_shortcut(obj, scex(_("Set Borders|#S")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->button_unset_borders = obj = fl_add_button(FL_NORMAL_BUTTON, 140, 140, 120, 30, idex(_("Unset Borders|#U")));fl_set_button_shortcut(obj, scex(_("Unset Borders|#U")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_longtable = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 130, 90, 25, _("Longtable"));
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->input_column_width = obj = fl_add_input(FL_NORMAL_INPUT, 330, 190, 95, 30, _("Width"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SetPWidthCB, 0);
+ fdui->radio_rotate_table = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 155, 90, 25, idex(_("Rotate 90°|#9")));fl_set_button_shortcut(obj, scex(_("Rotate 90°|#9")), 1);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_linebreak_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 55, 95, 25, idex(_("Linebreaks|#N")));fl_set_button_shortcut(obj, scex(_("Linebreaks|#N")), 1);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 300, 110, 100, 20, _("Spec. Table"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 420, 20, 100, 160, "");
+ obj = fl_add_text(FL_NORMAL_TEXT, 425, 10, 85, 20, _("Longtable"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->radio_lt_firsthead = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 30, 90, 25, _("First Head"));
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_lt_head = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 60, 90, 25, _("Head"));
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_lt_foot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 90, 90, 25, _("Foot"));
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_lt_lastfoot = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 120, 90, 25, _("Last Foot"));
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_lt_newpage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 420, 150, 90, 25, _("New Page"));
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_rotate_cell = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 300, 80, 95, 25, _("Rotate 90°"));
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->button_table_extra = obj = fl_add_button(FL_NORMAL_BUTTON, 430, 235, 100, 30, idex(_("Extra|#X")));fl_set_button_shortcut(obj, scex(_("Extra|#X")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_align_left = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 175, 30, 80, 25, idex(_("Left|#e")));fl_set_button_shortcut(obj, scex(_("Left|#e")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_align_right = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 175, 55, 80, 25, idex(_("Right|#i")));fl_set_button_shortcut(obj, scex(_("Right|#i")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ fdui->radio_align_center = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 175, 80, 80, 25, idex(_("Center|#C")));fl_set_button_shortcut(obj, scex(_("Center|#C")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
fl_end_form();
//fdui->form_table_options->fdui = fdui;
FD_form_paragraph_extra *fdui = (FD_form_paragraph_extra *) fl_calloc(1, sizeof(FD_form_paragraph_extra));
fdui->form_paragraph_extra = fl_bgn_form(FL_NO_BOX, 460, 250);
- obj = fl_add_box(FL_UP_BOX,0,0,460,250,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,20,170,100,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,350,20,100,100,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,190,20,150,100,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,120,20,_("Extra Options"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->input_pextra_width = obj = fl_add_input(FL_NORMAL_INPUT,240,30,90,30,idex(_("Length|#L")));fl_set_button_shortcut(obj,scex(_("Length|#L")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
- fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON,130,210,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 460, 250, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 170, 100, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 350, 20, 100, 100, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 190, 20, 150, 100, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 120, 20, _("Extra Options"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->input_pextra_width = obj = fl_add_input(FL_NORMAL_INPUT, 240, 30, 90, 30, idex(_("Length|#L")));fl_set_button_shortcut(obj, scex(_("Length|#L")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
+ fdui->button_ok = obj = fl_add_button(FL_RETURN_BUTTON, 130, 210, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ParagraphExtraOKCB,0);
- fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON,240,210,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphExtraOKCB, 0);
+ fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 240, 210, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ParagraphExtraApplyCB,0);
- fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON,350,210,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ParagraphExtraApplyCB, 0);
+ fdui->button_cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 350, 210, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ParagraphExtraCancelCB,0);
- fdui->input_pextra_widthp = obj = fl_add_input(FL_INT_INPUT,240,70,90,30,idex(_("or %|#o")));fl_set_button_shortcut(obj,scex(_("or %|#o")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,200,10,60,20,_("Width"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,350,10,90,20,_("Alignment"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ fl_set_object_callback(obj, ParagraphExtraCancelCB, 0);
+ fdui->input_pextra_widthp = obj = fl_add_input(FL_INT_INPUT, 240, 70, 90, 30, idex(_("or %|#o")));fl_set_button_shortcut(obj, scex(_("or %|#o")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 200, 10, 60, 20, _("Width"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 350, 10, 90, 20, _("Alignment"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fdui->group_alignment = fl_bgn_group();
- fdui->radio_pextra_top = obj = fl_add_checkbutton(FL_RADIO_BUTTON,360,30,80,30,idex(_("Top|#T")));fl_set_button_shortcut(obj,scex(_("Top|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
- fdui->radio_pextra_middle = obj = fl_add_checkbutton(FL_RADIO_BUTTON,360,60,80,30,idex(_("Middle|#d")));fl_set_button_shortcut(obj,scex(_("Middle|#d")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
- fdui->radio_pextra_bottom = obj = fl_add_checkbutton(FL_RADIO_BUTTON,360,90,80,30,idex(_("Bottom|#B")));fl_set_button_shortcut(obj,scex(_("Bottom|#B")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
+ fdui->radio_pextra_top = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 30, 80, 30, idex(_("Top|#T")));fl_set_button_shortcut(obj, scex(_("Top|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
+ fdui->radio_pextra_middle = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 60, 80, 30, idex(_("Middle|#d")));fl_set_button_shortcut(obj, scex(_("Middle|#d")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
+ fdui->radio_pextra_bottom = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 360, 90, 80, 30, idex(_("Bottom|#B")));fl_set_button_shortcut(obj, scex(_("Bottom|#B")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
fl_end_group();
- fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT,10,170,330,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->radio_pextra_hfill = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,130,300,30,idex(_("HFill between Minipage paragraphs|#H")));fl_set_button_shortcut(obj,scex(_("HFill between Minipage paragraphs|#H")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_pextra_startmp = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,160,260,30,idex(_("Start new Minipage|#S")));fl_set_button_shortcut(obj,scex(_("Start new Minipage|#S")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->text_warning = obj = fl_add_text(FL_NORMAL_TEXT, 10, 170, 330, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->radio_pextra_hfill = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 130, 300, 30, idex(_("HFill between Minipage paragraphs|#H")));fl_set_button_shortcut(obj, scex(_("HFill between Minipage paragraphs|#H")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_pextra_startmp = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 160, 260, 30, idex(_("Start new Minipage|#S")));fl_set_button_shortcut(obj, scex(_("Start new Minipage|#S")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->group_extraopt = fl_bgn_group();
- fdui->radio_pextra_indent = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,30,160,30,idex(_("Indented Paragraph|#I")));fl_set_button_shortcut(obj,scex(_("Indented Paragraph|#I")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
- fdui->radio_pextra_minipage = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,60,160,30,idex(_("Minipage|#M")));fl_set_button_shortcut(obj,scex(_("Minipage|#M")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
- fdui->radio_pextra_floatflt = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,90,160,30,idex(_("Floatflt|#F")));fl_set_button_shortcut(obj,scex(_("Floatflt|#F")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,CheckPExtraOptCB,0);
+ fdui->radio_pextra_indent = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 30, 160, 30, idex(_("Indented Paragraph|#I")));fl_set_button_shortcut(obj, scex(_("Indented Paragraph|#I")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
+ fdui->radio_pextra_minipage = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 60, 160, 30, idex(_("Minipage|#M")));fl_set_button_shortcut(obj, scex(_("Minipage|#M")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
+ fdui->radio_pextra_floatflt = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 90, 160, 30, idex(_("Floatflt|#F")));fl_set_button_shortcut(obj, scex(_("Floatflt|#F")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, CheckPExtraOptCB, 0);
fl_end_group();
fl_end_form();
FD_form_table_extra *fdui = (FD_form_table_extra *) fl_calloc(1, sizeof(FD_form_table_extra));
fdui->form_table_extra = fl_bgn_form(FL_NO_BOX, 330, 200);
- obj = fl_add_box(FL_UP_BOX,0,0,330,200,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,15,95,305,60,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 330, 200, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 15, 95, 305, 60, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_text(FL_NORMAL_TEXT,20,85,205,20,_("Special Multicolumn Alignment"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 85, 205, 20, _("Special Multicolumn Alignment"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,15,20,305,60,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 15, 20, 305, 60, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->input_special_alignment = obj = fl_add_input(FL_NORMAL_INPUT,25,35,280,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_special_alignment = obj = fl_add_input(FL_NORMAL_INPUT, 25, 35, 280, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj,TableOptionsCB,0);
- obj = fl_add_button(FL_RETURN_BUTTON,220,160,100,30,_("Close"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
+ obj = fl_add_button(FL_RETURN_BUTTON, 220, 160, 100, 30, _("Close"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,TableSpeCloseCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,170,20,_("Special Column Alignment"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ fl_set_object_callback(obj, TableSpeCloseCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 170, 20, _("Special Column Alignment"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->input_special_multialign = obj = fl_add_input(FL_NORMAL_INPUT,25,110,280,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_special_multialign = obj = fl_add_input(FL_NORMAL_INPUT, 25, 110, 280, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fl_set_object_callback(obj,TableOptionsCB,0);
+ fl_set_object_callback(obj, TableOptionsCB, 0);
fl_end_form();
//fdui->form_table_extra->fdui = fdui;
FD_form_title *fdui = (FD_form_title *) fl_calloc(1, sizeof(FD_form_title));
fdui->form_title = fl_bgn_form(FL_NO_BOX, 425, 290);
- obj = fl_add_box(FL_UP_BOX,0,0,425,290,"");
- fl_set_object_color(obj,FL_BLACK,FL_TOP_BCOL);
- fdui->timer_title = obj = fl_add_timer(FL_HIDDEN_TIMER,110,170,190,60,"");
- fl_set_object_callback(obj,TimerCB,0);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 425, 290, "");
+ fl_set_object_color(obj, FL_BLACK, FL_TOP_BCOL);
+ fdui->timer_title = obj = fl_add_timer(FL_HIDDEN_TIMER, 110, 170, 190, 60, "");
+ fl_set_object_callback(obj, TimerCB, 0);
fl_end_form();
//fdui->form_title->fdui = fdui;
FD_form_figure *fdui = (FD_form_figure *) fl_calloc(1, sizeof(FD_form_figure));
fdui->form_figure = fl_bgn_form(FL_NO_BOX, 340, 150);
- obj = fl_add_box(FL_UP_BOX,0,0,340,150,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,20,320,80,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 150, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 320, 80, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
fdui->group_radio_fugre = fl_bgn_group();
- fdui->radio_postscript = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,30,320,30,idex(_("Encapsulated Postscript (*.eps, *.ps)|#E")));fl_set_button_shortcut(obj,scex(_("Encapsulated Postscript (*.eps, *.ps)|#E")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_inline = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,60,320,30,idex(_("Inlined EPS (*.eps, *.ps)|#I")));fl_set_button_shortcut(obj,scex(_("Inlined EPS (*.eps, *.ps)|#I")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_postscript = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 320, 30, idex(_("Encapsulated Postscript (*.eps, *.ps)|#E")));fl_set_button_shortcut(obj, scex(_("Encapsulated Postscript (*.eps, *.ps)|#E")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_inline = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 320, 30, idex(_("Inlined EPS (*.eps, *.ps)|#I")));fl_set_button_shortcut(obj, scex(_("Inlined EPS (*.eps, *.ps)|#I")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- obj = fl_add_button(FL_RETURN_BUTTON,10,110,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,FigureOKCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,120,110,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,FigureApplyCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,230,110,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,FigureCancelCB,0);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,50,20,_("Type"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_button(FL_RETURN_BUTTON, 10, 110, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, FigureOKCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 120, 110, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, FigureApplyCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 230, 110, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, FigureCancelCB, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 50, 20, _("Type"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form();
//fdui->form_figure->fdui = fdui;
FD_form_screen *fdui = (FD_form_screen *) fl_calloc(1, sizeof(FD_form_screen));
fdui->form_screen = fl_bgn_form(FL_NO_BOX, 390, 220);
- obj = fl_add_box(FL_UP_BOX,0,0,390,220,"");
- fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT,140,10,240,30,idex(_("Roman Font|#R")));fl_set_button_shortcut(obj,scex(_("Roman Font|#R")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 390, 220, "");
+ fdui->input_roman = obj = fl_add_input(FL_NORMAL_INPUT, 140, 10, 240, 30, idex(_("Roman Font|#R")));fl_set_button_shortcut(obj, scex(_("Roman Font|#R")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->input_sans = obj = fl_add_input(FL_NORMAL_INPUT,140,40,240,30,idex(_("Sans Serif Font|#S")));fl_set_button_shortcut(obj,scex(_("Sans Serif Font|#S")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_sans = obj = fl_add_input(FL_NORMAL_INPUT, 140, 40, 240, 30, idex(_("Sans Serif Font|#S")));fl_set_button_shortcut(obj, scex(_("Sans Serif Font|#S")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->input_typewriter = obj = fl_add_input(FL_NORMAL_INPUT,140,70,240,30,idex(_("Typewriter Font|#T")));fl_set_button_shortcut(obj,scex(_("Typewriter Font|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_typewriter = obj = fl_add_input(FL_NORMAL_INPUT, 140, 70, 240, 30, idex(_("Typewriter Font|#T")));fl_set_button_shortcut(obj, scex(_("Typewriter Font|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->input_font_norm = obj = fl_add_input(FL_NORMAL_INPUT,140,100,240,30,idex(_("Font Norm|#N")));fl_set_button_shortcut(obj,scex(_("Font Norm|#N")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->input_font_norm = obj = fl_add_input(FL_NORMAL_INPUT, 140, 100, 240, 30, idex(_("Font Norm|#N")));fl_set_button_shortcut(obj, scex(_("Font Norm|#N")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- fdui->intinput_size = obj = fl_add_input(FL_INT_INPUT,140,140,50,30,idex(_("Font Zoom|#Z")));fl_set_button_shortcut(obj,scex(_("Font Zoom|#Z")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->intinput_size = obj = fl_add_input(FL_INT_INPUT, 140, 140, 50, 30, idex(_("Font Zoom|#Z")));fl_set_button_shortcut(obj, scex(_("Font Zoom|#Z")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_NoGravity);
fl_set_object_resize(obj, FL_RESIZE_X);
- obj = fl_add_button(FL_RETURN_BUTTON,60,180,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_button(FL_RETURN_BUTTON, 60, 180, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ScreenOKCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,170,180,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ScreenOKCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 170, 180, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ScreenApplyCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,280,180,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, ScreenApplyCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 280, 180, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,ScreenCancelCB,0);
+ fl_set_object_callback(obj, ScreenCancelCB, 0);
fl_end_form();
//fdui->form_screen->fdui = fdui;
FD_form_toc *fdui = (FD_form_toc *) fl_calloc(1, sizeof(FD_form_toc));
fdui->form_toc = fl_bgn_form(FL_NO_BOX, 420, 340);
- obj = fl_add_box(FL_UP_BOX,0,0,420,340,"");
- fdui->browser_toc = obj = fl_add_browser(FL_HOLD_BROWSER,10,10,400,280,"");
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 420, 340, "");
+ fdui->browser_toc = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 400, 280, "");
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- fl_set_object_callback(obj,TocSelectCB,0);
- obj = fl_add_button(FL_RETURN_BUTTON,310,300,100,30,_("Close"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TocSelectCB, 0);
+ obj = fl_add_button(FL_RETURN_BUTTON, 310, 300, 100, 30, _("Close"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,TocCancelCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,200,300,100,30,idex(_("Update|Uu#u")));fl_set_button_shortcut(obj,scex(_("Update|Uu#u")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, TocCancelCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 200, 300, 100, 30, idex(_("Update|Uu#u")));fl_set_button_shortcut(obj, scex(_("Update|Uu#u")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,TocUpdateCB,0);
+ fl_set_object_callback(obj, TocUpdateCB, 0);
fl_end_form();
//fdui->form_toc->fdui = fdui;
FD_form_ref *fdui = (FD_form_ref *) fl_calloc(1, sizeof(FD_form_ref));
fdui->form_ref = fl_bgn_form(FL_NO_BOX, 290, 330);
- obj = fl_add_box(FL_UP_BOX,0,0,290,330,"");
- fdui->browser_ref = obj = fl_add_browser(FL_HOLD_BROWSER,10,10,270,140,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 290, 330, "");
+ fdui->browser_ref = obj = fl_add_browser(FL_HOLD_BROWSER, 10, 10, 270, 140, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_NorthWest, FL_SouthEast);
- obj = fl_add_button(FL_NORMAL_BUTTON,180,200,100,30,idex(_("Update|#U")));fl_set_button_shortcut(obj,scex(_("Update|#U")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 180, 200, 100, 30, idex(_("Update|#U")));fl_set_button_shortcut(obj, scex(_("Update|#U")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,RefUpdateCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,180,240,100,30,idex(_("Close|#C^[")));fl_set_button_shortcut(obj,scex(_("Close|#C^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, RefUpdateCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 180, 240, 100, 30, idex(_("Close|#C^[")));fl_set_button_shortcut(obj, scex(_("Close|#C^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,RefHideCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,10,240,160,30,idex(_("Insert Reference|#I^M")));fl_set_button_shortcut(obj,scex(_("Insert Reference|#I^M")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, RefHideCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 10, 240, 160, 30, idex(_("Insert Reference|#I^M")));fl_set_button_shortcut(obj, scex(_("Insert Reference|#I^M")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
- fl_set_object_callback(obj,RefSelectCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,10,200,160,30,idex(_("Insert Page Number|#P")));fl_set_button_shortcut(obj,scex(_("Insert Page Number|#P")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, RefSelectCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 10, 200, 160, 30, idex(_("Insert Page Number|#P")));fl_set_button_shortcut(obj, scex(_("Insert Page Number|#P")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
- fl_set_object_callback(obj,RefSelectCB,1);
- obj = fl_add_button(FL_NORMAL_BUTTON,10,280,160,30,idex(_("Go to Reference|#G")));fl_set_button_shortcut(obj,scex(_("Go to Reference|#G")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, RefSelectCB, 1);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 10, 280, 160, 30, idex(_("Go to Reference|#G")));fl_set_button_shortcut(obj, scex(_("Go to Reference|#G")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthWest);
- fl_set_object_callback(obj,RefSelectCB,2);
- fdui->ref_name = obj = fl_add_input(FL_NORMAL_INPUT,80,160,200,30,idex(_("Name|#N")));fl_set_button_shortcut(obj,scex(_("Name|#N")),1);
+ fl_set_object_callback(obj, RefSelectCB, 2);
+ fdui->ref_name = obj = fl_add_input(FL_NORMAL_INPUT, 80, 160, 200, 30, idex(_("Name|#N")));fl_set_button_shortcut(obj, scex(_("Name|#N")), 1);
fl_set_object_gravity(obj, FL_SouthWest, FL_SouthEast);
fl_set_object_resize(obj, FL_RESIZE_X);
fl_end_form();
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich,
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include "credits.h"
#include "insets/insetref.h"
#include "insets/insetquotes.h"
+#if 0
#include "insets/insetlatex.h"
+#endif
#include "insets/insetlabel.h"
#include "insets/insetinfo.h"
#include "insets/insetspecialchar.h"
current_view->buffer()->text->sel_cursor =
current_view->buffer()->text->cursor;
- if (f==1 || f==-1) {
+ if (f == 1 || f == -1) {
if (current_view->buffer()->isLyxClean()) {
current_view->buffer()->markDirty();
minibuffer->setTimer(4);
string fname = buf->getFileName();
string s = MakeAbsPath(fname);
if (AskQuestion(_("Save failed. Rename and try again?"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("(If not, document is not saved.)"))) {
MenuWriteAs(buf);
}
}
// Make sure the absolute filename ends with appropriate suffix
- string s= MakeAbsPath(fname);
+ string s = MakeAbsPath(fname);
if (!IsLyXFilename(s))
s += ".lyx";
// Same name as we have already?
if (s == oldname) {
if (!AskQuestion(_("Same name as document already has:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Save anyway?")))
return;
// Falls through to name change and save
// No, but do we have another file with this name open?
else if (bufferlist.exists(s)) {
if (AskQuestion(_("Another document with same name open!"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Replace with current document?")))
{
bufferlist.close(bufferlist.getBuffer(s));
else {
FileInfo myfile(s);
if (myfile.isOK() && !AskQuestion(_("Document already exists:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Replace file?")))
return;
}
}
WriteAlert(_("Chktex run successfully"), s, t);
} else {
- WriteAlert(_("Error!"),_("It seems chktex does not work."));
+ WriteAlert(_("Error!"), _("It seems chktex does not work."));
}
return ret;
}
// Returns false if we fail.
bool RunScript(Buffer * buffer, bool wait,
string const & command, string const & orgname = string(),
- bool need_shell=true)
+ bool need_shell = true)
{
string path;
string cmd;
- string name= orgname;
+ string name = orgname;
int result = 0;
if (MakeDVIOutput(buffer) > 0)
result = one.startscript(wait ? Systemcalls::Wait
: Systemcalls::DontWait, cmd);
}
- return (result==0);
+ return (result == 0);
}
// Returns false if we fail
-bool MenuRunDvips(Buffer *buffer, bool wait=false)
+bool MenuRunDvips(Buffer *buffer, bool wait = false)
{
if (!buffer->text)
return false;
string paper;
char real_papersize = buffer->params.papersize;
- if (real_papersize == PAPER_DEFAULT)
+ if (real_papersize == BufferParams::PAPER_DEFAULT)
real_papersize = lyxrc->default_papersize;
switch (real_papersize) {
- case PAPER_USLETTER:
+ case BufferParams::PAPER_USLETTER:
paper = "letter";
break;
- case PAPER_A3PAPER:
+ case BufferParams::PAPER_A3PAPER:
paper = "a3";
break;
- case PAPER_A4PAPER:
+ case BufferParams::PAPER_A4PAPER:
paper = "a4";
break;
- case PAPER_A5PAPER:
+ case BufferParams::PAPER_A5PAPER:
paper = "a5";
break;
- case PAPER_B5PAPER:
+ case BufferParams::PAPER_B5PAPER:
paper = "b5";
break;
- case PAPER_EXECUTIVEPAPER:
+ case BufferParams::PAPER_EXECUTIVEPAPER:
paper = "foolscap";
break;
- case PAPER_LEGALPAPER:
+ case BufferParams::PAPER_LEGALPAPER:
paper = "legal";
break;
default: /* If nothing else fits, keep an empty value... */
string command = "dvips " + lyxrc->print_to_file + ' ';
command += SpaceLess(ps);
if (buffer->params.use_geometry
- && buffer->params.papersize2 == VM_PAPER_CUSTOM
+ && buffer->params.papersize2 == BufferParams::VM_PAPER_CUSTOM
&& !lyxrc->print_paper_dimension_flag.empty()
&& !buffer->params.paperwidth.empty()
&& !buffer->params.paperheight.empty()) {
command += buffer->params.paperwidth + ',';
command += buffer->params.paperheight;
} else if (!paper.empty()
- && (real_papersize != PAPER_USLETTER ||
- buffer->params.orientation == ORIENTATION_PORTRAIT)) {
+ && (real_papersize != BufferParams::PAPER_USLETTER ||
+ buffer->params.orientation == BufferParams::ORIENTATION_PORTRAIT)) {
// dvips won't accept -t letter -t landscape. In all other
// cases, include the paper size explicitly.
command += ' ';
command += lyxrc->print_paper_flag + ' ' + paper;
}
- if (buffer->params.orientation == ORIENTATION_LANDSCAPE) {
+ if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE) {
command += ' ';
command += lyxrc->print_landscape_flag;
}
help2 += " &";
Systemcalls one(Systemcalls::System, help2);
} else
- send_fax(ps,lyxrc->fax_command);
+ send_fax(ps, lyxrc->fax_command);
}
string paper;
char real_papersize = buffer->params.papersize;
- if (real_papersize == PAPER_DEFAULT)
+ if (real_papersize == BufferParams::PAPER_DEFAULT)
real_papersize = lyxrc->default_papersize;
switch (real_papersize) {
- case PAPER_USLETTER:
+ case BufferParams::PAPER_USLETTER:
paper = "us";
break;
- case PAPER_A3PAPER:
+ case BufferParams::PAPER_A3PAPER:
paper = "a3";
break;
- case PAPER_A4PAPER:
+ case BufferParams::PAPER_A4PAPER:
paper = "a4";
break;
- case PAPER_A5PAPER:
+ case BufferParams::PAPER_A5PAPER:
paper = "a5";
break;
- case PAPER_B5PAPER:
+ case BufferParams::PAPER_B5PAPER:
paper = "b5";
break;
- case PAPER_EXECUTIVEPAPER:
+ case BufferParams::PAPER_EXECUTIVEPAPER:
paper = "foolscap";
break;
- case PAPER_LEGALPAPER:
+ case BufferParams::PAPER_LEGALPAPER:
paper = "legal";
break;
default: /* If nothing else fits, keep the empty value */
}
if (paper.empty()) {
- if (buffer->params.orientation == ORIENTATION_LANDSCAPE)
+ if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
// we HAVE to give a size when the page is in
// landscape, so use USletter.
paper = " -paper usr";
} else {
paper = " -paper " + paper;
- if (buffer->params.orientation == ORIENTATION_LANDSCAPE)
- paper+='r';
+ if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
+ paper+= 'r';
}
// push directorypath, if necessary
FilePtr myfile(s, FilePtr::read);
if (myfile() &&
!AskQuestion(_("File already exists:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) {
minibuffer->Set(_("Canceled"));
return;
FilePtr myfile(s, FilePtr::read);
if (myfile() &&
!AskQuestion(_("File already exists:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) {
minibuffer->Set(_("Canceled"));
return;
FilePtr myfile(s, FilePtr::read);
if (myfile() &&
!AskQuestion(_("File already exists:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) {
minibuffer->Set(_("Canceled"));
return;
FilePtr myfile(s, FilePtr::read);
if (myfile() &&
!AskQuestion(_("File already exists:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to overwrite the file?"))) {
minibuffer->Set(_("Canceled"));
return;
minibuffer->Set(_("Autosaving current document..."));
// create autosave filename
- string fname = OnlyPath(current_view->buffer()->getFileName());
+ string fname = OnlyPath(current_view->buffer()->getFileName());
fname += "#";
fname += OnlyFilename(current_view->buffer()->getFileName());
fname += "#";
<< "\nTemplate is " << tmpname << endl;
// find a free buffer
- Buffer *tmpbuf = bufferlist.newFile(name,tmpname);
+ Buffer *tmpbuf = bufferlist.newFile(name, tmpname);
if (tmpbuf)
lastfiles->newFile(tmpbuf->getFileName());
return tmpbuf;
if (!fi.exist() || !fi.readable() || !myfile()) {
WriteFSAlert(_("Error! Cannot open specified file:"),
- MakeDisplayPath(fname,50));
+ MakeDisplayPath(fname, 50));
return;
}
tmppar = new LyXParagraph;
-#ifdef NEW_TEXT
- tmppar->text.reserve(500);
-#endif
tmppar->readSimpleWholeFile(myfile);
// set the end of the string
-#ifdef NEW_TEXT
+#warning why do we do this?
// I don't think this is needed. Actually it might be plain wrong.
tmppar->InsertChar(tmppar->text.size() - 1,'\0');
-#else
- tmppar->InsertChar(tmppar->last-1,'\0');
-#endif
+
// insert the string
current_view->getScreen()->HideCursor();
ow = fd_form_toc->form_toc->w;
oh = fd_form_toc->form_toc->h;
}
- fl_set_form_minsize(fd_form_toc->form_toc,ow,oh);
+ fl_set_form_minsize(fd_form_toc->form_toc, ow, oh);
}
}
-void MenuInsertLabel(const char *arg)
+void MenuInsertLabel(char const *arg)
{
string label = arg;
ProhibitInput();
- //string label = fl_show_input(_("Enter new label to insert:"),"");
+ //string label = fl_show_input(_("Enter new label to insert:"), "");
if (label.empty())
label = frontStrip(strip(askForText(_("Enter new label to insert:"))));
if (!label.empty()) {
ow = fd_form_ref->form_ref->w;
oh = fd_form_ref->form_ref->h;
}
- fl_set_form_minsize(fd_form_ref->form_ref,ow,oh);
+ fl_set_form_minsize(fd_form_ref->form_ref, ow, oh);
}
}
if (flag != -1) {
if (!current_view->available())
return 0;
- current_view->buffer()->makeLinuxDocFile(name,0);
- LYX_PAPER_SIZE ps = (LYX_PAPER_SIZE) current_view->buffer()->params.papersize;
+ current_view->buffer()->makeLinuxDocFile(name, 0);
+ BufferParams::PAPER_SIZE ps = current_view->buffer()->params.papersize;
switch (ps) {
- case PAPER_A4PAPER: add_flags = "-p a4"; break;
- case PAPER_USLETTER: add_flags = "-p letter"; break;
+ case BufferParams::PAPER_A4PAPER: add_flags = "-p a4"; break;
+ case BufferParams::PAPER_USLETTER: add_flags = "-p letter"; break;
default: /* nothing to be done yet ;-) */ break;
}
}
if (!current_view->available())
return 0;
- current_view->buffer()->makeDocBookFile(name,0);
+ current_view->buffer()->makeDocBookFile(name, 0);
// Shall this code go or should it stay? (Lgb)
// string add_flags;
// LYX_PAPER_SIZE ps = (LYX_PAPER_SIZE) current_view->buffer()->params.papersize;
// switch (ps) {
-// case PAPER_A4PAPER: add_flags = "-p a4"; break;
-// case PAPER_USLETTER: add_flags = "-p letter"; break;
+// case BufferParams::PAPER_A4PAPER: add_flags = "-p a4"; break;
+// case BufferParams::PAPER_USLETTER: add_flags = "-p letter"; break;
// default: /* nothing to be done yet ;-) */ break;
// }
ProhibitInput();
)
){
if (par->previous
- && par->previous->footnoteflag !=
+ && par->previous->footnoteflag !=
LyXParagraph::CLOSED_FOOTNOTE){ /* should be */
current_view->buffer()->text->SetCursorIntern(par->previous,
0);
fl_raise_form(fd_form_character->form_character);
} else {
fl_show_form(fd_form_character->form_character,
- FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
+ FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
_("Character Style"));
if (ow < 0) {
ow = fd_form_character->form_character->w;
oh = fd_form_character->form_character->h;
}
- fl_set_form_minsize(fd_form_character->form_character,ow,oh);
+ fl_set_form_minsize(fd_form_character->form_character, ow, oh);
}
}
int align = buf->text->cursor.par->GetAlign();
if (align == LYX_ALIGN_LAYOUT)
- align = textclasslist.Style(buf->params.textclass,
+ align = textclasslist.Style(buf->params.textclass,
buf->text->cursor.par->GetLayout()).align;
switch (align) {
fl_set_button(fd_form_document->check_use_amsmath, params->use_amsmath);
- if (params->paragraph_separation == LYX_PARSEP_INDENT)
+ if (params->paragraph_separation == BufferParams::PARSEP_INDENT)
fl_set_button(fd_form_document->radio_indent, 1);
else
fl_set_button(fd_form_document->radio_skip, 1);
{
fl_set_choice(fd_form_document->choice_spacing, 4);
char sval[20];
- sprintf(sval,"%g",params->spacing.getValue());
+ sprintf(sval, "%g", params->spacing.getValue());
fl_set_input(fd_form_document->input_spacing, sval);
break;
}
oh = fd_form_preamble->form_preamble->h;
}
fl_set_form_minsize(fd_form_preamble->form_preamble,
- ow,oh);
+ ow, oh);
}
}
}
{
InsetInfo *new_inset = new InsetInfo();
current_view->buffer()->insertInset(new_inset);
- new_inset->Edit(0,0);
+ new_inset->Edit(0, 0);
//current_view->buffer()->update(-1);
}
if (current_view->available()) {
current_view->getScreen()->HideCursor();
current_view->buffer()->update(-2);
- current_view->buffer()->text->InsertChar(LYX_META_NEWLINE);
+ current_view->buffer()->text->InsertChar(LyXParagraph::META_NEWLINE);
current_view->buffer()->update(-1);
}
}
if (current_view->available()) {
current_view->getScreen()->HideCursor();
current_view->buffer()->update(-2);
- current_view->buffer()->text->InsertChar(LYX_META_PROTECTED_SEPARATOR);
+ current_view->buffer()->text->InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR);
current_view->buffer()->update(-1);
}
}
if (current_view->available()) {
current_view->getScreen()->HideCursor();
current_view->buffer()->update(-2);
- current_view->buffer()->text->InsertChar(LYX_META_HFILL);
+ current_view->buffer()->text->InsertChar(LyXParagraph::META_HFILL);
current_view->buffer()->update(-1);
}
}
extern "C" void CharacterOKCB(FL_OBJECT *ob, long data)
{
- CharacterApplyCB(ob,data);
- CharacterCloseCB(ob,data);
+ CharacterApplyCB(ob, data);
+ CharacterCloseCB(ob, data);
}
{
bool redo = false;
BufferParams *params = &(current_view->buffer()->params);
- current_view->buffer()->params.language =
+ current_view->buffer()->params.language =
combo_language->getline();
// If default skip is a "Length" but there's no text in the
/* ChangeKeymap(buffer->parameters.language, TRUE, false,
fl_get_choice(fd_form_document->choice_language)); */
- params->fonts =
+ params->fonts =
fl_get_choice_text(fd_form_document->choice_fonts);
- params->inputenc =
+ params->inputenc =
fl_get_choice_text(fd_form_document->choice_inputenc);
- params->fontsize =
+ params->fontsize =
fl_get_choice_text(fd_form_document->choice_fontsize);
- params->pagestyle =
+ params->pagestyle =
fl_get_choice_text(fd_form_document->choice_pagestyle);
- params->graphicsDriver =
+ params->graphicsDriver =
fl_get_choice_text(fd_form_document->choice_postscript_driver);
- params->use_amsmath =
+ params->use_amsmath =
fl_get_button(fd_form_document->check_use_amsmath);
if (!current_view->available())
if (ret){
string s;
- if (ret==1)
- s= _("One paragraph couldn't be converted");
+ if (ret == 1)
+ s = _("One paragraph couldn't be converted");
else {
s += tostr(ret);
s += _(" paragraphs couldn't be converted");
}
- WriteAlert(_("Conversion Errors!"),s,
+ WriteAlert(_("Conversion Errors!"), s,
_("into chosen document class"));
}
char tmpsep = params->paragraph_separation;
if (fl_get_button(fd_form_document->radio_indent))
- params->paragraph_separation = LYX_PARSEP_INDENT;
+ params->paragraph_separation = BufferParams::PARSEP_INDENT;
else
- params->paragraph_separation = LYX_PARSEP_SKIP;
+ params->paragraph_separation = BufferParams::PARSEP_SKIP;
if (tmpsep != params->paragraph_separation)
redo = true;
params->tocdepth =
static_cast<int>(fl_get_counter_value(fd_form_document->slider_tocdepth));
- params->float_placement =
+ params->float_placement =
fl_get_input(fd_form_document->input_float_placement);
// More checking should be done to ensure the string doesn't have
minibuffer->Set(_("Document layout set"));
current_view->buffer()->markDirty();
- params->options =
+ params->options =
fl_get_input(fd_form_document->input_extra);
}
extern "C" void DocumentOKCB(FL_OBJECT *ob, long data)
{
- DocumentCancelCB(ob,data);
- DocumentApplyCB(ob,data);
+ DocumentCancelCB(ob, data);
+ DocumentApplyCB(ob, data);
}
if (!current_view->buffer()->text->GotoNextNote()) {
if (current_view->buffer()->text->cursor.pos
- || current_view->buffer()->text->cursor.par !=
+ || current_view->buffer()->text->cursor.par !=
current_view->buffer()->text->FirstParagraph())
{
tmp = current_view->buffer()->text->cursor;
- current_view->buffer()->text->cursor.par =
+ current_view->buffer()->text->cursor.par =
current_view->buffer()->text->FirstParagraph();
current_view->buffer()->text->cursor.pos = 0;
if (!current_view->buffer()->text->GotoNextNote()) {
}
}
current_view->buffer()->update(0);
- current_view->buffer()->text->sel_cursor =
+ current_view->buffer()->text->sel_cursor =
current_view->buffer()->text->cursor;
}
return;
minibuffer->Set(_("Quotes type set"));
- //current_view->buffer()->params.quotes_language =
+ //current_view->buffer()->params.quotes_language =
// fl_get_choice(fd_form_quotes->choice_quotes_language) - 1;
InsetQuotes::quote_language lga = InsetQuotes::EnglishQ;
switch(fl_get_choice(fd_form_quotes->choice_quotes_language) - 1) {
if (!current_view->available())
return;
- current_view->buffer()->params.preamble =
+ current_view->buffer()->params.preamble =
fl_get_input(fd_form_preamble->input_preamble);
current_view->buffer()->markDirty();
minibuffer->Set(_("LaTeX preamble set"));
extern "C" void TableApplyCB(FL_OBJECT *, long)
{
- int xsize,ysize;
+ int xsize, ysize;
if (!current_view->getScreen())
return;
//if (!fl_get_button(fd_form_table->check_latex)){
// insert the new wysiwy table
current_view->buffer()->text->SetLayout(0); // standard layout
- if (current_view->buffer()->text->cursor.par->footnoteflag ==
+ if (current_view->buffer()->text->cursor.par->footnoteflag ==
LyXParagraph::NO_FOOTNOTE) {
current_view->buffer()->
text->SetParagraph(0, 0,
current_view->buffer()->text->cursor.par->table = new LyXTable(xsize, ysize);
int i;
- for (i=0; i<xsize * ysize - 1; i++)
- current_view->buffer()->text->cursor.par->InsertChar(0,LYX_META_NEWLINE);
+ for (i = 0; i<xsize * ysize - 1; i++)
+ current_view->buffer()->text->cursor.par->InsertChar(0, LyXParagraph::META_NEWLINE);
current_view->buffer()->text->RedoParagraph();
current_view->buffer()->text->UnFreezeUndo();
extern "C" void TableOKCB(FL_OBJECT *ob, long data)
{
- TableApplyCB(ob,data);
- TableCancelCB(ob,data);
+ TableApplyCB(ob, data);
+ TableCancelCB(ob, data);
}
fl_hide_form(fd_form_print->form_print);
}
-static bool stringOnlyContains (string const & LStr, const char * cset)
+static bool stringOnlyContains (string const & LStr, char const * cset)
{
- const char * cstr = LStr.c_str() ;
+ char const * cstr = LStr.c_str() ;
- return strspn(cstr,cset) == strlen(cstr) ;
+ return strspn(cstr, cset) == strlen(cstr) ;
}
extern "C" void PrintApplyCB(FL_OBJECT *, long)
reverseflag = lyxrc->print_reverse_flag + ' ';
string orientationflag;
- if (buffer->params.orientation == ORIENTATION_LANDSCAPE)
+ if (buffer->params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
orientationflag = lyxrc->print_landscape_flag + ' ';
string ps_file = SpaceLess(fl_get_input(fd_form_print->input_file));
+ orientationflag + extraflags;
char real_papersize = buffer->params.papersize;
- if (real_papersize == PAPER_DEFAULT)
+ if (real_papersize == BufferParams::PAPER_DEFAULT)
real_papersize = lyxrc->default_papersize;
string
paper;
switch (real_papersize) {
- case PAPER_USLETTER:
+ case BufferParams::PAPER_USLETTER:
paper = "letter";
break;
- case PAPER_A3PAPER:
+ case BufferParams::PAPER_A3PAPER:
paper = "a3";
break;
- case PAPER_A4PAPER:
+ case BufferParams::PAPER_A4PAPER:
paper = "a4";
break;
- case PAPER_A5PAPER:
+ case BufferParams::PAPER_A5PAPER:
paper = "a5";
break;
- case PAPER_B5PAPER:
+ case BufferParams::PAPER_B5PAPER:
paper = "b5";
break;
- case PAPER_EXECUTIVEPAPER:
+ case BufferParams::PAPER_EXECUTIVEPAPER:
paper = "foolscap";
break;
- case PAPER_LEGALPAPER:
+ case BufferParams::PAPER_LEGALPAPER:
paper = "legal";
break;
default: /* If nothing else fits, keep an empty value... */
}
if (buffer->params.use_geometry
- && buffer->params.papersize2 == VM_PAPER_CUSTOM
+ && buffer->params.papersize2 == BufferParams::VM_PAPER_CUSTOM
&& !lyxrc->print_paper_dimension_flag.empty()
&& !buffer->params.paperwidth.empty()
&& !buffer->params.paperheight.empty()) {
command += buffer->params.paperheight + ' ';
} else if (!lyxrc->print_paper_flag.empty()
&& !paper.empty()
- && (real_papersize != PAPER_USLETTER ||
- buffer->params.orientation == ORIENTATION_PORTRAIT)) {
+ && (real_papersize != BufferParams::PAPER_USLETTER ||
+ buffer->params.orientation == BufferParams::ORIENTATION_PORTRAIT)) {
command += " " + lyxrc->print_paper_flag + " " + paper + " ";
}
if (fl_get_button(fd_form_print->radio_file))
extern "C" void PrintOKCB(FL_OBJECT *ob, long data)
{
PrintCancelCB(ob, data);
- PrintApplyCB(ob,data);
+ PrintApplyCB(ob, data);
}
// The standard layout should always be numer 0;
buffer->text->SetLayout(0);
- if (buffer->text->cursor.par->footnoteflag ==
+ if (buffer->text->cursor.par->footnoteflag ==
LyXParagraph::NO_FOOTNOTE) {
buffer->text->SetParagraph(0, 0,
0, 0,
extern "C" void FigureOKCB(FL_OBJECT *ob, long data)
{
- FigureApplyCB(ob,data);
- FigureCancelCB(ob,data);
+ FigureApplyCB(ob, data);
+ FigureCancelCB(ob, data);
}
extern "C" void ScreenApplyCB(FL_OBJECT *, long)
extern "C" void ScreenOKCB(FL_OBJECT *ob, long data)
{
- ScreenCancelCB(ob,data);
- ScreenApplyCB(ob,data);
+ ScreenCancelCB(ob, data);
+ ScreenApplyCB(ob, data);
}
// Run configure in user lyx directory
Path p(user_lyxdir);
Systemcalls one(Systemcalls::System,
- AddName(system_lyxdir,"configure"));
+ AddName(system_lyxdir, "configure"));
p.pop();
minibuffer->Set(_("Reloading configuration..."));
lyxrc->Read(LibFileSearch(string(), "lyxrc.defaults"));
int i = fl_get_browser(ob);
int a = 0;
- for (a=1; a<i && tmptoclist->next; a++){
+ for (a = 1; a<i && tmptoclist->next; a++){
tmptoclist = tmptoclist->next;
}
if (par) {
BeforeChange();
current_view->buffer()->text->SetCursor(par, 0);
- current_view->buffer()->text->sel_cursor =
+ current_view->buffer()->text->sel_cursor =
current_view->buffer()->text->cursor;
current_view->buffer()->update(0);
}
/* insert this into the table of contents */
/* first indent a little bit */
- for (pos=0;
+ for (pos = 0;
pos < (labeltype -
textclasslist.TextClass(current_view->buffer()->
params.textclass).maxcounter()) * 4 + 2;
pos++;
/* now the contents */
-#ifdef NEW_TEXT
LyXParagraph::size_type i = 0;
while (pos < 199 && i < par->size()) {
-#else
- int i = 0;
- while (pos < 199 && i < par->last) {
-#endif
c = par->GetChar(i);
if (isprint(c) || c >= 128) {
line[pos] = c;
tmptoclist->next = 0;
int a = 0;
- for (a=0; a<6; a++){
+ for (a = 0; a<6; a++){
tmptoclist->counter[a] = par->GetFirstCounter(a);
}
tmptoclist->appendix = par->appendix;
if (!current_view->available())
return;
- string s =
+ string s =
fl_get_browser_line(fd_form_ref->browser_ref,
fl_get_browser(fd_form_ref->browser_ref));
string u = frontStrip(strip(fl_get_input(fd_form_ref->ref_name)));
if (s.empty())
return;
- if (data==2) {
+ if (data == 2) {
current_view->owner()->getLyXFunc()->Dispatch(LFUN_REFGOTO, s.c_str());
return;
}
string t;
- if (data==0)
+ if (data == 0)
t += "\\ref";
else
t += "\\pageref";
else
t += "{" + s + "}";
- Inset *new_inset =
+ Inset *new_inset =
new InsetRef(t, current_view->buffer());
current_view->buffer()->insertInset(new_inset);
}
FL_OBJECT * brow = fd_form_ref->browser_ref;
// Get the current line, in order to restore it later
- char const * const btmp=fl_get_browser_line(brow,
+ char const * const btmp = fl_get_browser_line(brow,
fl_get_browser(brow));
- string currentstr=btmp ? btmp : "";
+ string currentstr = btmp ? btmp : "";
//string currentstr = fl_get_browser_line(brow,
// fl_get_browser(brow));
int topline = 1;
#if FL_REVISION > 85
- fl_addto_browser_chars(brow,refs.c_str());
+ fl_addto_browser_chars(brow, refs.c_str());
int total_lines = fl_get_browser_maxline(brow);
for (int i = 1; i <= total_lines ; i++) {
if (fl_get_browser_line(brow, i) == currentstr) {
int ref_num = 0;
while(true) {
- curr_ref = refs.token('\n',ref_num);
+ curr_ref = refs.token('\n', ref_num);
if (curr_ref.empty())
break;
- fl_add_browser_line(brow,curr_ref.c_str());
+ fl_add_browser_line(brow, curr_ref.c_str());
ref_num++;
}
#endif
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include <cstdlib>
// Make sure default screen is not larger than monitor
if (width == 690 && height == 510) {
- Screen * scr=(DefaultScreenOfDisplay(fl_get_display()));
+ Screen * scr = (DefaultScreenOfDisplay(fl_get_display()));
if (HeightOfScreen(scr)-24<height)
height = HeightOfScreen(scr)-24;
if (WidthOfScreen(scr)-8<width)
// (petr 120997).
fl_setpup_fontstyle(FL_NORMAL_STYLE);
fl_setpup_fontsize(FL_NORMAL_SIZE);
- fl_setpup_color(FL_MCOL,FL_BLACK);
+ fl_setpup_color(FL_MCOL, FL_BLACK);
fl_set_goodies_font(FL_NORMAL_STYLE, FL_NORMAL_SIZE);
// all lyxrc settings has to be done here as lyxrc has not yet
fl_set_form_atclose(fd_form_title->form_title, CancelCloseBoxCB, 0);
fl_addto_form(fd_form_title->form_title);
#ifdef TWO_COLOR_ICONS
- FL_OBJECT *obj = fl_add_bitmapbutton(FL_NORMAL_BUTTON,0,0,425,290,"");
- fl_set_bitmapbutton_data(obj,banner_bw_width,
+ FL_OBJECT *obj = fl_add_bitmapbutton(FL_NORMAL_BUTTON, 0, 0, 425, 290, "");
+ fl_set_bitmapbutton_data(obj, banner_bw_width,
banner_bw_height, banner_bw_bits);
- fl_set_object_color(obj,FL_WHITE,FL_BLACK);
+ fl_set_object_color(obj, FL_WHITE, FL_BLACK);
#else
- FL_OBJECT *obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON,0,0,425,290,"");
+ FL_OBJECT *obj = fl_add_pixmapbutton(FL_NORMAL_BUTTON, 0, 0, 425, 290, "");
fl_set_pixmapbutton_data(obj, (char**)banner);
#if FL_REVISION > 85
- fl_set_pixmapbutton_focus_outline(obj,3);
+ fl_set_pixmapbutton_focus_outline(obj, 3);
#endif
#endif
- fl_set_button_shortcut(obj,"^M ^[",1);
- fl_set_object_boxtype(obj,FL_NO_BOX);
- fl_set_object_callback(obj,TimerCB,0);
+ fl_set_button_shortcut(obj, "^M ^[", 1);
+ fl_set_object_boxtype(obj, FL_NO_BOX);
+ fl_set_object_callback(obj, TimerCB, 0);
- obj = fl_add_text(FL_NORMAL_TEXT,248,265,170,16, LYX_VERSION);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 248, 265, 170, 16, LYX_VERSION);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
#ifdef TWO_COLOR_ICONS
- fl_set_object_color(obj,FL_WHITE,FL_WHITE);
- fl_set_object_lcol(obj,FL_BLACK);
+ fl_set_object_color(obj, FL_WHITE, FL_WHITE);
+ fl_set_object_lcol(obj, FL_BLACK);
#else
-// fl_set_object_color(obj,FL_WHITE, FL_WHITE);
-// fl_set_object_lcol(obj,FL_BLACK);
+// fl_set_object_color(obj, FL_WHITE, FL_WHITE);
+// fl_set_object_lcol(obj, FL_BLACK);
fl_mapcolor(FL_FREE_COL2, 0x05, 0x2e, 0x4c);
fl_mapcolor(FL_FREE_COL3, 0xe1, 0xd2, 0x9b);
- fl_set_object_color(obj,FL_FREE_COL2, FL_FREE_COL2);
- fl_set_object_lcol(obj,FL_FREE_COL3);
+ fl_set_object_color(obj, FL_FREE_COL2, FL_FREE_COL2);
+ fl_set_object_lcol(obj, FL_FREE_COL3);
#endif
- fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ fl_set_object_lalign(obj, FL_ALIGN_CENTER|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form();
// the paragraph form
fl_addto_choice(fd_form_document->choice_spacing,
_(" Single | OneHalf | Double | Other "));
- fl_set_counter_bounds(fd_form_document->slider_secnumdepth,-1,5);
- fl_set_counter_bounds(fd_form_document->slider_tocdepth,-1,5);
- fl_set_counter_step(fd_form_document->slider_secnumdepth,1,1);
- fl_set_counter_step(fd_form_document->slider_tocdepth,1,1);
+ fl_set_counter_bounds(fd_form_document->slider_secnumdepth,-1, 5);
+ fl_set_counter_bounds(fd_form_document->slider_tocdepth,-1, 5);
+ fl_set_counter_step(fd_form_document->slider_secnumdepth, 1, 1);
+ fl_set_counter_step(fd_form_document->slider_tocdepth, 1, 1);
fl_set_counter_precision(fd_form_document->slider_secnumdepth, 0);
fl_set_counter_precision(fd_form_document->slider_tocdepth, 0);
fl_addto_form(fd_form_document->form_document);
combo_language = new Combox(FL_COMBOX_DROPLIST);
FL_OBJECT *ob = fd_form_document->choice_language;
combo_language->add(ob->x, ob->y, ob->w, ob->h, 200);
- combo_language->shortcut("#G",1);
+ combo_language->shortcut("#G", 1);
fl_end_form();
int n; // declared here because DEC cxx does not like multiple
// declarations of variables in for() loops (JMarc)
- for (n=0; tex_babel[n][0]; n++) {
+ for (n = 0; tex_babel[n][0]; n++) {
combo_language->addto(tex_babel[n]);
}
// not really necessary, but we can do it anyway.
fl_addto_choice(fd_form_document->choice_fontsize, "default|10|11|12");
- for (n=0; tex_fonts[n][0]; n++) {
- fl_addto_choice(fd_form_document->choice_fonts,tex_fonts[n]);
+ for (n = 0; tex_fonts[n][0]; n++) {
+ fl_addto_choice(fd_form_document->choice_fonts, tex_fonts[n]);
}
fl_addto_choice(fd_form_document->choice_inputenc,
"default|latin1|latin2|latin5"
"|koi8-r|koi8-u|cp866|cp1251");
- for (n=0; tex_graphics[n][0]; n++) {
+ for (n = 0; tex_graphics[n][0]; n++) {
fl_addto_choice(fd_form_document->choice_postscript_driver,
tex_graphics[n]);
}
// the table form
fd_form_table = create_form_form_table();
fl_set_form_atclose(fd_form_table->form_table, CancelCloseBoxCB, 0);
- fl_set_slider_bounds(fd_form_table->slider_rows,1,50);
- fl_set_slider_bounds(fd_form_table->slider_columns,1,50);
+ fl_set_slider_bounds(fd_form_table->slider_rows, 1, 50);
+ fl_set_slider_bounds(fd_form_table->slider_columns, 1, 50);
fl_set_slider_value(fd_form_table->slider_rows, 5);
fl_set_slider_value(fd_form_table->slider_columns, 5);
fl_set_slider_precision(fd_form_table->slider_rows, 0);
// the sendto form
fd_form_sendto = create_form_form_sendto();
- fl_set_form_atclose(fd_form_sendto->form_sendto,CancelCloseBoxCB,0);
+ fl_set_form_atclose(fd_form_sendto->form_sendto, CancelCloseBoxCB, 0);
// the figure form
fd_form_figure = create_form_form_figure();
int main_placement = FL_PLACE_CENTER | FL_FREE_SIZE;
int title_placement = FL_PLACE_CENTER;
// Did we get a valid position?
- if (xpos>=0 && ypos>=0) {
+ if (xpos>= 0 && ypos>= 0) {
lyxViews->setPosition(xpos, ypos);
// show the title form in the middle of the main form
fl_set_form_position(fd_form_title->form_title,
* Copyright (C) 1995 1996 Matthias Ettrich
* and the LyX Team.
*
- *======================================================*/
+ * ====================================================== */
-#ifndef _LYX_GUI_H_
-#define _LYX_GUI_H_
+#ifndef LYX_GUI_H
+#define LYX_GUI_H
#ifdef __GNUG__
#pragma interface
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
}
}
if (fd_form_toc->browser_toc->visible) {
- TocUpdateCB(0,0);
+ TocUpdateCB(0, 0);
}
#ifdef ALWAYS_UPDATE_REF
// Ideally, the RefUpdateCB should be modified so that if the
// of course a compromise and an annoyance for users switching
// between separate documents. ARRae 241198
if (fd_form_ref->form_ref->visible) {
- RefUpdateCB(0,0);
+ RefUpdateCB(0, 0);
}
#endif
if (current_view->buffer()->isReadonly()) {
const char* flyx_shortcut_extract(const char*sc)
{
// Find '|' in the sc and return the string after that.
- register const char *sd = sc;
- while(sd[0]!=0 && sd[0] != '|') sd++;
+ register char const *sd = sc;
+ while(sd[0]!= 0 && sd[0] != '|') sd++;
- if (sd[0]=='|') {
+ if (sd[0] == '|') {
sd++;
//lyxerr << sd << endl;
return sd;
}
// Extract identifier from <ident>|<shortcut> string
-const char* flyx_ident_extract(const char *sc)
+const char* flyx_ident_extract(char const *sc)
{
- register const char *se = sc;
- while(se[0]!=0 && se[0] != '|') se++;
+ register char const *se = sc;
+ while(se[0]!= 0 && se[0] != '|') se++;
- if (se[0]==0) return sc;
+ if (se[0] == 0) return sc;
char * sb = new char[se-sc + 1];
int index = 0;
- register const char *sd = sc;
+ register char const *sd = sc;
while (sd != se) {
sb[index] = sd[0];
index++; sd++;
}
- sb[index]=0;
+ sb[index] = 0;
return sb;
}
* Copyright (C) 1995 1996 Matthias Ettrich
* and the LyX Team.
*
-*======================================================*/
+* ====================================================== */
// Misc. GUI specific routines
-#ifndef _LYX_GUI_MISC_H
-#define _LYX_GUI_MISC_H
+#ifndef LYX_GUI_MISC_H
+#define LYX_GUI_MISC_H
#include FORMS_H_LOCATION
#include "LString.h"
#define scex flyx_shortcut_extract
/// Extract shortcut from <ident>|<shortcut> string
-const char* flyx_ident_extract(const char *sc);
+const char* flyx_ident_extract(char const *sc);
/// Make a shortnamed versjon of the above func
#define idex flyx_ident_extract
/// Show message
-void WriteAlert(string const & s1, string const & s2=string(),
- string const & s3=string());
+void WriteAlert(string const & s1, string const & s2 = string(),
+ string const & s3 = string());
/// Alarms user of something related to files
-void WriteFSAlert(string const & s1, string const & s2=string());
+void WriteFSAlert(string const & s1, string const & s2 = string());
/// Asks "Yes" or "No". Returns true for yes, false for no
-bool AskQuestion(string const & s1, string const & s2=string(),
- string const & s3=string());
+bool AskQuestion(string const & s1, string const & s2 = string(),
+ string const & s3 = string());
/// Asks "Yes", "No" or "Cancel". Returns 1 for yes, 2 for no, 3 for cancel
-int AskConfirmation(string const & s1, string const & s2=string(),
- string const & s3=string());
+int AskConfirmation(string const & s1, string const & s2 = string(),
+ string const & s3 = string());
/// returns a text
-string askForText(string const & msg, string const & dflt=string());
+string askForText(string const & msg, string const & dflt = string());
/// Informs the user that changes in the coming form will be ignored
void WarnReadonly();
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
// Now the GUI and LyX have taken care of their arguments, so
// the only thing left on the command line should be
// filenames.
- if ((*argc)==2)
+ if ((*argc) == 2)
lyxerr[Debug::INFO] << "Opening document..." << endl;
else if ((*argc)>2)
lyxerr[Debug::INFO] << "Opening documents..." << endl;
// If we had a command line switch, system_lyxdir is already set
string searchpath;
if (!system_lyxdir.empty())
- searchpath=MakeAbsPath(system_lyxdir) + ';';
+ searchpath= MakeAbsPath(system_lyxdir) + ';';
// LYX_DIR_10x environment variable
string lyxdir = GetEnvPath("LYX_DIR_10x");
OnlyFilename(binname)) + ';';
// Follow Symlinks
- FileInfo file(fullbinpath,true);
+ FileInfo file(fullbinpath, true);
FollowLink = file.isLink();
if (FollowLink) {
string Link;
- if (LyXReadLink(fullbinpath,Link)) {
+ if (LyXReadLink(fullbinpath, Link)) {
fullbinpath = Link;
binpath = MakeAbsPath(OnlyPath(fullbinpath));
}
}
// Calculate screen dpi as average of x-DPI and y-DPI:
- Screen * scr=(DefaultScreenOfDisplay(fl_get_display()));
+ Screen * scr= (DefaultScreenOfDisplay(fl_get_display()));
lyxrc->dpi = ((HeightOfScreen(scr)* 25.4 / HeightMMOfScreen(scr)) +
(WidthOfScreen(scr)* 25.4 / WidthMMOfScreen(scr))) / 2;
lyxerr[Debug::INFO] << "DPI setting detected to be "
// Run configure in user lyx directory
Path p(user_lyxdir);
- system(AddName(system_lyxdir,"configure").c_str());
+ system(AddName(system_lyxdir, "configure").c_str());
lyxerr << "LyX: " << _("Done!") << endl;
}
if (arg == "-dbg") {
if (i+1 < *argc) {
int erri = 0;
- sscanf(argv[i+1],"%d", &erri);
+ sscanf(argv[i+1], "%d", &erri);
setDebuggingLevel(erri);
// Now, remove these two arguments by shifting
// the following two places down.
(*argc) -= 2;
- for (int j=i; j < (*argc); j++)
+ for (int j= i; j < (*argc); j++)
argv[j] = argv[j+2];
i--; // After shift, check this number again.
} else
// Now, remove these two arguments by shifting
// the following two places down.
(*argc) -= 2;
- for (int j=i; j < (*argc); j++)
+ for (int j= i; j < (*argc); j++)
argv[j] = argv[j+2];
i--; // After shift, check this number again.
} else
bufferlist.emergencyWriteAll();
lyxerr << "Bye." << endl;
- if(err_sig!=SIGHUP && (!GetEnv("LYXDEBUG").empty() || err_sig == SIGSEGV))
+ if(err_sig!= SIGHUP && (!GetEnv("LYXDEBUG").empty() || err_sig == SIGSEGV))
abort();
exit(0);
}
// -*- C++ -*-
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 1996 Matthias Ettrich
* and the LyX Team.
*
-*======================================================*/
+* ====================================================== */
/* This is the declaration of the LyX class, there should only
* exist _one_ instance of this in the application. */
FD_xsendfax *fdui = (FD_xsendfax *) fl_calloc(1, sizeof(FD_xsendfax));
fdui->xsendfax = fl_bgn_form(FL_NO_BOX, 600, 330);
- obj = fl_add_box(FL_UP_BOX,0,0,600,330,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,15,465,125,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- fdui->Input_Phone = obj = fl_add_input(FL_NORMAL_INPUT,90,30,377,30,idex(_("Fax no.:|#F")));fl_set_button_shortcut(obj,scex(_("Fax no.:|#F")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->Input_Name = obj = fl_add_input(FL_NORMAL_INPUT,90,65,377,29,idex(_("Dest. Name:|#N")));fl_set_button_shortcut(obj,scex(_("Dest. Name:|#N")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->Input_Enterprise = obj = fl_add_input(FL_NORMAL_INPUT,90,100,377,29,idex(_("Enterprise:|#E")));fl_set_button_shortcut(obj,scex(_("Enterprise:|#E")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->Input_Comment = obj = fl_add_input(FL_MULTILINE_INPUT,15,165,575,106,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- fl_set_object_lstyle(obj,FL_NORMAL_STYLE+FL_EMBOSSED_STYLE);
- fdui->Button_Send = obj = fl_add_button(FL_NORMAL_BUTTON,20,290,180,30,idex(_("OK|#O")));fl_set_button_shortcut(obj,scex(_("OK|#O")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fl_set_object_callback(obj,FaxSendCB,0);
- fdui->Button_Cancel = obj = fl_add_button(FL_NORMAL_BUTTON,400,290,180,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fl_set_object_callback(obj,FaxCancelCB,0);
- fdui->Button_Apply = obj = fl_add_button(FL_NORMAL_BUTTON,210,290,180,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fl_set_object_callback(obj,FaxApplyCB,0);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,485,30,105,100,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_text(FL_NORMAL_TEXT,490,20,95,20,_("Phone Book"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->Button_SPhone = obj = fl_add_button(FL_NORMAL_BUTTON,490,45,15,15,idex(_("Select from|#S")));fl_set_button_shortcut(obj,scex(_("Select from|#S")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT);
- fl_set_object_callback(obj,FaxOpenPhonebookCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,490,65,15,15,idex(_("Add to|#t")));fl_set_button_shortcut(obj,scex(_("Add to|#t")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT);
- fl_set_object_callback(obj,cb_add_phoneno,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,490,85,15,15,idex(_("Delete from|#D")));fl_set_button_shortcut(obj,scex(_("Delete from|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT);
- fl_set_object_callback(obj,cb_delete_phoneno,0);
- fdui->pb_save = obj = fl_add_button(FL_NORMAL_BUTTON,490,105,15,15,idex(_("Save|#V")));fl_set_button_shortcut(obj,scex(_("Save|#V")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT);
- fl_set_object_callback(obj,cb_save_phoneno,0);
- obj = fl_add_text(FL_NORMAL_TEXT,15,5,100,20,_("Destination:"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,155,585,125,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_text(FL_NORMAL_TEXT,15,145,85,20,_("Comment:"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 600, 330, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 15, 465, 125, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ fdui->Input_Phone = obj = fl_add_input(FL_NORMAL_INPUT, 90, 30, 377, 30, idex(_("Fax no.:|#F")));fl_set_button_shortcut(obj, scex(_("Fax no.:|#F")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->Input_Name = obj = fl_add_input(FL_NORMAL_INPUT, 90, 65, 377, 29, idex(_("Dest. Name:|#N")));fl_set_button_shortcut(obj, scex(_("Dest. Name:|#N")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->Input_Enterprise = obj = fl_add_input(FL_NORMAL_INPUT, 90, 100, 377, 29, idex(_("Enterprise:|#E")));fl_set_button_shortcut(obj, scex(_("Enterprise:|#E")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->Input_Comment = obj = fl_add_input(FL_MULTILINE_INPUT, 15, 165, 575, 106, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fl_set_object_lstyle(obj, FL_NORMAL_STYLE+FL_EMBOSSED_STYLE);
+ fdui->Button_Send = obj = fl_add_button(FL_NORMAL_BUTTON, 20, 290, 180, 30, idex(_("OK|#O")));fl_set_button_shortcut(obj, scex(_("OK|#O")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fl_set_object_callback(obj, FaxSendCB, 0);
+ fdui->Button_Cancel = obj = fl_add_button(FL_NORMAL_BUTTON, 400, 290, 180, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fl_set_object_callback(obj, FaxCancelCB, 0);
+ fdui->Button_Apply = obj = fl_add_button(FL_NORMAL_BUTTON, 210, 290, 180, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fl_set_object_callback(obj, FaxApplyCB, 0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 485, 30, 105, 100, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_text(FL_NORMAL_TEXT, 490, 20, 95, 20, _("Phone Book"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->Button_SPhone = obj = fl_add_button(FL_NORMAL_BUTTON, 490, 45, 15, 15, idex(_("Select from|#S")));fl_set_button_shortcut(obj, scex(_("Select from|#S")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
+ fl_set_object_callback(obj, FaxOpenPhonebookCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 490, 65, 15, 15, idex(_("Add to|#t")));fl_set_button_shortcut(obj, scex(_("Add to|#t")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
+ fl_set_object_callback(obj, cb_add_phoneno, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 490, 85, 15, 15, idex(_("Delete from|#D")));fl_set_button_shortcut(obj, scex(_("Delete from|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
+ fl_set_object_callback(obj, cb_delete_phoneno, 0);
+ fdui->pb_save = obj = fl_add_button(FL_NORMAL_BUTTON, 490, 105, 15, 15, idex(_("Save|#V")));fl_set_button_shortcut(obj, scex(_("Save|#V")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT);
+ fl_set_object_callback(obj, cb_save_phoneno, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 15, 5, 100, 20, _("Destination:"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 155, 585, 125, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_text(FL_NORMAL_TEXT, 15, 145, 85, 20, _("Comment:"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_end_form();
//fdui->xsendfax->fdui = fdui;
FD_phonebook *fdui = (FD_phonebook *) fl_calloc(1, sizeof(FD_phonebook));
fdui->phonebook = fl_bgn_form(FL_NO_BOX, 600, 320);
- obj = fl_add_box(FL_UP_BOX,0,0,600,320,"");
- fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER,2,2,598,318,"");
- fl_set_object_lsize(obj,FL_MEDIUM_SIZE);
- fl_set_object_callback(obj,cb_select_phoneno,0);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 600, 320, "");
+ fdui->browser = obj = fl_add_browser(FL_HOLD_BROWSER, 2, 2, 598, 318, "");
+ fl_set_object_lsize(obj, FL_MEDIUM_SIZE);
+ fl_set_object_callback(obj, cb_select_phoneno, 0);
fl_end_form();
//fdui->phonebook->fdui = fdui;
FD_logfile *fdui = (FD_logfile *) fl_calloc(1, sizeof(FD_logfile));
fdui->logfile = fl_bgn_form(FL_NO_BOX, 510, 190);
- obj = fl_add_box(FL_UP_BOX,0,0,510,190,"");
- fdui->browser = obj = fl_add_browser(FL_NORMAL_BROWSER,10,10,490,130,"");
- fdui->Button_Close = obj = fl_add_button(FL_RETURN_BUTTON,410,150,90,30,_("Close"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,FaxLogfileCloseCB,0);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 510, 190, "");
+ fdui->browser = obj = fl_add_browser(FL_NORMAL_BROWSER, 10, 10, 490, 130, "");
+ fdui->Button_Close = obj = fl_add_button(FL_RETURN_BUTTON, 410, 150, 90, 30, _("Close"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, FaxLogfileCloseCB, 0);
fl_end_form();
//fdui->logfile->fdui = fdui;
if (fname.empty())
return false;
- path=OnlyPath(fname);
+ path= OnlyPath(fname);
if (path.empty() || path == "./")
filename = GetCWD() + "/" + fname;
else
phone_book_name = "phonebook";
} else
phone_book_name = lyxrc->phone_book;
- phone_book=FileSearch(user_lyxdir,phone_book_name);
+ phone_book= FileSearch(user_lyxdir, phone_book_name);
if (phone_book.empty())
- phone_book = AddName(user_lyxdir,phone_book_name);
+ phone_book = AddName(user_lyxdir, phone_book_name);
fl_set_browser_fontsize(fd_phonebook->browser, FL_NORMAL_SIZE);
fl_set_browser_fontstyle(fd_phonebook->browser, FL_FIXED_STYLE);
title += OnlyFilename(fname);
/* show the first form */
- fl_show_form(fd_xsendfax->xsendfax,FL_PLACE_MOUSE,FL_FULLBORDER,title.c_str());
+ fl_show_form(fd_xsendfax->xsendfax, FL_PLACE_MOUSE, FL_FULLBORDER, title.c_str());
/*
while(true) {
obj = fl_do_forms();
- if (obj==fd_xsendfax->Button_Cancel)
+ if (obj == fd_xsendfax->Button_Cancel)
break;
- else if (obj==fd_xsendfax->Button_Send) {
- if (button_send(fname,global_sendcmd))
+ else if (obj == fd_xsendfax->Button_Send) {
+ if (button_send(fname, global_sendcmd))
break;
- } else if (obj==fd_xsendfax->Button_Apply) {
- button_send(fname,global_sendcmd);
- } else if (obj==fd_xsendfax->Button_SPhone) {
- cb_select_phoneno(0,0);
+ } else if (obj == fd_xsendfax->Button_Apply) {
+ button_send(fname, global_sendcmd);
+ } else if (obj == fd_xsendfax->Button_SPhone) {
+ cb_select_phoneno(0, 0);
}
}
fl_hide_form(fd_xsendfax->xsendfax);
if (phone.empty())
return false;
- logfile = TmpFileName(OnlyPath(fname),"FAX");
+ logfile = TmpFileName(OnlyPath(fname), "FAX");
cmd = sendcmd + " >";
cmd += logfile + " 2>";
cmd += logfile;
cmd = subst(cmd, "$$FName", fname);
lyxerr << "CMD: " << cmd << endl;
Systemcalls one(Systemcalls::System, cmd);
- show_logfile(logfile,false);
+ show_logfile(logfile, false);
remove(logfile.c_str());
return true;
}
{
int
i,
- n=fl_get_browser_maxline(fd_phonebook->browser);
+ n= fl_get_browser_maxline(fd_phonebook->browser);
char const
*line;
fl_hide_form(fd_phonebook->phonebook);
line = fl_get_browser_line(fd_phonebook->browser, 1);
- if (!n || strstr(line,_("Empty Phonebook"))) {
+ if (!n || strstr(line, _("Empty Phonebook"))) {
fl_clear_browser(fd_phonebook->browser);
return;
}
return;
char *buf = new char [strlen(line)+1];
- strcpy(buf,line);
- for(i = LEN_PHONE;(i>0) && (buf[i]==' ');i--)
+ strcpy(buf, line);
+ for(i = LEN_PHONE;(i>0) && (buf[i] == ' ');i--)
;
buf[i+1] = 0;
- for(i = LEN_PHONE+LEN_NAME+1;(i>LEN_PHONE) && (buf[i]==' ');i--)
+ for(i = LEN_PHONE+LEN_NAME+1;(i>LEN_PHONE) && (buf[i] == ' ');i--)
;
buf[i+1] = 0;
- fl_set_input(fd_xsendfax->Input_Phone,buf);
- fl_set_input(fd_xsendfax->Input_Name,buf+LEN_PHONE+1);
- fl_set_input(fd_xsendfax->Input_Enterprise,buf+LEN_PHONE+LEN_NAME+2);
+ fl_set_input(fd_xsendfax->Input_Phone, buf);
+ fl_set_input(fd_xsendfax->Input_Name, buf+LEN_PHONE+1);
+ fl_set_input(fd_xsendfax->Input_Enterprise, buf+LEN_PHONE+LEN_NAME+2);
delete [] buf;
}
*phone = fl_get_input(fd_xsendfax->Input_Phone),
*enterprise = fl_get_input(fd_xsendfax->Input_Enterprise);
int
- i,n;
+ i, n;
if (!strlen(phone))
return;
char *buf = new char [50+strlen(enterprise)];
- sprintf(buf,"%-*.*s %-*.*s %s",
- LEN_PHONE,LEN_PHONE,phone,
- LEN_NAME,LEN_NAME,name,
+ sprintf(buf, "%-*.*s %-*.*s %s",
+ LEN_PHONE, LEN_PHONE, phone,
+ LEN_NAME, LEN_NAME, name,
enterprise);
n = fl_get_browser_maxline(fd_phonebook->browser);
if (n) {
line = fl_get_browser_line(fd_phonebook->browser, 1);
- if (strstr(line,_("Empty Phonebook"))) {
+ if (strstr(line, _("Empty Phonebook"))) {
fl_clear_browser(fd_phonebook->browser);
n = 0;
}
}
for(i = 1; i <= n; i++) {
line = fl_get_browser_line(fd_phonebook->browser, i);
- if (!strncmp(buf,line,46))
+ if (!strncmp(buf, line, 46))
break;
}
if (i > n) {
- fl_addto_browser(fd_phonebook->browser,buf);
+ fl_addto_browser(fd_phonebook->browser, buf);
fl_set_object_label(fd_xsendfax->pb_save, _("Save (needed)"));
}
delete[] buf;
*phone = fl_get_input(fd_xsendfax->Input_Phone),
*enterprise = fl_get_input(fd_xsendfax->Input_Enterprise);
int
- i,n;
+ i, n;
if (!strlen(phone))
return;
char *buf = new char [50+strlen(enterprise)];
- sprintf(buf,"%-*.*s %-*.*s %s",
- LEN_PHONE,LEN_PHONE,phone,
- LEN_NAME,LEN_NAME,name,
+ sprintf(buf, "%-*.*s %-*.*s %s",
+ LEN_PHONE, LEN_PHONE, phone,
+ LEN_NAME, LEN_NAME, name,
enterprise);
n = fl_get_browser_maxline(fd_phonebook->browser);
if (n) {
line = fl_get_browser_line(fd_phonebook->browser, 1);
- if (strstr(line,_("Empty Phonebook"))) {
+ if (strstr(line, _("Empty Phonebook"))) {
fl_clear_browser(fd_phonebook->browser);
n = 0;
}
}
- for(i=1;i<=n;i++) {
+ for(i= 1;i<= n;i++) {
line = fl_get_browser_line(fd_phonebook->browser, i);
- if (!strncmp(buf,line,46))
+ if (!strncmp(buf, line, 46))
break;
}
if (i <= n) {
- fl_delete_browser_line(fd_phonebook->browser,i);
+ fl_delete_browser_line(fd_phonebook->browser, i);
fl_set_object_label(fd_xsendfax->pb_save, _("Save (needed)"));
}
delete[] buf;
char const
*line;
int
- i,n;
+ i, n;
FILE
*fp;
- if (!(fp = fopen(phone_book.c_str(),"w"))) {
- WriteAlert(_("Error!"),_("Cannot open phone book: "),phone_book);
+ if (!(fp = fopen(phone_book.c_str(), "w"))) {
+ WriteAlert(_("Error!"), _("Cannot open phone book: "), phone_book);
return;
}
n = fl_get_browser_maxline(fd_phonebook->browser);
if (n) {
line = fl_get_browser_line(fd_phonebook->browser, 1);
- if (strstr(line,_("Empty Phonebook"))) {
+ if (strstr(line, _("Empty Phonebook"))) {
fl_clear_browser(fd_phonebook->browser);
n = 0;
}
}
- for(i=1;i<=n;i++) {
+ for(i= 1;i<= n;i++) {
line = fl_get_browser_line(fd_phonebook->browser, i);
- fprintf(fp,"%s\n",line);
+ fprintf(fp, "%s\n", line);
}
fclose(fp);
fl_set_object_label(fd_xsendfax->pb_save, _("Save"));
{
if (logfile.empty())
return;
- if (!fl_load_browser(fd_logfile->browser,logfile.c_str())) {
+ if (!fl_load_browser(fd_logfile->browser, logfile.c_str())) {
if (!show_if_empty)
return;
fl_add_browser_line(fd_logfile->browser,
fl_raise_form(fd_logfile->logfile);
} else {
fl_show_form(fd_logfile->logfile,
- FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER,
+ FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
_("Message-Window"));
}
}
void FaxApplyCB(FL_OBJECT *, long)
{
- button_send(filename,global_sendcmd);
+ button_send(filename, global_sendcmd);
}
void FaxSendCB(FL_OBJECT *, long)
{
- if (button_send(filename,global_sendcmd))
- FaxCancelCB(0,0);
+ if (button_send(filename, global_sendcmd))
+ FaxCancelCB(0, 0);
}
void FaxOpenPhonebookCB(FL_OBJECT *, long)
{
int
- n=fl_get_browser_maxline(fd_phonebook->browser);
+ n= fl_get_browser_maxline(fd_phonebook->browser);
if (!n)
- fl_addto_browser(fd_phonebook->browser,_("@L@b@cEmpty Phonebook"));
- fl_show_form(fd_phonebook->phonebook,FL_PLACE_MOUSE,FL_FULLBORDER,
+ fl_addto_browser(fd_phonebook->browser, _("@L@b@cEmpty Phonebook"));
+ fl_show_form(fd_phonebook->phonebook, FL_PLACE_MOUSE, FL_FULLBORDER,
_("Phonebook"));
}
/*
This file is part of
- ======================================================
+ ======================================================
LyX, The Document Processor
Copyright 1995 Matthias Ettrich
Copyright 1995-1999 The LyX Team.
- ======================================================
+ ======================================================
*/
#include <config.h>
//\message{LyX LaTeX Extensions (LLE v0.2) of 11-Jan-1996.}
// include this always
-string const lyx_def =
+string const lyx_def =
"\\providecommand{\\LyX}{L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}";
-string const lyxline_def =
+string const lyxline_def =
"\\newcommand{\\lyxline}[1]{\n"
" {#1 \\vspace{1ex} \\hrule width \\columnwidth \\vspace{1ex}}\n"
"}";
-string const quotedblbase_def =
+string const quotedblbase_def =
"\\ProvideTextCommandDefault{\\quotedblbase}{%\n"
" \\raisebox{-1.4ex}[1ex][.5ex]{\\textquotedblright}%\n"
" \\penalty10000\\hskip0em\\relax%\n"
"}";
-string const quotesinglbase_def =
+string const quotesinglbase_def =
"\\ProvideTextCommandDefault{\\quotesinglbase}{%\n"
" \\raisebox{-1.4ex}[1ex][.5ex]{\\textquoteright}%\n"
" \\penalty10000\\hskip0em\\relax%\n"
"}";
-string const guillemotleft_def =
+string const guillemotleft_def =
"\\ProvideTextCommandDefault{\\guillemotleft}{%\n"
" {\\usefont{U}{lasy}{m}{n}\\char'50\\kern-.15em\\char'50}%\n"
"\\penalty10000\\hskip0pt\\relax%\n"
"}";
-string const guillemotright_def =
+string const guillemotright_def =
"\\ProvideTextCommandDefault{\\guillemotright}{%\n"
" \\penalty10000\\hskip0pt%\n"
" {\\usefont{U}{lasy}{m}{n}\\char'51\\kern-.15em\\char'51}%\n"
"}";
-string const guilsinglleft_def =
+string const guilsinglleft_def =
"\\ProvideTextCommandDefault{\\guilsinglleft}{%\n"
" {\\usefont{U}{lasy}{m}{n}\\char'50}%\n"
" \\penalty10000\\hskip0pt\\relax%\n"
"}";
-string const guilsinglright_def =
+string const guilsinglright_def =
"\\ProvideTextCommandDefault{\\guilsinglright}{%\n"
" \\penalty10000\\hskip0pt%\n"
" {\\usefont{U}{lasy}{m}{n}\\char'51}%\n"
"}";
-string const paragraphindent_def =
+string const paragraphindent_def =
"\\newenvironment{LyXParagraphIndent}[1]%\n"
"{\n"
" \\begin{list}{}{%\n"
"}\n"
"{\\end{list}}\n";
-string const floatingfootnote_def =
+string const floatingfootnote_def =
"%% Special footnote code from the package 'stblftnt.sty'\n"
"%% Author: Robin Fairbairns -- Last revised Dec 13 1996\n"
"\\let\\SF@@footnote\\footnote\n"
" \\expandafter\\noexpand\\csname SF@gobble@opt \\endcsname}\n"
"\\def\\SF@gobble@twobracket[#1]#2{}\n";
-string const minipageindent_def =
+string const minipageindent_def =
"%% This length is the backup for minipages of the \\parindent\n"
"\\newlength{\\LyXMinipageIndent}\n"
"\\setlength{\\LyXMinipageIndent}{\\parindent}\n";
-string const boldsymbol_def =
+string const boldsymbol_def =
"%% Bold symbol macro for standard LaTeX users\n"
"\\newcommand{\\boldsymbol}[1]{\\mbox{\\boldmath $#1$}}\n";
-string const binom_def =
+string const binom_def =
"%% Binom macro for standard LaTeX users\n"
"\\newcommand{\\binom}[2]{{#1 \\choose #2}}\n";
======================================================
*/
-#ifndef _LYX_STY_H
-#define _LYX_STY_H
+#ifndef LYX_STY_H
+#define LYX_STY_H
#include "LString.h"
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
*
- *======================================================*/
+ * ====================================================== */
#ifndef LYXCURSOR_H
#define LYXCURSOR_H
struct LyXCursor {
///
LyXParagraph * par;
-#ifdef NEW_TEXT
///
LyXParagraph::size_type pos;
-#else
- ///
- int pos;
-#endif
///
int x;
///
long int background_pixels;
// X11 color names
-char const * const X11Color[11] =
+char const * const X11Color[11] =
{ "black", "black", "white", "red", "green", "blue", "cyan", "magenta",
"yellow", "black", "black" };
void do_reverse_video(XGCValues &val)
{
if (reverse_video) {
- val.foreground=WhitePixel(fl_display,
+ val.foreground= WhitePixel(fl_display,
DefaultScreen(fl_display));
- val.background=BlackPixel(fl_display,
+ val.background= BlackPixel(fl_display,
DefaultScreen(fl_display));
} else {
- val.foreground=BlackPixel(fl_display,
+ val.foreground= BlackPixel(fl_display,
DefaultScreen(fl_display));
- val.background=WhitePixel(fl_display,
+ val.background= WhitePixel(fl_display,
DefaultScreen(fl_display));
}
}
XGCValues val;
if (reverse_video ^ mono_video) {
- val.foreground=WhitePixel(fl_display, DefaultScreen(fl_display));
- val.background=BlackPixel(fl_display, DefaultScreen(fl_display));
+ val.foreground= WhitePixel(fl_display, DefaultScreen(fl_display));
+ val.background= BlackPixel(fl_display, DefaultScreen(fl_display));
} else {
- val.foreground=BlackPixel(fl_display, DefaultScreen(fl_display));
- val.background=WhitePixel(fl_display, DefaultScreen(fl_display));
+ val.foreground= BlackPixel(fl_display, DefaultScreen(fl_display));
+ val.background= WhitePixel(fl_display, DefaultScreen(fl_display));
}
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
setForegroundColor(latex_color, val);
latex_gc = XCreateGC(fl_display, fl_root, GCBackground
XGCValues val;
if (reverse_video) {
- val.foreground=BlackPixel(fl_display,
+ val.foreground= BlackPixel(fl_display,
DefaultScreen(fl_display));
- val.background=WhitePixel(fl_display,
+ val.background= WhitePixel(fl_display,
DefaultScreen(fl_display));
} else {
- val.background=BlackPixel(fl_display,
+ val.background= BlackPixel(fl_display,
DefaultScreen(fl_display));
- val.foreground=WhitePixel(fl_display,
+ val.foreground= WhitePixel(fl_display,
DefaultScreen(fl_display));
}
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
if (!fast_selection && background_color != "white") {
setForegroundColor(background_color.c_str(), val);
XGCValues val;
do_reverse_video(val);
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
setForegroundColor(on_off_line_color, val);
val.line_width = 0;
XGCValues val;
do_reverse_video(val);
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
val.line_width = 2;
val.line_style = LineSolid;
XGCValues val;
do_reverse_video(val);
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
val.line_style = LineOnOffDash;
val.line_width = 0;
- thin_on_off_line_gc =
+ thin_on_off_line_gc =
XCreateGC(fl_display, fl_root, GCBackground
| GCForeground | GCFunction | GCGraphicsExposures
| GCLineWidth | GCLineStyle , &val);
XGCValues val;
do_reverse_video(val);
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
val.line_style = LineSolid;
val.line_width = 0;
val.line_style = LineSolid;
val.line_width = 2;
val.graphics_exposures = false;
- val.function=GXinvert;
+ val.function= GXinvert;
select_gc = XCreateGC(fl_display, fl_root,
GCFunction | GCGraphicsExposures | GCPlaneMask
| GCLineWidth | GCLineStyle , &val);
XGCValues val;
if (!reverse_video) {
- val.foreground=BlackPixel(fl_display,
+ val.foreground= BlackPixel(fl_display,
DefaultScreen(fl_display));
- val.background=WhitePixel(fl_display,
+ val.background= WhitePixel(fl_display,
DefaultScreen(fl_display));
} else {
- val.background=BlackPixel(fl_display,
+ val.background= BlackPixel(fl_display,
DefaultScreen(fl_display));
- val.foreground=WhitePixel(fl_display,
+ val.foreground= WhitePixel(fl_display,
DefaultScreen(fl_display));
}
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
if (!fast_selection && selection_color[0] != 0) {
if (!setForegroundColor(selection_color, val)) {
if (lighted_gc) return lighted_gc;
XGCValues val;
if (reverse_video) {
- val.background=BlackPixel(fl_display, DefaultScreen(fl_display));
+ val.background= BlackPixel(fl_display, DefaultScreen(fl_display));
} else {
- val.background=WhitePixel(fl_display, DefaultScreen(fl_display));
+ val.background= WhitePixel(fl_display, DefaultScreen(fl_display));
}
- val.foreground=val.background;
- val.function=GXcopy;
+ val.foreground= val.background;
+ val.function= GXcopy;
val.graphics_exposures = false;
val.line_style = LineSolid;
val.line_width = 0;
XGCValues val;
do_reverse_video(val);
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
setForegroundColor(X11Color[color], val);
val.line_width = 0;
GC GetAccentGC(LyXFont const &f, int line_width)
{
- if (line_width>=10) line_width = 9;
+ if (line_width>= 10) line_width = 9;
if (accent_gc[line_width]) return accent_gc[line_width];
XGCValues val;
do_reverse_video(val);
- val.function=GXcopy;
+ val.function= GXcopy;
val.graphics_exposures = false;
val.line_style = LineOnOffDash;
val.line_width = 0;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include <clocale>
#endif
#include <cctype>
+
#include "gettext.h"
-#include "definitions.h"
#include "lyxfont.h"
#include "debug.h"
#include "lyxrc.h"
// Names for the GUI
//
-string const GUIFamilyNames[6] =
+string const GUIFamilyNames[6] =
{ N_("Roman"), N_("Sans serif"), N_("Typewriter"), N_("Symbol"), N_("Inherit"),
N_("Ignore") };
-string const GUISeriesNames[4] =
+string const GUISeriesNames[4] =
{ N_("Medium"), N_("Bold"), N_("Inherit"), N_("Ignore") };
-string const GUIShapeNames[6] =
+string const GUIShapeNames[6] =
{ N_("Upright"), N_("Italic"), N_("Slanted"), N_("Smallcaps"), N_("Inherit"),
N_("Ignore") };
-string const GUISizeNames[14] =
+string const GUISizeNames[14] =
{ N_("Tiny"), N_("Smallest"), N_("Smaller"), N_("Small"), N_("Normal"), N_("Large"),
N_("Larger"), N_("Largest"), N_("Huge"), N_("Huger"), N_("Increase"), N_("Decrease"),
N_("Inherit"), N_("Ignore") };
-string const lGUISizeNames[15] =
+string const lGUISizeNames[15] =
{ N_("tiny"), N_("smallest"), N_("smaller"), N_("small"), N_("normal"), N_("large"),
N_("larger"), N_("largest"), N_("huge"), N_("huger"), N_("increase"), N_("decrease"),
N_("inherit"), N_("ignore"), string() };
//
// Strings used to read and write .lyx format files
//
-string const LyXFamilyNames[6] =
+string const LyXFamilyNames[6] =
{ "roman", "sans", "typewriter", "symbol", "default", "error" };
-string const LyXSeriesNames[4] =
+string const LyXSeriesNames[4] =
{ "medium", "bold", "default", "error" };
string const LyXShapeNames[6] =
{ "up", "italic", "slanted", "smallcaps", "default", "error" };
-string const LyXSizeNames[14] =
+string const LyXSizeNames[14] =
{ "tiny", "scriptsize", "footnotesize", "small", "normal", "large",
"larger", "largest", "huge", "giant",
"increase-error", "decrease-error", "default", "error" };
-string const LyXMiscNames[12] =
+string const LyXMiscNames[12] =
{ "off", "on", "toggle", "default", "error" };
-string const LyXColorNames[13] =
+string const LyXColorNames[13] =
{ "none", "black", "white", "red", "green", "blue", "cyan", "magenta",
"yellow", "matherror", "inseterror", "default", "error" };
// Strings used to write LaTeX files
//
-string const LaTeXFamilyNames[6] =
+string const LaTeXFamilyNames[6] =
{ "textrm", "textsf", "texttt", "error1", "error2", "error3" };
-string const LaTeXSeriesNames[4] =
+string const LaTeXSeriesNames[4] =
{ "textmd", "textbf", "error4", "error5" };
-string const LaTeXShapeNames[6] =
+string const LaTeXShapeNames[6] =
{ "textup", "textit", "textsl", "textsc", "error6", "error7" };
-string const LaTeXSizeNames[14] =
+string const LaTeXSizeNames[14] =
{ "tiny", "scriptsize", "footnotesize", "small", "normalsize", "large",
"Large", "LARGE", "huge", "Huge", "error8", "error9", "error10", "error11" };
-string const LaTeXColorNames[13] =
+string const LaTeXColorNames[13] =
{ "none", "black", "white", "red", "green", "blue", "cyan", "magenta",
"yellow", "error12", "error13", "error14", "error15" };
{
string s = lowercase(fam);
- int i=0;
+ int i= 0;
while (s != LyXFamilyNames[i] && LyXFamilyNames[i] != "error") i++;
if (s == LyXFamilyNames[i]) {
setFamily(LyXFont::FONT_FAMILY(i));
{
string s = lowercase(ser);
- int i=0;
+ int i= 0;
while (s != LyXSeriesNames[i] && LyXSeriesNames[i] != "error") i++;
if (s == LyXSeriesNames[i]) {
setSeries(LyXFont::FONT_SERIES(i));
{
string s = lowercase(sha);
- int i=0;
+ int i= 0;
while (s != LyXShapeNames[i] && LyXShapeNames[i] != "error") i++;
if (s == LyXShapeNames[i]) {
setShape(LyXFont::FONT_SHAPE(i));
LyXFont& LyXFont::setLyXSize(string const & siz)
{
string s = lowercase(siz);
- int i=0;
+ int i= 0;
while (s != LyXSizeNames[i] && LyXSizeNames[i] != "error") i++;
if (s == LyXSizeNames[i]) {
setSize(LyXFont::FONT_SIZE(i));
LyXFont::FONT_MISC_STATE LyXFont::setLyXMisc(string const & siz)
{
string s = lowercase(siz);
- int i=0;
+ int i= 0;
while (s != LyXMiscNames[i] && LyXMiscNames[i] != "error") i++;
if (s == LyXMiscNames[i])
return FONT_MISC_STATE(i);
LyXFont& LyXFont::setLyXColor(string const & col)
{
string s = lowercase(col);
- int i=0;
+ int i= 0;
while (s != LyXColorNames[i] && LyXColorNames[i] != "error") i++;
if (s == LyXColorNames[i]) {
setColor(LyXFont::FONT_COLOR(i));
LyXFont& LyXFont::setGUISize(string const & siz)
{
string s = lowercase(siz);
- int i=0;
+ int i= 0;
while (!lGUISizeNames[i].empty() &&
s != _(lGUISizeNames[i].c_str()))
i++;
XFontStruct* LyXFont::getXFontstruct() const
{
- return fontloader.load(family(),series(),realShape(),size());
+ return fontloader.load(family(), series(), realShape(), size());
}
smallfont.decSize();
smallfont.decSize();
smallfont.setShape(LyXFont::UP_SHAPE);
- for (int i=0; i < n; i++){
+ for (int i= 0; i < n; i++){
c = s[i];
if (islower(c)){
c = toupper(c);
smallfont.decSize();
smallfont.decSize();
smallfont.setShape(LyXFont::UP_SHAPE);
- for (i=0; i < n; i++){
+ for (i= 0; i < n; i++){
c = s[i];
if (islower(c)){
c = toupper(c);
*
* Copyright (C) 1995 Matthias Ettrich
*
- *======================================================*/
+ * ====================================================== */
#ifndef LYXFONT_H
#define LYXFONT_H
/// Shortcut initialization
LyXFont(LyXFont::FONT_INIT3);
- /// LyXFont x,y; x=y;
+ /// LyXFont x, y; x = y;
LyXFont& operator=(LyXFont const & x);
/// Decreases font size by one
/** Updates font settings according to request. If an
attribute is IGNORE, the attribute is left as it is. */
/*
- * When toggleall=true, all properties that matches the font in use
+ * When toggleall = true, all properties that matches the font in use
* will have the effect that the properties is reset to the
* default. If we have a text that is TYPEWRITER_FAMILY, and is
* update()'ed with TYPEWRITER_FAMILY, the operation will be as if
* a INHERIT_FAMILY was asked for. This is necessary for the
* toggle-user-defined-style button on the toolbar.
*/
- void update(LyXFont const & newfont, bool toggleall=false);
+ void update(LyXFont const & newfont, bool toggleall = false);
/** Reduce font to fall back to template where possible.
Equal fields are reduced to INHERIT */
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich,
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
fl_deactivate_object(fd_fs->replace_button);
fl_deactivate_object(fd_fs->replaceall_button);
fl_deactivate_object(fd_fs->input_replace);
- fl_set_object_lcol(fd_fs->replace_button,FL_INACTIVE);
- fl_set_object_lcol(fd_fs->replaceall_button,FL_INACTIVE);
+ fl_set_object_lcol(fd_fs->replace_button, FL_INACTIVE);
+ fl_set_object_lcol(fd_fs->replaceall_button, FL_INACTIVE);
fl_set_object_lcol(fd_fs->input_replace, FL_INACTIVE);
}
}
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich,
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#include "lyx_gui_misc.h"
#include "minibuffer.h"
#include "support/lstrings.h"
+#include "support/textutils.h"
extern BufferView *current_view; // called too many times in this file...
extern MiniBuffer *minibuffer;
// function prototypes
-bool IsLetterCharOrDigit(char ch);
-
// If nothing selected, select the word at the cursor.
// Returns the current selection
// Note: this function should be in LyXText!
//-------------------------------------------------------------
-bool IsLetterCharOrDigit(char ch)
-{
- return IsLetterChar(ch) || isdigit(ch);
-}
// Returns the current selection. If nothing is selected or if the selection
LyXParagraph * par = lt->cursor.par;
if (lt->selection && (lt->sel_cursor.par == par)) {
// (selected) and (begin/end in same paragraph)
-#ifdef NEW_TEXT
- LyXParagraph::size_type pos =
- lt->sel_start_cursor.pos;
- LyXParagraph::size_type endpos =
- lt->sel_end_cursor.pos;
-#else
- int pos =
+ LyXParagraph::size_type pos =
lt->sel_start_cursor.pos;
- int endpos =
+ LyXParagraph::size_type endpos =
lt->sel_end_cursor.pos;
-#endif
int i = 0;
bool fPrevIsSpace = false;
char ch;
ch = par->GetChar(pos);
//HB??: Maybe (ch <= ' ')
- if ((ch == ' ') || (ch <= LYX_META_INSET)) {
+ if ((ch == ' ') || (ch <= LyXParagraph::META_INSET)) {
// consecutive spaces --> 1 space char
if (fPrevIsSpace) {
pos++; // Next text pos
{
lt->sel_cursor = lt->cursor;
int i;
- for (i=0; i < len; i++)
+ for (i= 0; i < len; i++)
lt->CursorRight();
lt->SetSelection();
}
bool LyXFindReplace1::SearchForward(LyXText * lt)
{
LyXParagraph * par = lt->cursor.par;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = lt->cursor.pos;
-#else
- int pos = lt->cursor.pos;
-#endif
- while (par && !IsSearchStringInText(par,pos)) {
+ while (par && !IsSearchStringInText(par, pos)) {
if (pos<par->Last()-1)
pos++;
else {
}
}
if (par) {
- lt->SetCursor(par,pos);
+ lt->SetCursor(par, pos);
return true;
} else
return false;
pos = par->Last()-1;
} while (par && pos<0);
}
- } while (par && !IsSearchStringInText(par,pos));
+ } while (par && !IsSearchStringInText(par, pos));
if (par) {
- lt->SetCursor(par,pos);
+ lt->SetCursor(par, pos);
return true;
} else
return false;
// returns true if the search string is at the specified position
// (Copied from the original "LyXText::IsStringInText" in text2.C )
-#ifdef NEW_TEXT
bool LyXFindReplace1::IsSearchStringInText(LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-bool LyXFindReplace1::IsSearchStringInText(LyXParagraph * par,
- int pos)
-#endif
{
char chSrch = 0;
char chText;
\end{itemize}
*/
int CompareChars(char chSearch, char chText);
-#ifdef NEW_TEXT
/// returns true if the specified string is at the specified position
- bool IsSearchStringInText(LyXParagraph * par, LyXParagraph::size_type pos);
-#else
- /// returns true if the specified string is at the specified position
- bool IsSearchStringInText(LyXParagraph * par, int pos);
-#endif
+ bool IsSearchStringInText(LyXParagraph * par,
+ LyXParagraph::size_type pos);
};
#endif
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#pragma implementation
#endif
-#include "definitions.h"
#include "lyxlookup.h"
#include "kbmap.h"
#include "lyxfunc.h"
#include "intl.h"
#include "lyx_main.h"
#include "lyx_cb.h"
+#if 0
#include "insets/insetlatex.h"
+#endif
#include "insets/inseturl.h"
#include "insets/insetlatexaccent.h"
#include "insets/insettoc.h"
#include "insets/insetlot.h"
#include "insets/insetref.h"
#include "insets/insetparent.h"
+#include "insets/insetindex.h"
+#include "insets/insetinclude.h"
+#include "insets/insetbib.h"
#include "mathed/formulamacro.h"
#include "toolbar.h"
#include "spellchecker.h" // RVDK_PATCH_5
#include "minibuffer.h"
#include "vspace.h"
-#include "insets/insetbib.h"
#include "LyXView.h"
-#include "insets/insetindex.h"
-#include "insets/insetinclude.h"
#include "filedlg.h"
#include "lyx_gui_misc.h"
#include "support/filetools.h"
#include "support/FileInfo.h"
#include "support/LAssert.h"
+#include "support/syscall.h"
+#include "support/lstrings.h"
+#include "support/path.h"
#include "lyxscreen.h"
#include "debug.h"
#include "lyxrc.h"
#include "trans_mgr.h"
#include "ImportLaTeX.h"
#include "ImportNoweb.h"
-#include "support/syscall.h"
-#include "support/lstrings.h"
-#include "support/path.h"
#include "layout.h"
extern bool cursor_follows_scrollbar;
extern int MenuRunLaTeX(Buffer*);
extern int MenuBuildProg(Buffer*);
extern int MenuRunChktex(Buffer*);
-extern bool MenuRunDvips(Buffer *,bool);
+extern bool MenuRunDvips(Buffer *, bool);
extern void MenuPrint(Buffer*);
extern void MenuSendto();
extern void QuitLyX();
extern void FreeUpdateTimer();
extern bool MenuPreview(Buffer*);
extern bool MenuPreviewPS(Buffer*);
-extern void MenuInsertLabel(const char *);
+extern void MenuInsertLabel(char const *);
extern void MenuInsertRef();
extern void MenuLayoutCharacter();
extern void MenuLayoutParagraph();
if (lyxerr.debugging(Debug::KEY)) {
char buf[100];
- keyseq.print(buf,100);
+ keyseq.print(buf, 100);
lyxerr << "Key ["
<< action << "]["
<< buf << "]["
if(keyseq.length>1 || keyseq.length<-1){
char buf[100];
- keyseq.print(buf,100);
+ keyseq.print(buf, 100);
owner->getMiniBuffer()->Set(buf);
}
- if (action==-1) {
+ if (action == -1) {
if (keyseq.length<-1) { // unknown key sequence...
char buf[100];
LyXBell();
- keyseq.print(buf,100);
- owner->getMiniBuffer()->Set(_("Unknown sequence:"),buf);
+ keyseq.print(buf, 100);
+ owner->getMiniBuffer()->Set(_("Unknown sequence:"), buf);
return 0;
}
return 0;
}
} else
- if (action==LFUN_SELFINSERT) {
+ if (action == LFUN_SELFINSERT) {
argument = s_r[0];
}
// the math inset [asierra060396]
if (owner->currentView()->available() &&
owner->buffer()->the_locking_inset) {
- if (action>1 || (action==LFUN_UNKNOWN_ACTION && keyseq.length>=-1)) {
- if (action==LFUN_UNKNOWN_ACTION && argument.empty()) {
+ if (action>1 || (action == LFUN_UNKNOWN_ACTION && keyseq.length>= -1)) {
+ if (action == LFUN_UNKNOWN_ACTION && argument.empty()) {
argument = keyseq.getiso();
}
// Undo/Redo pre 0.13 is a bit tricky for insets.
- if (action==LFUN_UNDO) {
+ if (action == LFUN_UNDO) {
int slx, sly;
- UpdatableInset* inset =
+ UpdatableInset* inset =
owner->buffer()->the_locking_inset;
inset->GetCursorPos(slx, sly);
UnlockInset(inset);
inset->Edit(slx, sly);
return string();
} else
- if (action==LFUN_REDO) {
+ if (action == LFUN_REDO) {
int slx, sly;
UpdatableInset* inset = owner->buffer()->the_locking_inset;
inset->GetCursorPos(slx, sly);
return string();
else {
setMessage(N_("Text mode"));
- if (action==LFUN_RIGHT || action==-1)
+ if (action == LFUN_RIGHT || action == -1)
owner->buffer()->text->CursorRight();
- if (action==LFUN_LEFT || action==LFUN_RIGHT)
+ if (action == LFUN_LEFT || action == LFUN_RIGHT)
return string();
}
}
owner->buffer()->update(-2);
}
char buf[100];
- keyseq.print(buf,100, true);
+ keyseq.print(buf, 100, true);
owner->getMiniBuffer()->Set(buf, string(), string(), 1);
}
break;
owner->currentView()->getScreen()->
Draw(owner->buffer()->text->cursor.y -
owner->currentView()->getWorkArea()->h/2);
- } else { // <=
+ } else { // <=
owner->currentView()->getScreen()->
Draw(0);
}
case LFUN_EXPORT:
{
//needs argument as string
- string extyp=argument;
+ string extyp= argument;
// latex
if (extyp == "latex") {
case LFUN_IMPORT:
{
//needs argument as string
- string imtyp=argument;
+ string imtyp= argument;
// latex
if (imtyp == "latex") {
case LFUN_TOC_INSERT:
{
- Inset *new_inset =
+ Inset *new_inset =
new InsetTOC(owner->buffer());
owner->buffer()->insertInset(new_inset,
"Standard", true);
case LFUN_LOF_INSERT:
{
- Inset *new_inset =
+ Inset *new_inset =
new InsetLOF(owner->buffer());
owner->buffer()->insertInset(new_inset,
"Standard", true);
case LFUN_LOA_INSERT:
{
- Inset *new_inset =
+ Inset *new_inset =
new InsetLOA(owner->buffer());
owner->buffer()->insertInset(new_inset,
"Standard", true);
case LFUN_LOT_INSERT:
{
- Inset *new_inset =
+ Inset *new_inset =
new InsetLOT(owner->buffer());
owner->buffer()->insertInset(new_inset,
"Standard", true);
!= LyXParagraph::NO_FOOTNOTE)
{ // only melt footnotes with FOOTMELT, not margins etc
if(owner->buffer()->text->cursor.par->footnotekind == LyXParagraph::FOOTNOTE)
- MeltCB(ob,0);
+ MeltCB(ob, 0);
}
else
FootCB(ob, 0);
!= LyXParagraph::NO_FOOTNOTE)
{ // only melt margins
if(owner->buffer()->text->cursor.par->footnotekind == LyXParagraph::MARGIN)
- MeltCB(ob,0);
+ MeltCB(ob, 0);
}
else
MarginCB(ob, 0);
// Derive layout number from given argument (string)
// and current buffer's textclass (number). */
int layoutno = -1;
- layoutno =
+ layoutno =
textclasslist.NumberOfLayout(owner->
buffer()->
text->parameters->
case LFUN_REFTOGGLE:
{
- InsetRef *inset =
+ InsetRef *inset =
(InsetRef*)getInsetByCode(Inset::REF_CODE);
if (inset) {
- if (inset->getFlag()==InsetRef::REF)
+ if (inset->getFlag() == InsetRef::REF)
inset->setFlag(InsetRef::PAGE_REF);
else
inset->setFlag(InsetRef::REF);
{
string label(argument);
if (label.empty()) {
- InsetRef *inset =
+ InsetRef *inset =
(InsetRef*)getInsetByCode(Inset::REF_CODE);
if (inset)
label = inset->getContents();
tmpbuffer->update(-2);
if (tmptext->cursor.pos < tmptext->cursor.par->Last()
&& tmptext->cursor.par->GetChar(tmptext->cursor.pos)
- == LYX_META_INSET
+ == LyXParagraph::META_INSET
&& tmptext->cursor.par->GetInset(tmptext->cursor.pos)
- && tmptext->cursor.par->GetInset(tmptext->cursor.pos)->Editable()==2){
+ && tmptext->cursor.par->GetInset(tmptext->cursor.pos)->Editable() == 2){
Inset* tmpinset = tmptext->cursor.par->GetInset(tmptext->cursor.pos);
setMessage(tmpinset->EditMessage());
- tmpinset->Edit(0,0);
+ tmpinset->Edit(0, 0);
break;
}
tmptext->CursorRight();
txt->CursorLeft();
if (txt->cursor.pos < txt->cursor.par->Last()
&& txt->cursor.par->GetChar(txt->cursor.pos)
- == LYX_META_INSET
+ == LyXParagraph::META_INSET
&& txt->cursor.par->GetInset(txt->cursor.pos)
- && txt->cursor.par->GetInset(txt->cursor.pos)->Editable()==2) {
+ && txt->cursor.par->GetInset(txt->cursor.pos)->Editable() == 2) {
Inset* tmpinset = txt->cursor.par->GetInset(txt->cursor.pos);
setMessage(tmpinset->EditMessage());
tmpinset->Edit(tmpinset->Width(txt->GetFont(txt->cursor.par,
- txt->cursor.pos)),0);
+ txt->cursor.pos)), 0);
// tmpinset->Edit(-1, 0); // -1 means go rightmost
break;
}
// --- text changing commands ------------------------
case LFUN_BREAKLINE:
BeforeChange();
- owner->buffer()->text->InsertChar(LYX_META_NEWLINE);
+ owner->buffer()->text->InsertChar(LyXParagraph::META_NEWLINE);
SmallUpdate(1);
SetUpdateTimer(0.01);
moveCursorUpdate(false);
case LFUN_PROTECTEDSPACE:
BeforeChange();
owner->buffer()->text->
- InsertChar(LYX_META_PROTECTED_SEPARATOR);
+ InsertChar(LyXParagraph::META_PROTECTED_SEPARATOR);
SmallUpdate(1);
SetUpdateTimer();
moveCursorUpdate(false);
owner->buffer()->update(0);
setMessage(N_("Mark set"));
}
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
break;
FreeUpdateTimer();
if (!owner->buffer()->text->selection) {
owner->buffer()->text->Delete();
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
SmallUpdate(1);
// It is possible to make it a lot faster still
} else {
owner->buffer()->text->CursorLeft();
owner->buffer()->text->Delete();
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
SmallUpdate(1);
}
} else {
owner->buffer()->text->Delete();
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
SmallUpdate(1);
}
case LFUN_MARK_OFF:
BeforeChange();
owner->buffer()->update(0);
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
setMessage(N_("Mark off"));
break;
BeforeChange();
owner->buffer()->text->mark_set = 1;
owner->buffer()->update( 0 );
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
setMessage(N_("Mark on"));
break;
if (!owner->buffer()->text->selection) {
if (owner->getIntl()->getTrans()->backspace()) {
owner->buffer()->text->Backspace();
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
SmallUpdate(1);
// It is possible to make it a lot faster still
owner->buffer()->text->BreakParagraph(0);
SmallUpdate(1);
SetUpdateTimer(0.01);
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
break;
}
owner->buffer()->text->BreakParagraph(1);
SmallUpdate(1);
SetUpdateTimer(0.01);
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
break;
}
case LFUN_CHARATCURSOR:
{
-#ifdef NEW_TEXT
- LyXParagraph::size_type pos =
+ LyXParagraph::size_type pos =
owner->buffer()->text->cursor.pos;
if(pos < owner->buffer()->text->cursor.par->size())
-#else
- int pos = owner->buffer()->text->cursor.pos;
- if(pos < owner->buffer()->text->cursor.par->last)
-#endif
dispatch_buffer = owner->buffer()->text->
cursor.par->text[pos];
else
case LFUN_NOTIFY:
{
char buf[100];
- keyseq.print(buf,100);
+ keyseq.print(buf, 100);
dispatch_buffer = buf;
lyxserver->notifyClient(dispatch_buffer);
}
owner->currentView()->getScreen()->
Draw(owner->buffer()->text->cursor.y -
owner->currentView()->getWorkArea()->h/2);
- } else { // <=
+ } else { // <=
owner->currentView()->getScreen()->
Draw(0);
}
{
char c;
- if (keyseq.length==-1 && keyseq.getiso()!=0)
- c=keyseq.getiso();
+ if (keyseq.length == -1 && keyseq.getiso()!= 0)
+ c= keyseq.getiso();
else
- c=0;
+ c= 0;
owner->getIntl()->getTrans()->
deadkey(c, get_accent(action).accent,
// Need to reset, in case the minibuffer calls these
// actions
keyseq.reset();
- keyseq.length=0;
+ keyseq.length= 0;
// copied verbatim from do_accent_char
SmallUpdate(1);
break;
// --- insert characters ----------------------------------------
-
+#if 0
case LFUN_INSERT_INSET_LATEX:
{
Inset *new_inset = new InsetLatex(argument);
owner->buffer()->insertInset(new_inset);
}
break;
-
+#endif
// --- Mathed stuff. If we are here, there is no locked inset yet.
// Greek mode
case LFUN_INSERT_CITATION:
{
- InsetCitation *new_inset = new InsetCitation();
+ InsetCitation * new_inset = new InsetCitation();
// ale970405
// The note, if any, must be after the key, delimited
// by a | so both key and remark can have spaces.
owner->buffer()->insertInset(new_inset);
} else {
owner->buffer()->insertInset(new_inset);
- new_inset->Edit(0,0);
+ new_inset->Edit(0, 0);
}
}
break;
string bibstyle = token(lsarg, ' ', 1);
if (bibstyle.empty())
bibstyle = "plain";
- InsetBibtex *new_inset
+ InsetBibtex * new_inset
= new InsetBibtex(token(lsarg, ' ', 0),
bibstyle,
owner->buffer());
owner->buffer()->insertInset(new_inset);
if (lsarg.empty()) {
- new_inset->Edit(0,0);
+ new_inset->Edit(0, 0);
}
}
break;
// BibTeX data bases
case LFUN_BIBDB_ADD:
{
- InsetBibtex *inset =
- (InsetBibtex*)getInsetByCode(Inset::BIBTEX_CODE);
+ InsetBibtex * inset =
+ static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
if (inset) {
inset->addDatabase(argument);
}
case LFUN_BIBDB_DEL:
{
- InsetBibtex *inset =
- (InsetBibtex*)getInsetByCode(Inset::BIBTEX_CODE);
+ InsetBibtex * inset =
+ static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
if (inset) {
inset->delDatabase(argument);
}
case LFUN_BIBTEX_STYLE:
{
- InsetBibtex *inset =
- (InsetBibtex*)getInsetByCode(Inset::BIBTEX_CODE);
+ InsetBibtex * inset =
+ static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
if (inset) {
inset->setOptions(argument);
}
// grab a word
-#ifdef NEW_TEXT
- LyXParagraph::size_type lastpos =
+ LyXParagraph::size_type lastpos =
owner->buffer()->text->cursor.pos - 1;
// If this can't happen, let's make sure that it really don't
Assert(owner->buffer()->text->cursor.pos - 1 >= 0);
-#else
- int lastpos =owner->buffer()->text->cursor.pos - 1;
- //this shouldn't happen, but let's be careful
- if (lastpos < 0) lastpos=0;
-#endif
// get the current word
// note that this must be done before
// inserting the inset, or the inset will break
new_inset->setContents(curstring);
//don't edit it if the call was to INSERT_LAST
- if(action!=LFUN_INDEX_INSERT_LAST) {
- new_inset->Edit(0,0);
+ if(action!= LFUN_INDEX_INSERT_LAST) {
+ new_inset->Edit(0, 0);
} else {
//it looks blank on the screen unless
//we do something. put it here.
// move the cursor to the returned value of lastpos
// but only for the auto-insert
- owner->buffer()->text->cursor.pos=lastpos;
+ owner->buffer()->text->cursor.pos= lastpos;
}
//put the new inset into the buffer.
case LFUN_INDEX_PRINT:
{
- Inset *new_inset = new InsetPrintIndex(owner->buffer());
+ Inset * new_inset = new InsetPrintIndex(owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true);
}
break;
case LFUN_PARENTINSERT:
{
lyxerr << "arg " << argument << endl;
- Inset *new_inset = new InsetParent(argument, owner->buffer());
+ Inset * new_inset = new InsetParent(argument, owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true);
}
break;
case LFUN_CHILDINSERT:
{
- Inset *new_inset = new InsetInclude(argument,owner->buffer());
+ Inset * new_inset = new InsetInclude(argument,
+ owner->buffer());
owner->buffer()->insertInset(new_inset, "Standard", true);
- new_inset->Edit(0,0);
+ new_inset->Edit(0, 0);
}
break;
case LFUN_CHILDOPEN:
{
- string filename = MakeAbsPath(argument,
- OnlyPath(owner->buffer()->getFileName()));
+ string filename =
+ MakeAbsPath(argument,
+ OnlyPath(owner->buffer()->getFileName()));
setMessage(N_("Opening child document ") +
MakeDisplayPath(filename) + "...");
owner->currentView()->savePosition();
SmallUpdate(1);
}
SetUpdateTimer();
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
moveCursorUpdate(false);
}
}
BeforeChange();
- for (string::size_type i = 0; i < argument.length(); ++i) {
+ for (string::size_type i = 0;
+ i < argument.length(); ++i) {
if (greek_kb_flag) {
if (!math_insert_greek(argument[i]))
owner->getIntl()->getTrans()->TranslateAndInsert(argument[i], owner->buffer()->text);
SmallUpdate(1);
SetUpdateTimer();
- owner->buffer()->text->sel_cursor =
+ owner->buffer()->text->sel_cursor =
owner->buffer()->text->cursor;
moveCursorUpdate(false);
return string();
} // end of switch
exit_with_message:
- string res=getMessage();
+ string res= getMessage();
if (res.empty()) {
if (!commandshortcut.empty()) {
// Check if the document already is open
if (bufferlist.exists(s)){
switch(AskConfirmation(_("Document is already open:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to close that document now?\n"
"('No' will just switch to the open version)")))
{
FilePtr myfile(s, FilePtr::read);
if (myfile() &&
AskQuestion(_("File already exists:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to open the document?"))) {
// loads document
owner->getMiniBuffer()->Set(_("Opening document"),
// find a free buffer
lyxerr.debug() << "Find a free buffer." << endl;
- owner->currentView()->buffer(bufferlist.newFile(s,templname));
+ owner->currentView()->buffer(bufferlist.newFile(s, templname));
}
// Check if the document already is open
if (bufferlist.exists(s)){
switch(AskConfirmation(_("Document is already open:"),
- MakeDisplayPath(s,50),
+ MakeDisplayPath(s, 50),
_("Do you want to close that document now?\n"
"('No' will just switch to the open version)")))
{
return;
}
- owner->currentView()->buffer(bufferlist.newFile(s,string()));
+ owner->currentView()->buffer(bufferlist.newFile(s, string()));
owner->getMiniBuffer()->Set(_("Importing ASCII file"),
MakeDisplayPath(filename), "...");
// Insert ASCII file
- InsertAsciiFile(filename,linorpar);
+ InsertAsciiFile(filename, linorpar);
owner->getMiniBuffer()->Set(_("ASCII file "),
MakeDisplayPath(filename),
_("imported."));
string LyXfilename = ChangeExtension(filename, ".lyx", false);
if (bufferlist.exists(LyXfilename)){
switch(AskConfirmation(_("Document is already open:"),
- MakeDisplayPath(LyXfilename,50),
+ MakeDisplayPath(LyXfilename, 50),
_("Do you want to close that document now?\n"
"('No' will just switch to the open version)")))
{
bool found = false;
Inset * inset = 0;
LyXCursor cursor = owner->buffer()->text->cursor;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = cursor.pos;
-#else
- int pos = cursor.pos;
-#endif
LyXParagraph * par = cursor.par;
while (par && !found) {
while ((inset = par->ReturnNextInsetPointer(pos))){
- if (inset->LyxCode()==code) {
+ if (inset->LyxCode() == code) {
found = true;
break;
}
// These can't be global because are part of the internat state (ale970227)
/// Get the current keyseq string
- string keyseqStr(int l=190);
+ string keyseqStr(int l = 190);
/// Is the key sequence uncomplete?
bool keyseqUncomplete();
/// get options for the current keyseq
- string keyseqOptions(int l=190);
+ string keyseqOptions(int l = 190);
/// Returns the name of a funcion given a keyseq
char const* getFunc(char*)
void LyXLex::printTable()
{
lyxerr << "\nNumber of tags: " << no_items << endl;
- for(int i=0; i<no_items; i++)
+ for(int i= 0; i<no_items; i++)
lyxerr << "table[" << i
<< "]: tag: `" << table[i].tag
<< "' code:" << table[i].code << endl;
int LyXLex::lex()
{
//NOTE: possible bug.
- if (next() && status==LEX_TOKEN)
+ if (next() && status == LEX_TOKEN)
return search_kw(buff);
else
return status;
bool LyXLex::EatLine()
{
- int i=0;
+ int i= 0;
int c = '\0'; // getc() returns an int
- while (!feof(file) && c!='\n' && i!=(LEX_MAX_BUFF-1)) {
+ while (!feof(file) && c!= '\n' && i!= (LEX_MAX_BUFF-1)) {
c = getc(file);
if (c != '\r')
buff[i++] = c;
}
- if (i==(LEX_MAX_BUFF-1) && c !='\n') {
+ if (i == (LEX_MAX_BUFF-1) && c != '\n') {
printError("Line too long");
c = '\n'; // Pretend we had an end of line
--lineno; // but don't increase line counter (netto effect)
++i; // and preserve last character read.
}
- if (c=='\n') {
+ if (c == '\n') {
++lineno;
buff[--i] = '\0'; // i can never be 0 here, so no danger
status = LEX_DATA;
int LyXLex::search_kw(char const * const tag) const
{
- int m, k=0 , l= 0, r=no_items;
+ int m, k= 0 , l= 0, r= no_items;
while (l < r) {
m = (l+r)/2;
if (table[m].tag)
k = compare_no_case(table[m].tag, tag);
- if (k==0)
+ if (k == 0)
return table[m].code;
else
if (k<0) l = m+1; else r = m;
status = 0;
while (!feof(file) && !status) {
c = getc(file);
- if (c=='#') {
+ if (c == '#') {
// Read rest of line (fast :-)
fgets(buff, sizeof(buff), file);
++lineno;
continue;
}
- if (c=='\"') {
+ if (c == '\"') {
int i = -1;
do {
c = getc(file);
if (c != '\r')
buff[++i] = c;
- } while (c!='\"' && c!='\n' && !feof(file) &&
- i!=(LEX_MAX_BUFF-2));
+ } while (c!= '\"' && c!= '\n' && !feof(file) &&
+ i!= (LEX_MAX_BUFF-2));
- if (i==(LEX_MAX_BUFF-2)) {
+ if (i == (LEX_MAX_BUFF-2)) {
printError("Line too long");
c = '\"'; // Pretend we got a "
++i;
}
- if (c!='\"') {
+ if (c!= '\"') {
printError("Missing quote");
- if (c=='\n')
+ if (c == '\n')
++lineno;
}
break;
}
- if (c==',')
+ if (c == ',')
continue; /* Skip ','s */
if (c > ' ' && !feof(file)) {
status = LEX_TOKEN;
}
- if (c== '\r' && !feof(file)) {
+ if (c == '\r' && !feof(file)) {
// The Windows support has lead to the
// possibility of "\r\n" at the end of
// a line. This will stop LyX choking
c = getc(file);
}
- if (c=='\n')
+ if (c == '\n')
++lineno;
}
c = getc(file);
// skip ','s
- if (c==',') continue;
+ if (c == ',') continue;
- if (c=='\\') {
+ if (c == '\\') {
// escape
int i = 0;
do {
continue;
}
- if (c=='#') {
+ if (c == '#') {
// Read rest of line (fast :-)
fgets(buff, sizeof(buff), file);
++lineno;
}
// string
- if (c=='\"') {
+ if (c == '\"') {
int i = -1;
bool escaped = false;
do {
buff[++i] = c;
if (!escaped && c == '\"') break;
- } while (c!='\n' && !feof(file) &&
- i!=(LEX_MAX_BUFF-2));
+ } while (c!= '\n' && !feof(file) &&
+ i!= (LEX_MAX_BUFF-2));
- if (i==(LEX_MAX_BUFF-2)) {
+ if (i == (LEX_MAX_BUFF-2)) {
printError("Line too long");
c = '\"'; // Pretend we got a "
++i;
}
- if (c!='\"') {
+ if (c!= '\"') {
printError("Missing quote");
- if (c=='\n')
+ if (c == '\n')
++lineno;
}
}
// new line
- if (c=='\n')
+ if (c == '\n')
++lineno;
}
printError("Line too long");
}
- if (c == '\\') ungetc(c,file); // put it back
+ if (c == '\\') ungetc(c, file); // put it back
buff[i] = '\0';
status = LEX_TOKEN;
}
- if (c=='\n')
+ if (c == '\n')
++lineno;
}
struct pushed_table {
///
pushed_table(){
- next=0;
- table_elem=0;
+ next= 0;
+ table_elem= 0;
}
///
pushed_table *next;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
static XIM xim;
static XIC xic;
-XComposeStatus compose_status={0,0};
+XComposeStatus compose_status= {0, 0};
// This is called after the main LyX window has been created
void InitLyXLookup(Display* display, Window window)
xic = 0;
// This part could be done before opening display
- setlocale(LC_CTYPE,"");
+ setlocale(LC_CTYPE, "");
if (!XSupportsLocale()) {
lyxerr.debug() << "InitLyXLookup: X does not support this locale." << endl;
return;
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-XComposeStatus compose_status={0,0};
+XComposeStatus compose_status= {0, 0};
// This is called after the main LyX window has been created
void InitLyXLookup(Display* , Window )
/* This file is part of -*- C++ -*-
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995-1997 Matthias Ettrich
* & The LyX team
*
-*======================================================*/
+* ====================================================== */
/* This header file defines wrappers around the X input method related
functions. This should probably be moved into LyXView (to have
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
#pragma interface
#endif
-#define NEW_TEXT 1
//#define NEW_TABLE 1
#ifdef NEW_TABLE
#include <list>
#endif
-#ifdef NEW_TEXT
#include <vector>
-//#include <deque>
-//#define __STD_STUFF 1
-//#include <rope.h>
-#endif
-#include "definitions.h"
#include "insets/lyxinset.h"
+#include "insets/insetbib.h"
#include "table.h"
-#include "support/textutils.h"
#include "vspace.h"
-#include "insets/insetbib.h"
#include "layout.h"
class BufferParams;
/// A LyXParagraph holds all text, attributes and insets in a text paragraph
class LyXParagraph {
public:
+ ///
+ enum PEXTRA_TYPE {
+ ///
+ PEXTRA_NONE,
+ ///
+ PEXTRA_INDENT,
+ ///
+ PEXTRA_MINIPAGE,
+ ///
+ PEXTRA_FLOATFLT
+ };
+ ///
+ enum MINIPAGE_ALIGNMENT {
+ ///
+ MINIPAGE_ALIGN_TOP,
+ ///
+ MINIPAGE_ALIGN_MIDDLE,
+ ///
+ MINIPAGE_ALIGN_BOTTOM
+ };
+ ///
+ enum META_KIND {
+ ///
+ META_FOOTNOTE = 1,
+ ///
+ META_MARGIN,
+ ///
+ META_FIG,
+ ///
+ META_TAB,
+ ///
+ META_ALGORITHM,
+ ///
+ META_WIDE_FIG,
+ ///
+ META_WIDE_TAB,
+ ///
+ META_HFILL,
+ ///
+ META_NEWLINE,
+ ///
+ META_PROTECTED_SEPARATOR,
+ ///
+ META_INSET
+ };
+
/// The footnoteflag
enum footnote_flag {
///
id = id_arg;
}
-#ifndef NEW_TEXT
- /** allocates more memory for the specified paragraph
- pos is needed to specify the paragraph correctly. Remember the
- closed footnotes
- */
- void Enlarge(int pos, int number);
- /** make the allocated memory fit to the needed size
- used to make a paragraph smaller
- */
- void FitSize();
-#endif
-
///
void read();
}
-#ifdef NEW_TEXT
///
typedef char value_type;
///
TextContainer text;
///
size_type size() const { return text.size(); }
-#else
- ///
- int last;
- ///
- int size;
- ///
- char * text;
-#endif
///
VSpace added_space_top;
*/
LyXParagraph * NextAfterFootnote();
///
+ LyXParagraph * NextAfterFootnote() const;
+ ///
LyXParagraph * PreviousBeforeFootnote();
///
LyXParagraph * LastPhysicalPar();
///
LyXParagraph * FirstPhysicalPar();
-#ifdef NEW_TEXT
/// returns the physical paragraph
LyXParagraph * ParFromPos(size_type pos);
/// returns the position in the physical par
int PositionInParFromPos(size_type pos);
-#else
- /// returns the physical paragraph
- LyXParagraph * ParFromPos(int pos);
- /// returns the position in the physical par
- int PositionInParFromPos(int pos);
-#endif
/// for the environments
LyXParagraph * DepthHook(int depth);
void SetOnlyLayout(LyXTextClass::LayoutList::size_type new_layout);
///
int GetFirstCounter(int i);
-#ifdef NEW_TEXT
///
size_type Last();
///
///
char GetChar(size_type pos);
///
+ char GetChar(size_type pos) const;
+ ///
void SetFont(size_type pos, LyXFont const & font);
///
string GetWord(size_type &);
/// Returns the height of the highest font in range
- LyXFont::FONT_SIZE HighestFontInRange(size_type startpos, size_type endpos) const;
+ LyXFont::FONT_SIZE HighestFontInRange(size_type startpos,
+ size_type endpos) const;
///
void InsertChar(size_type pos, char c);
///
void CutIntoMinibuffer(size_type pos);
///
void InsertFromMinibuffer(size_type pos);
+
///
- bool IsHfill(size_type pos) {
- return IsHfillChar(GetChar(pos));
- }
-
- ///
- bool IsInset(size_type pos) {
- return IsInsetChar(GetChar(pos));
- }
-
- ///
- bool IsFloat(size_type pos) {
- return IsFloatChar(GetChar(pos));
- }
-
- ///
- bool IsNewline(size_type pos) {
- bool tmp = false;
- if (pos >= 0)
- tmp= IsNewlineChar(GetChar(pos));
- return tmp;
- }
-
- ///
- bool IsSeparator(size_type pos) {
- return IsSeparatorChar(GetChar(pos));
- }
-
- ///
- bool IsLineSeparator(size_type pos) {
- return IsLineSeparatorChar(GetChar(pos));
- }
-
- ///
- bool IsKomma(size_type pos){
- return IsKommaChar(GetChar(pos));
- }
-
- /// Used by the spellchecker
- bool IsLetter(size_type pos);
-
- ///
- bool IsWord(size_type pos ) {
- return IsWordChar( GetChar(pos) ) ;
- }
-#else
- ///
- int Last();
- ///
- void Erase(int pos);
- /** the flag determines wether the layout should be copied
- */
- void BreakParagraph(int pos, int flag);
- ///
- void BreakParagraphConservative(int pos);
- /** Get unistantiated font setting. Returns the difference
- between the characters font and the layoutfont.
- This is what is stored in the fonttable
- */
- LyXFont GetFontSettings(int pos);
- /** Get fully instantiated font. If pos == -1, use the layout
- font attached to this paragraph.
- If pos == -2, use the label font of the layout attached here.
- In all cases, the font is instantiated, i.e. does not have any
- attributes with values LyXFont::INHERIT, LyXFont::IGNORE or
- LyXFont::TOGGLE.
- */
- LyXFont getFont(int pos);
- ///
- char GetChar(int pos);
- ///
- void SetFont(int pos, LyXFont const & font);
- ///
- string GetWord(int &);
- /// Returns the height of the highest font in range
- LyXFont::FONT_SIZE HighestFontInRange(int startpos, int endpos) const;
- ///
- void InsertChar(int pos, char c);
- ///
- void InsertInset(int pos, Inset * inset);
- ///
- Inset * GetInset(int pos);
- ///
- Inset * ReturnNextInsetPointer(int & pos);
- ///
- void OpenFootnote(int pos);
- ///
- void CloseFootnote(int pos);
- /// important for cut and paste
- void CopyIntoMinibuffer(int pos);
- ///
- void CutIntoMinibuffer(int pos);
+ bool IsHfill(size_type pos) const;
///
- void InsertFromMinibuffer(int pos);
+ bool IsInset(size_type pos) const;
///
- bool IsHfill(int pos) {
- return IsHfillChar(GetChar(pos));
- }
-
+ bool IsFloat(size_type pos) const;
///
- bool IsInset(int pos) {
- return IsInsetChar(GetChar(pos));
- }
-
+ bool IsNewline(size_type pos) const;
///
- bool IsFloat(int pos) {
- return IsFloatChar(GetChar(pos));
- }
-
+ bool IsSeparator(size_type pos) const;
///
- bool IsNewline(int pos) {
- bool tmp = false;
- if (pos >= 0)
- tmp= IsNewlineChar(GetChar(pos));
- return tmp;
- }
-
+ bool IsLineSeparator(size_type pos) const;
///
- bool IsSeparator(int pos) {
- return IsSeparatorChar(GetChar(pos));
- }
-
- ///
- bool IsLineSeparator(int pos) {
- return IsLineSeparatorChar(GetChar(pos));
- }
-
- ///
- bool IsKomma(int pos){
- return IsKommaChar(GetChar(pos));
- }
-
+ bool IsKomma(size_type pos) const;
/// Used by the spellchecker
- bool IsLetter(int pos);
-
+ bool IsLetter(size_type pos) const;
///
- bool IsWord( int pos ) {
- return IsWordChar( GetChar(pos) ) ;
- }
-#endif
+ bool IsWord(size_type pos) const;
+
/** This one resets all layout and dtp switches but not the font
of the single characters
*/
void SetPExtraType(int type, char const * width, char const * widthp);
///
void UnsetPExtraType();
-#ifdef NEW_TEXT
///
bool RoffContTableRows(FILE * file, size_type i,
int actcell);
void DocBookContTableRows(string & file, string & extra, int & desc_on,
size_type i,
int current_cell_number, int & column);
-#else
- ///
- bool RoffContTableRows(FILE * file, int i, int actcell);
- ///
- void DocBookContTableRows(string & file, string & extra, int & desc_on,
- int i, int current_cell_number, int & column);
-#endif
///
bool linuxDocConvertChar(char c, string & sgml_string);
///
is limited. (Asger)
*/
struct FontTable {
-#ifdef NEW_TEXT
/// Start position of paragraph this font attribute covers
size_type pos;
/// Ending position of paragraph this font attribute covers
size_type pos_end;
-#else
- /// Start position of paragraph this font attribute covers
- int pos;
- /// Ending position of paragraph this font attribute covers
- int pos_end;
-#endif
/** Font. Interpretation of the font values:
If a value is LyXFont::INHERIT_*, it means that the font
attribute is inherited from either the layout of this
};
///
struct InsetTable {
-#ifdef NEW_TEXT
///
size_type pos;
-#else
- ///
- int pos;
-#endif
///
Inset * inset;
#ifndef NEW_TABLE
bool SimpleTeXOnePar(string & file, TexRow & texrow);
///
bool SimpleTeXOneTablePar(string & file, TexRow & texrow);
-#ifdef NEW_TEXT
///
bool TeXContTableRows(string & file, size_type i,
int current_cell_number,
LyXLayout const & style,
size_type & i,
int & column, char const c);
-#else
- ///
- bool TeXContTableRows(string & file, int i, int current_cell_number,
- int & column, TexRow & texrow);
- ///
- void SimpleTeXBlanks(string & file, TexRow & texrow,
- int const i, int & column, LyXFont const & font,
- LyXLayout const & style);
- ///
- void SimpleTeXSpecialChars(string & file, TexRow & texrow,
- LyXFont & font, LyXFont & running_font,
- LyXFont & basefont, bool & open_font,
- LyXLayout const & style,
- int & i, int & column, char const c);
-#endif
///
int id;
///
static unsigned int paragraph_id;
};
-
#endif
extern LyXAction lyxaction;
enum _LyXRCTags {
- RC_BEGINTOOLBAR=1,
+ RC_BEGINTOOLBAR = 1,
RC_FONT_ENCODING,
RC_PRINTER,
RC_PRINT_COMMAND,
view_ps_command = "ghostview -swap";
view_pspic_command = "ghostview";
view_dvi_command = "xdvi";
- default_papersize = PAPER_USLETTER;
+ default_papersize = BufferParams::PAPER_USLETTER;
custom_export_format = "ps";
chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
html_command = "tth -t";
int LyXRC::ReadBindFile(string const & name)
{
hasBindFile = true;
- string tmp = i18nLibFileSearch("bind",name,"bind");
+ string tmp = i18nLibFileSearch("bind", name, "bind");
lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
int result = Read(tmp);
if (result) {
if (lexrc.next()) {
string size = lowercase(lexrc.GetString());
if (size == "usletter")
- default_papersize = PAPER_USLETTER;
+ default_papersize = BufferParams::PAPER_USLETTER;
else if (size == "legal")
- default_papersize = PAPER_LEGALPAPER;
+ default_papersize = BufferParams::PAPER_LEGALPAPER;
else if (size == "executive")
- default_papersize = PAPER_EXECUTIVEPAPER;
+ default_papersize = BufferParams::PAPER_EXECUTIVEPAPER;
else if (size == "a3")
- default_papersize = PAPER_A3PAPER;
+ default_papersize = BufferParams::PAPER_A3PAPER;
else if (size == "a4")
- default_papersize = PAPER_A4PAPER;
+ default_papersize = BufferParams::PAPER_A4PAPER;
else if (size == "a5")
- default_papersize = PAPER_A5PAPER;
+ default_papersize = BufferParams::PAPER_A5PAPER;
else if (size == "b5")
- default_papersize = PAPER_B5PAPER;
+ default_papersize = BufferParams::PAPER_B5PAPER;
}
break;
case RC_VIEWDVI_COMMAND:
ReadBindFile();
// !!!chb, dynamic key binding...
- int action, res=0;
+ int action, res = 0;
string seq, cmd;
- if (lexrc.lex()==LyXLex::LEX_DATA) {
+ if (lexrc.lex() == LyXLex::LEX_DATA) {
seq = lexrc.GetString();
} else {
lexrc.printError("Bad key sequence: `$$Token'");
break;
}
- if (lexrc.lex()==LyXLex::LEX_DATA) {
+ if (lexrc.lex() == LyXLex::LEX_DATA) {
cmd = lexrc.GetString();
} else {
lexrc.printError("Bad command: `$$Token'");
break;
}
- if ((action = lyxaction.LookupFunc(cmd.c_str()))>=0) {
+ if ((action = lyxaction.LookupFunc(cmd.c_str()))>= 0) {
if (lyxerr.debugging(Debug::KEY)) {
lyxerr << "RC_BIND: Sequence `"
<< seq << "' Command `"
case RC_SELECTION_COLOR:
if (lexrc.next())
strncpy(selection_color,
- lexrc.GetString().c_str(),31);
+ lexrc.GetString().c_str(), 31);
break;
case RC_FAX_COMMAND:
if (lexrc.next())
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#ifndef LYXRC_H
#define LYXRC_H
#endif
#include "toolbar.h"
+#include "bufferparams.h"
/// This contains the runtime configuration of LyX
class LyXRC {
/// program for viewing dvi output (default "xdvi")
string view_dvi_command;
/// default paper size for local xdvi/dvips/ghostview/whatever
- LYX_PAPER_SIZE default_papersize;
+ BufferParams::PAPER_SIZE default_papersize;
/// command to run chktex incl. options
string chktex_command;
/// command to run an html converter incl. options
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
///
LyXParagraph * par;
///
-#ifdef NEW_TEXT
LyXParagraph::size_type pos;
-#else
- int pos;
-#endif
///
unsigned short baseline;
/** what is missing to a full row can be negative.
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team
*
- * ======================================================*/
+ * ====================================================== */
#ifndef LYXSCREEN_H
#define LYXSCREEN_H
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
/**
Docu : To use the lyxserver define the name of the pipe in your
errno = 0;
int status;
// the single = is intended here.
- while((status = read(fd,charbuf,CMDBUFLEN-1)))
+ while((status = read(fd, charbuf, CMDBUFLEN-1)))
{// break and return in loop
if(status > 0) // got something
{
- charbuf[status]='\0'; // turn it into a c string
+ charbuf[status]= '\0'; // turn it into a c string
lsbuf += strip(charbuf, '\r');
// commit any commands read
while(lsbuf.find('\n') != string::npos) // while still
{
// split() grabs the entire string if
// the delim /wasn't/ found. ?:-P
- lsbuf=split(lsbuf, cmd,'\n');
+ lsbuf= split(lsbuf, cmd,'\n');
lyxerr[Debug::LYXSERVER]
<< "LyXComm: status:" << status
<< ", lsbuf:" << lsbuf
}
c->closeConnection();
c->openConnection();
- errno=0;
+ errno= 0;
}
extern "C" void C_LyXComm_callback(int fd, void *v)
// modified june 1999 by stefano@zool.su.se to send as many bye
// messages as there are clients, each with client's name.
string message;
- for (int i=0; i<numclients; i++) {
+ for (int i= 0; i<numclients; i++) {
message = "LYXSRV:" + clients[i] + ":bye\n";
pipes.send(message);
}
bool server_only = false;
while(*p) {
// --- 1. check 'header' ---
- if (strncmp(p, "LYXSRV:", 7)==0) {
+ if (strncmp(p, "LYXSRV:", 7) == 0) {
server_only = true;
- } else if(0!=strncmp(p, "LYXCMD:", 7)) {
+ } else if(0!= strncmp(p, "LYXCMD:", 7)) {
lyxerr << "LyXServer: Unknown request" << endl;
return;
}
// we are listening.
if (cmd == "hello") {
// One more client
- if(serv->numclients==MAX_CLIENTS){ //paranoid check
+ if(serv->numclients == MAX_CLIENTS){ //paranoid check
lyxerr[Debug::LYXSERVER]
<< "LyXServer: too many clients..."
<< endl;
return;
}
- int i=0; //find place in clients[]
+ int i= 0; //find place in clients[]
while (!serv->clients[i].empty()
&& i<serv->numclients)
i++;
<< client << endl;
serv->pipes.send(buf);
} else if (cmd == "bye") {
- // If clients==0 maybe we should reset the pipes
+ // If clients == 0 maybe we should reset the pipes
// to prevent fake callbacks
int i; //look if client is registered
- for (i=0; i<serv->numclients; i++) {
+ for (i= 0; i<serv->numclients; i++) {
if (serv->clients[i] == client) break;
}
if (i<serv->numclients) {
//int action = -1;
string rval, buf;
- if (action>=0) {
+ if (action>= 0) {
rval = serv->func->Dispatch(action, arg.c_str());
} else {
rval = "Unknown command";
// -*- C++ -*-
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1998 The LyX Team.
*
-*======================================================*/
+* ====================================================== */
#ifndef LYXSERVER_H
#define LYXSERVER_H
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#ifndef LYXTEXT_H
#define LYXTEXT_H
#pragma interface
#endif
-#include "definitions.h"
#include "lyxfont.h"
#include "lyxrow.h"
#include "undo.h"
/// Destructor
~LyXText();
-#ifdef NEW_TEXT
///
LyXFont GetFont(LyXParagraph * par,
LyXParagraph::size_type pos);
void SetCharFont(LyXParagraph * par,
LyXParagraph::size_type pos,
LyXFont font);
-#else
- ///
- LyXFont GetFont(LyXParagraph * par, int pos);
- ///
- void SetCharFont(LyXParagraph * par, int pos, LyXFont font);
-#endif
/// returns a pointer to the very first LyXParagraph
LyXParagraph * FirstParagraph();
/** returns a pointer to a specified row. y is set to the beginning
of the row
*/
-#ifdef NEW_TEXT
Row * GetRow(LyXParagraph * par,
LyXParagraph::size_type pos, long & y);
-#else
- Row * GetRow(LyXParagraph * par, int pos, long & y);
-#endif
/** returns the height of a default row, needed for scrollbar
*/
int DefaultHeight();
char * SelectNextWord(float & value);
///
void SelectSelectedWord();
-#ifdef NEW_TEXT
///
void SetCursor(LyXParagraph * par,
LyXParagraph::size_type pos);
///
void SetCursorIntern(LyXParagraph * par,
LyXParagraph::size_type pos);
-#else
- ///
- void SetCursor(LyXParagraph * par, int pos);
- ///
- void SetCursorIntern(LyXParagraph * par, int pos);
-#endif
///
void SetCursorFromCoordinates(int x, long y);
///
/** returns true if the specified string is at the specified
position
*/
-#ifdef NEW_TEXT
bool IsStringInText(LyXParagraph * par,
LyXParagraph::size_type pos,
char const * str);
-#else
- bool IsStringInText(LyXParagraph * par, int pos, char const * str);
-#endif
/** sets the selection over the number of characters of string,
no check!!
*/
bool SearchForward(char const * string);
bool SearchBackward(char const * string);
-#ifdef NEW_TEXT
/// needed to insert the selection
void InsertStringA(LyXParagraph::TextContainer const & text);
/// needed to insert the selection
void InsertStringB(LyXParagraph::TextContainer const & text);
-#endif
/// needed to insert the selection
void InsertStringA(char const * string);
/// needed to insert the selection
/// returns 0 if inset wasn't found
int UpdateInset(Inset * inset);
-#ifdef NEW_TEXT
///
void CheckParagraph(LyXParagraph * par,
LyXParagraph::size_type pos);
///
int NumberOfCell(LyXParagraph * par,
LyXParagraph::size_type pos);
-#else
- ///
- void CheckParagraph(LyXParagraph * par, int pos);
- ///
- int NumberOfCell(LyXParagraph * par, int pos);
-#endif
/* table stuff -- begin*/
/** all table features of the text-class are put together in
/** pos points at the beginning of the next cell (if there is one)
*/
-#ifdef NEW_TEXT
int WidthOfCell(LyXParagraph * par, LyXParagraph::size_type & pos);
///
void CheckParagraphInTable(LyXParagraph * par,
LyXParagraph::size_type pos);
-#else
- int WidthOfCell(LyXParagraph * par, int & pos);
- ///
- void CheckParagraphInTable(LyXParagraph * par, int pos);
-#endif
///
void InsertCharInTable(char c);
///
/** inserts a new row behind the specified row, increments
* the touched counters */
-#ifdef NEW_TEXT
void InsertRow(Row * row, LyXParagraph * par,
LyXParagraph::size_type pos );
-#else
- void InsertRow(Row * row, LyXParagraph * par, int pos );
-#endif
/** removes the row and reset the touched counters */
void RemoveRow(Row * row);
* some low level functions
*/
-#ifdef NEW_TEXT
///
int SingleWidth(LyXParagraph * par,
LyXParagraph::size_type pos);
/// get the next breakpoint in a given paragraph
LyXParagraph::size_type NextBreakPoint(Row * row,
int width);
-#else
- ///
- int SingleWidth(LyXParagraph * par, int pos);
- ///
- int SingleWidth(LyXParagraph * par, int pos, char c);
- ///
- void Draw(Row * row, int & pos, LyXScreen & scr,
- int offset, float & x);
- /// get the next breakpoint in a given paragraph
- int NextBreakPoint(Row * row, int width);
-#endif
/// returns the minimum space a row needs on the screen in pixel
int Fill(Row * row, int paperwidth);
screen in pixel */
int LabelFill(Row * row);
-#ifdef NEW_TEXT
///
LyXParagraph::size_type BeginningOfMainBody(LyXParagraph * par);
-#else
- ///
- int BeginningOfMainBody(LyXParagraph * par);
-#endif
/** Returns the left beginning of the text.
This information cannot be taken from the layouts-objekt, because
in LaTeX the beginning of the text fits in some cases
/** returns true, if a expansion is needed. Rules are given by
LaTeX
*/
-#ifdef NEW_TEXT
bool HfillExpansion(Row * row_ptr,
LyXParagraph::size_type pos);
/** returns the paragraph position of the last character in the
specified row
*/
LyXParagraph::size_type RowLast(Row * row);
-#else
- bool HfillExpansion(Row * row_ptr, int pos);
- /** returns the paragraph position of the last character in the
- specified row
- */
- int RowLast(Row * row);
-#endif
};
#endif
// If the document is changed, we might want to save it
if (!vcs->owner()->isLyxClean() &&
AskQuestion(_("Changes in document:"),
- MakeDisplayPath(vcs->owner()->getFileName(),50),
+ MakeDisplayPath(vcs->owner()->getFileName(), 50),
_("Save document and proceed?"))) {
vcs->owner()->getUser()->owner()
->getLyXFunc()->Dispatch(LFUN_MENUWRITE);
// If the document is changed, we might want to save it
if (!vcs->owner()->isLyxClean() &&
AskQuestion(_("Changes in document:"),
- MakeDisplayPath(vcs->owner()->getFileName(),50),
+ MakeDisplayPath(vcs->owner()->getFileName(), 50),
_("Save document and proceed?"))) {
vcs->owner()->getUser()->owner()
->getLyXFunc()->Dispatch(LFUN_MENUWRITE);
lyxerr[Debug::LYXVC] << "LyXVC: checkOut" << endl;
if (!vcs->owner()->isLyxClean()
&& !AskQuestion(_("Changes in document:"),
- MakeDisplayPath(vcs->owner()->getFileName(),50),
+ MakeDisplayPath(vcs->owner()->getFileName(), 50),
_("Ignore changes and proceed with check out?"))) {
return;
}
_("Close"));
fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_callback(obj, C_LyXVC_logClose, 0);
- obj = fl_add_button(FL_NORMAL_BUTTON,370,340,90,30,
+ obj = fl_add_button(FL_NORMAL_BUTTON, 370, 340, 90, 30,
idex(_("Update|#Uu")));
- fl_set_button_shortcut(obj,scex(_("Update|#Uu")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj, C_LyXVC_logUpdate,0);
+ fl_set_button_shortcut(obj, scex(_("Update|#Uu")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_LyXVC_logUpdate, 0);
fl_end_form();
fl_set_form_atclose(browser->LaTeXLog, CancelCloseBoxCB, 0);
}
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- *======================================================*/
+ * ====================================================== */
#include <config.h>
#include FORMS_H_LOCATION
_wildcard(&argc, &argv);
#endif
- LyX lyx(&argc,argv);
+ LyX lyx(&argc, argv);
return 0; // ok
}
/*
* This file is part of
- * ==================================================
+ * ==================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ==================================================
+ * ==================================================
*/
/* This file contains all the menu and submenu declarations.
int moffset = 0;
// menubar frame
- obj = fl_add_frame(FL_UP_FRAME,0,0,form->w,mheight,"");
+ obj = fl_add_frame(FL_UP_FRAME, 0, 0, form->w, mheight, "");
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthWestGravity, NorthEastGravity);
menu_grp1 = fl_bgn_group();
// File menu button
- menu_file = obj =
+ menu_file = obj =
fl_add_button(FL_TOUCH_BUTTON,
- air+moffset,yloc,
+ air+moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("File"),
strlen(_("File"))) + mbadd,
- mbheight,_("File"));
+ mbheight, _("File"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#F")), 1);
- fl_set_object_callback(obj,C_Menus_ShowFileMenu, 0);
+ fl_set_object_callback(obj, C_Menus_ShowFileMenu, 0);
obj->u_vdata = this;
// Edit menu button
- menu_edit = obj =
+ menu_edit = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Edit"),
strlen(_("Edit"))) + mbadd,
- mbheight,_("Edit"));
+ mbheight, _("Edit"));
moffset += obj->w + air;
- fl_set_object_shortcut(obj, scex(_("MB|#E")),1);
- fl_set_object_callback(obj,C_Menus_ShowEditMenu,0);
+ fl_set_object_shortcut(obj, scex(_("MB|#E")), 1);
+ fl_set_object_callback(obj, C_Menus_ShowEditMenu, 0);
obj->u_vdata = this;
// Layout menu button
- menu_layout = obj =
+ menu_layout = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Layout"),
strlen(_("Layout"))) + mbadd,
- mbheight,_("Layout"));
+ mbheight, _("Layout"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#L")), 1);
- fl_set_object_callback(obj,C_Menus_ShowLayoutMenu,0);
+ fl_set_object_callback(obj, C_Menus_ShowLayoutMenu, 0);
obj->u_vdata = this;
// Insert menu button button
- menu_insert = obj =
+ menu_insert = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Insert"),
strlen(_("Insert"))) + mbadd,
- mbheight,_("Insert"));
+ mbheight, _("Insert"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#I")), 1);
- fl_set_object_callback(obj,C_Menus_ShowInsertMenu,0);
+ fl_set_object_callback(obj, C_Menus_ShowInsertMenu, 0);
obj->u_vdata = this;
// Math menu button
- menu_math = obj =
+ menu_math = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Math"),
strlen(_("Math"))) + mbadd,
- mbheight,_("Math"));
+ mbheight, _("Math"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#M")), 1);
- fl_set_object_callback(obj,C_Menus_ShowMathMenu,0);
+ fl_set_object_callback(obj, C_Menus_ShowMathMenu, 0);
obj->u_vdata = this;
// Options menu button
- menu_options = obj =
+ menu_options = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Options"),
strlen(_("Options"))) + mbadd,
- mbheight,_("Options"));
+ mbheight, _("Options"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#O")), 1);
- fl_set_object_callback(obj,C_Menus_ShowOptionsMenu, 0);
+ fl_set_object_callback(obj, C_Menus_ShowOptionsMenu, 0);
obj->u_vdata = this;
// Documents menu button
- menu_buffer = obj =
+ menu_buffer = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Documents"),
strlen(_("Documents"))) + mbadd,
- mbheight,_("Documents"));
+ mbheight, _("Documents"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#D")), 1);
- fl_set_object_callback(obj,C_Menus_ShowBufferMenu,0);
+ fl_set_object_callback(obj, C_Menus_ShowBufferMenu, 0);
obj->u_vdata = this;
// Help menu button
- menu_help = obj =
+ menu_help = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Help"),
strlen(_("Help"))) + mbadd,
- mbheight,_("Help"));
+ mbheight, _("Help"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#H")), 1);
- fl_set_object_callback(obj,C_Menus_ShowHelpMenu,0);
+ fl_set_object_callback(obj, C_Menus_ShowHelpMenu, 0);
obj->u_vdata = this;
fl_end_group();
obj = menu_grp1->next;
do {
fl_set_object_boxtype(obj, FL_FLAT_BOX);
- fl_set_object_color(obj,FL_MCOL, FL_MCOL);
- fl_set_object_lsize(obj,MENU_LABEL_SIZE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ fl_set_object_color(obj, FL_MCOL, FL_MCOL);
+ fl_set_object_lsize(obj, MENU_LABEL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthWestGravity, NorthWestGravity);
- obj=obj->next;
+ obj= obj->next;
} while (obj != 0 && obj->objclass != FL_END_GROUP);
// group 2
menu_grp2 = fl_bgn_group();
// File menu button
- menu_file2 = obj =
+ menu_file2 = obj =
fl_add_button(FL_TOUCH_BUTTON,
- air+moffset,yloc,
+ air+moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("File"),
strlen(_("File"))) + mbadd,
- mbheight,_("File"));
+ mbheight, _("File"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#F")), 1);
- fl_set_object_callback(obj,C_Menus_ShowFileMenu2, 0);
+ fl_set_object_callback(obj, C_Menus_ShowFileMenu2, 0);
obj->u_vdata = this;
// Options menu button
- menu_options2 = obj =
+ menu_options2 = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Options"),
strlen(_("Options"))) +mbadd,
- mbheight,_("Options"));
+ mbheight, _("Options"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#O")), 1);
- fl_set_object_callback(obj,C_Menus_ShowOptionsMenu, 0);
+ fl_set_object_callback(obj, C_Menus_ShowOptionsMenu, 0);
obj->u_vdata = this;
// Help menu button
- menu_help2 = obj =
+ menu_help2 = obj =
fl_add_button(FL_TOUCH_BUTTON,
- moffset,yloc,
+ moffset, yloc,
fl_get_string_width(FL_BOLD_STYLE,
MENU_LABEL_SIZE,
_("Help"),
strlen(_("Help"))) + mbadd,
- mbheight,_("Help"));
+ mbheight, _("Help"));
moffset += obj->w + air;
fl_set_object_shortcut(obj, scex(_("MB|#H")), 1);
- fl_set_object_callback(obj,C_Menus_ShowHelpMenu,0);
+ fl_set_object_callback(obj, C_Menus_ShowHelpMenu, 0);
obj->u_vdata = this;
fl_end_group();
obj = menu_grp2->next;
do {
fl_set_object_boxtype(obj, FL_FLAT_BOX);
- fl_set_object_color(obj,FL_MCOL, FL_MCOL);
- fl_set_object_lsize(obj,MENU_LABEL_SIZE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
+ fl_set_object_color(obj, FL_MCOL, FL_MCOL);
+ fl_set_object_lsize(obj, MENU_LABEL_SIZE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, NorthWestGravity, NorthWestGravity);
- obj=obj->next;
+ obj= obj->next;
} while (obj != 0 && obj->objclass != FL_END_GROUP);
}
fl_set_input(fd_form_screen->input_font_norm,
lyxrc->font_norm.c_str());
char tmpstring[10];
- sprintf(tmpstring,"%d", lyxrc->zoom);
+ sprintf(tmpstring, "%d", lyxrc->zoom);
fl_set_input(fd_form_screen->intinput_size, tmpstring);
if (fd_form_screen->form_screen->visible) {
fl_raise_form(fd_form_screen->form_screen);
// and now docbook also.
int SubFileExport = 0;
if (!LinuxDoc && !DocBook)
- SubFileExport=fl_defpup(FL_ObjWin(ob),
+ SubFileExport= fl_defpup(FL_ObjWin(ob),
_("Export%t"
"|as LaTeX...%x40"
"|as DVI...%x41"
"|as HTML...%x44"
"|Custom...%x45"));
else if(LinuxDoc)
- SubFileExport=fl_defpup(FL_ObjWin(ob),
+ SubFileExport= fl_defpup(FL_ObjWin(ob),
_("Export%t"
"|as LinuxDoc...%x40"
"|as DVI...%x41"
"|as PostScript...%x42"
"|as Ascii Text...%x43"));
else if(DocBook)
- SubFileExport=fl_defpup(FL_ObjWin(ob),
+ SubFileExport= fl_defpup(FL_ObjWin(ob),
_("Export%t"
"|as DocBook...%x40"
"|as DVI...%x41"
fl_setpup_shortcut(FileMenu, 7, scex(_("FM|Rr#r#R")));
fl_setpup_shortcut(FileMenu, 8, scex(_("FM|dD#d#D")));
fl_setpup_shortcut(FileMenu, 9, scex(_("FM|wW#w#W")));
- fl_setpup_shortcut(FileMenu,10, scex(_("FM|vV#v#V")));
- fl_setpup_shortcut(FileMenu,11, scex(_("FM|Uu#u#U")));
- fl_setpup_shortcut(FileMenu,12, scex(_("FM|Bb#b#B")));
- fl_setpup_shortcut(FileMenu,13, scex(_("FM|Pp#p#P")));
- fl_setpup_shortcut(FileMenu,14, scex(_("FM|Ff#f#F")));
+ fl_setpup_shortcut(FileMenu, 10, scex(_("FM|vV#v#V")));
+ fl_setpup_shortcut(FileMenu, 11, scex(_("FM|Uu#u#U")));
+ fl_setpup_shortcut(FileMenu, 12, scex(_("FM|Bb#b#B")));
+ fl_setpup_shortcut(FileMenu, 13, scex(_("FM|Pp#p#P")));
+ fl_setpup_shortcut(FileMenu, 14, scex(_("FM|Ff#f#F")));
// These commands are disabled when the corresponding programs
// are not installed. I simply grey them out, since I do not
}
// xgettext:no-c-format
- fl_addtopup(FileMenu,_("|Import%m"), SubFileImport);
+ fl_addtopup(FileMenu, _("|Import%m"), SubFileImport);
// xgettext:no-c-format
- fl_addtopup(FileMenu,_("|Export%m%l"), SubFileExport);
+ fl_addtopup(FileMenu, _("|Export%m%l"), SubFileExport);
// xgettext:no-c-format
- fl_addtopup(FileMenu,_("|Exit%l"));
+ fl_addtopup(FileMenu, _("|Exit%l"));
fl_setpup_shortcut(FileMenu, 15, scex(_("FM|Ii#i#I")));
fl_setpup_shortcut(FileMenu, 16, scex(_("FM|Ee#e#E")));
fl_setpup_shortcut(FileMenu, 17, scex(_("FM|xX#x#X")));
LyXFunc * tmpfunc = men->_view->getLyXFunc();
// Floats & Insets submenu
- int SubEditFloats=fl_defpup(FL_ObjWin(ob),
+ int SubEditFloats= fl_defpup(FL_ObjWin(ob),
_("Floats & Insets%t"
"|Open/Close%x21"
"|Melt%x22"
fl_setpup_shortcut(SubEditTable, 31, scex(_("EMT|Ii#i#I")));
}
- int SubVersionControl = fl_newpup(FL_ObjWin(ob));
+ int SubVersionControl = fl_newpup(FL_ObjWin(ob));
fl_addtopup(SubVersionControl, _("Version Control%t"));
if (tmpbuffer->lyxvc.inUse()) {
// xgettext:no-c-format
fl_setpup_shortcut(SubVersionControl, 55, scex(_("EMV|Uu#u#U")));
fl_setpup_shortcut(SubVersionControl, 56, scex(_("EMV|Hh#h#H")));
- int EditMenu=fl_defpup(FL_ObjWin(ob),
+ int EditMenu= fl_defpup(FL_ObjWin(ob),
_("Undo"
"|Redo %l"
"|Cut"
fl_setpup_shortcut(SubInsertAscii, 41, scex(_("IMA|Ll#l#L")));
fl_setpup_shortcut(SubInsertAscii, 42, scex(_("IMA|Pp#p#P")));
- int SubInsertTableList=fl_defpup(FL_ObjWin(ob),
+ int SubInsertTableList= fl_defpup(FL_ObjWin(ob),
_("Lists & TOC%t"
"|Table of Contents%x21"
"|List of Figures%x22"
{
string fname = i18nLibFileSearch("doc", docname, "lyx");
_view->getMiniBuffer()->Set(_("Opening help file"),
- MakeDisplayPath(fname),"...");
- currentView()->buffer(bufferlist.loadLyXFile(fname,false));
+ MakeDisplayPath(fname), "...");
+ currentView()->buffer(bufferlist.loadLyXFile(fname, false));
if (docname == "Reference")
_view->getLyXFunc()->Dispatch(LFUN_TOCVIEW);
* Copyright (C) 1995 1996 Matthias Ettrich
* and the LyX Team.
*
-*======================================================*/
+* ====================================================== */
#ifndef MENUS_H
#define MENUS_H
#include "gettext.h"
extern bool keyseqUncomplete();
-extern string keyseqOptions(int l=190);
-extern string keyseqStr(int l=190);
+extern string keyseqOptions(int l= 190);
+extern string keyseqStr(int l= 190);
extern LyXAction lyxaction;
void MiniBuffer::TimerCB(FL_OBJECT * ob, long)
FL_Coord, FL_Coord,
int key, void * xev)
{
- return MiniBuffer::peek_event(ob,event,0,0,key,xev);
+ return MiniBuffer::peek_event(ob, event, 0, 0, key, xev);
}
{
text.clear();
fl_set_input(the_buffer, "");
- fl_set_focus_object(owner->getForm(),the_buffer);
+ fl_set_focus_object(owner->getForm(), the_buffer);
}
{
FL_OBJECT * obj;
- the_buffer = obj = fl_add_input(type,x,y,w,h,text.c_str());
- fl_set_object_boxtype(obj,FL_DOWN_BOX);
+ the_buffer = obj = fl_add_input(type, x, y, w, h, text.c_str());
+ fl_set_object_boxtype(obj, FL_DOWN_BOX);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj, SouthWestGravity, SouthEastGravity);
- fl_set_object_color(obj,FL_MCOL,FL_MCOL);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,C_MiniBuffer_ExecutingCB, 0);
+ fl_set_object_color(obj, FL_MCOL, FL_MCOL);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, C_MiniBuffer_ExecutingCB, 0);
// To intercept Up, Down, Table for history
fl_set_object_prehandler(obj, C_MiniBuffer_peek_event);
obj->wantkey = FL_KEY_TAB;
// timer
- timer = fl_add_timer(FL_HIDDEN_TIMER, 0,0,0,0, "Timer");
+ timer = fl_add_timer(FL_HIDDEN_TIMER, 0, 0, 0, 0, "Timer");
fl_set_object_callback(timer, C_MiniBuffer_TimerCB, 0);
timer->u_vdata = this;
fl_set_input(the_buffer, text.c_str());
// Else, show the buffer state.
else if (owner->currentView()->available()) {
- string nicename =
+ string nicename =
MakeDisplayPath(owner->buffer()->
getFileName());
// Should we do this instead? (kindo like emacs)
// -*- C++ -*-
-#ifndef _MINIBUFFER_H
-#define _MINIBUFFER_H
+#ifndef MINIBUFFER_H
+#define MINIBUFFER_H
#include FORMS_H_LOCATION
#include "LString.h"
void Set(string const& = string(),
string const& = string(),
string const& = string(),
- int delay_secs=6);
+ int delay_secs= 6);
///
string GetText() const { return text; }
///
int history_idx, history_cnt;
///
void addHistory(string const &cmd) {
- if (history_cnt==0 || (history_cnt>0 && cmd!=history[(history_cnt-1) % MAX_HISTORY])) {
+ if (history_cnt == 0 || (history_cnt>0 && cmd!= history[(history_cnt-1) % MAX_HISTORY])) {
history[history_cnt % MAX_HISTORY] = cmd;
history_cnt++;
}
/* -*- C++ -*- */
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, the High Level Word Processor
*
* Copyright (C) 1995Matthias Ettrich
* Copyright (C) 1995-1998 The LyX Team.
*
- * ======================================================
+ * ======================================================
A few prototypes and definitions needed for Windows NT */
/* Hacks to get LyX running under Win-NT w. Cygnus b19 (steven@cs.uu.nl) */
/* -*- C++ -*- */
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
-* Copyright (C) 1995,1996 Matthias Ettrich
+* Copyright (C) 1995, 1996 Matthias Ettrich
*
-*======================================================
+* ======================================================
A few prototypes and definitions needed for OS/2 */
-#ifndef _OS2_DEFINES_H
-#define _OS2_DEFINES_H
+#ifndef OS2_DEFINES_H
+#define OS2_DEFINES_H
-#include <ctype.h>
+#include <cctype>
#include <process.h>
-#include <stdlib.h>
+#include <cstdlib>
#include <unistd.h>
#include <X11/Xlocale.h>
/* #include <assert.h> */
#define lstat stat
#define S_ISLNK(x) false
#define S_ISBLK(x) false
-#define readlink(s,t,l) (strcpy(t,s),strlen(t))
-/*#define mkfifo(p,m) (0) *//* LyXserver is temporary disabled. */
+#define readlink(s, t, l) (strcpy(t, s), strlen(t))
+/*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
#define getcwd _getcwd2
#define chdir _chdir2
#define strcasecmp stricmp
*
* LyX, The Document Processor
*
-* Copyright (C) 1995,1996 Matthias Ettrich
+* Copyright (C) 1995, 1996 Matthias Ettrich
*
-*======================================================
+* ======================================================
A table for translating OS/2 API return code into errno.
Copied from emx library source. */
-#ifndef _OS2_ERRORTABLE_H
-#define _OS2_ERRORTABLE_H
-#ifndef _ERRNO_H
-#include <errno.h>
-#endif
+#ifndef OS2_ERRORTABLE_H
+#define OS2_ERRORTABLE_H
+//#ifndef _ERRNO_H
+#include <cerrno>
+//#endif
static unsigned char const errno_tab[] =
{
EINVAL, EINVAL, ENOENT, ENOENT, EMFILE, /* 0..4 */
EACCES, EBADF, EIO, ENOMEM, EIO, /* 5..9 */
- EINVAL, ENOEXEC,EINVAL, EINVAL, EINVAL, /* 10..14 */
+ EINVAL, ENOEXEC, EINVAL, EINVAL, EINVAL, /* 10..14 */
ENOENT, EBUSY, EXDEV, ENOENT, EROFS, /* 15..19 */
EIO, EIO, EIO, EIO, EIO, /* 20..24 */
EIO, EIO, EIO, ENOSPC, EIO, /* 25..29 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 175..179 */
EINVAL, EINVAL, EINVAL, EINVAL, ECHILD, /* 180..184 */
EINVAL, EINVAL, ENOENT, EINVAL, EINVAL, /* 185..189 */
- ENOEXEC,ENOEXEC,ENOEXEC,ENOEXEC,ENOEXEC, /* 190..194 */
- ENOEXEC,ENOEXEC,ENOEXEC,ENOEXEC,ENOEXEC, /* 195..199 */
- ENOEXEC,ENOEXEC,ENOEXEC,ENOENT, EINVAL, /* 200..204 */
+ ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 190..194 */
+ ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 195..199 */
+ ENOEXEC, ENOEXEC, ENOEXEC, ENOENT, EINVAL, /* 200..204 */
EINVAL, ENAMETOOLONG, EINVAL, EINVAL, EINVAL, /* 205..209 */
- EINVAL, EINVAL, EACCES, ENOEXEC,ENOEXEC, /* 210..214 */
+ EINVAL, EINVAL, EACCES, ENOEXEC, ENOEXEC, /* 210..214 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 215..219 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 220..224 */
EINVAL, EINVAL, EINVAL, ECHILD, EINVAL, /* 225..229 */
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#endif
#include "lyxparagraph.h"
+#include "support/textutils.h"
#include "lyxrc.h"
#include "layout.h"
#include "tex-strings.h"
#include "lyx_gui_misc.h"
#include "texrow.h"
-#ifndef NEW_TEXT
-#define INITIAL_SIZE_PAR 10 /*Number of bytes in one paragraph*/
-#define STEP_SIZE_PAR 10 /*Number of bytes added when reallocated*/
-#endif
extern void addNewlineAndDepth(string & file, int const depth); // Jug 990923
extern unsigned char GetCurrentTextClass(); // this should be fixed/removed
LyXParagraph::LyXParagraph()
{
-#ifndef NEW_TEXT
- size = INITIAL_SIZE_PAR;
- text = new char[size];
- last = 0;
-#endif
+ text.reserve(500); // is this number too big?
+
for (int i = 0; i < 10; ++i) setCounter(i , 0);
appendix = false;
enumdepth = 0;
/* this konstruktor inserts the new paragraph in a list */
LyXParagraph::LyXParagraph(LyXParagraph * par)
{
-#ifndef NEW_TEXT
- size = INITIAL_SIZE_PAR;
- text = new char[size];
- last = 0;
-#endif
+#warning we also need a reserve here
+#warning this would be a nice place to shrink par
for (int i = 0; i < 10; ++i) setCounter(i, 0);
appendix = false;
enumdepth = 0;
Clear();
}
-/// Used by the spellchecker
-#ifdef NEW_TEXT
-bool LyXParagraph::IsLetter(LyXParagraph::size_type pos) {
-#else
-bool LyXParagraph::IsLetter(int pos) {
-#endif
- unsigned char c = GetChar(pos);
- if (IsLetterChar(c))
- return true;
- // '\0' is not a letter, allthough every string contains "" (below)
- if( c == '\0')
- return false;
- // We want to pass the ' and escape chars to ispell
- string extra = lyxrc->isp_esc_chars + '\'';
- char ch[2];
- ch[0] = c;
- ch[1] = 0;
- return contains(extra, ch);
-}
-
void LyXParagraph::writeFile(FILE * file, BufferParams & params,
char footflag, char dth)
/* First write the layout */
fprintf(file, "\n\\layout %s\n",
- textclasslist.NameOfLayout(params.textclass,layout)
+ textclasslist.NameOfLayout(params.textclass, layout)
.c_str());
/* maybe some vertical spaces */
fprintf(file, " \\pextra_widthp %s",
pextra_widthp.c_str());
}
- fprintf(file,"\n");
+ fprintf(file, "\n");
}
}
else {
font1 = LyXFont(LyXFont::ALL_INHERIT);
column = 0;
-#ifdef NEW_TEXT
for (size_type i = 0; i < size(); i++) {
if (!i){
fprintf(file, "\n");
column = 0;
}
-#else
- for (int i = 0; i < last; i++) {
- if (!i){
- fprintf(file, "\n");
- column = 0;
- }
-#endif
// Write font changes
font2 = GetFontSettings(i);
c = GetChar(i);
switch (c) {
- case LYX_META_INSET:
+ case META_INSET:
inset = GetInset(i);
if (inset)
if (inset->DirectWrite()) {
column = 0;
}
break;
- case LYX_META_NEWLINE:
+ case META_NEWLINE:
fprintf(file, "\n\\newline \n");
column = 0;
break;
- case LYX_META_HFILL:
+ case META_HFILL:
fprintf(file, "\n\\hfill \n");
column = 0;
break;
- case LYX_META_PROTECTED_SEPARATOR:
+ case META_PROTECTED_SEPARATOR:
fprintf(file, "\n\\protected_separator \n");
column = 0;
break;
column = 0;
break;
case '.':
-#ifdef NEW_TEXT
if (i + 1 < size() && GetChar(i + 1) == ' ') {
fprintf(file, ".\n");
column = 0;
} else
fprintf(file, ".");
-#else
- if (i + 1 < last && GetChar(i + 1) == ' ') {
- fprintf(file, ".\n");
- column = 0;
- } else
- fprintf(file, ".");
-#endif
break;
default:
- if ((column > 70 && c==' ')
+ if ((column > 70 && c == ' ')
|| column > 79){
fprintf(file, "\n");
column = 0;
if (layout.needprotect
&& next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
features.NeedLyXFootnoteCode = true;
- if ((current_view->buffer()->params.paragraph_separation == LYX_PARSEP_INDENT) &&
- (pextra_type == PEXTRA_MINIPAGE))
+ if ((current_view->buffer()->params.paragraph_separation == BufferParams::PARSEP_INDENT) &&
+ (pextra_type == LyXParagraph::PEXTRA_MINIPAGE))
features.NeedLyXMinipageIndent = true;
if (table && table->NeedRotating())
features.rotating = true;
/* first few functions needed for cut and paste and paragraph breaking */
-#ifdef NEW_TEXT
void LyXParagraph::CopyIntoMinibuffer(LyXParagraph::size_type pos)
-#else
-void LyXParagraph::CopyIntoMinibuffer(int pos)
-#endif
{
minibuffer_char = GetChar(pos);
minibuffer_font = GetFontSettings(pos);
minibuffer_inset = 0;
- if (minibuffer_char == LYX_META_INSET) {
+ if (minibuffer_char == LyXParagraph::META_INSET) {
if (GetInset(pos)) {
minibuffer_inset = GetInset(pos)->Clone();
} else {
}
}
-#ifdef NEW_TEXT
void LyXParagraph::CutIntoMinibuffer(LyXParagraph::size_type pos)
-#else
-void LyXParagraph::CutIntoMinibuffer(int pos)
-#endif
{
minibuffer_char = GetChar(pos);
minibuffer_font = GetFontSettings(pos);
minibuffer_inset = 0;
- if (minibuffer_char == LYX_META_INSET) {
+ if (minibuffer_char == LyXParagraph::META_INSET) {
if (GetInset(pos)) {
minibuffer_inset = GetInset(pos);
// This is a little hack since I want exactly
/* find the entry */
InsetTable * tmpi = insettable;
while (tmpi && tmpi->pos != pos) {
- tmpi=tmpi->next;
+ tmpi= tmpi->next;
}
if (tmpi) { /* This should always be true */
tmpi->inset = 0;
}
-#ifdef NEW_TEXT
void LyXParagraph::InsertFromMinibuffer(LyXParagraph::size_type pos)
-#else
-void LyXParagraph::InsertFromMinibuffer(int pos)
-#endif
{
InsertChar(pos, minibuffer_char);
SetFont(pos, minibuffer_font);
- if (minibuffer_char == LYX_META_INSET)
+ if (minibuffer_char == LyXParagraph::META_INSET)
InsertInset(pos, minibuffer_inset);
}
if (next)
next->previous = previous;
-#ifndef NEW_TEXT
- if (text)
- delete[] text;
-#endif
-
#ifndef NEW_TABLE
InsetTable * tmpinset;
while (insettable) {
}
-#ifdef NEW_TEXT
void LyXParagraph::Erase(LyXParagraph::size_type pos)
-#else
-void LyXParagraph::Erase(int pos)
-#endif
{
/* > because last is the next unused position, and you can
* use it if you want */
-#ifdef NEW_TEXT
if (pos > size()) {
if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
NextAfterFootnote()->Erase(pos - text.size() - 1);
"position does not exist." << endl;
return;
}
-#else
- if (pos > last) {
- if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- NextAfterFootnote()->Erase(pos - last - 1);
- else
- lyxerr.debug() << "ERROR (LyXParagraph::Erase): "
- "position does not exist." << endl;
- return;
- }
-#endif
-#ifdef NEW_TEXT
if (pos < size()) { // last is free for insertation, but should be empty
-#else
- if (pos < last) { // last is free for insertation, but should be empty
-#endif
#ifdef NEW_TABLE
/* if it is an inset, delete the inset entry */
- if (text[pos] == LYX_META_INSET) {
+ if (text[pos] == LyXParagraph::META_INSET) {
/* find the entry */
for(InsetList::iterator it = insetlist.begin();
it != insetlist.end(); ++it) {
}
#else
/* if it is an inset, delete the inset entry */
- if (text[pos] == LYX_META_INSET) {
+ if (text[pos] == LyXParagraph::META_INSET) {
/* find the entry */
InsetTable *tmpi = insettable;
InsetTable *tmpi2 = tmpi;
while (tmpi && tmpi->pos != pos) {
- tmpi2=tmpi;
- tmpi=tmpi->next;
+ tmpi2= tmpi;
+ tmpi= tmpi->next;
}
if (tmpi) { // this should always be true
if (tmpi->inset) // delete the inset if it exists
}
}
#endif
-#ifdef NEW_TEXT
text.erase(text.begin() + pos);
- //text.erase(pos, 1);
-#else
- // Shift rest of text
- for (int i = pos; i < last - 1; i++) {
- text[i]=text[i+1];
- }
- last--;
-#endif
#ifdef NEW_TABLE
/* erase entries in the tables */
for(FontList::iterator it = fontlist.begin();
while (tmpi) {
if (tmpi->pos > pos)
tmpi->pos--;
- tmpi=tmpi->next;
+ tmpi= tmpi->next;
}
#endif
} else {
}
-#ifndef NEW_TEXT
-/* pos is needed to specify the paragraph correctly. Remember the
-* closed footnotes */
-void LyXParagraph::Enlarge(int pos, int number)
-{
- /* > because last is the next unused position, and you can
- * use it if you want */
- if (pos > last) {
- if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- NextAfterFootnote()->Enlarge(pos - last - 1, number);
- else
- lyxerr << "ERROR (LyXParagraph::Enlarge): "
- "position does not exist." << endl;
- return;
- }
-
- if (size - last < number) {
- size += number - size + last + STEP_SIZE_PAR;
- char * tmp = new char[size];
- for (int i = 0; i < last; ++i)
- tmp[i] = text[i];
- delete[] text;
- text = tmp;
- }
-}
-#endif
-
-
-#ifndef NEW_TEXT
-/* make the allocated memory fit to the needed size */
-/* used to make a paragraph smaller */
-void LyXParagraph::FitSize()
-{
- if (size - last > STEP_SIZE_PAR) {
- size = last + STEP_SIZE_PAR;
- char * tmp = new char[size];
- for (int i = 0; i < last; ++i)
- tmp[i] = text[i];
- delete[] text;
- text = tmp;
- }
-}
-#endif
-
-#ifdef NEW_TEXT
void LyXParagraph::InsertChar(LyXParagraph::size_type pos, char c)
-#else
-void LyXParagraph::InsertChar(int pos, char c)
-#endif
{
-#ifdef NEW_TEXT
/* > because last is the next unused position, and you can
* use it if you want */
if (pos > size()) {
return;
}
text.insert(text.begin() + pos, c);
- //text.insert(pos, c);
-#else
- /* > because last is the next unused position, and you can
- * use it if you want */
- if (pos > last) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- NextAfterFootnote()->InsertChar(pos - last - 1, c);
- else
- lyxerr.debug() << "ERROR (LyXParagraph::InsertChar): "
- "position does not exist." << endl;
- return;
- }
- // Are we full? If so, enlarge.
- if (last == size) {
- size += STEP_SIZE_PAR;
- char * tmp = new char[size];
- for (int i = 0; i < last; i++)
- tmp[i] = text[i];
- delete[] text;
- text = tmp;
- }
-
- // Shift rest of character
- for (int i = last; i>pos; i--) {
- text[i] = text[i - 1];
- }
-
- text[pos] = c;
- last++;
-#endif
#ifdef NEW_TABLE
// update the font table
for(FontList::iterator it = fontlist.begin();
while (tmpi) {
if (tmpi->pos >= pos)
tmpi->pos++;
- tmpi=tmpi->next;
+ tmpi= tmpi->next;
}
#endif
}
-#ifdef NEW_TEXT
+
void LyXParagraph::InsertInset(LyXParagraph::size_type pos,
Inset * inset)
-#else
-void LyXParagraph::InsertInset(int pos, Inset * inset)
-#endif
{
/* > because last is the next unused position, and you can
* use it if you want */
-#ifdef NEW_TEXT
if (pos > size()) {
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
"position does not exist: " << pos << endl;
return;
}
-#else
- if (pos > last) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- NextAfterFootnote()
- ->InsertInset(pos - last - 1, inset);
- else
- lyxerr << "ERROR (LyXParagraph::InsertInset): "
- "position does not exist: " << pos << endl;
- return;
- }
-#endif
- if (text[pos] != LYX_META_INSET) {
+ if (text[pos] != LyXParagraph::META_INSET) {
lyxerr << "ERROR (LyXParagraph::InsertInset): "
- "there is no LYX_META_INSET" << endl;
+ "there is no LyXParagraph::META_INSET" << endl;
return;
}
#endif
}
-#ifdef NEW_TEXT
+
Inset * LyXParagraph::GetInset(LyXParagraph::size_type pos)
-#else
-Inset * LyXParagraph::GetInset(int pos)
-#endif
{
-#ifdef NEW_TEXT
if (pos >= size()) {
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
}
return 0;
}
-#else
- if (pos >= last) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- return NextAfterFootnote()->GetInset(pos - last - 1);
- else {
- lyxerr << "ERROR (LyXParagraph::GetInset): "
- "position does not exist: "
- << pos << endl;
- }
- return 0;
- }
-#endif
#ifdef NEW_TABLE
/* find the inset */
for(InsetList::iterator it = insetlist.begin();
// Gets uninstantiated font setting at position.
// Optimized after profiling. (Asger)
-#ifdef NEW_TEXT
LyXFont LyXParagraph::GetFontSettings(LyXParagraph::size_type pos)
-#else
-LyXFont LyXParagraph::GetFontSettings(int pos)
-#endif
{
-#ifdef NEW_TEXT
if (pos < size()) {
#ifdef NEW_TABLE
for(FontList::iterator it = fontlist.begin();
} else if (pos) {
return GetFontSettings(pos - 1);
}
-#else
- if (pos < last) {
-#ifdef NEW_TABLE
- for(FontList::iterator it = fontlist.begin();
- it != fontlist.end(); ++it) {
- if (pos >= (*it).pos && pos <= (*it).pos_end)
- return (*it).font;
- }
-#else
- FontTable * tmp = fonttable;
- while (tmp) {
- if (pos >= tmp->pos && pos <= tmp->pos_end)
- return tmp->font;
- tmp = tmp->next;
- }
-#endif
- }
- /* > because last is the next unused position, and you can
- * use it if you want */
- else if (pos > last) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- return NextAfterFootnote()
- ->GetFontSettings(pos - last - 1);
- else {
- // Why is it an error to ask for the font of a
- // position that does not exist? Would it be
- // enough for this to be anable on debug?
- // We want strict error checking, but it's ok to only
- // have it when debugging. (Asger)
- lyxerr << "ERROR (LyXParagraph::GetFontSettings): "
- "position does not exist. " << pos << endl;
- }
- } else if (pos) {
- return GetFontSettings(pos - 1);
- }
-#endif
return LyXFont(LyXFont::ALL_INHERIT);
}
// the true picture of the buffer. (Asger)
// If position is -1, we get the layout font of the paragraph.
// If position is -2, we get the font of the manual label of the paragraph.
-#ifdef NEW_TEXT
LyXFont LyXParagraph::getFont(LyXParagraph::size_type pos)
-#else
-LyXFont LyXParagraph::getFont(int pos)
-#endif
{
LyXFont tmpfont;
LyXLayout const & layout = textclasslist.Style(GetCurrentTextClass(),
GetLayout());
-#ifdef NEW_TEXT
LyXParagraph::size_type main_body = 0;
-#else
- int main_body = 0;
-#endif
if (layout.labeltype == LABEL_MANUAL)
main_body = BeginningOfMainBody();
/// Returns the height of the highest font in range
-#ifdef NEW_TEXT
LyXFont::FONT_SIZE LyXParagraph::HighestFontInRange(LyXParagraph::size_type startpos, LyXParagraph::size_type endpos) const
-#else
-LyXFont::FONT_SIZE LyXParagraph::HighestFontInRange(int startpos, int endpos) const
-#endif
{
LyXFont::FONT_SIZE maxsize = LyXFont::SIZE_TINY;
#ifdef NEW_TABLE
while (tmp) {
if (startpos <= tmp->pos_end && endpos >= tmp->pos) {
LyXFont::FONT_SIZE size = tmp->font.size();
- if (size > maxsize && size<=LyXFont::SIZE_HUGER)
+ if (size > maxsize && size<= LyXFont::SIZE_HUGER)
maxsize = size;
}
tmp = tmp->next;
}
-#ifdef NEW_TEXT
char LyXParagraph::GetChar(LyXParagraph::size_type pos)
-#else
-char LyXParagraph::GetChar(int pos)
-#endif
{
#ifdef DEVEL_VERSION
/* a workaround to 'fix' some bugs in text-class */
}
#endif
-#ifdef NEW_TEXT
if (pos < size()) {
return text[pos];
}
<< ")\n";
}
return '\0';
-#else
- if (pos < last) {
+ } else {
+ /* we should have a footnote environment */
+ if (!next || next->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
+ // Notice that LyX does request the
+ // last char from time to time. (Asger)
+ //lyxerr << "ERROR (LyXParagraph::GetChar): "
+ // "expected footnote." << endl;
+ return '\0';
+ }
+ switch (next->footnotekind) {
+ case LyXParagraph::FOOTNOTE:
+ return LyXParagraph::META_FOOTNOTE;
+ case LyXParagraph::MARGIN:
+ return LyXParagraph::META_MARGIN;
+ case LyXParagraph::FIG:
+ case LyXParagraph::WIDE_FIG:
+ return LyXParagraph::META_FIG;
+ case LyXParagraph::TAB:
+ case LyXParagraph::WIDE_TAB:
+ return LyXParagraph::META_TAB;
+ case LyXParagraph::ALGORITHM:
+ return LyXParagraph::META_ALGORITHM;
+ }
+ return '\0'; // to shut up gcc
+ }
+}
+
+
+char LyXParagraph::GetChar(LyXParagraph::size_type pos) const
+{
+#ifdef DEVEL_VERSION
+ /* a workaround to 'fix' some bugs in text-class */
+ if (pos < 0) {
+ // This function is important. It should not work around bugs.
+ // Let's find the bugs instead and fix them. (Asger)
+ lyxerr << "FATAL ERROR (LyXParagraph::GetChar):"
+ " bad position " << pos << endl;
+ abort();
+ }
+#endif
+
+ if (pos < size()) {
return text[pos];
}
/* > because last is the next unused position, and you can
* use it if you want */
- else if (pos > last) {
+ else if (pos > size()) {
if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
- return NextAfterFootnote()->GetChar(pos - last - 1);
- else
+ return NextAfterFootnote()
+ ->GetChar(pos - text.size() - 1);
+ else {
lyxerr << "ERROR (LyXParagraph::GetChar): "
- "position does not exist." << pos << endl;
+ "position does not exist."
+ << pos << " (" << static_cast<int>(pos)
+ << ")\n";
+ }
return '\0';
-#endif
} else {
/* we should have a footnote environment */
if (!next || next->footnoteflag == LyXParagraph::NO_FOOTNOTE) {
}
switch (next->footnotekind) {
case LyXParagraph::FOOTNOTE:
- return LYX_META_FOOTNOTE;
+ return LyXParagraph::META_FOOTNOTE;
case LyXParagraph::MARGIN:
- return LYX_META_MARGIN;
+ return LyXParagraph::META_MARGIN;
case LyXParagraph::FIG:
case LyXParagraph::WIDE_FIG:
- return LYX_META_FIG;
+ return LyXParagraph::META_FIG;
case LyXParagraph::TAB:
case LyXParagraph::WIDE_TAB:
- return LYX_META_TAB;
+ return LyXParagraph::META_TAB;
case LyXParagraph::ALGORITHM:
- return LYX_META_ALGORITHM;
+ return LyXParagraph::META_ALGORITHM;
}
return '\0'; // to shut up gcc
}
}
-#ifdef NEW_TEXT
string LyXParagraph::GetWord(LyXParagraph::size_type & lastpos)
-#else
-string LyXParagraph::GetWord(int & lastpos)
-#endif
-
//Added 98/9/21 by REH
// return an string of the current word, and the end of the word
// in lastpos.
//i think the devcode aborts before this, but why not be
// versatile?
- if (lastpos < 0) lastpos=0;
+ if (lastpos < 0) lastpos= 0;
// move back until we have a letter
//since someone might have typed a punctuation first
int firstpos = lastpos;
- while ((firstpos >=0) && !IsLetter(firstpos))
+ while ((firstpos >= 0) && !IsLetter(firstpos))
firstpos--;
// now find the beginning by looking for a nonletter
- while ((firstpos>=0) && IsLetter(firstpos))
+ while ((firstpos>= 0) && IsLetter(firstpos))
firstpos--;
// the above is now pointing to the preceeding non-letter
firstpos++;
- lastpos=firstpos;
+ lastpos= firstpos;
// so copy characters into theword until we get a nonletter
// note that this can easily exceed lastpos, wich means
}
-#ifdef NEW_TEXT
LyXParagraph::size_type LyXParagraph::Last()
-#else
-int LyXParagraph::Last()
-#endif
{
-#ifdef NEW_TEXT
if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
return text.size() + NextAfterFootnote()->Last() + 1;
/* the 1 is the symbol
for the footnote */
else
return text.size();
-#else
- if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- return last + NextAfterFootnote()->Last() + 1;
- /* the 1 is the symbol
- for the footnote */
- else
- return last;
-#endif
}
-#ifdef NEW_TEXT
LyXParagraph * LyXParagraph::ParFromPos(LyXParagraph::size_type pos)
-#else
-LyXParagraph * LyXParagraph::ParFromPos(int pos)
-#endif
{
-#ifdef NEW_TEXT
/* > because last is the next unused position, and you can
* use it if you want */
if (pos > size()) {
"position does not exist." << endl;
return this;
}
-#else
- /* > because last is the next unused position, and you can
- * use it if you want */
- if (pos > last) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- return NextAfterFootnote()->ParFromPos(pos - last - 1);
- else
- lyxerr << "ERROR (LyXParagraph::ParFromPos): "
- "position does not exist." << endl;
- return this;
- }
-#endif
else
return this;
}
-#ifdef NEW_TEXT
int LyXParagraph::PositionInParFromPos(LyXParagraph::size_type pos)
-#else
-int LyXParagraph::PositionInParFromPos(int pos)
-#endif
{
/* > because last is the next unused position, and you can
* use it if you want */
-#ifdef NEW_TEXT
if (pos > size()) {
if (next
&& next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
"position does not exist." << endl;
return pos;
}
-#else
- if (pos > last) {
- if (next
- && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- return NextAfterFootnote()
- ->PositionInParFromPos(pos - last - 1);
- else
- lyxerr <<
- "ERROR (LyXParagraph::PositionInParFromPos): "
- "position does not exist." << endl;
- return pos;
- }
-#endif
else
return pos;
}
-#ifdef NEW_TEXT
void LyXParagraph::SetFont(LyXParagraph::size_type pos,
LyXFont const & font)
-#else
-void LyXParagraph::SetFont(int pos, LyXFont const & font)
-#endif
{
/* > because last is the next unused position, and you can
* use it if you want */
-#ifdef NEW_TEXT
if (pos > size()) {
if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
NextAfterFootnote()->SetFont(pos - text.size() - 1,
}
return;
}
-#else
- if (pos > last) {
- if (next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
- NextAfterFootnote()->SetFont(pos - last - 1, font);
- } else {
- lyxerr << "ERROR (LyXParagraph::SetFont): "
- "position does not exist." << endl;
- }
- return;
- }
-#endif
LyXFont patternfont(LyXFont::ALL_INHERIT);
// First, reduce font against layout/label font
}
+LyXParagraph * LyXParagraph::NextAfterFootnote() const
+{
+ if (next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE) {
+ LyXParagraph * tmp = next;
+ while (tmp && tmp->footnoteflag != LyXParagraph::NO_FOOTNOTE)
+ tmp = tmp->next;
+ if (tmp && tmp->footnoteflag != LyXParagraph::CLOSED_FOOTNOTE)
+ return tmp; /* there can be more than one footnote
+ in a logical paragraph */
+ else
+ return next; /* this should never happen! */
+ }
+ else
+ return next;
+}
+
+
LyXParagraph * LyXParagraph::PreviousBeforeFootnote()
{
LyXParagraph * tmp;
return this;
LyXParagraph * tmp = this;
- while (tmp->next && tmp->next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
+ while (tmp->next
+ && tmp->next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
tmp = tmp->NextAfterFootnote();
return tmp;
return previous;
}
-#ifdef NEW_TEXT
+
void LyXParagraph::BreakParagraph(LyXParagraph::size_type pos,
int flag)
-#else
-void LyXParagraph::BreakParagraph(int pos, int flag)
-#endif
{
-#ifdef NEW_TEXT
size_type i, pos_end, pos_first;
-#else
- int i, pos_end, pos_first;
-#endif
/* create a new paragraph */
LyXParagraph * par = ParFromPos(pos);
LyXParagraph * firstpar = FirstPhysicalPar();
while (ParFromPos(pos_first) != par)
pos_first++;
-#ifdef NEW_TEXT
pos_end = pos_first + par->text.size() - 1;
tmp->text.reserve(pos_end - pos);
-#else
- pos_end = pos_first + par->last - 1;
- /* make sure there is enough memory for the now larger
- paragraph. This is not neccessary, because
- InsertFromMinibuffer will enlarge the memory (it uses
- InsertChar of course). But doing it by hand
- is MUCH faster! (only one time, not thousend times!!) */
- tmp->Enlarge(0, pos_end - pos);
-#endif
+
for (i = pos; i <= pos_end; i++) {
par->CutIntoMinibuffer(i - pos_first);
tmp->InsertFromMinibuffer(i - pos);
for (i = pos_end; i >= pos; i--)
par->Erase(i - pos_first);
-#ifdef NEW_TEXT
+
par->text.resize(par->text.size());
-#else
- /* free memory of the now shorter paragraph*/
- par->FitSize();
-#endif
}
/* just an idea of me */
LyXParagraph * tmppar = this;
while (tmppar && (
(tmppar->IsDummy()
- && tmppar->previous->footnoteflag ==
+ && tmppar->previous->footnoteflag ==
LyXParagraph::CLOSED_FOOTNOTE)
|| tmppar->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE))
tmppar = tmppar->previous;
/* copy everything behind the break-position to the new paragraph */
-#ifdef NEW_TEXT
result->text.reserve(size());
for (size_type i = 0; i < size(); i++) {
CopyIntoMinibuffer(i);
result->InsertFromMinibuffer(i);
}
-#else
- /* make shure there is enough memory for the now larger paragraph.
- * This is not neccessary, because InsertFromMinibuffer will enlarge
- * the memory (it uses InsertChar of course). But doing it by hand
- * is MUCH faster! (only one time, not thousend times!!) */
- result->Enlarge(0, last+2);
- for (int i = 0; i < last; i++) {
- CopyIntoMinibuffer(i);
- result->InsertFromMinibuffer(i);
- }
-#endif
return result;
}
par->depth == depth);
}
-#ifdef NEW_TEXT
+
void LyXParagraph::BreakParagraphConservative(LyXParagraph::size_type pos)
-#else
-void LyXParagraph::BreakParagraphConservative(int pos)
-#endif
{
-#ifdef NEW_TEXT
size_type i, pos_end, pos_first;
-#else
- int i, pos_end, pos_first;
-#endif
/* create a new paragraph */
LyXParagraph * par = ParFromPos(pos);
pos_first = 0;
while (ParFromPos(pos_first) != par)
pos_first++;
-#ifdef NEW_TEXT
pos_end = pos_first + par->text.size() - 1;
-#else
- pos_end = pos_first + par->last - 1;
-#endif
/* make shure there is enough memory for the now larger
paragraph. This is not neccessary, because
InsertFromMinibuffer will enlarge the memory (it uses
InsertChar of course). But doing it by hand
is MUCH faster! (only one time, not thousend times!!) */
-#ifdef NEW_TEXT
tmp->text.reserve(pos_end - pos);
-#else
- tmp->Enlarge(0, pos_end - pos);
-#endif
+
for (i = pos; i <= pos_end; i++) {
par->CutIntoMinibuffer(i - pos_first);
}
for (i = pos_end; i >= pos; i--)
par->Erase(i - pos_first);
-#ifdef NEW_TEXT
+
par->text.resize(par->text.size());
-#else
- /* free memory of the now shorter paragraph*/
- par->FitSize();
-#endif
}
}
firstpar->added_space_bottom = the_next->added_space_bottom;
firstpar->pagebreak_bottom = the_next->pagebreak_bottom;
-#ifdef NEW_TEXT
size_type pos_end = the_next->text.size() - 1;
size_type pos_insert = Last();
size_type i;
-#else
- int pos_end = the_next->last - 1;
- int pos_insert = Last();
- /* enlarge the paragraph. This is faster than enlarge it
- * every 10th insertion. */
- if (pos_end >= 0)
- Enlarge(pos_insert, pos_end);
- int i;
-#endif
/* ok, now copy the paragraph */
for (i = 0; i <= pos_end; i++) {
delete the_next;
}
-#ifdef NEW_TEXT
+
void LyXParagraph::OpenFootnote(LyXParagraph::size_type pos)
-#else
-void LyXParagraph::OpenFootnote(int pos)
-#endif
{
LyXParagraph * par = ParFromPos(pos);
par = par->next;
}
}
-#ifdef NEW_TEXT
+
void LyXParagraph::CloseFootnote(LyXParagraph::size_type pos)
-#else
-void LyXParagraph::CloseFootnote(int pos)
-#endif
{
LyXParagraph * par = ParFromPos(pos);
par = par->next;
p1 = ppar->pextra_width,
p2 = ppar->pextra_widthp;
ppar->SetPExtraType(ppar->pextra_type,
- p1.c_str(),p2.c_str());
+ p1.c_str(), p2.c_str());
}
if ((par->pextra_type == PEXTRA_NONE) &&
npar && (npar->pextra_type != PEXTRA_NONE)) {
p1 = npar->pextra_width,
p2 = npar->pextra_widthp;
npar->SetPExtraType(npar->pextra_type,
- p1.c_str(),p2.c_str());
+ p1.c_str(), p2.c_str());
}
}
}
p1 = ppar->pextra_width,
p2 = ppar->pextra_widthp;
ppar->SetPExtraType(ppar->pextra_type,
- p1.c_str(),p2.c_str());
+ p1.c_str(), p2.c_str());
}
if ((par->pextra_type == PEXTRA_NONE) &&
npar && (npar->pextra_type != PEXTRA_NONE)) {
p1 = npar->pextra_width,
p2 = npar->pextra_widthp;
npar->SetPExtraType(npar->pextra_type,
- p1.c_str(),p2.c_str());
+ p1.c_str(), p2.c_str());
}
}
}
if (FirstPhysicalPar() != this)
return -1;
-
-// Unroll the first two cycles of the loop
-// and remember the previous character to remove unnecessary GetChar() calls
-#ifdef NEW_TEXT
+ // Unroll the first two cycles of the loop
+ // and remember the previous character to
+ // remove unnecessary GetChar() calls
size_type i = 0;
if (i < size()
- && GetChar(i) != LYX_META_NEWLINE) {
+ && GetChar(i) != LyXParagraph::META_NEWLINE) {
++i;
char previous_char, temp;
if (i < size()
- && (previous_char = GetChar(i)) != LYX_META_NEWLINE) {
- // Yes, this ^ is supposed to be "=" not "=="
+ && (previous_char = GetChar(i)) != LyXParagraph::META_NEWLINE) {
+ // Yes, this ^ is supposed to be "= " not "== "
++i;
while (i < size()
&& previous_char != ' '
- && (temp = GetChar(i)) != LYX_META_NEWLINE) {
+ && (temp = GetChar(i)) != LyXParagraph::META_NEWLINE) {
++i;
previous_char = temp;
}
}
if (i == 0 && i == size() &&
- !(footnoteflag==LyXParagraph::NO_FOOTNOTE
+ !(footnoteflag == LyXParagraph::NO_FOOTNOTE
&& next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE))
i++; /* the cursor should not jump
* to the main body if there
* is nothing in! */
-#else
- int i = 0;
- if (i < last
- && GetChar(i) != LYX_META_NEWLINE) {
- ++i;
- char previous_char, temp;
- if (i < last
- && (previous_char = GetChar(i)) != LYX_META_NEWLINE) {
- // Yes, this ^ is supposed to be "=" not "=="
- ++i;
- while (i < last
- && previous_char != ' '
- && (temp = GetChar(i)) != LYX_META_NEWLINE) {
- ++i;
- previous_char = temp;
- }
- }
- }
-
- if (i==0 && i == last &&
- !(footnoteflag==LyXParagraph::NO_FOOTNOTE
- && next && next->footnoteflag != LyXParagraph::NO_FOOTNOTE)
- )
- i++; /* the cursor should not jump
- * to the main body if there
- * is nothing in! */
-#endif
return i;
}
}
-#ifdef NEW_TEXT
Inset * LyXParagraph::ReturnNextInsetPointer(LyXParagraph::size_type & pos)
-#else
-Inset * LyXParagraph::ReturnNextInsetPointer(int & pos)
-#endif
{
#ifdef NEW_TABLE
InsetTable * tmp = 0;
if (!tmpi2 || tmpi->pos < tmpi2->pos)
tmpi2 = tmpi;
}
- tmpi=tmpi->next;
+ tmpi= tmpi->next;
}
if (tmpi2){
pos = tmpi2->pos;
if (footnoteflag == LyXParagraph::NO_FOOTNOTE
&& next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
int further = NextAfterFootnote()->GetPositionOfInset(inset);
-#ifdef NEW_TEXT
if (further != -1)
return size() + 1 + further;
-#else
- if (further != -1)
- return last + 1 + further;
-#endif
}
return -1;
#else
/* think about footnotes */
if (footnoteflag == LyXParagraph::NO_FOOTNOTE
&& next && next->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE) {
- int further =
+ int further =
NextAfterFootnote()->GetPositionOfInset(inset);
-#ifdef NEW_TEXT
if (further != -1)
return text.size() + 1 + further;
-#else
- if (further != -1)
- return last + 1 + further;
-#endif
}
return -1;
}
void LyXParagraph::readSimpleWholeFile(FILE * myfile)
{
-
-#ifndef NEW_TEXT
- FileInfo fileInfo(fileno(myfile));
- long file_size = fileInfo.getSize();
- /* it is horrible, I know, but faster.
- * I should not use InsertString for that :-( */
-
- /* I will write a better insertion in the future */
- Enlarge(0, file_size + 10);
-#endif
rewind(myfile);
if (!feof(myfile)) {
char c = 0;
do {
c = fgetc(myfile);
-#ifdef NEW_TEXT
InsertChar(text.size(), c);
-#else
- InsertChar(last,c);
-#endif
} while (!feof(myfile));
}
{
lyxerr[Debug::LATEX] << "TeXOnePar... " << this << endl;
LyXParagraph * par = next;
- LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), layout);
+ LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(),
+ layout);
bool further_blank_line = false;
if (IsDummy())
return SimpleTeXOneTablePar(file, texrow);
char c;
-#ifdef NEW_TEXT
size_type main_body;
-#else
- int main_body;
-#endif
bool return_value = false;
int column = 0;
if (main_body >= 0
-#ifdef NEW_TEXT
&& !text.size()
-#else
- && !last
-#endif
&& !IsDummy()) {
if (style.isCommand()) {
file += '{';
texrow.start(this, 0);
-#ifdef NEW_TEXT
for (size_type i = 0; i < size(); ++i) {
-#else
- for (int i = 0; i < last; ++i) {
-#endif
column++;
// First char in paragraph or after label?
if (i == main_body && !IsDummy()) {
case LYX_ALIGN_SPECIAL: break;
case LYX_ALIGN_LEFT:
file += "\\raggedright ";
- column+=13;
+ column+= 13;
break;
case LYX_ALIGN_RIGHT:
file += "\\raggedleft ";
- column+=12;
+ column+= 12;
break;
case LYX_ALIGN_CENTER:
file += "\\centering ";
- column+=11;
+ column+= 11;
break;
}
}
// Spaces at end of font change are simulated to be
// outside font change, i.e. we write "\textXX{text} "
// rather than "\textXX{text }". (Asger)
-#ifdef NEW_TEXT
if (open_font && c == ' ' && i <= size() - 2
&& !getFont(i+1).equalExceptLatex(running_font)
&& !getFont(i+1).equalExceptLatex(font)) {
font = getFont(i+1);
}
-#else
- if (open_font && c == ' ' && i <= last-2
- && !getFont(i+1).equalExceptLatex(running_font)
- && !getFont(i+1).equalExceptLatex(font)) {
- font = getFont(i+1);
- }
-#endif
// We end font definition before blanks
if (!font.equalExceptLatex(running_font) && open_font) {
- column += running_font.latexWriteEndChanges(file, basefont);
+ column += running_font.latexWriteEndChanges(file,
+ basefont);
running_font = basefont;
open_font = false;
}
if (c == ' '){
// Do not print the separation of the optional argument
if (i != main_body - 1) {
- SimpleTeXBlanks(file, texrow, i, column, font, style);
+ SimpleTeXBlanks(file, texrow, i,
+ column, font, style);
}
}
open_font = true;
}
- if (c == LYX_META_NEWLINE) {
+ if (c == LyXParagraph::META_NEWLINE) {
// newlines are handled differently here than
// the default in SimpleTeXSpecialChars().
if (!style.newline_allowed
running_font.latexWriteEndChanges(file, basefont);
}
-#ifdef NEW_TEXT
/* needed if there is an optional argument but no contents */
if (main_body > 0 && main_body == size()) {
file += "]~";
return_value = false;
}
-#else
- /* needed if there is an optional argument but no contents */
- if (main_body > 0 && main_body == last) {
- file += "]~";
- return_value = false;
- }
-#endif
+
lyxerr[Debug::LATEX] << "SimpleTeXOnePar...done " << this << endl;
return return_value;
}
bool return_value = false;
int current_cell_number = -1;
- LyXLayout const & style =
+ LyXLayout const & style =
textclasslist.Style(GetCurrentTextClass(), GetLayout());
LyXFont basefont = getFont(-1); // Get layout font
// Which font is currently active?
case LYX_ALIGN_SPECIAL: break;
case LYX_ALIGN_LEFT:
file += "\\raggedright ";
- column+=13;
+ column+= 13;
break;
case LYX_ALIGN_RIGHT:
file += "\\raggedleft ";
- column+=12;
+ column+= 12;
break;
case LYX_ALIGN_CENTER:
file += "\\centering ";
- column+=11;
+ column+= 11;
break;
}
}
current_cell_number = -1;
- tmp = table->TexEndOfCell(file,current_cell_number);
+ tmp = table->TexEndOfCell(file, current_cell_number);
for (; tmp >0 ; --tmp)
texrow.newline();
texrow.start(this, 0);
-#ifdef NEW_TEXT
for (size_type i = 0; i < size(); ++i) {
-#else
- for (int i = 0; i < last; ++i) {
-#endif
c = GetChar(i);
if (table->IsContRow(current_cell_number+1)) {
- if (c == LYX_META_NEWLINE)
+ if (c == LyXParagraph::META_NEWLINE)
current_cell_number++;
continue;
}
// Spaces at end of font change are simulated to be outside font change.
// i.e. we write "\textXX{text} " rather than "\textXX{text }". (Asger)
-#ifdef NEW_TEXT
if (open_font && c == ' ' && i <= size() - 2
-#else
- if (open_font && c == ' ' && i <= last-2
-#endif
&& getFont(i+1) != running_font && getFont(i+1) != font) {
font = getFont(i+1);
}
// We end font definition before blanks
if (font != running_font && open_font) {
- column += running_font.latexWriteEndChanges(file, basefont);
+ column += running_font.latexWriteEndChanges(file,
+ basefont);
running_font = basefont;
open_font = false;
}
column += 9;
}
}
- if (c == LYX_META_NEWLINE) {
+ if (c == LyXParagraph::META_NEWLINE) {
// special case for inside a table
// different from default case in SimpleTeXSpecialChars()
if (open_font) {
running_font = basefont;
current_cell_number++;
if (table->CellHasContRow(current_cell_number) >= 0) {
- TeXContTableRows(file, i+1, current_cell_number, column, texrow);
+ TeXContTableRows(file, i+1,
+ current_cell_number,
+ column, texrow);
}
// if this cell follow only ContRows till end don't
// put the EndOfCell because it is put after the
current_cell_number--;
break;
}
- int tmp = table->TexEndOfCell(file, current_cell_number);
+ int tmp = table->TexEndOfCell(file,
+ current_cell_number);
if (tmp>0) {
column = 0;
} else if (tmp < 0) {
// This one spits out the text off ContRows in tables
-#ifdef NEW_TEXT
bool LyXParagraph::TeXContTableRows(string & file,
LyXParagraph::size_type i,
int current_cell_number,
int & column, TexRow & texrow)
-#else
-bool LyXParagraph::TeXContTableRows(string & file, int i,
- int current_cell_number,
- int & column, TexRow & texrow)
-#endif
{
lyxerr[Debug::LATEX] << "TeXContTableRows... " << this << endl;
if (!table)
char c;
bool return_value = false;
- LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), GetLayout());
+ LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(),
+ GetLayout());
LyXFont basefont;
basefont = getFont(-1); // Get layout font
// Do we have an open font change?
bool open_font = false;
-#ifdef NEW_TEXT
size_type lastpos = i;
-#else
- int lastpos = i;
-#endif
int cell = table->CellHasContRow(current_cell_number);
current_cell_number++;
while(cell >= 0) {
// first find the right position
i = lastpos;
-#ifdef NEW_TEXT
for (; (i < size()) && (current_cell_number<cell); ++i) {
-#else
- for (; (i < last) && (current_cell_number<cell); ++i) {
-#endif
c = GetChar(i);
- if (c == LYX_META_NEWLINE)
+ if (c == LyXParagraph::META_NEWLINE)
current_cell_number++;
}
lastpos = i;
file += " \\\\\n";
texrow.newline();
column = 0;
- } else if ((c != ' ') && (c != LYX_META_NEWLINE)) {
+ } else if ((c != ' ') && (c != LyXParagraph::META_NEWLINE)) {
file += ' ';
}
-#ifdef NEW_TEXT
- for (; i < size() && (c = GetChar(i)) != LYX_META_NEWLINE;
- ++i) {
-#else
- for (; (i < last) && ((c=GetChar(i)) != LYX_META_NEWLINE);
+
+ for (; i < size() && (c = GetChar(i)) != LyXParagraph::META_NEWLINE;
++i) {
-#endif
++column;
// Fully instantiated font
// Spaces at end of font change are simulated to be outside font change.
// i.e. we write "\textXX{text} " rather than "\textXX{text }". (Asger)
-#ifdef NEW_TEXT
if (open_font && c == ' ' && i <= size() - 2
&& getFont(i + 1) != running_font
&& getFont(i + 1) != font) {
-#else
- if (open_font && c == ' ' && i <= last - 2
- && getFont(i + 1) != running_font
- && getFont(i + 1) != font) {
-#endif
font = getFont(i + 1);
}
}
// Blanks are printed before start of fontswitch
if (c == ' '){
- SimpleTeXBlanks(file, texrow, i, column, font, style);
+ SimpleTeXBlanks(file, texrow, i,
+ column, font, style);
}
// Do we need to change font?
if (font != running_font) {
- column += font.latexWriteStartChanges(file, basefont);
+ column +=
+ font.latexWriteStartChanges(file,
+ basefont);
running_font = font;
open_font = true;
}
column += 9;
}
}
- SimpleTeXSpecialChars(file, texrow, font, running_font, basefont,
+ SimpleTeXSpecialChars(file, texrow, font,
+ running_font, basefont,
open_font, style, i, column, c);
}
// If we have an open font definition, we have to close it
{
bool retval = false;
switch (c) {
- case LYX_META_HFILL:
+ case LyXParagraph::META_HFILL:
sgml_string.clear();
break;
- case LYX_META_PROTECTED_SEPARATOR:
+ case LyXParagraph::META_PROTECTED_SEPARATOR:
sgml_string = ' ';
break;
- case LYX_META_NEWLINE:
+ case LyXParagraph::META_NEWLINE:
sgml_string = '\n';
break;
case '&':
lyxerr[Debug::LATEX] << "SimpleDocbookOneTablePar... " << this << endl;
int column, tmp;
int current_cell_number = -1;
- LyXFont font1,font2;
+ LyXFont font1, font2;
char c;
Inset *inset;
-#ifdef NEW_TEXT
size_type main_body;
-#else
- int main_body;
-#endif
string emph = "emphasis";
- bool emph_flag=false;
- int char_line_count=0;
+ bool emph_flag= false;
+ int char_line_count= 0;
LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), GetLayout());
addNewlineAndDepth(file, ++depth);
}
current_cell_number = -1;
- tmp = table->DocBookEndOfCell(file,current_cell_number, depth);
+ tmp = table->DocBookEndOfCell(file, current_cell_number, depth);
/* parsing main loop */
-#ifdef NEW_TEXT
for (size_type i = 0; i < size(); ++i) {
-#else
- for (int i = 0; i < last; ++i) {
-#endif
c = GetChar(i);
if (table->IsContRow(current_cell_number+1)) {
- if (c == LYX_META_NEWLINE)
+ if (c == LyXParagraph::META_NEWLINE)
current_cell_number++;
continue;
}
if (font1.emph() != font2.emph() && i) {
if (font2.emph() == LyXFont::ON) {
file += "<emphasis>";
- emph_flag=true;
+ emph_flag= true;
} else if (emph_flag) {
file += "</emphasis>";
- emph_flag=false;
+ emph_flag= false;
}
}
- if (c == LYX_META_NEWLINE) {
+ if (c == LyXParagraph::META_NEWLINE) {
// we have only to control for emphasis open here!
if (emph_flag) {
file += "</emphasis>";
- emph_flag=false;
+ emph_flag= false;
}
font1 = font2 = getFont(-1);
current_cell_number++;
current_cell_number--;
break;
}
- tmp=table->DocBookEndOfCell(file, current_cell_number,
+ tmp= table->DocBookEndOfCell(file, current_cell_number,
depth);
if (tmp > 0)
column = 0;
- } else if (c == LYX_META_INSET) {
+ } else if (c == LyXParagraph::META_INSET) {
inset = GetInset(i);
string tmp_out;
inset->DocBook(tmp_out);
// This code needs some explanation:
// Two insets are treated specially
// label if it is the first element in a command paragraph
- // desc_on==3
+ // desc_on == 3
// graphics inside tables or figure floats can't go on
// title (the equivalente in latex for this case is caption
// and title should come first
- // desc_on==4
+ // desc_on == 4
//
if(desc_on != 3 || i != 0) {
if(tmp_out[0] == '@') {
file += tmp_out;
}
} else if (font2.latex() == LyXFont::ON) {
- // "TeX"-Mode on ==> SGML-Mode on.
+ // "TeX"-Mode on == > SGML-Mode on.
if (c != '\0')
file += c;
char_line_count++;
}
/* needed if there is an optional argument but no contents */
-#ifdef NEW_TEXT
if (main_body > 0 && main_body == size()) {
font1 = style.font;
}
-#else
- if (main_body > 0 && main_body == last) {
- font1 = style.font;
- }
-#endif
+
if (emph_flag) {
file += "</emphasis>";
}
<< this << endl;
}
-#ifdef NEW_TEXT
-void LyXParagraph::DocBookContTableRows(string & file, string & extra,
- int & desc_on, LyXParagraph::size_type i,
- int current_cell_number, int &column)
-#else
void LyXParagraph::DocBookContTableRows(string & file, string & extra,
- int & desc_on, int i,
+ int & desc_on, LyXParagraph::size_type i,
int current_cell_number, int &column)
-#endif
{
if (!table)
return;
lyxerr[Debug::LATEX] << "DocBookContTableRows... " << this << endl;
int cell;
- LyXFont font1,font2;
+ LyXFont font1, font2;
char c;
Inset * inset;
-#ifdef NEW_TEXT
size_type main_body;
size_type lastpos;
-#else
- int main_body;
- int lastpos;
-#endif
- string emph="emphasis";
- bool emph_flag=false;
- int char_line_count=0;
+ string emph= "emphasis";
+ bool emph_flag= false;
+ int char_line_count= 0;
- LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), GetLayout());
+ LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(),
+ GetLayout());
if (style.labeltype != LABEL_MANUAL)
main_body = 0;
while(cell >= 0) {
// first find the right position
i = lastpos;
-#ifdef NEW_TEXT
for (; i < size() && current_cell_number < cell; ++i) {
-#else
- for (; i < last && (current_cell_number < cell); ++i) {
-#endif
c = GetChar(i);
- if (c == LYX_META_NEWLINE)
+ if (c == LyXParagraph::META_NEWLINE)
current_cell_number++;
}
lastpos = i;
// file += " \\\\\n";
// column = 0;
// } else
- if ((c != ' ') && (c != LYX_META_NEWLINE)) {
+ if ((c != ' ') && (c != LyXParagraph::META_NEWLINE)) {
file += ' ';
}
-#ifdef NEW_TEXT
- for (; i < size() && (c = GetChar(i)) != LYX_META_NEWLINE;
- ++i) {
-#else
- for (; i < last && ((c = GetChar(i)) != LYX_META_NEWLINE);
+
+ for (; i < size()
+ && (c = GetChar(i)) != LyXParagraph::META_NEWLINE;
++i) {
-#endif
++column;
// Fully instantiated font
if (font1.emph() != font2.emph() && i) {
if (font2.emph() == LyXFont::ON) {
file += "<emphasis>";
- emph_flag=true;
+ emph_flag= true;
} else if (emph_flag) {
file += "</emphasis>";
- emph_flag=false;
+ emph_flag= false;
}
}
- if (c == LYX_META_INSET) {
+ if (c == LyXParagraph::META_INSET) {
inset = GetInset(i);
string tmp_out;
inset->DocBook(tmp_out);
// This code needs some explanation:
// Two insets are treated specially
// label if it is the first element in a command paragraph
- // desc_on==3
+ // desc_on == 3
// graphics inside tables or figure floats can't go on
// title (the equivalente in latex for this case is caption
// and title should come first
- // desc_on==4
+ // desc_on == 4
//
if(desc_on != 3 || i != 0) {
- if(tmp_out[0]=='@') {
+ if(tmp_out[0] == '@') {
if(desc_on == 4)
extra += frontStrip(tmp_out, '@');
else
file += tmp_out;
}
} else if (font2.latex() == LyXFont::ON) {
- // "TeX"-Mode on ==> SGML-Mode on.
- if (c!='\0')
+ // "TeX"-Mode on == > SGML-Mode on.
+ if (c!= '\0')
file += c;
char_line_count++;
} else {
// we have only to control for emphasis open here!
if (emph_flag) {
file += "</emphasis>";
- emph_flag=false;
+ emph_flag= false;
}
font1 = font2 = getFont(-1);
cell = table->CellHasContRow(current_cell_number);
lyxerr[Debug::LATEX] << "DocBookContTableRows...done " << this << endl;
}
-#ifdef NEW_TEXT
-void LyXParagraph::SimpleTeXBlanks(string & file, TexRow & texrow,
- LyXParagraph::size_type const i, int & column, LyXFont const & font,
- LyXLayout const & style)
-#else
void LyXParagraph::SimpleTeXBlanks(string & file, TexRow & texrow,
- int const i, int & column, LyXFont const & font,
+ LyXParagraph::size_type const i,
+ int & column, LyXFont const & font,
LyXLayout const & style)
-#endif
{
if (column > tex_code_break_column
&& i
&& GetChar(i - 1) != ' '
-#ifdef NEW_TEXT
&& (i < size() - 1)
-#else
- && (i < last-1)
-#endif
// In LaTeX mode, we don't want to
// break lines since some commands
// do not like this
}
-#ifdef NEW_TEXT
void LyXParagraph::SimpleTeXSpecialChars(string & file, TexRow & texrow,
- LyXFont & font, LyXFont & running_font,
+ LyXFont & font,
+ LyXFont & running_font,
LyXFont & basefont,
bool & open_font,
LyXLayout const & style,
- LyXParagraph::size_type & i, int &column, char const c)
-#else
-void LyXParagraph::SimpleTeXSpecialChars(string & file, TexRow & texrow,
- LyXFont & font, LyXFont & running_font,
- LyXFont & basefont,
- bool & open_font,
- LyXLayout const & style,
- int & i, int &column, char const c)
-#endif
+ LyXParagraph::size_type & i,
+ int & column, char const c)
{
// Two major modes: LaTeX or plain
// Handle here those cases common to both modes
// and then split to handle the two modes separately.
switch (c) {
- case LYX_META_INSET: {
+ case LyXParagraph::META_INSET: {
Inset * inset = GetInset(i);
if (inset) {
int len = file.length();
}
break;
- case LYX_META_NEWLINE:
+ case LyXParagraph::META_NEWLINE:
if (open_font) {
- column += running_font.latexWriteEndChanges(file, basefont);
+ column += running_font.latexWriteEndChanges(file,
+ basefont);
open_font = false;
}
basefont = getFont(-1);
running_font = basefont;
break;
- case LYX_META_HFILL:
+ case LyXParagraph::META_HFILL:
file += "\\hfill{}";
column += 7;
break;
// but I'll leave it as a switch statement
// so its simpler to extend. (ARRae)
switch (c) {
- case LYX_META_PROTECTED_SEPARATOR:
+ case LyXParagraph::META_PROTECTED_SEPARATOR:
file += ' ';
break;
} else {
// Plain mode (i.e. not LaTeX)
switch (c) {
- case LYX_META_PROTECTED_SEPARATOR:
+ case LyXParagraph::META_PROTECTED_SEPARATOR:
file += '~';
break;
file += c;
//... but we should avoid ligatures
if ((c == '>' || c == '<')
-#ifdef NEW_TEXT
&& i <= size() - 2
-#else
- && i <= last - 2
-#endif
&& GetChar(i+1) == c){
file += "\\textcompwordmark{}";
column += 19;
break;
case '-': // "--" in Typewriter mode -> "-{}-"
-#ifdef NEW_TEXT
if (i <= size() - 2
-#else
- if (i <= last - 2
-#endif
&& GetChar(i + 1) == '-'
&& font.family() == LyXFont::TYPEWRITER_FAMILY) {
file += "-{}";
/* idea for labels --- begin*/
/* check for LyX */
if (c == 'L'
-#ifdef NEW_TEXT
&& i <= size() - 3
-#else
- && i <= last - 3
-#endif
&& font.family() != LyXFont::TYPEWRITER_FAMILY
&& GetChar(i + 1) == 'y'
&& GetChar(i + 2) == 'X') {
}
/* check for TeX */
else if (c == 'T'
-#ifdef NEW_TEXT
&& i <= size() - 3
-#else
- && i <= last-3
-#endif
&& font.family() != LyXFont::TYPEWRITER_FAMILY
&& GetChar(i + 1) == 'e'
&& GetChar(i + 2) == 'X') {
}
/* check for LaTeX2e */
else if (c == 'L'
-#ifdef NEW_TEXT
&& i <= size() - 7
-#else
- && i <= last-7
-#endif
&& font.family() != LyXFont::TYPEWRITER_FAMILY
&& GetChar(i + 1) == 'a'
&& GetChar(i + 2) == 'T'
}
/* check for LaTeX */
else if (c == 'L'
-#ifdef NEW_TEXT
&& i <= size() - 5
-#else
- && i <= last - 5
-#endif
&& font.family() != LyXFont::TYPEWRITER_FAMILY
&& GetChar(i + 1) == 'a'
&& GetChar(i + 2) == 'T'
}
}
-#ifdef NEW_TEXT
+
bool LyXParagraph::RoffContTableRows(FILE * fp,
LyXParagraph::size_type i,
int actcell)
-#else
-bool LyXParagraph::RoffContTableRows(FILE * fp, int i, int actcell)
-#endif
{
if (!table)
return false;
while(cell >= 0) {
// first find the right position
i = lastpos;
-#ifdef NEW_TEXT
for (; i < size() && actcell < cell; ++i) {
-#else
- for (; i < last && actcell < cell; ++i) {
-#endif
c = GetChar(i);
- if (c == LYX_META_NEWLINE)
+ if (c == LyXParagraph::META_NEWLINE)
actcell++;
}
lastpos = i;
c = GetChar(i);
- if ((c != ' ') && (c != LYX_META_NEWLINE))
- fprintf(fp," ");
-#ifdef NEW_TEXT
- for (; i < size() && (c = GetChar(i)) != LYX_META_NEWLINE;
- ++i) {
-#else
- for (; (i < last) && ((c=GetChar(i)) != LYX_META_NEWLINE);
+ if ((c != ' ') && (c != LyXParagraph::META_NEWLINE))
+ fprintf(fp, " ");
+ for (; i < size()
+ && (c = GetChar(i)) != LyXParagraph::META_NEWLINE;
++i) {
-#endif
font2 = GetFontSettings(i);
if (font1.latex() != font2.latex()) {
if (font2.latex() != LyXFont::OFF)
}
c = GetChar(i);
switch (c) {
- case LYX_META_INSET:
+ case LyXParagraph::META_INSET:
if ((inset = GetInset(i))) {
- if (!(fp2=fopen(fname2.c_str(),"w+"))) {
- WriteAlert(_("LYX_ERROR:"), _("Cannot open temporary file:"), fname2);
+ if (!(fp2= fopen(fname2.c_str(), "w+"))) {
+ WriteAlert(_("LYX_ERROR:"),
+ _("Cannot open temporary file:"),
+ fname2);
return false;
}
inset->Latex(fp2,-1);
c = fgetc(fp2);
while(!feof(fp2)) {
if (c == '\\')
- fprintf(fp,"\\\\");
+ fprintf(fp, "\\\\");
else
- fputc(c,fp);
+ fputc(c, fp);
c = fgetc(fp2);
}
fclose(fp2);
}
break;
- case LYX_META_NEWLINE:
+ case LyXParagraph::META_NEWLINE:
break;
- case LYX_META_HFILL:
+ case LyXParagraph::META_HFILL:
break;
- case LYX_META_PROTECTED_SEPARATOR:
+ case LyXParagraph::META_PROTECTED_SEPARATOR:
break;
case '\\':
fprintf(fp, "\\\\");
return true;
}
+
LyXParagraph * LyXParagraph::TeXDeeper(string & file, TexRow & texrow,
string & foot, TexRow & foot_texrow,
int & foot_count)
if (IsDummy())
lyxerr << "ERROR (LyXParagraph::TeXEnvironment)" << endl;
- LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(), layout);
+ LyXLayout const & style = textclasslist.Style(GetCurrentTextClass(),
+ layout);
if (pextra_type == PEXTRA_INDENT) {
if (!pextra_width.empty()) {
file += "\\hfill{}\n";
texrow.newline();
}
- if (par_sep == LYX_PARSEP_INDENT) {
+ if (par_sep == BufferParams::PARSEP_INDENT) {
file += "{\\setlength\\parindent{0pt}\n";
texrow.newline();
}
file += "\\columnwidth}\n";
}
texrow.newline();
- if (par_sep == LYX_PARSEP_INDENT) {
+ if (par_sep == BufferParams::PARSEP_INDENT) {
file += "\\setlength\\parindent{\\LyXMinipageIndent}\n";
texrow.newline();
}
par->pextra_start_minipage) {
file += "\\end{minipage}\n";
texrow.newline();
- if (par_sep == LYX_PARSEP_INDENT) {
+ if (par_sep == BufferParams::PARSEP_INDENT) {
file += "}\n";
texrow.newline();
}
file += "\\hfill{}\n";
texrow.newline();
}
- if (par_sep == LYX_PARSEP_INDENT) {
+ if (par_sep == BufferParams::PARSEP_INDENT) {
file += "{\\setlength\\parindent{0pt}\n";
texrow.newline();
}
file += "\\columnwidth}\n";
}
texrow.newline();
- if (par_sep == LYX_PARSEP_INDENT) {
+ if (par_sep == BufferParams::PARSEP_INDENT) {
file += "\\setlength\\parindent{\\LyXMinipageIndent}\n";
texrow.newline();
}
par->pextra_type != PEXTRA_MINIPAGE)) {
file += "\\end{minipage}\n";
texrow.newline();
- if (par_sep == LYX_PARSEP_INDENT) {
+ if (par_sep == BufferParams::PARSEP_INDENT) {
file += "}\n";
texrow.newline();
}
file += "\\end{LyXParagraphIndent}\n";
texrow.newline();
}
- if (!(par && (par->pextra_type==PEXTRA_MINIPAGE)
+ if (!(par && (par->pextra_type == PEXTRA_MINIPAGE)
&& par->pextra_hfill)) {
file += '\n';
texrow.newline();
foot += "\\stepcounter{footnote}";
}
foot += "\\footnotetext{%\n";
- foot_texrow.start(this,0);
+ foot_texrow.start(this, 0);
foot_texrow.newline();
++foot_count;
}
par->pextra_widthp = widthp;
par = par->NextAfterFootnote();
if (par && (par->depth > depth))
- par->SetPExtraType(type,width,widthp);
+ par->SetPExtraType(type, width, widthp);
while (par && ((par->depth > depth) || par->IsDummy()))
par = par->NextAfterFootnote();
}
}
}
+
void LyXParagraph::UnsetPExtraType()
{
if (pextra_type == PEXTRA_NONE)
}
}
}
+
+
+bool LyXParagraph::IsHfill(size_type pos) const
+{
+ return IsHfillChar(GetChar(pos));
+}
+
+
+bool LyXParagraph::IsInset(size_type pos) const
+{
+ return IsInsetChar(GetChar(pos));
+}
+
+
+bool LyXParagraph::IsFloat(size_type pos) const
+{
+ return IsFloatChar(GetChar(pos));
+}
+
+
+bool LyXParagraph::IsNewline(size_type pos) const
+{
+ bool tmp = false;
+ if (pos >= 0)
+ tmp = IsNewlineChar(GetChar(pos));
+ return tmp;
+}
+
+
+bool LyXParagraph::IsSeparator(size_type pos) const
+{
+ return IsSeparatorChar(GetChar(pos));
+}
+
+
+bool LyXParagraph::IsLineSeparator(size_type pos) const
+{
+ return IsLineSeparatorChar(GetChar(pos));
+}
+
+
+bool LyXParagraph::IsKomma(size_type pos) const
+{
+ return IsKommaChar(GetChar(pos));
+}
+
+
+/// Used by the spellchecker
+bool LyXParagraph::IsLetter(LyXParagraph::size_type pos) const
+{
+ unsigned char c = GetChar(pos);
+ if (IsLetterChar(c))
+ return true;
+ // '\0' is not a letter, allthough every string contains "" (below)
+ if( c == '\0')
+ return false;
+ // We want to pass the ' and escape chars to ispell
+ string extra = lyxrc->isp_esc_chars + '\'';
+ char ch[2];
+ ch[0] = c;
+ ch[1] = 0;
+ return contains(extra, ch);
+}
+
+
+bool LyXParagraph::IsWord(size_type pos ) const
+{
+ return IsWordChar( GetChar(pos) ) ;
+}
FD_form_print *fdui = (FD_form_print *) fl_calloc(1, sizeof(FD_form_print));
fdui->form_print = fl_bgn_form(FL_NO_BOX, 340, 360);
- obj = fl_add_box(FL_UP_BOX,0,0,340,360,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,215,320,90,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_text(FL_NORMAL_TEXT,20,205,70,20,_("Print to"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->input_printer = obj = fl_add_input(FL_NORMAL_INPUT,90,225,230,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->input_file = obj = fl_add_input(FL_NORMAL_INPUT,90,265,230,30,"");
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 360, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 215, 320, 90, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 205, 70, 20, _("Print to"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->input_printer = obj = fl_add_input(FL_NORMAL_INPUT, 90, 225, 230, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->input_file = obj = fl_add_input(FL_NORMAL_INPUT, 90, 265, 230, 30, "");
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fdui->group_radio_printto = fl_bgn_group();
- fdui->radio_printer = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,225,80,30,idex(_("Printer|#P")));fl_set_button_shortcut(obj,scex(_("Printer|#P")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_file = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,265,80,30,idex(_("File|#F")));fl_set_button_shortcut(obj,scex(_("File|#F")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_printer = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 225, 80, 30, idex(_("Printer|#P")));fl_set_button_shortcut(obj, scex(_("Printer|#P")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_file = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 265, 80, 30, idex(_("File|#F")));fl_set_button_shortcut(obj, scex(_("File|#F")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- obj = fl_add_frame(FL_ENGRAVED_FRAME,180,20,150,70,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,20,160,180,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_button(FL_RETURN_BUTTON,10,315,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PrintOKCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,120,315,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PrintApplyCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,230,315,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,PrintCancelCB,0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 180, 20, 150, 70, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 160, 180, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_button(FL_RETURN_BUTTON, 10, 315, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PrintOKCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 120, 315, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PrintApplyCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 230, 315, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, PrintCancelCB, 0);
fdui->group_radio_pages = fl_bgn_group();
- fdui->radio_all_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,30,160,30,idex(_("All Pages|#G")));fl_set_button_shortcut(obj,scex(_("All Pages|#G")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_odd_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,60,160,30,idex(_("Only Odd Pages|#O")));fl_set_button_shortcut(obj,scex(_("Only Odd Pages|#O")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_even_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,90,160,30,idex(_("Only Even Pages|#E")));fl_set_button_shortcut(obj,scex(_("Only Even Pages|#E")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_all_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 160, 30, idex(_("All Pages|#G")));fl_set_button_shortcut(obj, scex(_("All Pages|#G")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_odd_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 160, 30, idex(_("Only Odd Pages|#O")));fl_set_button_shortcut(obj, scex(_("Only Odd Pages|#O")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_even_pages = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 90, 160, 30, idex(_("Only Even Pages|#E")));fl_set_button_shortcut(obj, scex(_("Only Even Pages|#E")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
fdui->group_radio_order = fl_bgn_group();
- fdui->radio_order_normal = obj = fl_add_checkbutton(FL_RADIO_BUTTON,180,30,150,30,idex(_("Normal Order|#N")));fl_set_button_shortcut(obj,scex(_("Normal Order|#N")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_order_reverse = obj = fl_add_checkbutton(FL_RADIO_BUTTON,180,60,150,30,idex(_("Reverse Order|#R")));fl_set_button_shortcut(obj,scex(_("Reverse Order|#R")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_order_normal = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 180, 30, 150, 30, idex(_("Normal Order|#N")));fl_set_button_shortcut(obj, scex(_("Normal Order|#N")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_order_reverse = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 180, 60, 150, 30, idex(_("Reverse Order|#R")));fl_set_button_shortcut(obj, scex(_("Reverse Order|#R")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- obj = fl_add_text(FL_NORMAL_TEXT,200,10,60,20,_("Order"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,50,20,_("Print"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->input_pages = obj = fl_add_input(FL_NORMAL_INPUT,20,160,140,30,_("Pages:"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,180,110,150,90,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_text(FL_NORMAL_TEXT,200,95,50,20,_("Copies"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->input_copies = obj = fl_add_input(FL_NORMAL_INPUT,190,160,130,30,_("Count:"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- fdui->do_unsorted = obj = fl_add_checkbutton(FL_PUSH_BUTTON,180,115,140,30,idex(_("Unsorted|#U")));fl_set_button_shortcut(obj,scex(_("Unsorted|#U")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 200, 10, 60, 20, _("Order"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 50, 20, _("Print"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->input_pages = obj = fl_add_input(FL_NORMAL_INPUT, 20, 160, 140, 30, _("Pages:"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 180, 110, 150, 90, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_text(FL_NORMAL_TEXT, 200, 95, 50, 20, _("Copies"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->input_copies = obj = fl_add_input(FL_NORMAL_INPUT, 190, 160, 130, 30, _("Count:"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ fdui->do_unsorted = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 180, 115, 140, 30, idex(_("Unsorted|#U")));fl_set_button_shortcut(obj, scex(_("Unsorted|#U")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_form();
//fdui->form_print->fdui = fdui;
FD_form_sendto *fdui = (FD_form_sendto *) fl_calloc(1, sizeof(FD_form_sendto));
fdui->form_sendto = fl_bgn_form(FL_NO_BOX, 340, 210);
- obj = fl_add_box(FL_UP_BOX,0,0,340,210,"");
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,20,310,80,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,80,20,_("File Type"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- fdui->input_cmd = obj = fl_add_input(FL_NORMAL_INPUT,10,130,320,30,idex(_("Command:|#C")));fl_set_button_shortcut(obj,scex(_("Command:|#C")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT);
- obj = fl_add_button(FL_RETURN_BUTTON,10,170,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,SendtoOKCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,120,170,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,SendtoApplyCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,230,170,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_callback(obj,SendtoCancelCB,0);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 210, "");
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 310, 80, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 80, 20, _("File Type"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ fdui->input_cmd = obj = fl_add_input(FL_NORMAL_INPUT, 10, 130, 320, 30, idex(_("Command:|#C")));fl_set_button_shortcut(obj, scex(_("Command:|#C")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT);
+ obj = fl_add_button(FL_RETURN_BUTTON, 10, 170, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SendtoOKCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 120, 170, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SendtoApplyCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 230, 170, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SendtoCancelCB, 0);
fdui->group_ftype = fl_bgn_group();
- fdui->radio_ftype_dvi = obj = fl_add_checkbutton(FL_RADIO_BUTTON,110,30,110,30,idex(_("DVI|#D")));fl_set_button_shortcut(obj,scex(_("DVI|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_ftype_ps = obj = fl_add_checkbutton(FL_RADIO_BUTTON,110,60,110,30,idex(_("Postscript|#P")));fl_set_button_shortcut(obj,scex(_("Postscript|#P")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_ftype_latex = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,60,100,30,idex(_("LaTeX|#T")));fl_set_button_shortcut(obj,scex(_("LaTeX|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_ftype_dvi = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 30, 110, 30, idex(_("DVI|#D")));fl_set_button_shortcut(obj, scex(_("DVI|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_ftype_ps = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 110, 60, 110, 30, idex(_("Postscript|#P")));fl_set_button_shortcut(obj, scex(_("Postscript|#P")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_ftype_latex = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 100, 30, idex(_("LaTeX|#T")));fl_set_button_shortcut(obj, scex(_("LaTeX|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_button(obj, 1);
- fdui->radio_ftype_lyx = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,30,100,30,idex(_("LyX|#L")));fl_set_button_shortcut(obj,scex(_("LyX|#L")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->radio_ftype_ascii = obj = fl_add_checkbutton(FL_RADIO_BUTTON,220,30,90,30,idex(_("Ascii|#s")));fl_set_button_shortcut(obj,scex(_("Ascii|#s")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->radio_ftype_lyx = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 100, 30, idex(_("LyX|#L")));fl_set_button_shortcut(obj, scex(_("LyX|#L")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->radio_ftype_ascii = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 220, 30, 90, 30, idex(_("Ascii|#s")));fl_set_button_shortcut(obj, scex(_("Ascii|#s")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
fl_end_form();
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1998 The LyX Team
*
-*======================================================*/
+* ====================================================== */
#include <config.h>
Dimension offset_x,
Dimension offset_y,
LyXText *text_ptr)
- : text(text_ptr),_window(window),
- _width(width),_height(height),
+ : text(text_ptr), _window(window),
+ _width(width), _height(height),
_offset_x(offset_x), _offset_y(offset_y)
{
first = 0;
/* ok there is something visible */
text->GetVisibleRow(*this, y, row, y + first);
}
- y_text+=row->height;
+ y_text+= row->height;
}
cursor_pixmap_h = y2 - y1 + 1;
cursor_pixmap_x = x;
cursor_pixmap_y = y1;
- cursor_pixmap =
+ cursor_pixmap =
XCreatePixmap(fl_display,
fl_root,
cursor_pixmap_w,
void LyXScreen::HideManualCursor(long x, long y, int asc, int desc){
if (fast_selection || mono_video)
- ShowManualCursor(x,y,asc,desc);
+ ShowManualCursor(x, y, asc, desc);
else
HideCursor();
}
y1 = y - first - asc;
if (y1 < 0)
- y1 =0;
+ y1 = 0;
y2 = y -first + desc;
if (y2 > _height)
y2 = _height;
cursor_pixmap_h = y2 - y1 + 1;
cursor_pixmap_x = x,
cursor_pixmap_y = y1;
- cursor_pixmap =
+ cursor_pixmap =
XCreatePixmap (fl_display,
fl_root,
cursor_pixmap_w,
top = 0;
if (bottom > _height)
bottom = _height;
- XFillRectangle(fl_display,_window,
+ XFillRectangle(fl_display, _window,
getGC(gc_select),
text->sel_start_cursor.x
+_offset_x,
top = 0;
if (bottom > _height)
bottom = _height;
- XFillRectangle(fl_display,_window,
+ XFillRectangle(fl_display, _window,
getGC(gc_select),
text->sel_start_cursor.x
+_offset_x,
/* the main body */
- if (text->sel_start_cursor.row->next !=
+ if (text->sel_start_cursor.row->next !=
text->sel_end_cursor.row) {
top = text->sel_start_cursor.y
- text->sel_start_cursor.row->baseline
top = 0;
if (bottom > _height)
bottom = _height;
- XFillRectangle(fl_display,_window,
+ XFillRectangle(fl_display, _window,
getGC(gc_select),
0+_offset_x,
top+_offset_y,
bottom = top + text->toggle_cursor.row->height;
if (top < 0) top = 0;
if (bottom > _height) bottom = _height;
- XFillRectangle(fl_display,_window,
+ XFillRectangle(fl_display, _window,
getGC(gc_select),
text->toggle_cursor.x+_offset_x,
top+_offset_y,
top = 0;
if (bottom > _height)
bottom = _height;
- XFillRectangle(fl_display,_window,
+ XFillRectangle(fl_display, _window,
getGC(gc_select),
text->toggle_cursor.x+_offset_x,
top+_offset_y,
/* the main body */
- if (text->toggle_cursor.row->next !=
+ if (text->toggle_cursor.row->next !=
text->toggle_end_cursor.row) {
top = text->toggle_cursor.y
- text->toggle_cursor.row->baseline
top = first + _height;
if (top != bottom) {
- XFillRectangle(fl_display,_window,
+ XFillRectangle(fl_display, _window,
getGC(gc_select),
0+_offset_x,
top - first+_offset_y,
top = 0;
if (bottom > _height)
bottom = _height;
- XFillRectangle(fl_display,_window,
+ XFillRectangle(fl_display, _window,
getGC(gc_select),
0+_offset_x,
top+_offset_y,
// I think these calls to fl_color might make xforms sometimes
// draw the wrong color on other objects.
fl_color(FL_TOP_BCOL);
- XFillRectangle(fl_display, foreground, fl_gc,x-d,y-d,w+2*d,d);
+ XFillRectangle(fl_display, foreground, fl_gc, x-d, y-d, w+2*d, d);
fl_color(FL_BOTTOM_BCOL);
- XFillRectangle(fl_display, foreground, fl_gc,x-d,y+h,w+2*d,d);
+ XFillRectangle(fl_display, foreground, fl_gc, x-d, y+h, w+2*d, d);
// Now a couple of trapezoids
XPoint pl[4], pr[4];
FD_form_spell_options *fdui = (FD_form_spell_options *) fl_calloc(1, sizeof(FD_form_spell_options));
fdui->form_spell_options = fl_bgn_form(FL_NO_BOX, 340, 400);
- obj = fl_add_box(FL_UP_BOX,0,0,340,400,"");
- fl_set_object_lsize(obj,0);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,20,320,110,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
- obj = fl_add_frame(FL_ENGRAVED_FRAME,10,150,320,200,"");
- fl_set_object_color(obj,FL_COL1,FL_COL1);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 400, "");
+ fl_set_object_lsize(obj, 0);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 20, 320, 110, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
+ obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 150, 320, 200, "");
+ fl_set_object_color(obj, FL_COL1, FL_COL1);
fdui->lang_buts = fl_bgn_group();
- fdui->buflang = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,30,320,30,idex(_("Use language of document|#D")));fl_set_button_shortcut(obj,scex(_("Use language of document|#D")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->altlang = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,60,320,30,idex(_("Use alternate language:|#U")));fl_set_button_shortcut(obj,scex(_("Use alternate language:|#U")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->buflang = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 30, 320, 30, idex(_("Use language of document|#D")));fl_set_button_shortcut(obj, scex(_("Use language of document|#D")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->altlang = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 60, 320, 30, idex(_("Use alternate language:|#U")));fl_set_button_shortcut(obj, scex(_("Use alternate language:|#U")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_end_group();
- fdui->altlang_input = obj = fl_add_input(FL_NORMAL_INPUT,40,90,240,30,"");
- fl_set_object_lsize(obj,0);
- fdui->compounds = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,160,320,30,idex(_("Treat run-together words as legal|#T")));fl_set_button_shortcut(obj,scex(_("Treat run-together words as legal|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->inpenc = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,190,320,30,idex(_("Input Encoding switch to ispell|#I")));fl_set_button_shortcut(obj,scex(_("Input Encoding switch to ispell|#I")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON,10,360,100,30,_("OK"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fdui->altlang_input = obj = fl_add_input(FL_NORMAL_INPUT, 40, 90, 240, 30, "");
+ fl_set_object_lsize(obj, 0);
+ fdui->compounds = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 160, 320, 30, idex(_("Treat run-together words as legal|#T")));fl_set_button_shortcut(obj, scex(_("Treat run-together words as legal|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->inpenc = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 190, 320, 30, idex(_("Input Encoding switch to ispell|#I")));fl_set_button_shortcut(obj, scex(_("Input Encoding switch to ispell|#I")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->ok = obj = fl_add_button(FL_RETURN_BUTTON, 10, 360, 100, 30, _("OK"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SpellOptionsOKCB,0);
- obj = fl_add_button(FL_NORMAL_BUTTON,230,360,100,30,idex(_("Cancel|^[")));fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SpellOptionsOKCB, 0);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 230, 360, 100, 30, idex(_("Cancel|^[")));fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SpellOptionsCancelCB,0);
- fdui->perdict = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,220,320,30,idex(_("Use alternate personal dictionary:|#P")));fl_set_button_shortcut(obj,scex(_("Use alternate personal dictionary:|#P")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->esc_chars = obj = fl_add_checkbutton(FL_PUSH_BUTTON,10,280,320,30,idex(_("Extra special chars allowed in words:|#E")));fl_set_button_shortcut(obj,scex(_("Extra special chars allowed in words:|#E")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->perdict_input = obj = fl_add_input(FL_NORMAL_INPUT,40,250,240,30,"");
- fl_set_object_lsize(obj,0);
- fdui->esc_chars_input = obj = fl_add_input(FL_NORMAL_INPUT,40,310,240,30,"");
- fl_set_object_lsize(obj,0);
- obj = fl_add_text(FL_NORMAL_TEXT,20,10,90,20,_("Dictionary"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_text(FL_NORMAL_TEXT,30,140,70,20,_("Options"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fl_set_object_lstyle(obj,FL_BOLD_STYLE);
- obj = fl_add_button(FL_NORMAL_BUTTON,120,360,100,30,idex(_("Apply|#A")));fl_set_button_shortcut(obj,scex(_("Apply|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ fl_set_object_callback(obj, SpellOptionsCancelCB, 0);
+ fdui->perdict = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 220, 320, 30, idex(_("Use alternate personal dictionary:|#P")));fl_set_button_shortcut(obj, scex(_("Use alternate personal dictionary:|#P")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->esc_chars = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 10, 280, 320, 30, idex(_("Extra special chars allowed in words:|#E")));fl_set_button_shortcut(obj, scex(_("Extra special chars allowed in words:|#E")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->perdict_input = obj = fl_add_input(FL_NORMAL_INPUT, 40, 250, 240, 30, "");
+ fl_set_object_lsize(obj, 0);
+ fdui->esc_chars_input = obj = fl_add_input(FL_NORMAL_INPUT, 40, 310, 240, 30, "");
+ fl_set_object_lsize(obj, 0);
+ obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 90, 20, _("Dictionary"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_text(FL_NORMAL_TEXT, 30, 140, 70, 20, _("Options"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fl_set_object_lstyle(obj, FL_BOLD_STYLE);
+ obj = fl_add_button(FL_NORMAL_BUTTON, 120, 360, 100, 30, idex(_("Apply|#A")));fl_set_button_shortcut(obj, scex(_("Apply|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
- fl_set_object_callback(obj,SpellOptionsApplyCB,0);
+ fl_set_object_callback(obj, SpellOptionsApplyCB, 0);
fl_end_form();
//fdui->form_spell_options->fdui = fdui;
FD_form_spell_check *fdui = (FD_form_spell_check *) fl_calloc(1, sizeof(FD_form_spell_check));
fdui->form_spell_check = fl_bgn_form(FL_NO_BOX, 540, 280);
- obj = fl_add_box(FL_UP_BOX,0,0,540,280,"");
- fl_set_object_lsize(obj,0);
- fdui->text = obj = fl_add_text(FL_NORMAL_TEXT,80,10,220,30,"");
- fl_set_object_boxtype(obj,FL_DOWN_BOX);
- fl_set_object_lsize(obj,0);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
- fdui->input = obj = fl_add_input(FL_NORMAL_INPUT,80,40,220,30,_("Replace"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->browser = obj = fl_add_browser(FL_SELECT_BROWSER,80,70,220,150,_("Near\nMisses"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
- fdui->options = obj = fl_add_button(FL_NORMAL_BUTTON,310,210,220,30,idex(_("Spellchecker Options...|#O")));fl_set_button_shortcut(obj,scex(_("Spellchecker Options...|#O")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->start = obj = fl_add_button(FL_NORMAL_BUTTON,310,10,220,30,idex(_("Start spellchecking|#S")));fl_set_button_shortcut(obj,scex(_("Start spellchecking|#S")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->insert = obj = fl_add_button(FL_NORMAL_BUTTON,310,50,220,30,idex(_("Insert in personal dictionary|#I")));fl_set_button_shortcut(obj,scex(_("Insert in personal dictionary|#I")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->ignore = obj = fl_add_button(FL_NORMAL_BUTTON,310,110,220,30,idex(_("Ignore word|#g")));fl_set_button_shortcut(obj,scex(_("Ignore word|#g")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->accept = obj = fl_add_button(FL_NORMAL_BUTTON,310,80,220,30,idex(_("Accept word in this session|#A")));fl_set_button_shortcut(obj,scex(_("Accept word in this session|#A")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->stop = obj = fl_add_button(FL_NORMAL_BUTTON,310,180,220,30,idex(_("Stop spellchecking|#T")));fl_set_button_shortcut(obj,scex(_("Stop spellchecking|#T")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->done = obj = fl_add_button(FL_NORMAL_BUTTON,310,240,220,30,idex(_("Close Spellchecker|#C^[")));fl_set_button_shortcut(obj,scex(_("Close Spellchecker|#C^[")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
+ obj = fl_add_box(FL_UP_BOX, 0, 0, 540, 280, "");
+ fl_set_object_lsize(obj, 0);
+ fdui->text = obj = fl_add_text(FL_NORMAL_TEXT, 80, 10, 220, 30, "");
+ fl_set_object_boxtype(obj, FL_DOWN_BOX);
+ fl_set_object_lsize(obj, 0);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ fdui->input = obj = fl_add_input(FL_NORMAL_INPUT, 80, 40, 220, 30, _("Replace"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->browser = obj = fl_add_browser(FL_SELECT_BROWSER, 80, 70, 220, 150, _("Near\nMisses"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
+ fdui->options = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 210, 220, 30, idex(_("Spellchecker Options...|#O")));fl_set_button_shortcut(obj, scex(_("Spellchecker Options...|#O")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->start = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 10, 220, 30, idex(_("Start spellchecking|#S")));fl_set_button_shortcut(obj, scex(_("Start spellchecking|#S")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->insert = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 50, 220, 30, idex(_("Insert in personal dictionary|#I")));fl_set_button_shortcut(obj, scex(_("Insert in personal dictionary|#I")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->ignore = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 110, 220, 30, idex(_("Ignore word|#g")));fl_set_button_shortcut(obj, scex(_("Ignore word|#g")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->accept = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 80, 220, 30, idex(_("Accept word in this session|#A")));fl_set_button_shortcut(obj, scex(_("Accept word in this session|#A")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->stop = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 180, 220, 30, idex(_("Stop spellchecking|#T")));fl_set_button_shortcut(obj, scex(_("Stop spellchecking|#T")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->done = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 240, 220, 30, idex(_("Close Spellchecker|#C^[")));fl_set_button_shortcut(obj, scex(_("Close Spellchecker|#C^[")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
// xgettext:no-c-format
- obj = fl_add_box(FL_NO_BOX,10,250,50,20,_("0 %"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
+ obj = fl_add_box(FL_NO_BOX, 10, 250, 50, 20, _("0 %"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
// xgettext:no-c-format
- obj = fl_add_box(FL_NO_BOX,250,250,50,20,_("100 %"));
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fl_set_object_lalign(obj,FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
- fdui->replace = obj = fl_add_button(FL_NORMAL_BUTTON,310,140,220,30,idex(_("Replace word|#R")));fl_set_button_shortcut(obj,scex(_("Replace word|#R")),1);
- fl_set_object_lsize(obj,FL_NORMAL_SIZE);
- fdui->slider = obj = fl_add_slider(FL_HOR_FILL_SLIDER,10,230,290,20,"");
- fl_set_object_color(obj,FL_BLUE,FL_COL1);
- fl_set_object_lsize(obj,0);
- fl_set_object_lalign(obj,FL_ALIGN_LEFT);
+ obj = fl_add_box(FL_NO_BOX, 250, 250, 50, 20, _("100 %"));
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fl_set_object_lalign(obj, FL_ALIGN_RIGHT|FL_ALIGN_INSIDE);
+ fdui->replace = obj = fl_add_button(FL_NORMAL_BUTTON, 310, 140, 220, 30, idex(_("Replace word|#R")));fl_set_button_shortcut(obj, scex(_("Replace word|#R")), 1);
+ fl_set_object_lsize(obj, FL_NORMAL_SIZE);
+ fdui->slider = obj = fl_add_slider(FL_HOR_FILL_SLIDER, 10, 230, 290, 20, "");
+ fl_set_object_color(obj, FL_BLUE, FL_COL1);
+ fl_set_object_lsize(obj, 0);
+ fl_set_object_lalign(obj, FL_ALIGN_LEFT);
fl_end_form();
//fdui->form_spell_check->fdui = fdui;
/*
*This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1998 The LyX Team
*
- *======================================================
+ * ======================================================
*/
#include <config.h>
lyxrc->isp_alt_lang.c_str());
}
if (lyxrc->isp_use_alt_lang) {
- fl_set_button(fd_form_spell_options->buflang,0);
- fl_set_button(fd_form_spell_options->altlang,1);
+ fl_set_button(fd_form_spell_options->buflang, 0);
+ fl_set_button(fd_form_spell_options->altlang, 1);
} else {
- fl_set_button(fd_form_spell_options->buflang,1);
- fl_set_button(fd_form_spell_options->altlang,0);
+ fl_set_button(fd_form_spell_options->buflang, 1);
+ fl_set_button(fd_form_spell_options->altlang, 0);
}
// Personal dictionary
void SpellOptionsApplyCB(FL_OBJECT *, long)
{
// Build new status from form data
- lyxrc->isp_use_alt_lang =
+ lyxrc->isp_use_alt_lang =
fl_get_button(fd_form_spell_options->altlang);
- lyxrc->isp_use_pers_dict =
+ lyxrc->isp_use_pers_dict =
fl_get_button(fd_form_spell_options->perdict);
- lyxrc->isp_accept_compound =
+ lyxrc->isp_accept_compound =
fl_get_button(fd_form_spell_options->compounds);
- lyxrc->isp_use_esc_chars =
+ lyxrc->isp_use_esc_chars =
fl_get_button(fd_form_spell_options->esc_chars);
- lyxrc->isp_use_input_encoding =
+ lyxrc->isp_use_input_encoding =
fl_get_button(fd_form_spell_options->inpenc);
// Update strings with data from input fields
- lyxrc->isp_alt_lang =
+ lyxrc->isp_alt_lang =
fl_get_input(fd_form_spell_options->altlang_input);
- lyxrc->isp_pers_dict =
+ lyxrc->isp_pers_dict =
fl_get_input(fd_form_spell_options->perdict_input);
- lyxrc->isp_esc_chars =
+ lyxrc->isp_esc_chars =
fl_get_input(fd_form_spell_options->esc_chars_input);
// Update form
fl_raise_form(fd_form_spell_options->form_spell_options);
} else {
fl_show_form(fd_form_spell_options->form_spell_options,
- FL_PLACE_MOUSE,FL_FULLBORDER,
+ FL_PLACE_MOUSE, FL_FULLBORDER,
_("Spellchecker Options"));
}
}
isp_pid = -1;
- if(pipe(pipein)==-1 || pipe(pipeout)==-1) {
+ if(pipe(pipein) == -1 || pipe(pipeout) == -1) {
lyxerr << "LyX: Can't create pipe for spellchecker!" << endl;
return;
}
- if ((out = fdopen(pipein[1], "w"))==0) {
+ if ((out = fdopen(pipein[1], "w")) == 0) {
lyxerr << "LyX: Can't create stream for pipe for spellchecker!"
<< endl;
return;
}
- if ((in = fdopen(pipeout[0], "r"))==0) {
+ if ((in = fdopen(pipeout[0], "r")) == 0) {
lyxerr <<"LyX: Can't create stream for pipe for spellchecker!"
<< endl;
return;
isp_pid = fork();
- if(isp_pid==-1) {
+ if(isp_pid == -1) {
lyxerr << "LyX: Can't create child process for spellchecker!"
<< endl;
return;
}
- if(isp_pid==0) {
+ if(isp_pid == 0) {
/* child process */
dup2(pipein[0], STDIN_FILENO);
dup2(pipeout[1], STDOUT_FILENO);
// Specify an alternate personal dictionary
tmp = new char[3];
string("-p").copy(tmp, 2);
- tmp[2]='\0';
+ tmp[2]= '\0';
argv[argc++] = tmp;
tmp = new char[lyxrc->isp_pers_dict.length() + 1];
lyxrc->isp_pers_dict.copy(tmp, lyxrc->isp_pers_dict.length());
// free the memory used by string::copy in the
// setup of argv
- for (int i=0; i < argc -1; i++)
+ for (int i= 0; i < argc -1; i++)
delete[] argv[i];
lyxerr << "LyX: Failed to start ispell!" << endl;
result->str = buf;
char * nb = new char[result->str.length() + 1];
result->str.copy(nb, result->str.length());
- nb[result->str.length()]='\0';
+ nb[result->str.length()]= '\0';
p = strpbrk(nb+2, " ");
sscanf(p, "%d", &count); // Get near misses count
result->count = count;
if (count) result->misses = new char*[count];
p = strpbrk(nb, ":");
- p +=2;
+ p += 2;
for (i = 0; i<count; i++) {
result->misses[i] = p;
p = strpbrk(p, ",\n");
*p = 0;
- p+=2;
+ p+= 2;
}
break;
}
}
*buf = 0;
- if (result->flag!=ISP_IGNORE) {
- while (*buf!='\n') fgets(buf, 255, in); /* wait for ispell to finish */
+ if (result->flag!= ISP_IGNORE) {
+ while (*buf!= '\n') fgets(buf, 255, in); /* wait for ispell to finish */
}
return result;
}
}
static
-inline void ispell_store_replacement(const char *mis, string const & cor) {
+inline void ispell_store_replacement(char const *mis, string const & cor) {
if(actual_spell_checker == ASC_ASPELL) {
fputs("$$ra ", out);
fputs(mis, out);
fl_raise_form(fd_form_spell_check->form_spell_check);
} else {
fl_show_form(fd_form_spell_check->form_spell_check,
- FL_PLACE_MOUSE,FL_FULLBORDER,
+ FL_PLACE_MOUSE, FL_FULLBORDER,
_("Spellchecker"));
}
fl_deactivate_object(fd_form_spell_check->slider);
while (true) {
word = NextWord(newval);
- if (word==0) break;
+ if (word == 0) break;
word_count++;
// Update slider if and only if value has changed
newvalue = int(100.0*newval);
- if(newvalue!=oldval) {
+ if(newvalue!= oldval) {
oldval = newvalue;
fl_set_slider_value(fd_form_spell_check->slider, oldval);
}
result = ispell_check_word(word);
- if (isp_pid==-1) {
+ if (isp_pid == -1) {
delete[] word;
break;
}
fl_set_object_label(fd_form_spell_check->text, word);
fl_set_input(fd_form_spell_check->input, word);
fl_clear_browser(fd_form_spell_check->browser);
- for (i=0; i<result->count; i++) {
+ for (i= 0; i<result->count; i++) {
fl_add_browser_line(fd_form_spell_check->browser, result->misses[i]);
}
clickline = -1;
while (true) {
obj = fl_do_forms();
- if (obj==fd_form_spell_check->insert) {
+ if (obj == fd_form_spell_check->insert) {
ispell_insert_word(word);
break;
}
- if (obj==fd_form_spell_check->accept) {
+ if (obj == fd_form_spell_check->accept) {
ispell_accept_word(word);
break;
}
- if (obj==fd_form_spell_check->ignore) {
+ if (obj == fd_form_spell_check->ignore) {
break;
}
- if (obj==fd_form_spell_check->replace ||
- obj==fd_form_spell_check->input) {
+ if (obj == fd_form_spell_check->replace ||
+ obj == fd_form_spell_check->input) {
ispell_store_replacement(word, fl_get_input(fd_form_spell_check->input));
ReplaceWord(fl_get_input(fd_form_spell_check->input));
break;
}
- if (obj==fd_form_spell_check->browser) {
+ if (obj == fd_form_spell_check->browser) {
// implements double click in the browser window.
// sent to lyx@via by Mark Burton <mark@cbl.leeds.ac.uk>
- if (clickline ==
+ if (clickline ==
fl_get_browser(fd_form_spell_check->browser)) {
ispell_store_replacement(word, fl_get_input(fd_form_spell_check->input));
ReplaceWord(fl_get_input(fd_form_spell_check->input));
fl_get_browser(fd_form_spell_check->browser)));
}
- if (obj==fd_form_spell_check->stop) {
+ if (obj == fd_form_spell_check->stop) {
delete result;
delete[] word;
ispell_terminate();
return true;
}
- if (obj==fd_form_spell_check->done) {
+ if (obj == fd_form_spell_check->done) {
delete result;
delete[] word;
ispell_terminate();
}
}
- if(isp_pid!=-1) {
+ if(isp_pid!= -1) {
ispell_terminate();
string word_msg;
word_msg += tostr(word_count);
} else {
word_msg += _(" word checked.");
}
- fl_show_message("",_("Spellchecking completed!"),
+ fl_show_message("", _("Spellchecking completed!"),
word_msg.c_str());
return false;
} else {
//int status ;
if (isp_pid>0)
- //if (waitpid(isp_pid,&status,WNOHANG)==isp_pid) {
+ //if (waitpid(isp_pid, &status, WNOHANG) == isp_pid) {
if (pid == isp_pid) {
- isp_pid=-1;
+ isp_pid= -1;
fcntl(isp_fd, F_SETFL, O_NONBLOCK); /* set the file descriptor
to nonblocking so we can
continue */
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1998 The LyX Team.
*
- *======================================================
+ * ======================================================
*/
#include <config.h>
delete[] columnofcell;
delete[] column_info;
delete[] row_info;
- for (i=0; i<rows; i++) {
+ for (i = 0; i<rows; i++) {
delete[] cell_info[i]; // verify that this shoudn't be freed with delete
}
delete[] cell_info;
LyXTable *result = new LyXTable(rows, columns);
int row, column;;
- for (row=0; row<rows; row++){
- for (column=0; column<columns;column++){
+ for (row = 0; row<rows; row++){
+ for (column = 0; column<columns;column++){
result->cell_info[row][column] = cell_info[row][column];
}
}
- for (row=0; row<rows; row++){
+ for (row = 0; row<rows; row++){
result->row_info[row] = row_info[row];
}
- for (column=0; column<columns; column++){
+ for (column = 0; column<columns; column++){
result->column_info[column].left_line = column_info[column].left_line;
result->column_info[column].right_line = column_info[column].right_line;
result->column_info[column].alignment = column_info[column].alignment;
}
result->SetLongTable(is_long_table);
- result->rotate=rotate;
+ result->rotate = rotate;
result->Reinit();
return result;
}
/* activates all lines and sets all widths to 0 */
void LyXTable::Init(int rows_arg, int columns_arg)
{
- int i,j,cellno;
+ int i, j, cellno;
rows = rows_arg;
columns = columns_arg;
column_info = new columnstruct[columns];
cell_info = new cellstruct*[rows];
cellno = 0;
- for (i=0; i<rows;i++) {
+ for (i = 0; i<rows;i++) {
cell_info[i] = new cellstruct[columns];
row_info[i].top_line = true;
row_info[i].bottom_line = false;
row_info[i].is_cont_row = false;
row_info[i].newpage = false;
- for (j=0; j<columns; j++) {
+ for (j = 0; j<columns; j++) {
cell_info[i][j].cellno = cellno++;
cell_info[i][j].width_of_cell = 0;
cell_info[i][j].multicolumn = LyXTable::CELL_NORMAL;
row_info[i-1].bottom_line = true;
row_info[0].bottom_line = true;
- for (i=0; i<columns;i++) {
+ for (i = 0; i<columns;i++) {
column_info[i].left_line = true;
column_info[i].right_line = false;
column_info[i].alignment = LYX_ALIGN_CENTER;
cellstruct** cell_info2 = new cellstruct*[rows+1];
int i;
- for (i=0; i <= row; i++) {
+ for (i = 0; i <= row; i++) {
cell_info2[i] = cell_info[i];
row_info2[i] = row_info[i];
}
- for (i=rows-1; i >= row; i--) {
+ for (i = rows-1; i >= row; i--) {
cell_info2[i+1] = cell_info[i];
row_info2[i+1] = row_info[i];
}
- for (i=row;row_info[i].is_cont_row;i--);
- if (((row+1)>=rows) || !row_info[row+1].is_cont_row)
+ for (i = row;row_info[i].is_cont_row;i--);
+ if (((row+1)>= rows) || !row_info[row+1].is_cont_row)
row_info2[row+1].is_cont_row = false;
row_info2[row+1].top_line = row_info[i].top_line;
cell_info2[row+1] = new cellstruct[columns];
- for (i=0; i<columns; i++) {
+ for (i = 0; i<columns; i++) {
cell_info2[row+1][i].width_of_cell = 0;
cell_info2[row+1][i] = cell_info2[row][i];
}
int i;
delete[] cell_info[row];
- for (i=0; i < row; i++) {
+ for (i = 0; i < row; i++) {
cell_info2[i] = cell_info[i];
row_info2[i] = row_info[i];
}
if (row_info[i].is_cont_row)
row_info2[i-1].bottom_line = row_info[i].bottom_line;
- for (i=row; i < rows - 1; i++) {
+ for (i = row; i < rows - 1; i++) {
cell_info2[i] = cell_info[i+1];
row_info2[i] = row_info[i+1];
}
void LyXTable::AppendColumn(int cell)
{
- int i,j;
+ int i, j;
columnstruct *column_info2 = new columnstruct[columns+1];
int column = right_column_of_cell(cell);
- for (i=0; i<=column; i++){
+ for (i = 0; i<= column; i++){
column_info2[i] = column_info[i];
}
- for (i=columns-1; i>=column; i--){
+ for (i = columns-1; i>= column; i--){
column_info2[i+1] = column_info[i];
}
delete[] column_info;
column_info = column_info2;
- for (i=0; i<rows;i++){
+ for (i = 0; i<rows;i++){
cellstruct* tmp = cell_info[i];
cell_info[i] = new cellstruct[columns+1];
- for (j=0; j<=column; j++){
- cell_info[i][j]=tmp[j];
+ for (j = 0; j<= column; j++){
+ cell_info[i][j] = tmp[j];
}
- for (j=column; j<columns; j++){
- cell_info[i][j+1]=tmp[j];
+ for (j = column; j<columns; j++){
+ cell_info[i][j+1] = tmp[j];
}
// care about multicolumns
if (cell_info[i][column+1].multicolumn
- ==LyXTable::CELL_BEGIN_OF_MULTICOLUMN){
- cell_info[i][column+1].multicolumn =
+ == LyXTable::CELL_BEGIN_OF_MULTICOLUMN){
+ cell_info[i][column+1].multicolumn =
LyXTable::CELL_PART_OF_MULTICOLUMN;
}
if (column + 1 == columns
|| cell_info[i][column+2].multicolumn
- !=LyXTable::CELL_PART_OF_MULTICOLUMN){
- cell_info[i][column+1].multicolumn =
+ != LyXTable::CELL_PART_OF_MULTICOLUMN){
+ cell_info[i][column+1].multicolumn =
LyXTable::CELL_NORMAL;
}
void LyXTable::Reinit()
{
- int i,j;
+ int i, j;
- for (i=0; i<rows;i++) {
- for (j=0; j<columns; j++) {
+ for (i = 0; i<rows;i++) {
+ for (j = 0; j<columns; j++) {
cell_info[i][j].width_of_cell = 0;
if ((i+1 < rows) && !row_info[i+1].is_cont_row)
cell_info[i][j].has_cont_row = false;
}
}
- for (i=0; i<columns;i++) {
+ for (i = 0; i<columns;i++) {
calculate_width_of_column(i);
}
calculate_width_of_table();
void LyXTable::set_row_column_number_info()
{
int row = 0;
- int c= 0;
+ int c = 0;
int column = 0;
numberofcells = -1;
- for (row=0; row<rows; ++row) {
- for (column=0; column<columns; ++column) {
+ for (row = 0; row<rows; ++row) {
+ for (column = 0; column<columns; ++column) {
if (cell_info[row][column].multicolumn
!= LyXTable::CELL_PART_OF_MULTICOLUMN)
++numberofcells;
columnofcell = new int[numberofcells];
while (c < numberofcells && row < rows && column < columns) {
- rowofcell[c]=row;
- columnofcell[c]=column;
+ rowofcell[c] = row;
+ columnofcell[c] = column;
c++;
do{
column++;
int LyXTable::NumberOfCellsInRow(int cell)
{
int row = row_of_cell(cell);
- int i=0;
+ int i = 0;
int result = 0;
- for (i=0; i<columns; i++){
+ for (i = 0; i<columns; i++){
if (cell_info[row][i].multicolumn != LyXTable::CELL_PART_OF_MULTICOLUMN)
result++;
}
/* returns 1 if there is a topline, returns 0 if not */
bool LyXTable::TopLine(int cell)
{
- int row=row_of_cell(cell);
+ int row = row_of_cell(cell);
if (IsContRow(cell))
return TopLine(cell_info[row-1][column_of_cell(cell)].cellno);
if(cell >= numberofcells)
return false;
- int row=row_of_cell(cell);
+ int row = row_of_cell(cell);
if (RowHasContRow(cell))
return BottomLine(cell_info[row+1][column_of_cell(cell)].cellno);
int bottom = 1;
int column;
if (row){
- for (column=0;column < columns-1 && bottom;column++){
+ for (column = 0;column < columns-1 && bottom;column++){
switch (cell_info[row-1][column].multicolumn){
case LyXTable::CELL_BEGIN_OF_MULTICOLUMN:
bottom = cell_info[row-1][column].bottom_line;
bottom = row_info[row-1].bottom_line;
}
}
- for (column=0;column < columns-1 && top;column++){
+ for (column = 0;column < columns-1 && top;column++){
switch (cell_info[row][column].multicolumn){
case LyXTable::CELL_BEGIN_OF_MULTICOLUMN:
top = cell_info[row][column].top_line;
int column1 = column_of_cell(cell);
int column2 = right_column_of_cell(cell);
int i;
- int result=0;
- for (i=column1; i<=column2;i++){
+ int result = 0;
+ for (i = column1; i<= column2;i++){
result += column_info[i].width_of_column;
}
return result;
int column1 = column_of_cell(cell);
int column2 = right_column_of_cell(cell);
int i;
- int width=0;
+ int width = 0;
// first set columns to 0 so we can calculate the right width
- for (i=column1; i<=column2;i++) {
+ for (i = column1; i<= column2;i++) {
cell_info[row][i].width_of_cell = 0;
}
// set the width to MAX_WIDTH until width > 0
width = (new_width + 2*WIDTH_OF_LINE);
- for (i=column1; (i<column2) && (width > 0);i++){
+ for (i = column1; (i<column2) && (width > 0);i++){
cell_info[row][i].width_of_cell = column_info[i].width_of_column;
width -= column_info[i].width_of_column;
}
- if (i==column2) {
+ if (i == column2) {
cell_info[row][i].width_of_cell = width;
}
return true;
i;
// first set columns to 0 so we can calculate the right width
- for (i=column1; i<=column2;++i)
+ for (i = column1; i<= column2;++i)
cell_info[row][i].width_of_cell = 0;
- for(i=cell+1;(i<numberofcells) && (!IsMultiColumn(i));++i)
+ for(i = cell+1;(i<numberofcells) && (!IsMultiColumn(i));++i)
;
if (i < numberofcells)
- recalculateMulticolCells(i,GetWidthOfCell(i)-(2*WIDTH_OF_LINE));
- SetWidthOfMulticolCell(cell,new_width);
+ recalculateMulticolCells(i, GetWidthOfCell(i)-(2*WIDTH_OF_LINE));
+ SetWidthOfMulticolCell(cell, new_width);
}
/* returns 1 if a complete update is necessary, otherwise 0 */
{
int row = row_of_cell(cell);
int column1 = column_of_cell(cell);
- int tmp=0;
- int width=0;
+ int tmp = 0;
+ int width = 0;
if (IsMultiColumn(cell)) {
tmp = SetWidthOfMulticolCell(cell, new_width);
}
if (tmp) {
int i;
- for(i=0; i<columns;++i)
+ for(i = 0; i<columns;++i)
calculate_width_of_column_NMC(i);
- for(i=0; (i<numberofcells) && !IsMultiColumn(i); ++i)
+ for(i = 0; (i<numberofcells) && !IsMultiColumn(i); ++i)
;
if (i<numberofcells)
- recalculateMulticolCells(i,GetWidthOfCell(i)-(2*WIDTH_OF_LINE));
- for(i=0; i<columns;++i)
+ recalculateMulticolCells(i, GetWidthOfCell(i)-(2*WIDTH_OF_LINE));
+ for(i = 0; i<columns;++i)
calculate_width_of_column(i);
calculate_width_of_table();
return true;
} else {
column_info[column_of_cell(fvcell)].p_width = width;
if (!width.empty()) // do this only if there is a width
- SetAlignment(cell,LYX_ALIGN_LEFT);
+ SetAlignment(cell, LYX_ALIGN_LEFT);
}
return true;
}
bool LyXTable::SetAllLines(int cell, bool line)
{
- SetTopLine(cell,line);
- SetBottomLine(cell,line);
- SetRightLine(cell,line);
- SetLeftLine(cell,line);
+ SetTopLine(cell, line);
+ SetBottomLine(cell, line);
+ SetRightLine(cell, line);
+ SetLeftLine(cell, line);
return true;
}
int row = row_of_cell(cell);
if (IsContRow(cell))
- SetTopLine(cell_info[row-1][column_of_cell(cell)].cellno,line);
+ SetTopLine(cell_info[row-1][column_of_cell(cell)].cellno, line);
else if (!IsMultiColumn(cell))
row_info[row].top_line = line;
else
int row = row_of_cell(cell);
if (RowHasContRow(cell))
- SetBottomLine(cell_info[row+1][column_of_cell(cell)].cellno,line);
+ SetBottomLine(cell_info[row+1][column_of_cell(cell)].cellno, line);
else if (!IsMultiColumn(cell))
row_info[row_of_cell(cell)].bottom_line = line;
else
int column1 = column_of_cell(cell);
int column2 = right_column_of_cell(cell);
int i;
- int result=0;
- for (i=column1; i<=column2;i++){
+ int result = 0;
+ for (i = column1; i<= column2;i++){
result += cell_info[row][i].width_of_cell;
}
int i, max;
int old_column_width = column_info[column].width_of_column;
max = 0;
- for (i=0; i<rows; i++) {
+ for (i = 0; i<rows; i++) {
if (cell_info[i][column].width_of_cell > max) {
max = cell_info[i][column].width_of_cell;
}
int i, max;
int old_column_width = column_info[column].width_of_column;
max = 0;
- for (i=0; i<rows; ++i) {
- if (!IsMultiColumn(GetCellNumber(column,i)) &&
+ for (i = 0; i<rows; ++i) {
+ if (!IsMultiColumn(GetCellNumber(column, i)) &&
(cell_info[i][column].width_of_cell > max)) {
max = cell_info[i][column].width_of_cell;
}
void LyXTable::calculate_width_of_table()
{
- int i;
width_of_table = 0;
- for (i=0; i<columns;i++) {
+ for (int i = 0; i < columns; ++i) {
width_of_table += column_info[i].width_of_column;
}
}
void LyXTable::Write(FILE* file)
{
- int i,j;
+ int i, j;
fprintf(file, "multicol5\n");
fprintf(file, "%d %d %d %d %d %d %d %d\n", rows, columns, is_long_table,
rotate, endhead, endfirsthead, endfoot, endlastfoot);
- for (i=0; i<rows; i++){
+ for (i = 0; i<rows; i++){
fprintf(file, "%d %d %d %d\n", row_info[i].top_line,
row_info[i].bottom_line, row_info[i].is_cont_row,
row_info[i].newpage);
}
- for (i=0; i<columns; i++){
+ for (i = 0; i<columns; i++){
fprintf(file, "%d %d %d \"%s\" \"%s\"\n",
column_info[i].alignment, column_info[i].left_line,
column_info[i].right_line,
column_info[i].align_special.c_str());
}
- for (i=0; i<rows;i++){
- for (j=0;j<columns;j++){
+ for (i = 0; i<rows;i++){
+ for (j = 0;j<columns;j++){
fprintf(file, "%d %d %d %d %d %d %d \"%s\" \"%s\"\n",
cell_info[i][j].multicolumn,
cell_info[i][j].alignment,
void LyXTable::Read(FILE* file)
{
int version;
- int i,j;
+ int i, j;
int rows_arg = 0;
int columns_arg = 0;
int is_long_table_arg = false;
#warning Insert a error message window here that this format is not supported anymore
#endif
if (version < 5) {
- fprintf(stderr,"Tabular format < 5 is not supported anymore\n"
+ fprintf(stderr, "Tabular format < 5 is not supported anymore\n"
"Get an older version of LyX (< 1.1.x) for conversion!\n");
return;
}
- a=b=c=d=-1;
- fgets(vtmp,sizeof(vtmp),file);
+ a = b = c = d = -1;
+ fgets(vtmp, sizeof(vtmp), file);
sscanf(vtmp, "%d %d %d %d %d %d %d %d\n", &rows_arg, &columns_arg,
&is_long_table_arg, &rotate_arg, &a, &b, &c, &d);
Init(rows_arg, columns_arg);
endfirsthead = b;
endfoot = c;
endlastfoot = d;
- for (i=0; i<rows; i++){
- a=b=c=d=e=f=g=h=0;
- fgets(vtmp,sizeof(vtmp),file);
+ for (i = 0; i<rows; i++){
+ a = b = c = d = e = f = g = h = 0;
+ fgets(vtmp, sizeof(vtmp), file);
sscanf(vtmp, "%d %d %d %d\n",
&a, &b, &c, &d);
row_info[i].top_line = a;
row_info[i].is_cont_row = c;
row_info[i].newpage = d;
}
- for (i=0; i<columns; i++){
+ for (i = 0; i<columns; i++){
*stmp = 0;
*atmp = 0;
- fgets(vtmp,sizeof(vtmp),file);
+ fgets(vtmp, sizeof(vtmp), file);
sscanf(vtmp, "%d %d %d %s %s", &a, &b, &c, stmp, atmp);
column_info[i].alignment = (char) a;
column_info[i].left_line = b;
} else if (*stmp)
column_info[i].p_width = stmp;
}
- for (i=0; i<rows;i++){
- for (j=0;j<columns;j++){
+ for (i = 0; i<rows;i++){
+ for (j = 0;j<columns;j++){
*stmp = 0;
*atmp = 0;
- a=b=c=d=e=f=g=0;
- fgets(vtmp,sizeof(vtmp),file);
+ a = b = c = d = e = f = g = 0;
+ fgets(vtmp, sizeof(vtmp), file);
sscanf(vtmp, "%d %d %d %d %d %d %d %s %s\n",
&a, &b, &c, &d, &e, &f, &g, stmp, atmp);
cell_info[i][j].multicolumn = (char) a;
*stmp = 0;
*atmp = 0;
if (stmp[1] == '"')
- sscanf(vtmp,"%*d %*d %*d %*d %*d %*d %*d %*s \"%[^\"]\"",
+ sscanf(vtmp, "%*d %*d %*d %*d %*d %*d %*d %*s \"%[^\"]\"",
atmp);
else // otherwise after the first empty "" read is aborded
- sscanf(vtmp,"%*d %*d %*d %*d %*d %*d %*d \"%[^\"]\" \"%[^\"]\"",
+ sscanf(vtmp, "%*d %*d %*d %*d %*d %*d %*d \"%[^\"]\" \"%[^\"]\"",
stmp, atmp);
cell_info[i][j].align_special = stmp;
cell_info[i][j].p_width = atmp;
// cell <0 will tex the preamble
// returns the number of printed newlines
-int LyXTable::TexEndOfCell(string& file, int cell)
+int LyXTable::TexEndOfCell(string & file, int cell)
{
int i;
int ret = 0;
int tmp; // tmp2;
- int fcell,nvcell;
+ int fcell, nvcell;
if (ShouldBeVeryLastCell(cell)) {
// the very end at the very beginning
if (Linebreaks(cell))
tmp = 0;
fcell = cell;
while (!IsFirstCell(fcell))fcell--;
- for (i=0; i < NumberOfCellsInRow(fcell); i++){
+ for (i = 0; i < NumberOfCellsInRow(fcell); i++){
if (BottomLine(fcell+i))
tmp++;
}
file += "\\hline ";
} else {
tmp = 0;
- for (i=0; i < NumberOfCellsInRow(fcell); i++){
+ for (i = 0; i < NumberOfCellsInRow(fcell); i++){
if (BottomLine(fcell+i)){
file += "\\cline{";
file += tostr(column_of_cell(fcell+i)+1);
file += "\\begin{longtable}{";
else
file += "\\begin{tabular}{";
- for (i=0; i<columns;i++){
+ for (i = 0; i<columns;i++){
if (column_info[i].left_line)
file += '|';
if (!column_info[i].align_special.empty()) {
tmp = 0;
if (GetNumberOfCells()){
fcell = 0;
- for (i=0; i < NumberOfCellsInRow(fcell); i++){
+ for (i = 0; i < NumberOfCellsInRow(fcell); i++){
if (TopLine(fcell+i))
tmp++;
}
file += "\\hline ";
} else {
tmp = 0;
- for (i=0; i < NumberOfCellsInRow(fcell); i++){
+ for (i = 0; i < NumberOfCellsInRow(fcell); i++){
if (TopLine(fcell+i)){
file += "\\cline{";
file += tostr(column_of_cell(fcell+i)+1);
}
if (IsLastCell(cell)) {
int row = row_of_cell(cell);
- string hline1,hline2;
+ string hline1, hline2;
bool print_hline = true;
- bool pr_top_hline,flag1,flag2;
+ bool pr_top_hline, flag1, flag2;
flag1 = IsLongTable() &&
((row == endhead) || (row == endfirsthead) ||
(row == endfoot) || (row == endlastfoot));
fcell = cell;
while (!IsFirstCell(fcell))
fcell--;
- for (i=0; i < NumberOfCellsInRow(cell); i++){
+ for (i = 0; i < NumberOfCellsInRow(cell); i++){
if (BottomLine(fcell+i))
tmp++;
}
hline1 = "\\hline ";
} else {
tmp = 0;
- for (i=0; i < NumberOfCellsInRow(fcell); i++){
+ for (i = 0; i < NumberOfCellsInRow(fcell); i++){
if (BottomLine(fcell+i)){
file += "\\cline{";
file += tostr(column_of_cell(fcell+i)+1);
if (nvcell < numberofcells && (cell < GetNumberOfCells()-1) &&
!ShouldBeVeryLastCell(cell)) {
fcell = nvcell;
- for (i=0; i < NumberOfCellsInRow(fcell); i++){
+ for (i = 0; i < NumberOfCellsInRow(fcell); i++){
if (TopLine(fcell+i))
tmp++;
}
}
else {
tmp = 0;
- for (i=0; i < NumberOfCellsInRow(fcell); i++){
+ for (i = 0; i < NumberOfCellsInRow(fcell); i++){
if (TopLine(fcell+i)){
if (print_hline) {
file += "\\cline{";
}
if (RightLine(nvcell))
file += '|';
- //if (column_of_cell(cell+2)!=0 && LeftLine(cell+2))
+ //if (column_of_cell(cell+2)!= 0 && LeftLine(cell+2))
if (((nvcell+1) < numberofcells) &&
(NextVirtualCell(nvcell+1) < numberofcells) &&
- (column_of_cell(NextVirtualCell(nvcell+1))!=0) &&
+ (column_of_cell(NextVirtualCell(nvcell+1))!= 0) &&
LeftLine(NextVirtualCell(nvcell+1)))
file += '|';
file += "}{";
// returns the number of printed newlines
int LyXTable::RoffEndOfCell(FILE* file, int cell)
{
- int i,j;
+ int i, j;
int ret = 0;
if (cell == GetNumberOfCells() - 1){
// the very end at the very beginning
if (CellHasContRow(cell) >= 0) {
- fprintf(file,"\nT}");
+ fprintf(file, "\nT}");
ret++;
}
fprintf(file, "\n");
fprintf(file, ".TE\n.pl 1c");
} else {
if (cell < 0){
- int fcell=0;
+ int fcell = 0;
// preamble
fprintf(file, "\n.pl 500c\n.TS\n");
- for (j=0; j<rows; j++) {
- for (i=0; i<columns;i++,fcell++) {
+ for (j = 0; j<rows; j++) {
+ for (i = 0; i<columns;i++, fcell++) {
if (column_info[i].left_line)
fprintf(file, " | ");
- if (cell_info[j][i].multicolumn==CELL_PART_OF_MULTICOLUMN)
+ if (cell_info[j][i].multicolumn == CELL_PART_OF_MULTICOLUMN)
fprintf(file, "s");
else {
switch (column_info[i].alignment) {
fprintf(file, ".\n");
ret++;
if (row_info[0].top_line) {
- fprintf(file,"_\n");
+ fprintf(file, "_\n");
ret++;
}
if (CellHasContRow(0) >= 0) {
- fprintf(file,"T{\n");
+ fprintf(file, "T{\n");
ret++;
}
} else {
// usual cells
if (CellHasContRow(cell) >= 0) {
- fprintf(file,"\nT}");
+ fprintf(file, "\nT}");
ret++;
}
if (right_column_of_cell(cell) == columns -1){
fprintf(file, "\t");
if ((cell < GetNumberOfCells() - 1) &&
(CellHasContRow(cell+1) >= 0)) {
- fprintf(file,"T{\n");
+ fprintf(file, "T{\n");
ret++;
}
}
return ret;
}
-const char *LyXTable::getDocBookAlign(int cell, bool isColumn)
+char const *LyXTable::getDocBookAlign(int cell, bool isColumn)
{
int i;
if (isColumn)
// cell <0 will tex the preamble
// returns the number of printed newlines
-int LyXTable::DocBookEndOfCell(string& file, int cell, int &depth)
+int LyXTable::DocBookEndOfCell(string & file, int cell, int &depth)
{
int i;
int ret = 0;
file += "' COLSEP='1' ROWSEP='1'>";
addNewlineAndDepth(file,++depth);
ret++;
- for (i=0; i<columns;i++) {
+ for (i = 0; i < columns; ++i) {
file += "<COLSPEC ALIGN='";
file += getDocBookAlign(i, true);
file += "' COLNAME='col";
file += tostr(i+1);
file += "' COLNUM='";
file += tostr(i+1);
- file += "' COLSEP='";
+ file += "' COLSEP= '";
if (i == (columns-1)) {
file += '1';
} else {
file += '0';
}
file += "'>";
- addNewlineAndDepth(file,depth);
+ addNewlineAndDepth(file, depth);
ret++;
#ifdef NOT_HANDLED_YET_AS_I_DONT_KNOW_HOW
if (column_info[i].left_line)
addNewlineAndDepth(file,++depth);
file += "<ROW>";
addNewlineAndDepth(file,++depth);
- file += "<ENTRY ALIGN='";
+ file += "<ENTRY ALIGN= '";
file += getDocBookAlign(0);
file += "'";
if (IsMultiColumn(0)) {
- file += " NAMEST='col1' NAMEEND='col";
+ file += " NAMEST= 'col1' NAMEEND= 'col";
file += tostr(cells_in_multicolumn(0));
file += "'";
}
file += "</ENTRY>";
addNewlineAndDepth(file,--depth);
file += "</ROW>";
- addNewlineAndDepth(file,depth);
+ addNewlineAndDepth(file, depth);
file += "<ROW>";
addNewlineAndDepth(file,++depth);
- file += "<ENTRY ALIGN='";
+ file += "<ENTRY ALIGN= '";
file += getDocBookAlign(cell+1);
- file += "' VALIGN='middle'";
+ file += "' VALIGN= 'middle'";
if (IsMultiColumn(cell+1)) {
- file += " NAMEST='col";
+ file += " NAMEST= 'col";
file += tostr(column_of_cell(cell+1) + 1);
- file += "' NAMEEND='col";
+ file += "' NAMEEND= 'col";
file += tostr(column_of_cell(cell+1) +
cells_in_multicolumn(cell+1));
file += "'";
} else {
addNewlineAndDepth(file,--depth);
file += "</ENTRY>";
- addNewlineAndDepth(file,depth);
- file += "<ENTRY ALIGN='";
+ addNewlineAndDepth(file, depth);
+ file += "<ENTRY ALIGN= '";
file += getDocBookAlign(cell+1);
- file += "' VALIGN='middle'";
+ file += "' VALIGN= 'middle'";
if (IsMultiColumn(cell+1)) {
- file += " NAMEST='col";
+ file += " NAMEST= 'col";
file += tostr(column_of_cell(cell+1) + 1);
- file += "' NAMEEND='col";
+ file += "' NAMEEND= 'col";
file += tostr(column_of_cell(cell+1) +
cells_in_multicolumn(cell+1));
file += "'";
cellinfo_of_cell(fvcell)->top_line = row_info[row_of_cell(fvcell)].top_line;
cellinfo_of_cell(fvcell)->bottom_line = row_info[row_of_cell(fvcell)].bottom_line;
for (number--;number>0;number--){
- cellinfo_of_cell(fvcell+number)->multicolumn =
+ cellinfo_of_cell(fvcell+number)->multicolumn =
LyXTable::CELL_PART_OF_MULTICOLUMN;
new_width += cellinfo_of_cell(fvcell+number)->width_of_cell;
}
set_row_column_number_info();
- SetWidthOfCell(fvcell,new_width);
+ SetWidthOfCell(fvcell, new_width);
}
while (column < columns &&
cell_info[row][column].multicolumn
== LyXTable::CELL_PART_OF_MULTICOLUMN){
- cell_info[row][column].multicolumn =
+ cell_info[row][column].multicolumn =
LyXTable::CELL_NORMAL;
column++;
result++;
void LyXTable::delete_column(int column)
{
- int i,j;
+ int i, j;
columnstruct *column_info2 = new columnstruct[columns-1];
- for (i=0; i<column; i++){
+ for (i = 0; i<column; i++){
column_info2[i] = column_info[i];
}
- for (i=column; i<columns-1; i++){
+ for (i = column; i<columns-1; i++){
column_info2[i] = column_info[i+1];
}
delete[] column_info;
column_info = column_info2;
- for (i=0; i<rows;i++){
+ for (i = 0; i<rows;i++){
cellstruct* tmp = cell_info[i];
cell_info[i] = new cellstruct[columns-1];
- for (j=0; j<column; j++){
- cell_info[i][j]=tmp[j];
+ for (j = 0; j<column; j++){
+ cell_info[i][j] = tmp[j];
}
- for (j=column; j<columns-1; j++){
- cell_info[i][j]=tmp[j+1];
+ for (j = column; j<columns-1; j++){
+ cell_info[i][j] = tmp[j+1];
}
delete[] tmp;
}
{
if (rotate)
return true;
- for (int i=0; i<rows;i++){
- for (int j=0;j<columns;j++){
+ for (int i = 0; i<rows;i++){
+ for (int j = 0;j<columns;j++){
if (cell_info[i][j].rotate)
return true;
}
{
int row = row_of_cell(cell)+1;
- if (!RowHasContRow(cell) || (CellHasContRow(cell)>=0))
+ if (!RowHasContRow(cell) || (CellHasContRow(cell)>= 0))
AppendRow(cell);
row_info[row].is_cont_row = true;
row_info[row].top_line = false;
bool LyXTable::ShouldBeVeryLastRow(int cell)
{
- if (CellHasContRow(cell)>=0)
+ if (CellHasContRow(cell)>= 0)
return false;
int row = row_of_cell(cell)+1;
int column = column_of_cell(cell);
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995, 1996 Matthias Ettrich
*
- *======================================================*/
+ * ====================================================== */
#ifndef TABLE_H
#define TABLE_H
#pragma interface
#endif
-#include <stdio.h>
-#include "definitions.h"
+#include <cstdio>
+
#include "lyxlex.h"
#include "LString.h"
///
bool SetPWidth(int cell, string width);
///
- bool SetAlignSpecial(int cell, string special,int what);
+ bool SetAlignSpecial(int cell, string special, int what);
///
char GetAlignment(int cell); // add approp. signedness
///
// cell <0 will tex the preamble
// returns the number of printed newlines
///
- int TexEndOfCell(string& file, int cell);
+ int TexEndOfCell(string & file, int cell);
///
int RoffEndOfCell(FILE* file, int cell);
///
- const char *getDocBookAlign(int cell, bool isColumn=false);
+ char const *getDocBookAlign(int cell, bool isColumn= false);
///
int DocBookEndOfCell(string &file, int cell, int &depth);
// I am not sure how some of the XWindows names coresponds to the TeX ones.
//static
-tex_accent_struct lyx_accent_table[18] ={
+tex_accent_struct lyx_accent_table[18] = {
{ (tex_accent)0, "", "", "",(kb_action)0},
- {TEX_ACUTE, "\\'", " AEIOUYaeiouySZszRLCNrlcn","acute", LFUN_ACUTE},
+ {TEX_ACUTE, "\\'", " AEIOUYaeiouySZszRLCNrlcn", "acute", LFUN_ACUTE},
{TEX_GRAVE, "\\`", " aeiouAEIOU", "grave", LFUN_GRAVE},
{TEX_MACRON, "\\=", " EeAIOUaiou", "macron", LFUN_MACRON},
{TEX_TILDE, "\\~", " ANOanoIiUu", "tilde", LFUN_TILDE},
{TEX_TIE, "\\t", " ", "tie", LFUN_TIE},
{TEX_BREVE, "\\u", " AaGgUu", "breve", LFUN_BREVE},
{TEX_CARON, "\\v", " LSTZlstzCEDNRcednr", "caron", LFUN_CARON},
-// {TEX_SPECIAL_CARON, "\\q", "","ooo", LFUN_SPECIAL_CARON},
+// {TEX_SPECIAL_CARON, "\\q", "", "ooo", LFUN_SPECIAL_CARON},
{TEX_HUNGUML, "\\H", " OUou", "hugarian_umlaut", LFUN_HUNG_UMLAUT},
{TEX_UMLAUT, "\\\"", " AEIOUaeiouy", "umlaut", LFUN_UMLAUT},
{TEX_DOT, "\\.", " ZzICGicgEe", "dot", LFUN_DOT},
tex_accent_struct get_accent(kb_action action)
{
- int i=0;
- while (i<=TEX_MAX_ACCENT){
+ int i= 0;
+ while (i<= TEX_MAX_ACCENT){
if (lyx_accent_table[i].action == action)
return lyx_accent_table[i];
i++;
return temp;
}
-string DoAccent(const string& s,tex_accent accent)
+string DoAccent(string const & s, tex_accent accent)
{
string res;
- res+=lyx_accent_table[accent].cmd;
- res+='{';
- if (s=="i" || s=="j") {
- res+='\\';
+ res+= lyx_accent_table[accent].cmd;
+ res+= '{';
+ if (s == "i" || s == "j") {
+ res+= '\\';
}
- res+=s;
- res+='}';
+ res+= s;
+ res+= '}';
return res;
}
-string DoAccent(char c,tex_accent accent)
+string DoAccent(char c, tex_accent accent)
{
- return DoAccent(tostr(c),accent);
+ return DoAccent(tostr(c), accent);
}
///
TEX_OGONEK,
///
- TEX_MAX_ACCENT=TEX_OGONEK
+ TEX_MAX_ACCENT= TEX_OGONEK
};
// this file should perhaps be split into even smaller parts
-char const* string_paragraph_separation[3] = {
+char const * string_paragraph_separation[3] = {
"indent", "skip", ""
};
-char const* string_quotes_language[7] = {
+char const * string_quotes_language[7] = {
"english", "swedish", "german", "polish", "french", "danish", ""
};
-
-char const* string_oldpapersize[10] = {
+#if 0
+char const * string_oldpapersize[10] = {
"a4paper", "a4", "a4wide", "widemarginsa4", "usletter",
- "a5paper", "b5paper", "executivepaper", "legalpaper",""
+ "a5paper", "b5paper", "executivepaper", "legalpaper", ""
};
+#endif
-
-char const* string_papersize[12] = {
+char const * string_papersize[12] = {
"Default", "Custom", "letterpaper", "executivepaper", "legalpaper",
- "a3paper","a4paper","a5paper","b3paper","b4paper","b5paper",""
+ "a3paper", "a4paper", "a5paper", "b3paper", "b4paper", "b5paper", ""
};
-char const* string_paperpackages[4] = {
+char const * string_paperpackages[4] = {
"a4", "a4wide", "widemarginsa4", ""
};
-char const* string_orientation[3] = {
+char const * string_orientation[3] = {
"portrait", "landscape", ""
};
-char const* string_footnotekinds[8] = {
+char const * string_footnotekinds[8] = {
"footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", ""
};
-char const* string_align[5] = {
+char const * string_align[5] = {
"block", "left", "right", "center", ""
};
// 27 times in the object file. (Asger)
///
-char const *tex_babel[] = {"default","afrikaans", "american",
+char const * tex_babel[] = {"default", "afrikaans", "american",
"austrian", "bahasa", "brazil", "breton",
"catalan", "croatian", "czech", "danish", "dutch",
"english", "esperanto", "estonian",
"finnish", "francais", "french", "frenchb",
"galician",
"german", "greek", "hungarian", "irish",
- "italian","lsorbian", "magyar", "norsk",
+ "italian", "lsorbian", "magyar", "norsk",
"polish", "portuges", "romanian",
"russian", "scottish",
"spanish", "slovak", "slovene", "swedish",
""};
-char const *tex_graphics[] = {"default", "dvips", "dvitops", "emtex",
+char const * tex_graphics[] = {"default", "dvips", "dvitops", "emtex",
"ln", "oztex", "textures", "none", ""};
-char const *tex_fonts[] = {"default", "times", "palatino", "helvet", "avant",
+char const * tex_fonts[] = {"default", "times", "palatino", "helvet", "avant",
"newcent", "bookman", ""};
// -*- C++ -*-
-#ifndef _TEX_STRINGS_
-#define _TEX_STRINGS_
+#ifndef TEX_STRINGS
+#define TEX_STRINGS
// this file should perhaps be split into even smaler parts
///
-extern char const* string_paragraph_separation[];
+extern char const * string_paragraph_separation[];
///
-extern char const* string_quotes_language[];
+extern char const * string_quotes_language[];
///
-extern char const* string_oldpapersize[];
+extern char const * string_oldpapersize[];
///
-extern char const* string_papersize[];
+extern char const * string_papersize[];
///
-extern char const* string_paperpackages[];
+extern char const * string_paperpackages[];
///
-extern char const* string_orientation[];
+extern char const * string_orientation[];
///
-extern char const* string_footnotekinds[];
+extern char const * string_footnotekinds[];
///
-extern char const* string_align[];
+extern char const * string_align[];
// The following was moved from tex-defs.h to here, because tex-defs.h is
// used all over. As it happens, that meant that these strings were included
// 27 times in the object file. (Asger)
///
-extern char const *tex_babel[];
+extern char const * tex_babel[];
///
-extern char const *tex_graphics[];
+extern char const * tex_graphics[];
///
-extern char const *tex_fonts[];
+extern char const * tex_fonts[];
#endif
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* This file is Copyleft (C) 1996-1998
* Lars Gullik Bjønnes
*
-*======================================================*/
+* ====================================================== */
#include <config.h>
#include FORMS_H_LOCATION
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
}
-TexRow & TexRow::operator+=(const TexRow &tr)
+TexRow & TexRow::operator+= (const TexRow &tr)
{
// remember that the lists are stored in reverse
// so you've got to turn the second one around
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
void getIdFromRow(int row, int &id, int &pos);
/// Appends another TexRow
- TexRow & operator+=(const TexRow &);
+ TexRow & operator+= (const TexRow &);
private:
/// Linked list of items
/* This file is part of
-* ======================================================
+* ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 Matthias Ettrich
* Copyright (C) 1995-1998 The LyX Team.
*
-*======================================================*/
+* ====================================================== */
#include <config.h>
#include <cstdlib>
// dnaber 1999-02-02
extern MiniBuffer * minibuffer;
-#ifdef NEW_TEXT
int LyXText::SingleWidth(LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-int LyXText::SingleWidth(LyXParagraph * par, int pos)
-#endif
{
char c = par->GetChar(pos);
return SingleWidth(par, pos, c);
}
-#ifdef NEW_TEXT
int LyXText::SingleWidth(LyXParagraph * par,
LyXParagraph::size_type pos, char c)
-#else
-int LyXText::SingleWidth(LyXParagraph * par, int pos, char c)
-#endif
{
LyXFont font = GetFont(par, pos);
return 3; /* because of the representation
* as vertical lines */
- } else if (c == LYX_META_FOOTNOTE ||
- c == LYX_META_MARGIN ||
- c == LYX_META_FIG ||
- c == LYX_META_TAB ||
- c == LYX_META_WIDE_FIG ||
- c == LYX_META_WIDE_TAB ||
- c == LYX_META_ALGORITHM)
+ } else if (c == LyXParagraph::META_FOOTNOTE ||
+ c == LyXParagraph::META_MARGIN ||
+ c == LyXParagraph::META_FIG ||
+ c == LyXParagraph::META_TAB ||
+ c == LyXParagraph::META_WIDE_FIG ||
+ c == LyXParagraph::META_WIDE_TAB ||
+ c == LyXParagraph::META_ALGORITHM)
{
string fs;
switch (c) {
- case LYX_META_MARGIN:
+ case LyXParagraph::META_MARGIN:
fs = "margin";
break;
- case LYX_META_FIG:
+ case LyXParagraph::META_FIG:
fs = "fig";
break;
- case LYX_META_TAB:
+ case LyXParagraph::META_TAB:
fs = "tab";
break;
- case LYX_META_ALGORITHM:
+ case LyXParagraph::META_ALGORITHM:
fs = "alg";
break;
- case LYX_META_WIDE_FIG:
+ case LyXParagraph::META_WIDE_FIG:
fs = "wide-fig";
break;
- case LYX_META_WIDE_TAB:
+ case LyXParagraph::META_WIDE_TAB:
fs = "wide-tab";
break;
- case LYX_META_FOOTNOTE:
+ case LyXParagraph::META_FOOTNOTE:
fs = "foot";
break;
}
return font.stringWidth(fs);
}
- else if (c == LYX_META_INSET) {
- Inset *tmpinset=par->GetInset(pos);
+ else if (c == LyXParagraph::META_INSET) {
+ Inset *tmpinset= par->GetInset(pos);
if (tmpinset)
return par->GetInset(pos)->Width(font);
else
/* returns the paragraph position of the last character in the
* specified row */
-#ifdef NEW_TEXT
LyXParagraph::size_type LyXText::RowLast(Row * row)
-#else
-int LyXText::RowLast(Row * row)
-#endif
{
if (row->next == 0)
return row->par->Last()-1;
return row->next->pos - 1;
}
-#ifdef NEW_TEXT
+
void LyXText::Draw(Row * row, LyXParagraph::size_type & pos,
LyXScreen & scr, int offset, float & x)
-#else
-void LyXText::Draw(Row * row, int & pos,
- LyXScreen & scr, int offset, float & x)
-#endif
{
char c = row->par->GetChar(pos);
p[0].x = int(x + wid*0.375); p[0].y = int(y - 0.875*asc*0.75);
p[1].x = int(x); p[1].y = int(y - 0.500*asc*0.75);
p[2].x = int(x + wid*0.375); p[2].y = int(y - 0.125*asc*0.75);
- scr.drawLines(::getGC(gc_new_line),p, 3);
+ scr.drawLines(::getGC(gc_new_line), p, 3);
p[0].x = int(x); p[0].y = int(y - 0.500*asc*0.75);
p[1].x = int(x + wid); p[1].y = int(y - 0.500*asc*0.75);
p[2].x = int(x + wid); p[2].y = int(y - asc*0.75);
- scr.drawLines(::getGC(gc_new_line),p, 3);
+ scr.drawLines(::getGC(gc_new_line), p, 3);
return;
}
LyXFont font = GetFont(row->par, pos);
LyXFont font2 = font;
- if (c == LYX_META_FOOTNOTE ||
- c == LYX_META_MARGIN ||
- c == LYX_META_FIG ||
- c == LYX_META_TAB ||
- c == LYX_META_WIDE_FIG ||
- c == LYX_META_WIDE_TAB ||
- c == LYX_META_ALGORITHM) {
+ if (c == LyXParagraph::META_FOOTNOTE ||
+ c == LyXParagraph::META_MARGIN ||
+ c == LyXParagraph::META_FIG ||
+ c == LyXParagraph::META_TAB ||
+ c == LyXParagraph::META_WIDE_FIG ||
+ c == LyXParagraph::META_WIDE_TAB ||
+ c == LyXParagraph::META_ALGORITHM) {
string fs;
switch (c) {
- case LYX_META_MARGIN:
+ case LyXParagraph::META_MARGIN:
fs = "margin";
/* draw a sign at the left margin! */
scr.drawText(font, "!", 1, offset + row->baseline,
(LYX_PAPER_MARGIN - font.width('!'))/2);
break;
- case LYX_META_FIG:
+ case LyXParagraph::META_FIG:
fs = "fig";
break;
- case LYX_META_TAB:
+ case LyXParagraph::META_TAB:
fs = "tab";
break;
- case LYX_META_ALGORITHM:
+ case LyXParagraph::META_ALGORITHM:
fs = "alg";
break;
- case LYX_META_WIDE_FIG:
+ case LyXParagraph::META_WIDE_FIG:
fs = "wide-fig";
break;
- case LYX_META_WIDE_TAB:
+ case LyXParagraph::META_WIDE_TAB:
fs = "wide-tab";
break;
- case LYX_META_FOOTNOTE:
+ case LyXParagraph::META_FOOTNOTE:
fs = "foot";
break;
}
pos++;
return;
- } else if (c == LYX_META_INSET) {
+ } else if (c == LyXParagraph::META_INSET) {
Inset *tmpinset = row->par->GetInset(pos);
if (tmpinset)
tmpinset->Draw(font, scr, offset + row->baseline, x);
++pos;
#endif
-#ifdef NEW_TEXT
LyXParagraph::size_type last = RowLast(row);
-#else
- int last = RowLast(row);
-#endif
#if 0
// Prevent crash in the extremely unlikely event
// that our array is too small
// If monochrome and LaTeX mode, provide reverse background
if (mono_video && font.latex() == LyXFont::ON) {
- int a=font.maxAscent(), d=font.maxDescent();
+ int a= font.maxAscent(), d= font.maxDescent();
#if 0
scr.fillRectangle(gc_copy, int(tmpx), offset + row->baseline-a,
font.textWidth(textstring, i), a+d);
}
break;
}
- if (row->par->pextra_type == PEXTRA_INDENT) {
+ if (row->par->pextra_type == LyXParagraph::PEXTRA_INDENT) {
if (!row->par->pextra_widthp.empty()) {
x += paperwidth * atoi(row->par->pextra_widthp.c_str()) / 100;
} else if (!row->par->pextra_width.empty()) {
&& align == LYX_ALIGN_BLOCK
&& !row->par->noindent
&& (row->par->layout ||
- parameters->paragraph_separation == LYX_PARSEP_INDENT))
+ parameters->paragraph_separation == BufferParams::PARSEP_INDENT))
x += textclasslist.TextClass(parameters->textclass).defaultfont().stringWidth(parindent);
else
- if (layout.labeltype==LABEL_BIBLIO) { // ale970405 Right width for bibitems
+ if (layout.labeltype == LABEL_BIBLIO) { // ale970405 Right width for bibitems
x += bibitemMaxWidth(textclasslist.TextClass(parameters->textclass).defaultfont());
}
}
/* table stuff -- begin*/
-#ifdef NEW_TEXT
int LyXText::NumberOfCell(LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-int LyXText::NumberOfCell(LyXParagraph * par, int pos)
-#endif
{
int cell = 0;
-#ifdef NEW_TEXT
LyXParagraph::size_type tmp_pos = 0;
-#else
- int tmp_pos = 0;
-#endif
while (tmp_pos < pos) {
if (par->IsNewline(tmp_pos))
cell++;
return cell;
}
-#ifdef NEW_TEXT
+
int LyXText::WidthOfCell(LyXParagraph * par, LyXParagraph::size_type & pos)
-#else
-int LyXText::WidthOfCell(LyXParagraph * par, int & pos)
-#endif
{
int w = 0;
while (pos < par->Last() && !par->IsNewline(pos)) {
/* get the next breakpoint in a given paragraph */
-#ifdef NEW_TEXT
LyXParagraph::size_type
LyXText::NextBreakPoint(Row * row, int width)
-#else
-int LyXText::NextBreakPoint(Row * row, int width)
-#endif
{
int x = 0;
-#ifdef NEW_TEXT
LyXParagraph::size_type last_separator = -1;
/* position of the last possible breakpoint
* -1 isn't a suitable value, but a flag */
-#else
- int last_separator = -1; /* position of the last possible breakpoint
- * -1 isn't a suitable value, but a flag */
-#endif
int left_margin;
LyXParagraph * par = row->par;
-#ifdef NEW_TEXT
LyXParagraph::size_type i = 0;
LyXParagraph::size_type pos = row->pos;
-#else
- int i = 0;
- int pos = row->pos;
-#endif
/* table stuff -- begin*/
if (par->table) {
-#ifdef NEW_TEXT
while (pos < par->size()
-#else
- while (pos<par->last
-#endif
&& (!par->IsNewline(pos)
|| !par->table->IsFirstCell(NumberOfCell(par, pos+1)))) {
- if (par->GetChar(pos) == LYX_META_INSET &&
+ if (par->GetChar(pos) == LyXParagraph::META_INSET &&
par->GetInset(pos) && par->GetInset(pos)->Display()){
par->GetInset(pos)->SetDisplay(false);
}
left_margin = LabelEnd(row);
width -= RightMargin(row);
-#ifdef NEW_TEXT
- LyXParagraph::size_type main_body =
+ LyXParagraph::size_type main_body =
BeginningOfMainBody(par);
-#else
- int main_body = BeginningOfMainBody(par);
-#endif
LyXLayout const & layout = textclasslist.Style(parameters->textclass, par->GetLayout());
i = pos;
char c;
last_separator = i;
i = par->Last() - 1;/* this means break */
x = width;
- } else if (par->GetChar(i) == LYX_META_INSET &&
+ } else if (par->GetChar(i) == LyXParagraph::META_INSET &&
par->GetInset(i) && par->GetInset(i)->Display()){
par->GetInset(i)->SetDisplay(false);
}
}
} else {
// Last position is an invariant
-#ifdef NEW_TEXT
- LyXParagraph::size_type const last =
+ LyXParagraph::size_type const last =
par->Last();
-#else
- int const last = par->Last();
-#endif
/* this is the usual handling */
x = LeftMargin(row);
while (x < width && i < last) {
if (IsNewlineChar(c)) {
last_separator = i;
x = width; /* this means break */
- } else if (c == LYX_META_INSET &&
+ } else if (c == LyXParagraph::META_INSET &&
par->GetInset(i) && par->GetInset(i)->Display()){
/* check wether a Display() inset is valid here .
if not, change it to non-display*/
x += SingleWidth(par, i, c);
} else {
/* inset is display. So break the line here */
- if (i==pos){
+ if (i == pos){
if (pos < last-1) {
last_separator = i;
if (IsLineSeparatorChar(par->GetChar(i+1)))
{
int w, fill;
/* get the pure distance */
-#ifdef NEW_TEXT
LyXParagraph::size_type last = RowLast(row);
-#else
- int last = RowLast(row);
-#endif
/* table stuff -- begin*/
if (row->par->table) {
/* for tables FILL does calculate the widthes of each cell in
* the row */
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = row->pos;
-#else
- int pos = row->pos;
-#endif
int cell = NumberOfCell(row->par, pos);
w = 0;
do {
LyXLayout const & layout = textclasslist.Style(parameters->textclass,
row->par->GetLayout());
-#ifdef NEW_TEXT
- LyXParagraph::size_type main_body =
+ LyXParagraph::size_type main_body =
BeginningOfMainBody(row->par);
LyXParagraph::size_type i = row->pos;
while (i <= last) {
-#else
- int main_body = BeginningOfMainBody(row->par);
- int i = row->pos;
- while (i <= last) {
-#endif
w += SingleWidth(row->par, i);
++i;
if (i == main_body) {
int LyXText::LabelFill(Row * row)
{
-#ifdef NEW_TEXT
LyXParagraph::size_type last = BeginningOfMainBody(row->par) - 1;
-#else
- int last = BeginningOfMainBody(row->par) - 1;
-#endif
/* -1 because a label ends either with a space that is in the label,
* or with the beginning of a footnote that is outside the label. */
/* like NumberOfHfills, but only those in the manual label! */
int LyXText::NumberOfLabelHfills(Row * row)
{
-#ifdef NEW_TEXT
LyXParagraph::size_type last = RowLast(row);
LyXParagraph::size_type first = row->pos;
-#else
- int last = RowLast(row);
- int first = row->pos;
-#endif
if (first) { /* hfill *DO* count at the beginning
* of paragraphs! */
while(first < last && row->par->IsHfill(first))
first++;
}
-#ifdef NEW_TEXT
- LyXParagraph::size_type main_body =
+ LyXParagraph::size_type main_body =
BeginningOfMainBody(row->par);
-#else
- int main_body = BeginningOfMainBody(row->par);
-#endif
if (last > main_body)
last = main_body;
int n = 0;
-#ifdef NEW_TEXT
for (LyXParagraph::size_type p = first;
p < last; ++p) { // last, because the end is ignored!
-#else
- for (int p = first; p < last; p++) { // last, because the end is ignored!
-#endif
if (row->par->IsHfill(p)) {
++n;
}
/* returns true, if a expansion is needed.
* Rules are given by LaTeX */
-#ifdef NEW_TEXT
bool LyXText::HfillExpansion(Row * row_ptr,
LyXParagraph::size_type pos)
-#else
-bool LyXText::HfillExpansion(Row * row_ptr, int pos)
-#endif
{
/* by the way, is it a hfill? */
if (!row_ptr->par->IsHfill(pos))
/* if there is anything between the first char of the row and
* the sepcified position that is not a newline and not a hfill,
* the hfill will count, otherwise not */
-#ifdef NEW_TEXT
LyXParagraph::size_type i = row_ptr->pos;
-#else
- int i = row_ptr->pos;
-#endif
while (i < pos && (row_ptr->par->IsNewline(i)
|| row_ptr->par->IsHfill(i)))
i++;
// Check if any insets are larger
for (pos = row_ptr->pos; pos <= pos_end; pos++) {
- if (row_ptr->par->GetChar(pos) == LYX_META_INSET) {
+ if (row_ptr->par->GetChar(pos) == LyXParagraph::META_INSET) {
tmpfont = GetFont(row_ptr->par, pos);
tmpinset = row_ptr->par->GetInset(pos);
if (tmpinset) {
if (row_ptr->par->table){
// stretch the rows a bit
maxasc += 1;
- maxdesc +=1;
+ maxdesc += 1;
}
/* table stuff -- end*/
&& row_ptr->par == firstpar) {
/* some parksips VERY EASY IMPLEMENTATION */
- if (parameters->paragraph_separation == LYX_PARSEP_SKIP) {
+ if (parameters->paragraph_separation == BufferParams::PARSEP_SKIP) {
if (layout.isParagraph()
&& firstpar->GetDepth() == 0
&& firstpar->Previous())
/* this is special code for the chapter, since the label of this
* layout is printed in an extra row */
if (layout.labeltype == LABEL_COUNTER_CHAPTER
- && parameters->secnumdepth>=0) {
+ && parameters->secnumdepth>= 0) {
labeladdon = int(labelfont.maxDescent() *
layout.spacing.getValue() *
parameters->spacing.getValue())
tmptop = layout.topsep;
if (row_ptr->previous->par->GetDepth() >= row_ptr->par->GetDepth())
- tmptop-=textclasslist.Style(parameters->textclass, row_ptr->previous->par->GetLayout()).bottomsep;
+ tmptop-= textclasslist.Style(parameters->textclass, row_ptr->previous->par->GetLayout()).bottomsep;
if (tmptop > 0)
layoutasc = (tmptop * DefaultHeight());
if (comparepar->GetDepth() > nextpar->GetDepth()) {
usual = (textclasslist.Style(parameters->textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
comparepar = comparepar->DepthHook(nextpar->GetDepth());
- if (comparepar->GetLayout()!=nextpar->GetLayout()
+ if (comparepar->GetLayout()!= nextpar->GetLayout()
|| nextpar->GetLabelWidthString() !=
comparepar->GetLabelWidthString())
unusual = (textclasslist.Style(parameters->textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
else if (comparepar->GetDepth() == nextpar->GetDepth()) {
if (comparepar->GetLayout()!= nextpar->GetLayout()
- || nextpar->GetLabelWidthString() !=
+ || nextpar->GetLabelWidthString() !=
comparepar->GetLabelWidthString())
layoutdesc = int(textclasslist.Style(parameters->textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
}
/* calculate the new height of the text */
height -= row_ptr->height;
- row_ptr->height=maxasc+maxdesc+labeladdon;
- row_ptr->baseline=maxasc+labeladdon;
+ row_ptr->height= maxasc+maxdesc+labeladdon;
+ row_ptr->baseline= maxasc+labeladdon;
height += row_ptr->height;
}
do {
/* get the next breakpoint */
-#ifdef NEW_TEXT
- LyXParagraph::size_type z =
+ LyXParagraph::size_type z =
NextBreakPoint(row, paperwidth);
-#else
- int z = NextBreakPoint(row, paperwidth);
-#endif
Row * tmprow = row;
if (z < row->par->Last() ) {
void LyXText::BreakAgainOneRow(Row * row)
{
/* get the next breakpoint */
-#ifdef NEW_TEXT
LyXParagraph::size_type z = NextBreakPoint(row, paperwidth);
-#else
- int z = NextBreakPoint(row, paperwidth);
-#endif
Row * tmprow = row;
if (z < row->par->Last() ) {
row->height = 0;
}
else {
- row=row->next;
+ row= row->next;
z++;
if (row->pos != z)
row->pos = z;
/* table stuff -- begin*/
if (cursor.par->table) {
// breaking of tables is only allowed at the beginning or the end */
-#ifdef NEW_TEXT
if (cursor.pos && cursor.pos < cursor.par->size() &&
-#else
- if (cursor.pos && cursor.pos < cursor.par->last &&
-#endif
!cursor.par->table->ShouldBeVeryLastCell(NumberOfCell(cursor.par, cursor.pos)))
return; /* no breaking of tables allowed */
}
/* this is only allowed, if the current paragraph is not empty or caption*/
if ((cursor.par->Last() <= 0 && !cursor.par->IsDummy())
&&
- layout.labeltype!=LABEL_SENSITIVE)
+ layout.labeltype!= LABEL_SENSITIVE)
return;
SetUndo(Undo::INSERT,
if (cursor.par->table) {
int cell = NumberOfCell(cursor.par, cursor.pos);
if (cursor.par->table->ShouldBeVeryLastCell(cell))
-#ifdef NEW_TEXT
SetCursor(cursor.par, cursor.par->text.size());
-#else
- SetCursor(cursor.par, cursor.par->last);
-#endif
}
/* table stuff -- end*/
/* please break alway behind a space */
/* ok, move the cursor right before the footnote */
/* just a little faster than using CursorRight() */
- for (cursor.pos=0; cursor.par->ParFromPos(cursor.pos)!=par; cursor.pos++);
+ for (cursor.pos= 0; cursor.par->ParFromPos(cursor.pos)!= par; cursor.pos++);
/* now the cursor is at the beginning of the physical par */
-#ifdef NEW_TEXT
SetCursor(cursor.par,
cursor.pos + cursor.par->ParFromPos(cursor.pos)->text.size());
-#else
- SetCursor(cursor.par, cursor.pos + cursor.par->ParFromPos(cursor.pos)->last);
-#endif
/* the cursor must be exactly before the footnote */
par = cursor.par->ParFromPos(cursor.pos);
switch (feature){
case LyXTable::SET_PWIDTH:
- cursor.par->table->SetPWidth(actCell,val);
+ cursor.par->table->SetPWidth(actCell, val);
break;
case LyXTable::SET_SPECIAL_COLUMN:
case LyXTable::SET_SPECIAL_MULTI:
- cursor.par->table->SetAlignSpecial(actCell,val,feature);
+ cursor.par->table->SetAlignSpecial(actCell, val, feature);
break;
default:
break;
switch (feature){
case LyXTable::ALIGN_LEFT:
- setAlign=LYX_ALIGN_LEFT;
+ setAlign= LYX_ALIGN_LEFT;
break;
case LyXTable::ALIGN_RIGHT:
- setAlign=LYX_ALIGN_RIGHT;
+ setAlign= LYX_ALIGN_RIGHT;
break;
case LyXTable::ALIGN_CENTER:
- setAlign=LYX_ALIGN_CENTER;
+ setAlign= LYX_ALIGN_CENTER;
break;
default:
break;
}
switch (feature){
case LyXTable::APPEND_ROW: {
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = cursor.pos;
-#else
- int pos = cursor.pos;
-#endif
- /* move to the next row */
+
+ /* move to the next row */
int cell_org = actCell;
int cell = cell_org;
/* insert the new cells */
int number = cursor.par->table->NumberOfCellsInRow(cell_org);
for (int i = 0; i < number; ++i)
- cursor.par->InsertChar(pos, LYX_META_NEWLINE);
+ cursor.par->InsertChar(pos, LyXParagraph::META_NEWLINE);
/* append the row into the table */
cursor.par->table->AppendRow(cell_org);
return;
}
case LyXTable::APPEND_CONT_ROW: {
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = cursor.pos;
-#else
- int pos = cursor.pos;
-#endif
/* move to the next row */
int cell_org = actCell;
int cell = cell_org;
/* insert the new cells */
int number = cursor.par->table->NumberOfCellsInRow(cell_org);
int i;
- for (i=0; i<number; i++)
- cursor.par->InsertChar(pos, LYX_META_NEWLINE);
+ for (i= 0; i<number; i++)
+ cursor.par->InsertChar(pos, LyXParagraph::META_NEWLINE);
/* append the row into the table */
cursor.par->table->AppendContRow(cell_org);
return;
}
case LyXTable::APPEND_COLUMN: {
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = 0;
-#else
- int pos = 0;
-#endif
int cell_org = actCell;
int cell = 0;
do{
if (pos && (cursor.par->IsNewline(pos-1))){
if (cursor.par->table->AppendCellAfterCell(cell_org, cell)){
- cursor.par->InsertChar(pos, LYX_META_NEWLINE);
+ cursor.par->InsertChar(pos, LyXParagraph::META_NEWLINE);
if (pos <= cursor.pos)
cursor.pos++;
++pos;
/* remember that the very last cell doesn't end with a newline.
This saves one byte memory per table ;-) */
if (cursor.par->table->AppendCellAfterCell(cell_org, cell))
- cursor.par->InsertChar(cursor.par->Last(), LYX_META_NEWLINE);
+ cursor.par->InsertChar(cursor.par->Last(), LyXParagraph::META_NEWLINE);
/* append the column into the table */
cursor.par->table->AppendColumn(cell_org);
return;
case LyXTable::DELETE_COLUMN: {
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = 0;
-#else
- int pos = 0;
-#endif
int cell_org = actCell;
int cell = 0;
if (current_view->buffer()->the_locking_inset)
case LyXTable::TOGGLE_LINE_TOP:
lineSet = !cursor.par->table->TopLine(actCell);
if (!selection){
- cursor.par->table->SetTopLine(actCell,lineSet);
+ cursor.par->table->SetTopLine(actCell, lineSet);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i,n=-1,m=-2;
-#endif
for (i = sel_start_cursor.pos; i <= sel_end_cursor.pos; ++i){
if ((n = NumberOfCell(sel_start_cursor.par, i)) != m) {
cursor.par->table->SetTopLine(n, lineSet);
case LyXTable::TOGGLE_LINE_BOTTOM:
lineSet = !cursor.par->table->BottomLine(actCell);
if (!selection){
- cursor.par->table->SetBottomLine(actCell,lineSet);
+ cursor.par->table->SetBottomLine(actCell, lineSet);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i, n = -1, m = -2;
-#endif
for (i = sel_start_cursor.pos; i <= sel_end_cursor.pos; ++i) {
if ((n = NumberOfCell(sel_start_cursor.par, i)) != m) {
cursor.par->table->SetBottomLine(n, lineSet);
case LyXTable::TOGGLE_LINE_LEFT:
lineSet = !cursor.par->table->LeftLine(actCell);
if (!selection){
- cursor.par->table->SetLeftLine(actCell,lineSet);
+ cursor.par->table->SetLeftLine(actCell, lineSet);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i,n=-1,m=-2;
-#endif
for (i = sel_start_cursor.pos; i <= sel_end_cursor.pos; ++i){
- if ((n=NumberOfCell(sel_start_cursor.par,i)) != m) {
- cursor.par->table->SetLeftLine(n,lineSet);
+ if ((n= NumberOfCell(sel_start_cursor.par, i)) != m) {
+ cursor.par->table->SetLeftLine(n, lineSet);
m = n;
}
}
case LyXTable::TOGGLE_LINE_RIGHT:
lineSet = !cursor.par->table->RightLine(actCell);
if (!selection){
- cursor.par->table->SetRightLine(actCell,lineSet);
+ cursor.par->table->SetRightLine(actCell, lineSet);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i,n=-1,m=-2;
-#endif
- for (i=sel_start_cursor.pos; i<=sel_end_cursor.pos; i++){
- if ((n=NumberOfCell(sel_start_cursor.par,i)) != m) {
- cursor.par->table->SetRightLine(n,lineSet);
+ for (i= sel_start_cursor.pos; i<= sel_end_cursor.pos; i++){
+ if ((n= NumberOfCell(sel_start_cursor.par, i)) != m) {
+ cursor.par->table->SetRightLine(n, lineSet);
m = n;
}
}
case LyXTable::ALIGN_RIGHT:
case LyXTable::ALIGN_CENTER:
if (!selection){
- cursor.par->table->SetAlignment(actCell,setAlign);
+ cursor.par->table->SetAlignment(actCell, setAlign);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i,n=-1,m=-2;
-#endif
- for (i=sel_start_cursor.pos; i<=sel_end_cursor.pos; i++){
- if ((n=NumberOfCell(sel_start_cursor.par,i)) != m) {
- cursor.par->table->SetAlignment(n,setAlign);
+ for (i= sel_start_cursor.pos; i<= sel_end_cursor.pos; i++){
+ if ((n= NumberOfCell(sel_start_cursor.par, i)) != m) {
+ cursor.par->table->SetAlignment(n, setAlign);
m = n;
}
}
// temporary: Should put table in simple_cut_buffer (with before and after
// dummy-paragraph !!
// not necessar anymore with UNDO :)
-#ifdef NEW_TEXT
- for (LyXParagraph::size_type i =
+ for (LyXParagraph::size_type i =
cursor.par->text.size() - 1; i >= 0; --i)
-#else
- for (int i = cursor.par->last-1; i>=0; i--)
-#endif
cursor.par->Erase(i);
RedoParagraph();
return;
if (multicol){
int newlines = cursor.par->table->UnsetMultiColumn(actCell);
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = cursor.pos;
-#else
- int pos = cursor.pos;
-#endif
while (pos < cursor.par->Last() && !cursor.par->IsNewline(pos))
pos++;
for (;newlines;newlines--)
- cursor.par->InsertChar(pos, LYX_META_NEWLINE);
+ cursor.par->InsertChar(pos, LyXParagraph::META_NEWLINE);
RedoParagraph();
return;
}
}
else {
if (sel_start_cursor.row == sel_end_cursor.row){
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
-#else
- int i;
-#endif
number = 1;
for (i = sel_start_cursor.pos;
i < sel_end_cursor.pos; ++i){
cursor.pos),
setLines);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i,n=-1,m=-2;
-#endif
for (i = sel_start_cursor.pos; i <= sel_end_cursor.pos; ++i) {
- if ((n=NumberOfCell(sel_start_cursor.par,i)) != m) {
- cursor.par->table->SetAllLines(n,setLines);
+ if ((n= NumberOfCell(sel_start_cursor.par, i)) != m) {
+ cursor.par->table->SetAllLines(n, setLines);
m = n;
}
}
return;
case LyXTable::SET_ROTATE_CELL:
if (!selection){
- cursor.par->table->SetRotateCell(actCell,true);
+ cursor.par->table->SetRotateCell(actCell, true);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i,n=-1,m=-2;
-#endif
for (i = sel_start_cursor.pos; i <= sel_end_cursor.pos; ++i){
- if ((n = NumberOfCell(sel_start_cursor.par,i)) != m) {
- cursor.par->table->SetRotateCell(n,true);
+ if ((n = NumberOfCell(sel_start_cursor.par, i)) != m) {
+ cursor.par->table->SetRotateCell(n, true);
m = n;
}
}
return;
case LyXTable::UNSET_ROTATE_CELL:
if (!selection){
- cursor.par->table->SetRotateCell(actCell,false);
+ cursor.par->table->SetRotateCell(actCell, false);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i, n = -1, m = -2;
-#endif
- for (i=sel_start_cursor.pos; i<=sel_end_cursor.pos; i++){
- if ((n=NumberOfCell(sel_start_cursor.par,i)) != m) {
- cursor.par->table->SetRotateCell(n,false);
+ for (i= sel_start_cursor.pos; i<= sel_end_cursor.pos; i++){
+ if ((n= NumberOfCell(sel_start_cursor.par, i)) != m) {
+ cursor.par->table->SetRotateCell(n, false);
m = n;
}
}
case LyXTable::SET_LINEBREAKS:
what = !cursor.par->table->Linebreaks(cursor.par->table->FirstVirtualCell(actCell));
if (!selection){
- cursor.par->table->SetLinebreaks(actCell,what);
+ cursor.par->table->SetLinebreaks(actCell, what);
} else {
-#ifdef NEW_TEXT
LyXParagraph::size_type i;
int n = -1, m = -2;
-#else
- int i, n = -1, m = -2;
-#endif
for (i = sel_start_cursor.pos; i <= sel_end_cursor.pos; ++i) {
- if ((n = NumberOfCell(sel_start_cursor.par,i)) != m) {
- cursor.par->table->SetLinebreaks(n,what);
+ if ((n = NumberOfCell(sel_start_cursor.par, i)) != m) {
+ cursor.par->table->SetLinebreaks(n, what);
m = n;
}
}
}
return;
case LyXTable::SET_LTFIRSTHEAD:
- cursor.par->table->SetLTHead(actCell,true);
+ cursor.par->table->SetLTHead(actCell, true);
return;
case LyXTable::SET_LTHEAD:
- cursor.par->table->SetLTHead(actCell,false);
+ cursor.par->table->SetLTHead(actCell, false);
return;
case LyXTable::SET_LTFOOT:
- cursor.par->table->SetLTFoot(actCell,false);
+ cursor.par->table->SetLTFoot(actCell, false);
return;
case LyXTable::SET_LTLASTFOOT:
- cursor.par->table->SetLTFoot(actCell,true);
+ cursor.par->table->SetLTFoot(actCell, true);
return;
case LyXTable::SET_LTNEWPAGE:
what = !cursor.par->table->LTNewPage(actCell);
- cursor.par->table->SetLTNewPage(actCell,what);
+ cursor.par->table->SetLTNewPage(actCell, what);
return;
}
}
* current font */
// Get the font that is used to calculate the baselineskip
-#ifdef NEW_TEXT
- LyXParagraph::size_type const lastpos =
+ LyXParagraph::size_type const lastpos =
cursor.par->Last();
-#else
- int const lastpos = cursor.par->Last();
-#endif
LyXFont rawparfont = cursor.par->GetFontSettings(lastpos - 1);
jumped_over_space = false;
row = cursor.row;
y = cursor.y - row->baseline;
- if (c != LYX_META_INSET) /* in this case LyXText::InsertInset
+ if (c != LyXParagraph::META_INSET) /* in this case LyXText::InsertInset
* already inserted the character */
cursor.par->InsertChar(cursor.pos, c);
SetCharFont(cursor.par, cursor.pos, rawtmpfont);
RedoHeightOfParagraph(cursor);
}
-#ifdef NEW_TEXT
+
void LyXText::CheckParagraphInTable(LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-void LyXText::CheckParagraphInTable(LyXParagraph * par, int pos)
-#endif
{
- if (par->GetChar(pos) == LYX_META_INSET &&
+ if (par->GetChar(pos) == LyXParagraph::META_INSET &&
par->GetInset(pos) && par->GetInset(pos)->Display()){
par->GetInset(pos)->SetDisplay(false);
}
int tmpheight = row->height;
SetHeightOfRow(row);
-#ifdef NEW_TEXT
LyXParagraph::size_type tmp_pos = pos;
-#else
- int tmp_pos = pos;
-#endif
/* update the table information */
while (tmp_pos && !par->IsNewline(tmp_pos - 1))
tmp_pos--;
CursorLeftIntern();
/* some insets are undeletable here */
- if (cursor.par->GetChar(cursor.pos)==LYX_META_INSET) {
+ if (cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET) {
if (!cursor.par->GetInset(cursor.pos)->Deletable())
return;
}
bool jumped_over_space;
LyXFont realtmpfont;
LyXFont rawtmpfont;
-#ifdef NEW_TEXT
LyXParagraph::size_type z;
LyXParagraph::size_type lastpos;
-#else
- int z;
- int lastpos;
-#endif
LyXFont rawparfont;
SetUndo(Undo::INSERT,
/* When the free-spacing option is set for the current layout,
* all spaces are converted to protected spaces. */
- bool freeSpacingBo =
+ bool freeSpacingBo =
textclasslist.Style(parameters->textclass,
cursor.row->par->GetLayout()).free_spacing;
if (freeSpacingBo && IsLineSeparatorChar(c)
&& (!cursor.pos || cursor.par->IsLineSeparator(cursor.pos-1)))
- c = LYX_META_PROTECTED_SEPARATOR;
+ c = LyXParagraph::META_PROTECTED_SEPARATOR;
/* table stuff -- begin*/
if (cursor.par->table) {
}
/* the display inset stuff */
- if (cursor.row->par->GetChar(cursor.row->pos) == LYX_META_INSET
+ if (cursor.row->par->GetChar(cursor.row->pos) == LyXParagraph::META_INSET
&& cursor.row->par->GetInset(cursor.row->pos)
&& cursor.row->par->GetInset(cursor.row->pos)->Display())
cursor.row->fill = -1; // to force a new break
/* ok, heres a better way: */
row = cursor.row;
y = cursor.y - row->baseline;
- if (c != LYX_META_INSET) /* in this case LyXText::InsertInset
+ if (c != LyXParagraph::META_INSET) /* in this case LyXText::InsertInset
* already insertet the character */
cursor.par->InsertChar(cursor.pos, c);
SetCharFont(cursor.par, cursor.pos, rawtmpfont);
align = row->par->FirstPhysicalPar()->align;
/* center displayed insets */
- if (row->par->GetChar(row->pos) == LYX_META_INSET
+ if (row->par->GetChar(row->pos) == LyXParagraph::META_INSET
&& row->par->GetInset(row->pos)
&& row->par->GetInset(row->pos)->Display())
align = LYX_ALIGN_CENTER;
ns = NumberOfSeparators(row);
if (ns && row->next && row->next->par == row->par &&
!(row->next->par->IsNewline(row->next->pos-1))
- && !(row->next->par->GetChar(row->next->pos) == LYX_META_INSET
+ && !(row->next->par->GetChar(row->next->pos) == LyXParagraph::META_INSET
&& row->next->par->GetInset(row->next->pos)
&& row->next->par->GetInset(row->next->pos)->Display())
)
while ( tmpcursor.pos < tmpcursor.par->Last() &&
! tmpcursor.par->IsWord( tmpcursor.pos ) )
{
- // printf("Current pos1 %d",tmpcursor.pos) ;
+ // printf("Current pos1 %d", tmpcursor.pos) ;
tmpcursor.pos++;
steps++;
}
while ( tmpcursor.pos < tmpcursor.par->Last() &&
tmpcursor.par->IsWord( tmpcursor.pos ) )
{
- // printf("Current pos2 %d",tmpcursor.pos) ;
+ // printf("Current pos2 %d", tmpcursor.pos) ;
tmpcursor.pos++;
steps++;
}
(optional hyphens are part of a word) */
while (cursor.pos < cursor.par->Last()
&& (cursor.par->IsLetter(cursor.pos))
- || (cursor.par->GetChar(cursor.pos) == LYX_META_INSET &&
+ || (cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET &&
cursor.par->GetInset(cursor.pos) != 0 &&
- cursor.par->GetInset(cursor.pos)->Latex(latex,0)==0 &&
+ cursor.par->GetInset(cursor.pos)->Latex(latex, 0) == 0 &&
latex == "\\-"))
cursor.pos++;
if (sel_cursor.pos < cursor.pos) {
str = new char [cursor.pos - sel_cursor.pos + 2];
-#ifdef NEW_TEXT
LyXParagraph::size_type i, j;
-#else
- int i,j;
-#endif
for (i = sel_cursor.pos, j = 0; i < cursor.pos; ++i) {
- if (cursor.par->GetChar(i) != LYX_META_INSET)
+ if (cursor.par->GetChar(i) != LyXParagraph::META_INSET)
str[j++] = cursor.par->GetChar(i);
}
str[j] = '\0';
/* now find the end of the word */
while (cursor.pos < cursor.par->Last()
&& (cursor.par->IsLetter(cursor.pos)
- || (cursor.par->GetChar(cursor.pos) == LYX_META_INSET &&
+ || (cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET &&
cursor.par->GetInset(cursor.pos) != 0 &&
- cursor.par->GetInset(cursor.pos)->Latex(latex,0)==0 &&
+ cursor.par->GetInset(cursor.pos)->Latex(latex, 0) == 0 &&
latex == "\\-")))
cursor.pos++;
SetUndo(Undo::FINISH, tmppar->previous, tmppar->next);
-#ifdef NEW_TEXT
- LyXParagraph::size_type tmppos =
+ LyXParagraph::size_type tmppos =
cursor.par->PositionInParFromPos(cursor.pos);
while (tmppos < tmppar->size()) {
-#else
- int tmppos = cursor.par->PositionInParFromPos(cursor.pos);
- while (tmppos < tmppar->last) {
-#endif
unsigned char c = tmppar->text[tmppos];
if (IsKommaChar(c) || IsLineSeparatorChar(c))
break;
- if (c != LYX_META_INSET) {
+ if (c != LyXParagraph::META_INSET) {
switch (action) {
case text_lowercase:
c = tolower(c);
if ((lastpos == 0
|| (lastpos == 1 && cursor.par->IsSeparator(0)))
&& !(cursor.par->Next()
- && cursor.par->footnoteflag ==
+ && cursor.par->footnoteflag ==
LyXParagraph::NO_FOOTNOTE
- && cursor.par->Next()->footnoteflag ==
+ && cursor.par->Next()->footnoteflag ==
LyXParagraph::OPEN_FOOTNOTE)) {
if (cursor.par->previous) {
CursorLeftIntern();
/* some insets are undeletable here */
- if (cursor.par->GetChar(cursor.pos)==LYX_META_INSET) {
+ if (cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET) {
if (!cursor.par->GetInset(cursor.pos)->Deletable())
return;
/* force complete redo when erasing display insets */
row = cursor.row;
y = cursor.y - row->baseline;
-#ifdef NEW_TEXT
LyXParagraph::size_type z;
-#else
- int z;
-#endif
/* remember that a space at the end of a row doesnt count
* when calculating the fill */
if (cursor.pos < RowLast(row) ||
Row * row_ptr, long y)
{
/* returns a printed row */
-#ifdef NEW_TEXT
LyXParagraph::size_type pos, pos_end;
-#else
- int pos, pos_end;
-#endif
float x, tmpx;
int y_top, y_bottom;
float fill_separator, fill_hfill, fill_label_hfill;
PrepareToPrint(row_ptr, x, fill_separator,
fill_hfill, fill_label_hfill);
-#ifdef NEW_TEXT
- LyXParagraph::size_type main_body =
+ LyXParagraph::size_type main_body =
BeginningOfMainBody(row_ptr->par);
-#else
- int main_body = BeginningOfMainBody(row_ptr->par);
-#endif
/* initialize the pixmap */
scr.fillRectangle(gc_clear,
paperwidth - sel_start_cursor.x,
row_ptr->height);
} else if (sel_end_cursor.row == row_ptr) {
- scr.fillRectangle(gc_selection,0, offset,
+ scr.fillRectangle(gc_selection, 0, offset,
sel_end_cursor.x, row_ptr->height);
} else if (y > sel_start_cursor.y && y < sel_end_cursor.y) {
scr.fillRectangle(gc_selection, 0, offset,
scr.drawVerticalLine(gc_math, paperwidth-2 , offset, offset+row_ptr->height);
}
- if (row_ptr->par->pextra_type == PEXTRA_MINIPAGE) {
+ if (row_ptr->par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) {
/* draw a marker at the left margin! */
LyXFont font = GetFont(row_ptr->par, 0);
int asc = font.maxAscent();
if (mono_video) {
back = gc_clear;
}
- scr.fillRectangle(back,LYX_PAPER_MARGIN, offset+1,
+ scr.fillRectangle(back, LYX_PAPER_MARGIN, offset+1,
box_x - LYX_PAPER_MARGIN,
int(font.maxAscent())+
int(font.maxDescent()));
/* think about the parskip */
/* some parskips VERY EASY IMPLEMENTATION */
- if (parameters->paragraph_separation == LYX_PARSEP_SKIP) {
+ if (parameters->paragraph_separation == BufferParams::PARSEP_SKIP) {
if (layout.latextype == LATEX_PARAGRAPH
&& firstpar->GetDepth() == 0
&& firstpar->Previous())
string tmpstring = row_ptr->par->GetLabestring();
if (layout.labeltype == LABEL_COUNTER_CHAPTER) {
- if (parameters->secnumdepth >=0){
+ if (parameters->secnumdepth >= 0){
/* this is special code for the chapter layout. This is printed in
* an extra row and has a pagebreak at the top. */
maxdesc = int(font.maxDescent() * layout.spacing.getValue() * parameters->spacing.getValue())
}
}
}
- if (layout.labeltype==LABEL_BIBLIO) { // ale970302
+ if (layout.labeltype == LABEL_BIBLIO) { // ale970302
if (row_ptr->par->bibkey) {
tmpx = x;
x -= font.stringWidth(layout.labelsep);
} else {
if (row_ptr->par->IsSeparator(pos)) {
tmpx = x;
- x+=SingleWidth(row_ptr->par, pos);
+ x+= SingleWidth(row_ptr->par, pos);
/* -------> Only draw protected spaces when not in
* free-spacing mode. */
- if (row_ptr->par->GetChar(pos)==LYX_META_PROTECTED_SEPARATOR && !layout.free_spacing) {
+ if (row_ptr->par->GetChar(pos) == LyXParagraph::META_PROTECTED_SEPARATOR && !layout.free_spacing) {
scr.drawVerticalLine(gc_fill, int(tmpx),
offset + row_ptr->baseline - 3,
offset + row_ptr->baseline - 1);
scr.drawVerticalLine(gc_fill, int(x),
offset + row_ptr->baseline - DefaultHeight()/2,
offset + row_ptr->baseline);
- if (HfillExpansion(row_ptr,pos)) {
+ if (HfillExpansion(row_ptr, pos)) {
if (pos >= main_body) {
scr.drawOnOffLine(offset + row_ptr->baseline -
DefaultHeight()/4,
} else {
if (row_ptr->par->IsSeparator(pos)) {
tmpx = x;
- x+=SingleWidth(row_ptr->par, pos);
+ x+= SingleWidth(row_ptr->par, pos);
if (pos >= main_body)
x+= fill_separator;
/* -------> Only draw protected spaces when not in
* free-spacing mode. */
- if (row_ptr->par->GetChar(pos)==LYX_META_PROTECTED_SEPARATOR && !layout.free_spacing) {
+ if (row_ptr->par->GetChar(pos) == LyXParagraph::META_PROTECTED_SEPARATOR && !layout.free_spacing) {
scr.drawVerticalLine(gc_fill, int(tmpx),
offset + row_ptr->baseline - 3,
/* selection code */
if (sel_start_cursor.row == row_ptr && sel_end_cursor.row == row_ptr) {
- scr.fillRectangle(gc_select,sel_start_cursor.x, offset,
+ scr.fillRectangle(gc_select, sel_start_cursor.x, offset,
sel_end_cursor.x - sel_start_cursor.x,
row_ptr->height);
} else if (sel_start_cursor.row == row_ptr) {
tmpx -= SingleWidth(row->par, c - 1);
tmpx -= fill_separator;
}
- c-=row->pos;
+ c-= row->pos;
x = int(tmpx);
return c;
}
/* no marginpars in minipages */
if (kind == LyXParagraph::MARGIN
- && cursor.par->pextra_type == PEXTRA_MINIPAGE) {
+ && cursor.par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) {
WriteAlert(_("Impossible operation"),
_("You can't insert a marginpar in a minipage!"),
_("Sorry."));
/* returns pointer to a specified row */
-#ifdef NEW_TEXT
Row * LyXText::GetRow(LyXParagraph * par, LyXParagraph::size_type pos, long &y)
-#else
-Row * LyXText::GetRow(LyXParagraph * par, int pos, long &y)
-#endif
{
Row * tmprow;
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
#ifdef __GNUG__
#pragma implementation "lyxtext.h"
-#pragma implementation "undo.h"
#endif
#include "LString.h"
parameters = &p->params;
params = p;
number_of_rows = 0;
- refresh_y= 0;
+ refresh_y = 0;
status = LyXText::UNCHANGED;
LyXParagraph * par = p->paragraph;
current_font = GetFont(par, 0);
// smaller. (Asger)
// If position is -1, we get the layout font of the paragraph.
// If position is -2, we get the font of the manual label of the paragraph.
-#ifdef NEW_TEXT
LyXFont LyXText::GetFont(LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-LyXFont LyXText::GetFont(LyXParagraph * par, int pos)
-#endif
{
LyXLayout const & layout =
textclasslist.Style(parameters->textclass, par->GetLayout());
}
-#ifdef NEW_TEXT
void LyXText::SetCharFont(LyXParagraph * par,
LyXParagraph::size_type pos,
LyXFont font)
-#else
-void LyXText::SetCharFont(LyXParagraph * par, int pos, LyXFont font)
-#endif
{
/* let the insets convert their font */
- if (par->GetChar(pos) == LYX_META_INSET) {
+ if (par->GetChar(pos) == LyXParagraph::META_INSET) {
if (par->GetInset(pos))
font = par->GetInset(pos)->ConvertFont(font);
}
/* inserts a new row behind the specified row, increments
* the touched counters */
-#ifdef NEW_TEXT
void LyXText::InsertRow(Row * row, LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-void LyXText::InsertRow(Row * row, LyXParagraph * par, int pos)
-#endif
{
Row * tmprow = new Row;
if (!row) {
void LyXText::OpenStuff()
{
if (cursor.pos == 0 && cursor.par->bibkey){
- cursor.par->bibkey->Edit(0,0);
+ cursor.par->bibkey->Edit(0, 0);
}
else if (cursor.pos < cursor.par->Last()
- && cursor.par->GetChar(cursor.pos) == LYX_META_INSET
+ && cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET
&& cursor.par->GetInset(cursor.pos)->Editable()) {
minibuffer->Set(cursor.par->GetInset(cursor.pos)->EditMessage());
if (cursor.par->GetInset(cursor.pos)->Editable() != 2)
SetCursorParUndo();
- cursor.par->GetInset(cursor.pos)->Edit(0,0);
+ cursor.par->GetInset(cursor.pos)->Edit(0, 0);
}
else {
ToggleFootnote();
/* ok, move the cursor right before the footnote */
/* just a little faster than using CursorRight() */
- for (cursor.pos=0; cursor.par->ParFromPos(cursor.pos)!=par; cursor.pos++);
+ for (cursor.pos = 0; cursor.par->ParFromPos(cursor.pos)!= par; cursor.pos++);
/* now the cursor is at the beginning of the physical par */
-#ifdef NEW_TEXT
SetCursor(cursor.par,
cursor.pos +
cursor.par->ParFromPos(cursor.pos)->text.size());
-#else
- SetCursor(cursor.par, cursor.pos + cursor.par->ParFromPos(cursor.pos)->last);
-#endif
}
else {
/* we are in a footnote, so let us move at the beginning */
LyXLayout const & layout = textclasslist.Style(parameters->textclass, par->GetLayout());
-#ifdef NEW_TEXT
for (LyXParagraph::size_type pos = 0;
pos < par->Last(); ++pos) {
-#else
- for (int pos = 0; pos < par->Last(); pos++) {
-#endif
if (pos < BeginningOfMainBody(par))
layoutfont = layout.labelfont;
else
else
layoutfont = GetFont(cursor.par, -1);
// Update current font
- real_current_font.update(font,toggleall);
+ real_current_font.update(font, toggleall);
// Reduce to implicit settings
current_font = real_current_font;
== sel_start_cursor.par->footnoteflag) { /* an open footnote
* should behave
* like a closed */
- LyXFont newfont = GetFont(cursor.par,cursor.pos);
- newfont.update(font,toggleall);
+ LyXFont newfont = GetFont(cursor.par, cursor.pos);
+ newfont.update(font, toggleall);
SetCharFont(cursor.par, cursor.pos, newfont);
cursor.pos++;
} else {
tmpy = 0;
}
- if (tmpy<=y)
+ if (tmpy<= y)
while (tmprow->next && tmpy + tmprow->height <= y) {
tmpy += tmprow->height;
tmprow = tmprow->next;
int implicitSelection = SelectWordWhenUnderCursor();
// Set font
- SetFont(font,toggleall);
+ SetFont(font, toggleall);
//minibuffer->Set(_("Font style changed"));
/* Implicit selections are cleared afterwards and cursor is set to the
}
-#ifdef NEW_TEXT
-LyXParagraph::size_type
-LyXText::BeginningOfMainBody(LyXParagraph * par)
-#else
-int LyXText::BeginningOfMainBody(LyXParagraph * par)
-#endif
+LyXParagraph::size_type LyXText::BeginningOfMainBody(LyXParagraph * par)
{
if (textclasslist.Style(parameters->textclass, par->GetLayout()).labeltype != LABEL_MANUAL)
return 0;
tmppar = firsttmppar;
/* tmppar is now the paragraph right before the footnote */
-#ifdef NEW_TEXT
char first_footnote_par_is_not_empty = tmppar->next->text.size();
-#else
- char first_footnote_par_is_not_empty = tmppar->next->last;
-#endif
while (tmppar->next && tmppar->next->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
tmppar = tmppar->next; /* I use next instead of Next(),
* (only if the previous par and the footnotepar are not empty!) */
if ((!firsttmppar->next->GetLayout() && !firsttmppar->next->table)
|| firsttmppar->HasSameLayout(firsttmppar->next)) {
-#ifdef NEW_TEXT
if (firsttmppar->text.size()
&& !firsttmppar->IsSeparator(firsttmppar->text.size() - 1)
-#else
- if (firsttmppar->last
- && !firsttmppar->IsSeparator(firsttmppar->last - 1)
-#endif
&& first_footnote_par_is_not_empty) {
firsttmppar->next->InsertChar(0, ' ');
}
refresh_y = cursor.y - cursor.row->baseline;
if (cursor.par->footnoteflag ==
sel_start_cursor.par->footnoteflag) {
- if (type == PEXTRA_NONE) {
- if (cursor.par->pextra_type != PEXTRA_NONE) {
+ if (type == LyXParagraph::PEXTRA_NONE) {
+ if (cursor.par->pextra_type != LyXParagraph::PEXTRA_NONE) {
cursor.par->UnsetPExtraType();
- cursor.par->pextra_type=PEXTRA_NONE;
+ cursor.par->pextra_type = LyXParagraph::PEXTRA_NONE;
}
} else {
- cursor.par->SetPExtraType(type,width,widthp);
+ cursor.par->SetPExtraType(type, width, widthp);
cursor.par->pextra_hfill = hfill;
cursor.par->pextra_start_minipage = start_minipage;
cursor.par->pextra_alignment = alignment;
par->Previous()->GetLayout()
).labeltype != LABEL_BIBLIO
&& layout.labeltype == LABEL_BIBLIO)) {
- for (i=0; i<10; i++) {
+ for (i = 0; i<10; i++) {
par->setCounter(i, par->Previous()->GetFirstCounter(i));
}
par->appendix = par->Previous()->FirstPhysicalPar()->appendix;
if (!par->appendix && par->start_of_appendix){
par->appendix = true;
- for (i=0; i<10; i++) {
+ for (i = 0; i<10; i++) {
par->setCounter(i, 0);
}
}
par->itemdepth = par->Previous()->FirstPhysicalPar()->itemdepth;
}
else {
- for (i=0; i<10; i++) {
+ for (i = 0; i<10; i++) {
par->setCounter(i, 0);
}
par->appendix = par->start_of_appendix;
/* reset the counters.
* A depth change is like a breaking layout
*/
- for (i=6 + par->enumdepth + 1; i<10;i++)
+ for (i = 6 + par->enumdepth + 1; i<10;i++)
par->setCounter(i, 0);
}
if (layout.labeltype >= LABEL_FIRST_COUNTER) {
i = layout.labeltype - LABEL_FIRST_COUNTER;
- if (i >= 0 && i<=parameters->secnumdepth) {
+ if (i >= 0 && i<= parameters->secnumdepth) {
par->incCounter(i); // increment the counter
char * s = new char[50];
/* reset the enumeration counter. They are always resetted
* when there is any other layout between */
- for (i=6 + par->enumdepth; i<10;i++)
+ for (i = 6 + par->enumdepth; i<10;i++)
par->setCounter(i, 0);
}
}
SetUndo(Undo::INSERT,
cursor.par->ParFromPos(cursor.pos)->previous,
cursor.par->ParFromPos(cursor.pos)->next);
- cursor.par->InsertChar(cursor.pos, LYX_META_INSET);
+ cursor.par->InsertChar(cursor.pos, LyXParagraph::META_INSET);
cursor.par->InsertInset(cursor.pos, inset);
- InsertChar(LYX_META_INSET); /* just to rebreak and refresh correctly.
+ InsertChar(LyXParagraph::META_INSET); /* just to rebreak and refresh correctly.
* The character will not be inserted a
* second time */
}
== sel_end_cursor.par->ParFromPos(sel_end_cursor.pos)) {
/* only within one paragraph */
simple_cut_buffer = new LyXParagraph;
-#ifdef NEW_TEXT
- simple_cut_buffer->text.reserve(500);
LyXParagraph::size_type i =
sel_start_cursor.pos;
-#else
- int i = sel_start_cursor.pos;
-#endif
for (; i< sel_end_cursor.pos; i++){
/* table stuff -- begin*/
if (sel_start_cursor.par->table
void LyXText::CopySelection()
{
-#ifdef NEW_TEXT
LyXParagraph::size_type i = 0;
-#else
- int i = 0;
-#endif
/* this doesnt make sense, if there is no selection */
if (!selection) {
return;
== sel_end_cursor.par->ParFromPos(sel_end_cursor.pos)) {
/* only within one paragraph */
simple_cut_buffer = new LyXParagraph;
-#if NEW_TEXT
- simple_cut_buffer->text.reserve(500);
-#endif
for (i = sel_start_cursor.pos; i < sel_end_cursor.pos; ++i){
sel_start_cursor.par->CopyIntoMinibuffer(i);
simple_cut_buffer->InsertFromMinibuffer(i - sel_start_cursor.pos);
tmppar = tmppar->next;
tmppar2->next = tmppar->Clone();
tmppar2->next->previous = tmppar2;
- tmppar2=tmppar2->next;
+ tmppar2 = tmppar2->next;
}
tmppar2->next = 0;
}
/* the simple_cut_buffer paragraph is too big */
-#ifdef NEW_TEXT
LyXParagraph::size_type tmpi2 =
sel_start_cursor.par->PositionInParFromPos(sel_start_cursor.pos);
-#else
- int tmpi2 =
- sel_start_cursor.par->PositionInParFromPos(sel_start_cursor.pos);
-#endif
for (;tmpi2;tmpi2--)
simple_cut_buffer->Erase(0);
/* now tmppar 2 is too big, delete all after sel_end_cursor.pos */
tmpi2 = sel_end_cursor.par->PositionInParFromPos(sel_end_cursor.pos);
-#ifdef NEW_TEXT
while (tmppar2->size() > tmpi2) {
tmppar2->Erase(tmppar2->text.size() - 1);
}
-#else
- while (tmppar2->last > tmpi2) {
- tmppar2->Erase(tmppar2->last-1);
- }
-#endif
}
}
/* table stuff -- begin*/
bool table_too_small = false;
if (tmpcursor.par->table) {
-#ifdef NEW_TEXT
while (simple_cut_buffer->text.size()
&& !table_too_small) {
-#else
- while (simple_cut_buffer->last && !table_too_small){
-#endif
if (simple_cut_buffer->IsNewline(0)){
while(tmpcursor.pos < tmpcursor.par->Last() && !tmpcursor.par->IsNewline(tmpcursor.pos))
tmpcursor.pos++;
}
} else {
/* table stuff -- end*/
-#ifdef NEW_TEXT
while (simple_cut_buffer->text.size()){
-#else
- while (simple_cut_buffer->last){
-#endif
simple_cut_buffer->CutIntoMinibuffer(0);
simple_cut_buffer->Erase(0);
tmpcursor.par->InsertFromMinibuffer(tmpcursor.pos);
tmppar = tmppar->next;
tmppar2->next = tmppar->Clone();
tmppar2->next->previous = tmppar2;
- tmppar2=tmppar2->next;
+ tmppar2 = tmppar2->next;
if (cursor.par->footnoteflag){
tmppar->footnoteflag = cursor.par->footnoteflag;
tmppar->footnotekind = cursor.par->footnotekind;
/* find the end of the buffer */
LyXParagraph *lastbuffer = simple_cut_buffer;
while (lastbuffer->Next())
- lastbuffer=lastbuffer->Next();
+ lastbuffer = lastbuffer->Next();
/* find the physical end of the buffer */
lastbuffer = simple_cut_buffer;
while (lastbuffer->Next())
- lastbuffer=lastbuffer->Next();
+ lastbuffer = lastbuffer->Next();
/* please break behind a space, if there is one. The space
* should be copied too */
if ((!cursor.par->Last()
|| cursor.par->IsLineSeparator(cursor.pos - 1)
|| cursor.par->IsNewline(cursor.pos - 1))
-#ifdef NEW_TEXT
&& simple_cut_buffer->text.size()
-#else
- && simple_cut_buffer->last
-#endif
&& simple_cut_buffer->IsLineSeparator(0))
simple_cut_buffer->Erase(0);
/* returns true if the specified string is at the specified position */
-#ifdef NEW_TEXT
bool LyXText::IsStringInText(LyXParagraph * par,
LyXParagraph::size_type pos,
char const * str)
-#else
-bool LyXText::IsStringInText(LyXParagraph * par, int pos, char const * str)
-#endif
{
if (par) {
int i = 0;
}
// Get font setting before we cut
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = sel_end_cursor.pos;
-#else
- int pos = sel_end_cursor.pos;
-#endif
LyXFont font = sel_start_cursor.par->GetFontSettings(sel_start_cursor.pos);
// Insert the new string
bool LyXText::SearchForward(char const * str)
{
LyXParagraph * par = cursor.par;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = cursor.pos;
-#else
- int pos = cursor.pos;
-#endif
while (par && !IsStringInText(par, pos, str)) {
if (pos < par->Last() - 1)
++pos;
}
}
if (par) {
- SetCursor(par,pos);
+ SetCursor(par, pos);
return true;
}
else
pos = par->Last()-1;
} while (par && pos<0);
}
- } while (par && !IsStringInText(par,pos,string));
+ } while (par && !IsStringInText(par, pos, string));
if (par) {
- SetCursor(par,pos);
+ SetCursor(par, pos);
return true;
}
else
}
-#ifdef NEW_TEXT
void LyXText::InsertStringA(LyXParagraph::TextContainer const & text)
{
char * str = new char[text.size() + 1];
InsertStringA(str);
delete [] str;
}
-#endif
+
/* needed to insert the selection */
void LyXText::InsertStringA(char const * str)
{
LyXParagraph * par = cursor.par;
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = cursor.pos;
LyXParagraph::size_type a = 0;
-#else
- int pos = cursor.pos;
- int a = 0;
-#endif
int cell = 0;
LyXParagraph * endpar = cursor.par->Next();
/* insert the string, don't insert doublespace */
int i = 0;
-#ifndef NEW_TEXT
- int i2 = 0;
- for (i2 = i; str[i2] && str[i2] != '\n'; ++i2);
- par->Enlarge(pos, i2 - i);
-#endif
while (str[i]) {
- if (str[i]!='\n') {
- if (str[i]==' ' && (str[i+1]!=' ')
- && pos && par->GetChar(pos-1)!=' ') {
+ if (str[i]!= '\n') {
+ if (str[i] == ' ' && (str[i+1]!= ' ')
+ && pos && par->GetChar(pos-1)!= ' ') {
par->InsertChar(pos,' ');
pos++;
}
else if (par->table) {
if (str[i] == '\t') {
-#ifdef NEW_TEXT
while((pos < par->size()) &&
- (par->GetChar(pos) != LYX_META_NEWLINE))
+ (par->GetChar(pos) != LyXParagraph::META_NEWLINE))
++pos;
if (pos < par->size())
++pos;
-#else
- while((pos < par->last) &&
- (par->GetChar(pos) != LYX_META_NEWLINE))
- ++pos;
- if (pos < par->last)
- ++pos;
-#endif
else // no more fields to fill skip the rest
break;
} else if ((str[i] != 13) &&
((str[i] & 127) >= ' ')) {
- par->InsertChar(pos,str[i]);
+ par->InsertChar(pos, str[i]);
pos++;
}
}
- else if (str[i]==' ') {
- par->InsertChar(pos,LYX_META_PROTECTED_SEPARATOR);
+ else if (str[i] == ' ') {
+ par->InsertChar(pos, LyXParagraph::META_PROTECTED_SEPARATOR);
pos++;
}
- else if (str[i]=='\t') {
+ else if (str[i] == '\t') {
for (a = pos; a < (pos/8 + 1) * 8 ; ++a) {
- par->InsertChar(a, LYX_META_PROTECTED_SEPARATOR);
+ par->InsertChar(a, LyXParagraph::META_PROTECTED_SEPARATOR);
}
pos = a;
}
- else if (str[i]!=13 &&
+ else if (str[i]!= 13 &&
// Ignore unprintables
(str[i] & 127) >= ' ') {
- par->InsertChar(pos,str[i]);
+ par->InsertChar(pos, str[i]);
pos++;
}
} else {
pos++;
break;
}
-#ifdef NEW_TEXT
while((pos < par->size()) &&
-#else
- while((pos < par->last) &&
-#endif
- (par->GetChar(pos) != LYX_META_NEWLINE))
+ (par->GetChar(pos) != LyXParagraph::META_NEWLINE))
pos++;
pos++;
- cell=NumberOfCell(par,pos);
-#ifdef NEW_TEXT
+ cell = NumberOfCell(par, pos);
while((pos < par->size()) &&
!(par->table->IsFirstCell(cell))) {
while((pos < par->size()) &&
- (par->GetChar(pos) != LYX_META_NEWLINE))
+ (par->GetChar(pos) != LyXParagraph::META_NEWLINE))
++pos;
++pos;
- cell=NumberOfCell(par,pos);
+ cell = NumberOfCell(par, pos);
}
if (pos >= par->size())
// no more fields to fill skip the rest
break;
-#else
- while((pos < par->last) &&
- !(par->table->IsFirstCell(cell))) {
- while((pos < par->last) &&
- (par->GetChar(pos) != LYX_META_NEWLINE))
- pos++;
- pos++;
- cell=NumberOfCell(par,pos);
- }
- if (pos >= par->last)
- // no more fields to fill skip the rest
- break;
-#endif
} else {
-#ifdef NEW_TEXT
if (!par->text.size()) {
-#else
- if (!par->last) {
-#endif
- par->InsertChar(pos,LYX_META_PROTECTED_SEPARATOR);
+ par->InsertChar(pos, LyXParagraph::META_PROTECTED_SEPARATOR);
pos++;
}
par->BreakParagraph(pos, flag);
par = par->Next();
pos = 0;
}
-#ifndef NEW_TEXT
- for (i2 = i; str[i2] && str[i2] != '\n'; i2++);
- par->Enlarge(pos, i2 - i);
-#endif
}
i++;
}
- RedoParagraphs(cursor,endpar);
+ RedoParagraphs(cursor, endpar);
SetCursor(cursor.par, cursor.pos);
sel_cursor = cursor;
SetCursor(par, pos);
}
-#ifdef NEW_TEXT
void LyXText::InsertStringB(LyXParagraph::TextContainer const & text)
{
char * str = new char[text.size() + 1];
InsertStringB(str);
delete [] str;
}
-#endif
-
+
+
/* turns double-CR to single CR, others where converted into one blank and 13s
* that are ignored .Double spaces are also converted into one. Spaces at
* the beginning of a paragraph are forbidden. tabs are converted into one
bool LyXText::GotoNextError()
{
- LyXCursor res=cursor;
+ LyXCursor res = cursor;
do {
if (res.pos < res.par->Last() - 1) {
res.pos++;
}
else {
- res.par=res.par->Next();
+ res.par = res.par->Next();
res.pos = 0;
}
} while (res.par &&
- !(res.par->GetChar(res.pos)==LYX_META_INSET
+ !(res.par->GetChar(res.pos) == LyXParagraph::META_INSET
&& res.par->GetInset(res.pos)->AutoDelete()));
if (res.par) {
bool LyXText::GotoNextNote()
{
- LyXCursor res=cursor;
+ LyXCursor res = cursor;
do {
if (res.pos < res.par->Last()-1) {
res.pos++;
}
else {
- res.par=res.par->Next();
+ res.par = res.par->Next();
res.pos = 0;
}
} while (res.par &&
- !(res.par->GetChar(res.pos)==LYX_META_INSET
- && res.par->GetInset(res.pos)->LyxCode()==Inset::IGNORE_CODE));
+ !(res.par->GetChar(res.pos) == LyXParagraph::META_INSET
+ && res.par->GetInset(res.pos)->LyxCode() == Inset::IGNORE_CODE));
if (res.par) {
SetCursor(res.par, res.pos);
+ textclasslist.NameOfClass(class1) + " to "
+ textclasslist.NameOfClass(class2);
new_inset = new InsetError(s);
- par->InsertChar(0, LYX_META_INSET);
+ par->InsertChar(0, LyXParagraph::META_INSET);
par->InsertInset(0, new_inset);
}
}
-#ifdef NEW_TEXT
void LyXText::CheckParagraph(LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-void LyXText::CheckParagraph(LyXParagraph * par, int pos)
-#endif
{
LyXCursor tmpcursor;
/* table stuff -- end*/
long y = 0;
-#ifdef NEW_TEXT
LyXParagraph::size_type z;
-#else
- int z;
-#endif
Row * row = GetRow(par, pos, y);
/* is there a break one row above */
}
int tmpheight = row->height;
-#ifdef NEW_TEXT
LyXParagraph::size_type tmplast = RowLast(row);
-#else
- int tmplast = RowLast(row);
-#endif
refresh_y = y;
refresh_row = row;
}
-#ifdef NEW_TEXT
void LyXText::SetCursor(LyXParagraph * par,
LyXParagraph::size_type pos)
-#else
-void LyXText::SetCursor(LyXParagraph * par, int pos)
-#endif
{
LyXCursor old_cursor = cursor;
SetCursorIntern(par, pos);
}
-#ifdef NEW_TEXT
void LyXText::SetCursorIntern(LyXParagraph * par, LyXParagraph::size_type pos)
-#else
-void LyXText::SetCursorIntern(LyXParagraph * par, int pos)
-#endif
{
long y;
Row * row;
par = par->previous ;
if (par->IsDummy() &&
par->previous->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
-#ifdef NEW_TEXT
pos += par->text.size() + 1;
-#else
- pos += par->last + 1;
-#endif
}
if (par->previous) {
par = par->previous;
}
-#ifdef NEW_TEXT
pos += par->text.size() + 1;
-#else
- pos += par->last + 1;
-#endif
}
cursor.par = par;
float fill_separator, fill_hfill, fill_label_hfill;
left_margin = LabelEnd(row);
PrepareToPrint(row, x, fill_separator, fill_hfill, fill_label_hfill);
-#ifdef NEW_TEXT
LyXParagraph::size_type main_body =
BeginningOfMainBody(row->par);
-#else
- int main_body = BeginningOfMainBody(row->par);
-#endif
/* table stuff -- begin*/
if (row->par->table) {
int cell = NumberOfCell(row->par, row->pos);
x += GetFont(row->par, -2).stringWidth(
textclasslist.Style(parameters->textclass, row->par->GetLayout()).labelsep);
if (row->par->IsLineSeparator(pos))
- x-= SingleWidth(row->par, pos);
+ x -= SingleWidth(row->par, pos);
if (x < left_margin)
x = left_margin;
}
if (cursor.par->Next()) {
SetCursor(cursor.par->Next(), 0);
} else {
- SetCursor(cursor.par,cursor.par->Last());
+ SetCursor(cursor.par, cursor.par->Last());
}
}
// is stored in the undo. So restore the text informations.
if (undo->kind == Undo::EDIT){
tmppar2->text = tmppar->text;
-#ifdef NEW_TEXT
- //tmppar->text.clear();
- tmppar->text.erase(tmppar->text.begin(),
- tmppar->text.end());
-#else
- tmppar->text = 0;
-#endif
+ tmppar->text.clear();
+ //tmppar->text.erase(tmppar->text.begin(),
+ // tmppar->text.end());
tmppar2 = tmppar2->next;
}
if ( currentrow && currentrow->par == tmppar )
// check wether before points to a closed float and open it if necessary
if (before && before->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE
&& before->next && before->next->footnoteflag != LyXParagraph::NO_FOOTNOTE){
- tmppar4 =before;
+ tmppar4 = before;
while (tmppar4->previous &&
tmppar4->previous->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
tmppar4 = tmppar4->previous;
// a memory optimization: Just store the layout information when only edit
if (kind == Undo::EDIT){
-#ifdef NEW_TEXT
- //tmppar2->text.clear();
- tmppar2->text.erase(tmppar2->text.begin(),
- tmppar2->text.end());
-#else
- if (tmppar2->text)
- delete[] tmppar2->text;
- tmppar2->text = 0;
-#endif
+ tmppar2->text.clear();
+ //tmppar2->text.erase(tmppar2->text.begin(),
+ // tmppar2->text.end());
}
undopar = tmppar2;
tmppar2->next->SetID(tmppar->GetID());
// a memory optimization: Just store the layout information when only edit
if (kind == Undo::EDIT){
-#ifdef NEW_TEXT
- //tmppar2->next->text.clear();
- tmppar2->next->text.erase(tmppar2->next->text.begin(), tmppar2->next->text.end());
-#else
- if (tmppar2->next->text)
- delete[] tmppar2->next->text;
- tmppar2->next->text = 0;
-#endif
+ tmppar2->next->text.clear();
+ //tmppar2->next->text.erase(tmppar2->next->text.begin(), tmppar2->next->text.end());
}
tmppar2->next->previous = tmppar2;
- tmppar2=tmppar2->next;
+ tmppar2 = tmppar2->next;
}
tmppar2->next = 0;
}
bool LyXText::IsEmptyTableCell()
{
-#ifdef NEW_TEXT
LyXParagraph::size_type pos = cursor.pos - 1;
-#else
- int pos = cursor.pos - 1;
-#endif
while (pos >= 0 && pos < cursor.par->Last()
&& !cursor.par->IsNewline(pos))
--pos;
return cursor.par->IsNewline(pos + 1);
}
+
void LyXText::toggleAppendix(){
LyXParagraph * par = cursor.par->FirstPhysicalPar();
bool start = !par->start_of_appendix;
/* ensure that we have only one start_of_appendix in this document */
LyXParagraph * tmp = FirstParagraph();
- for (;tmp;tmp=tmp->next)
+ for (;tmp;tmp = tmp->next)
tmp->start_of_appendix = 0;
par->start_of_appendix = start;
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* This file is Copyright 1996-1998
* Lars Gullik Bjønnes
*
- * ======================================================*/
+ * ====================================================== */
// Added pseudo-action handling, asierra 180296
add(tmplist->action);
lyxerr[Debug::TOOLBAR] << "tool action: "
<< tmplist->action << endl;
- tmplist=tmplist->next;
+ tmplist= tmplist->next;
}
}
FL_Coord /*mx*/, FL_Coord /*my*/,
int key, void *xev)
{
- return Toolbar::BubblePost(ob,event,0,0,key,xev);
+ return Toolbar::BubblePost(ob, event, 0, 0, key, xev);
}
void Toolbar::activate()
{
- toolbarItem *item, *tmp=0;
+ toolbarItem *item, *tmp= 0;
item = toollist;
while(item){
tmp = item->next;
void Toolbar::deactivate()
{
- toolbarItem *item, *tmp=0;
+ toolbarItem *item, *tmp= 0;
item = toollist;
while(item){
tmp = item->next;
// add the time if it don't exist
if (bubble_timer == 0)
bubble_timer = fl_add_timer(FL_HIDDEN_TIMER,
- xpos,ypos,0,0,"Timer");
+ xpos, ypos, 0, 0, "Timer");
while(item != 0) {
switch(item->action){
break;
default:
xpos += standardspacing;
- item->icon = obj =
+ item->icon = obj =
fl_add_pixmapbutton(FL_NORMAL_BUTTON,
- xpos,ypos,
+ xpos, ypos,
buttonwidth,
- height,"");
- fl_set_object_boxtype(obj,FL_UP_BOX);
- fl_set_object_color(obj,FL_MCOL,FL_BLUE);
+ height, "");
+ fl_set_object_boxtype(obj, FL_UP_BOX);
+ fl_set_object_color(obj, FL_MCOL, FL_BLUE);
fl_set_object_resize(obj, FL_RESIZE_ALL);
fl_set_object_gravity(obj,
NorthWestGravity,
NorthWestGravity);
- fl_set_object_callback(obj,C_Toolbar_ToolbarCB,
+ fl_set_object_callback(obj, C_Toolbar_ToolbarCB,
(long)item->action);
#if FL_REVISION >85
// Remove the blue feedback rectangle
- fl_set_pixmapbutton_focus_outline(obj,0);
+ fl_set_pixmapbutton_focus_outline(obj, 0);
#endif
// set the bubble-help (Matthias)
fl_set_object_posthandler(obj, C_Toolbar_BubblePost);
- fl_set_pixmapbutton_data(obj,item->pixmap);
+ fl_set_pixmapbutton_data(obj, item->pixmap);
item = item->next;
// we must remember to update the positions
xpos += buttonwidth;
// first «hide» the toolbar buttons. This is not a real hide
// actually it deletes and frees the button altogether.
lyxerr << "Toolbar::add: «hide» the toolbar buttons." << endl;
- toolbarItem *item, *tmp=0;
+ toolbarItem *item, *tmp= 0;
item = toollist;
lightReset();
if (nth == 0) return;
- int count=0;
+ int count= 0;
toolbarItem *tmp = toollist;
while (tmp) {
count++;
* This file is Copyright (C) 1996-1998
* Lars Gullik Bjønnes
*
-*======================================================*/
+* ====================================================== */
-#ifndef _TOOLBAR_H_
-#define _TOOLBAR_H_
+#ifndef TOOLBAR_H
+#define TOOLBAR_H
#ifdef __GNUG__
#pragma interface
/// sets up the default toolbar
void init();
/// (re)sets the toolbar
- void set(bool doingmain=false);
+ void set(bool doingmain= false);
/** this is to be the entry point to the toolbar
frame, where you can change the toolbar realtime. */
void edit();
/// add a new button to the toolbar.
- void add(int ,bool doclean=true);
+ void add(int , bool doclean= true);
/// name of func instead of kb_action
- void add(string const & , bool doclean=true);
+ void add(string const & , bool doclean= true);
/// invokes the n'th icon in the toolbar
void push(int);
/// activates the toolbar
bool cleaned;
///
- char **getPixmap(kb_action, string const & arg=string());
+ char **getPixmap(kb_action, string const & arg= string());
/// removes all toolbar buttons from the toolbar.
void clean();
#include <config.h>
-//#include <cstdio>
-
#ifdef __GNUG__
#pragma implementation "trans.h"
#endif
// KmodInfo
KmodInfo::KmodInfo()
{
- exception_list=0;
+ exception_list = 0;
}
-KmodInfo::KmodInfo(const KmodInfo& o)
-{
- (*this)=o;
-}
-
-
-KmodInfo& KmodInfo::operator=(const KmodInfo& o)
-{
- if (this!=&o) {
- allowed=o.allowed;
- accent=o.accent;
- data=o.data;
- exception_list=o.exception_list;
- }
-
- return *this;
-}
-
-
// Default Trans
-bool DefaultTrans::init_=false;
+bool DefaultTrans::init_ = false;
DefaultTrans::DefaultTrans()
{
- if (init_==false) {
+ if (init_ == false) {
// Do initialization
- init_=true;
+ init_ = true;
}
}
-string DefaultTrans::process(char c,TransManager& k)
+string DefaultTrans::process(char c, TransManager & k)
{
- char dummy[2]="?";
- dummy[0]=c;
+ char dummy[2] = "?";
+ dummy[0] = c;
- return k.normalkey(c,dummy);
+ return k.normalkey(c, dummy);
}
{
int i;
- for(i=0; i<256; i++)
- keymap_[i]=0;
+ for(i = 0; i < 256; ++i)
+ keymap_[i] = 0;
- for(i=0; i<TEX_MAX_ACCENT+1; i++)
- kmod_list_[i]=0;
+ for(i = 0; i < TEX_MAX_ACCENT + 1; ++i)
+ kmod_list_[i] = 0;
}
}
-void Trans::InsertException(Trans::keyexc& exclist, char c,
- const string& data,bool flag,tex_accent accent)
+void Trans::InsertException(Trans::keyexc & exclist, char c,
+ string const & data, bool flag, tex_accent accent)
{
keyexc p;
p = new Keyexc;
- p -> next = exclist;
- p -> c = c;
+ p->next = exclist;
+ p->c = c;
p->data = data;
- p->combined=flag;
- p->accent=accent;
+ p->combined = flag;
+ p->accent = accent;
exclist = p;
}
-void Trans::FreeException(Trans::keyexc& exclist)
+void Trans::FreeException(Trans::keyexc & exclist)
{
Trans::keyexc p;
{
int i;
- for(i=0; i<256; i++)
+ for(i = 0; i < 256; ++i)
if (keymap_[i]) {
delete keymap_[i];
- keymap_[i]=0;
+ keymap_[i] = 0;
}
- for(i=0; i<TEX_MAX_ACCENT+1; i++)
+ for(i = 0; i < TEX_MAX_ACCENT + 1; ++i)
if (kmod_list_[i]) {
FreeException(kmod_list_[i]->exception_list);
delete kmod_list_[i];
- kmod_list_[i]=0;
+ kmod_list_[i] = 0;
}
}
}
-const string& Trans::GetName()
+string const & Trans::GetName()
{
return name_;
}
enum _kmaptags {
- KCOMB=1,
+ KCOMB = 1,
KMOD,
KMAP,
KXMOD,
struct keyword_item kmapTags[K_LAST-1] = {
- {"\\kcomb",KCOMB },
+ {"\\kcomb", KCOMB },
{ "\\kmap", KMAP },
{ "\\kmod", KMOD },
{ "\\kxmod", KXMOD }
};
-tex_accent getkeymod(const string&);
+tex_accent getkeymod(string const &);
-void Trans::AddDeadkey(tex_accent accent,const string& keys,
- const string& allowed)
+void Trans::AddDeadkey(tex_accent accent, string const & keys,
+ string const & allowed)
{
if (kmod_list_[accent]) {
FreeException(kmod_list_[accent]->exception_list);
kmod_list_[accent] = new kmod_list_decl;
kmod_list_[accent]->data = keys;
kmod_list_[accent]->accent = accent;
- if (allowed=="all") {
- kmod_list_[accent]->allowed=lyx_accent_table[accent].native;
+ if (allowed == "all") {
+ kmod_list_[accent]->allowed= lyx_accent_table[accent].native;
} else {
kmod_list_[accent]->allowed = allowed;
}
for(string::size_type i = 0; i < keys.length(); ++i) {
char * temp;
+ if (keys[i] == char(254))
+ lyxerr << "check one triggered" << endl;
temp = keymap_[keys[i]] = new char[2];
temp[0] = 0; temp[1] = accent;
}
- kmod_list_[accent]->exception_list=0;
+ kmod_list_[accent]->exception_list = 0;
}
-int Trans::Load(LyXLex &lex)
+int Trans::Load(LyXLex & lex)
{
bool error = false;
tex_accent accent = getkeymod(lex.GetString());
- if (accent==TEX_NOACCENT)
+ if (accent == TEX_NOACCENT)
return -1;
if (lex.next(true)) {
break;
}
case KCOMB: {
- const char *str;
+ char const * str;
lyxerr[Debug::KBMAP] << "KCOMB:" << endl;
if (lex.next(true)) {
- str=lex.text();
+ str= lex.text();
lyxerr[Debug::KBMAP] << str << endl;
} else
return -1;
- tex_accent accent_1=getkeymod(str);
- if (accent_1==TEX_NOACCENT) return -1;
+ tex_accent accent_1= getkeymod(str);
+ if (accent_1 == TEX_NOACCENT) return -1;
if (lex.next(true)) {
- str=lex.text();
+ str= lex.text();
lyxerr[Debug::KBMAP] << str << endl;
} else
return -1;
- tex_accent accent_2=getkeymod(str);
- if (accent_2==TEX_NOACCENT) return -1;
+ tex_accent accent_2= getkeymod(str);
+ if (accent_2 == TEX_NOACCENT) return -1;
- if (kmod_list_[accent_1]==0 || kmod_list_[accent_2]==0)
+ if (kmod_list_[accent_1] == 0 || kmod_list_[accent_2] == 0)
return -1;
// Find what key accent_2 is on - should check about accent_1 also
int key;
- for(key=0;key<256;key++)
- if (keymap_[key] && keymap_[key][0]==0 && keymap_[key][1]==accent_2)
+ for(key = 0; key < 256; ++key) {
+ if (keymap_[key] && keymap_[key][0] == 0
+ && keymap_[key][1] == accent_2)
break;
-
+ }
string allowed;
if (lex.next()) {
- allowed=lex.GetString();
+ allowed = lex.GetString();
lyxerr[Debug::KBMAP] << "allowed: "
<< allowed << endl;
} else
return -1;
- InsertException(kmod_list_[accent_1]->exception_list,(char)key,allowed,true,accent_2);
+ InsertException(kmod_list_[accent_1]->exception_list,(char)key, allowed, true, accent_2);
}
break;
case KMAP: {
char key_from;
- char *string_to;
+ char * string_to;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "KMAP:\t" << lex.text() << endl;
if (lex.next(true)) {
- key_from=lex.text()[0];
+ key_from= lex.text()[0];
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << "'"
<< endl;
return -1;
if (lex.next(true)) {
- char const *t = lex.text();
- string_to = strcpy(new char[strlen(t)+1],t);
- keymap_[key_from]=string_to;
+ char const * t = lex.text();
+ string_to = strcpy(new char[strlen(t)+1], t);
+ if (key_from == char(254))
+ lyxerr << "check two triggered"
+ << endl;
+ keymap_[key_from] = string_to;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << string_to << "'"
<< endl;
case KXMOD: {
tex_accent accent;
char key;
- const char *str;
+ char const * str;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "KXMOD:\t" << lex.text() << endl;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << "'"
<< endl;
- key=lex.text()[0];
+ key = lex.text()[0];
} else
return -1;
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "\t`" << lex.text() << "'"
<< endl;
- str=lex.text();
+ str = lex.text();
} else
return -1;
- InsertException(kmod_list_[accent]->exception_list,key,str);
+ InsertException(kmod_list_[accent]->exception_list, key, str);
break;
}
case LyXLex::LEX_FEOF:
}
-bool Trans::isAccentDefined(tex_accent accent,KmodInfo& i)
+bool Trans::isAccentDefined(tex_accent accent, KmodInfo & i)
{
- if (kmod_list_[accent]!=0) {
- i=*kmod_list_[accent];
+ if (kmod_list_[accent]!= 0) {
+ i = *kmod_list_[accent];
return true;
}
return false;
}
-string Trans::process(char c,TransManager& k)
+string Trans::process(char c, TransManager & k)
{
- char dummy[2]="?";
- char *dt=dummy;
- char *t=Match(c);
-
+ lyxerr << "enter process" << endl;
+ char dummy[2] = "?";
+ char * dt = dummy;
+ char * t = Match(c);
+ lyxerr << "finished variables" << endl;
- if ((t==0 && (*dt=c)) || (t[0]!=0 && (dt=t)) ){
- return k.normalkey(c,dt);
+ if ((t == 0 && (dt[0] = c)) || (t[0] != 0 && (dt = t)) ){
+ lyxerr << "normalkey" << endl;
+ return k.normalkey(c, dt);
} else {
- return k.deadkey(c,*kmod_list_[(tex_accent)t[1]]);
+ lyxerr << "deadkey" << endl;
+ return k.deadkey(c, *kmod_list_[(tex_accent)t[1]]);
}
}
-int Trans::Load(string const &language)
+int Trans::Load(string const & language)
{
string filename = LibFileSearch("kbd", language, "kmap");
if (filename.empty())
LyXLex lex(kmapTags, K_LAST-1);
lex.setFile(filename);
- int res=Load(lex);
+ int res = Load(lex);
- if (res==0) {
- name_=language;
+ if (res == 0) {
+ name_ = language;
} else
name_.clear();
}
-tex_accent getkeymod(string const &p)
+tex_accent getkeymod(string const & p)
/* return modifier - decoded from p and update p */
{
- for (int i = 1; i <= TEX_MAX_ACCENT; i++) {
+ for (int i = 1; i <= TEX_MAX_ACCENT; ++i) {
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "p = " << p
<< ", lyx_accent_table[" << i
- <<"].name = `" << lyx_accent_table[i].name
+ << "].name = `" << lyx_accent_table[i].name
<< "'" << endl;
if ( lyx_accent_table[i].name && contains(p, lyx_accent_table[i].name)) {
// -*- C++ -*-
-#ifndef _Trans_h_
-#define _Trans_h_
+#ifndef Trans_h
+#define Trans_h
#ifdef __GNUG__
#pragma interface
class TransInterface {
public:
///
- virtual string process(char,TransManager&)=0;
+ virtual string process(char, TransManager &) = 0;
///
- virtual bool isAccentDefined(tex_accent,KmodInfo&)=0;
+ virtual bool isAccentDefined(tex_accent, KmodInfo &) = 0;
};
/**
DefaultTrans: the default translation class. Hols info
on tex-accents. Monostate
*/
-class DefaultTrans: public TransInterface {
+class DefaultTrans : public TransInterface {
private:
///
static bool init_;
///
DefaultTrans();
///
- virtual string process(char,TransManager&);
+ virtual string process(char, TransManager &);
};
/**
Trans: holds a .kmap file
*/
-class Trans:public TransInterface {
+class Trans : public TransInterface {
public:
///
Trans();
virtual ~Trans();
///
- int Load(string const &language);
+ int Load(string const & language);
///
bool IsDefined();
///
- const string& GetName();
+ string const & GetName();
///
- string process(char,TransManager&);
+ string process(char, TransManager &);
///
- bool isAccentDefined(tex_accent,KmodInfo&);
+ bool isAccentDefined(tex_accent, KmodInfo &);
private:
///
typedef KmodException keyexc;
///
- void AddDeadkey(tex_accent, const string&, const string&);
+ void AddDeadkey(tex_accent, string const &, string const &);
///
void FreeKeymap();
///
int Load(LyXLex &);
///
- inline char* Match(char c);
+ inline char * Match(char c);
///
- void InsertException(keyexc &exclist, char c,
- const string& data, bool = false,
+ void InsertException(keyexc & exclist, char c,
+ string const & data, bool = false,
tex_accent = TEX_NOACCENT);
///
- void FreeException(keyexc& exclist);
+ void FreeException(keyexc & exclist);
///
string name_;
///
- char *keymap_[256];
+ char * keymap_[256];
///
- kmod_list_decl *kmod_list_[TEX_MAX_ACCENT+1];
+ kmod_list_decl * kmod_list_[TEX_MAX_ACCENT+1];
};
-char* Trans::Match(char c)
+char * Trans::Match(char c)
{
return keymap_[c];
}
// -*- C++ -*-
-#ifndef _Trans_Decl_h_
-#define _Trans_Decl_h_
+#ifndef Trans_Decl_h
+#define Trans_Decl_h
#include "LString.h"
#include "tex-accent.h"
struct Keyexc {
char c; /* character to make exception */
string data; /* exception data */
- Keyexc *next;
+ Keyexc * next;
bool combined; // Combination with another deadkey
tex_accent accent; // The accent combined with
};
///
-typedef Keyexc *KmodException;
+typedef Keyexc * KmodException;
//
//
tex_accent accent;
string allowed;
KmodException exception_list;
+
- KmodInfo(const KmodInfo&);
+ //KmodInfo(const KmodInfo&);
KmodInfo();
- KmodInfo& operator=(const KmodInfo&);
+ //KmodInfo& operator= (const KmodInfo&);
};
#endif
#pragma implementation "trans_mgr.h"
#endif
-//#include <cassert>
#include "trans_mgr.h"
#include "trans.h"
#include "lyxtext.h"
#include "lyxrc.h"
#include "support/lstrings.h"
-extern LyXRC* lyxrc;
-extern string DoAccent(const string&,tex_accent);
+extern LyXRC * lyxrc;
+extern string DoAccent(string const &, tex_accent);
extern void InsertCorrectQuote();
-extern string DoAccent(char,tex_accent);
-extern BufferView* current_view;
+extern string DoAccent(char, tex_accent);
+extern BufferView * current_view;
// TransFSMData
TransFSMData::TransFSMData()
{
- deadkey_=deadkey2_=0;
- deadkey_info_.accent=deadkey2_info_.accent=TEX_NOACCENT;
- comb_info_=0;
+ deadkey_ = deadkey2_ = 0;
+ deadkey_info_.accent = deadkey2_info_.accent = TEX_NOACCENT;
+ comb_info_ = 0;
}
// TransState
-const char TransState::TOKEN_SEP=4;
+char const TransState::TOKEN_SEP = 4;
-TransState::~TransState()
-{}
+TransState::~TransState() {}
// TransInitState
TransInitState::TransInitState()
{
- init_state_=this;
+ init_state_ = this;
}
-string TransInitState::normalkey(char c,char *t)
+string TransInitState::normalkey(char c, char * t)
{
string res;
- if (t!=0)
- res=t;
+ if (t!= 0)
+ res = t;
else
- res=c;
+ res = c;
return res;
}
-//bool TransInitState::backspace()
-//{
-// return true;
-//}
-
-
-string TransInitState::deadkey(char c,KmodInfo d)
+string TransInitState::deadkey(char c, KmodInfo d)
{
- deadkey_=c;
- deadkey_info_=d;
- currentState=deadkey_state_;
+ deadkey_ = c;
+ deadkey_info_ = d;
+ currentState = deadkey_state_;
return string();
}
// TransDeadkeyState
TransDeadkeyState::TransDeadkeyState()
{
- deadkey_state_=this;
+ deadkey_state_ = this;
}
-string TransDeadkeyState::normalkey(char c,char *trans)
+string TransDeadkeyState::normalkey(char c, char * trans)
{
string res;
// Check if it is an exception
- KmodException l=deadkey_info_.exception_list;
- while(l!=0) {
- if (l->c==c) {
- res=l->data;
+ KmodException l = deadkey_info_.exception_list;
+ while(l != 0) {
+ if (l->c == c) {
+ res = l->data;
break;
}
- l=l->next;
+ l = l->next;
}
- if (l==0) {
+ if (l == 0) {
// Not an exception. Check if it allowed
- if (current_view->buffer()->params.allowAccents==true ||
+ if (current_view->buffer()->params.allowAccents == true ||
countChar(deadkey_info_.allowed, c) > 0) {
- res=DoAccent(c,deadkey_info_.accent);
+ res = DoAccent(c, deadkey_info_.accent);
} else {
// Not allowed
- if (deadkey_!=0)
- res=deadkey_;
- res+=TOKEN_SEP;
- res+=trans;
+ if (deadkey_!= 0)
+ res = deadkey_;
+ res+= TOKEN_SEP;
+ res+= trans;
}
}
- currentState=init_state_;
+ currentState = init_state_;
return res;
}
-//bool TransDeadkeyState::backspace()
-//{
-// currentState=init_state_;
-// return false;
-//}
-
-
-string TransDeadkeyState::deadkey(char c,KmodInfo d)
+string TransDeadkeyState::deadkey(char c, KmodInfo d)
{
string res;
// Check if the same deadkey was typed twice
- if (deadkey_==c) {
- res=deadkey_;
- deadkey_=0;
- deadkey_info_.accent=TEX_NOACCENT;
- currentState=init_state_;
+ if (deadkey_ == c) {
+ res = deadkey_;
+ deadkey_ = 0;
+ deadkey_info_.accent = TEX_NOACCENT;
+ currentState = init_state_;
return res;
}
// Check if it is a combination or an exception
KmodException l;
- l=deadkey_info_.exception_list;
+ l = deadkey_info_.exception_list;
while(l) {
- if (l->combined==true && l->accent==d.accent) {
- deadkey2_=c;
- deadkey2_info_=d;
- comb_info_=l;
- currentState=combined_state_;
+ if (l->combined == true && l->accent == d.accent) {
+ deadkey2_ = c;
+ deadkey2_info_ = d;
+ comb_info_ = l;
+ currentState = combined_state_;
return string();
}
- if (l->c==c) {
- res=l->data;
- deadkey_=0;
- deadkey_info_.accent=TEX_NOACCENT;
- currentState=init_state_;
+ if (l->c == c) {
+ res = l->data;
+ deadkey_ = 0;
+ deadkey_info_.accent = TEX_NOACCENT;
+ currentState = init_state_;
return res;
}
- l=l->next;
+ l = l->next;
}
// Not a combination or an exception.
// Output deadkey1 and keep deadkey2
- if (deadkey_!=0)
- res=deadkey_;
- deadkey_=c;
- deadkey_info_=d;
- currentState=deadkey_state_;
+ if (deadkey_!= 0)
+ res = deadkey_;
+ deadkey_ = c;
+ deadkey_info_ = d;
+ currentState = deadkey_state_;
return res;
}
TransCombinedState::TransCombinedState()
{
- combined_state_=this;
+ combined_state_ = this;
}
-string TransCombinedState::normalkey(char c,char *trans)
+string TransCombinedState::normalkey(char c, char *trans)
{
string res;
// Check if the key is allowed on the combination
if (countChar(comb_info_->data, c) > 0) {
string temp;
- temp=DoAccent(c,deadkey2_info_.accent);
- res=DoAccent(temp,deadkey_info_.accent);
- currentState=init_state_;
+ temp = DoAccent(c, deadkey2_info_.accent);
+ res = DoAccent(temp, deadkey_info_.accent);
+ currentState = init_state_;
} else {
// Not allowed. Output deadkey1 and check deadkey2 + c
- if (deadkey_!=0)
- res+=deadkey_;
- res+=TOKEN_SEP;
- deadkey_=deadkey2_;
- deadkey_info_=deadkey2_info_;
+ if (deadkey_!= 0)
+ res+= deadkey_;
+ res+= TOKEN_SEP;
+ deadkey_ = deadkey2_;
+ deadkey_info_ = deadkey2_info_;
// Call deadkey state and leave it to setup the FSM
- res+=deadkey_state_->normalkey(c,trans);
+ res+= deadkey_state_->normalkey(c, trans);
}
return res;
}
-// bool TransCombinedState::backspace()
-// {
-// // cancel the second deadkey
-// deadkey2_=0;
-// deadkey2_info_.accent=TEX_NOACCENT;
-// currentState=deadkey_state_;
-
-// return false;
-// }
-
-
-string TransCombinedState::deadkey(char c,KmodInfo d)
+string TransCombinedState::deadkey(char c, KmodInfo d)
{
// Third key in a row. Output the first one and
// reenter with shifted deadkeys
string res;
- if (deadkey_!=0)
- res=deadkey_;
- res+=TOKEN_SEP;
- deadkey_=deadkey2_;
- deadkey_info_=deadkey2_info_;
- res+=deadkey_state_->deadkey(c,d);
+ if (deadkey_!= 0)
+ res = deadkey_;
+ res+= TOKEN_SEP;
+ deadkey_ = deadkey2_;
+ deadkey_info_ = deadkey2_info_;
+ res+= deadkey_state_->deadkey(c, d);
return res;
}
TransDeadkeyState(),
TransCombinedState()
{
- currentState=init_state_;
+ currentState = init_state_;
}
// TransManager
TransManager::TransManager()
- : active_(0),t1_(new Trans),t2_(new Trans),chset_(new CharacterSet)
+ : active_(0), t1_(new Trans), t2_(new Trans)
{}
-Trans* TransManager::default_=new Trans;
+Trans * TransManager::default_ = new Trans;
TransManager::~TransManager()
{
delete t1_;
delete t2_;
- delete chset_;
}
int TransManager::SetPrimary(string const & language)
{
- if (t1_->GetName()==language)
+ if (t1_->GetName() == language)
return 0;
return t1_->Load(language);
int TransManager::SetSecondary(string const & language)
{
- if (t2_->GetName()==language)
+ if (t2_->GetName() == language)
return 0;
return t2_->Load(language);
}
-bool TransManager::setCharset(const char *set)
+bool TransManager::setCharset(char const * set)
{
- return chset_->loadFile(set);
+ return chset_.loadFile(set);
}
void TransManager::EnablePrimary()
{
if (t1_->IsDefined())
- active_=t1_;
+ active_ = t1_;
lyxerr[Debug::KBMAP] << "Enabling primary keymap" << endl;
}
void TransManager::EnableSecondary()
{
if (t2_->IsDefined( ))
- active_=t2_;
+ active_ = t2_;
lyxerr[Debug::KBMAP] << "Enabling secondary keymap" << endl;
}
void TransManager::DisableKeymap()
{
- active_=default_;
+ active_ = default_;
lyxerr[Debug::KBMAP] << "Disabling keymap" << endl;
}
-void TransManager::TranslateAndInsert(char c,LyXText *text)
+void TransManager::TranslateAndInsert(char c, LyXText * text)
{
string res;
- res=active_->process(c,*this);
+ res = active_->process(c,*this);
// Process with tokens
string temp;
while(res.length()>0) {
- res=split(res, temp,TransState::TOKEN_SEP);
- insert(temp,text);
+ res = split(res, temp, TransState::TOKEN_SEP);
+ insert(temp, text);
}
}
-void TransManager::insertVerbatim(const string& str,LyXText *text)
+void TransManager::insertVerbatim(string const & str, LyXText * text)
{
- int l=str.length();
+ int l = str.length();
- for (int i=0;i<l;i++){
- if (str[i]=='\"'
+ for (int i = 0;i<l;i++){
+ if (str[i] == '\"'
&& text->GetFont(text->cursor.par,
text->cursor.pos).latex() == LyXFont::OFF)
InsertCorrectQuote();
}
-void TransManager::insert(string str,LyXText *text)
+void TransManager::insert(string str, LyXText * text)
{
- string t=str;
+ string t = str;
// Go through the character encoding only if the current
// encoding (chset_->name()) matches the current font_norm
// (lyrxc->font_norm
- if (chset_->getName()!=lyxrc->font_norm ||
- chset_->encodeString(str)==false) {
+ if (chset_.getName()!= lyxrc->font_norm ||
+ chset_.encodeString(str) == false) {
// Could not find an encoding
InsetLatexAccent ins(str);
if (ins.CanDisplay()) {
}
}
- insertVerbatim(str,text);
+ insertVerbatim(str, text);
}
-//bool TransManager::backspace()
-//{
-// return trans_fsm_.currentState->backspace();
-//}
-
-
-void TransManager::deadkey(char c,tex_accent accent,LyXText *t)
+void TransManager::deadkey(char c, tex_accent accent, LyXText * t)
{
KmodInfo i;
string res;
- if (c==0 && active_!=default_) {
+ if (c == 0 && active_!= default_) {
// A deadkey was pressed that cannot be printed
// or a accent command was typed in the minibuffer
- if (active_->isAccentDefined(accent,i)==true) {
- res=trans_fsm_.currentState->deadkey(c,i);
- insert(res,t);
+ if (active_->isAccentDefined(accent, i) == true) {
+ res = trans_fsm_.currentState->deadkey(c, i);
+ insert(res, t);
return;
}
- }// else {
- // Fall through to the next case
- //}
+ }
- if (active_==default_ || c==0) {
- i.accent=accent;
- i.allowed=lyx_accent_table[accent].native;
+ if (active_ == default_ || c == 0) {
+ i.accent = accent;
+ i.allowed = lyx_accent_table[accent].native;
i.data.clear();
- i.exception_list=0;
+ i.exception_list = 0;
- string res=trans_fsm_.currentState->deadkey(c,i);
- insert(res,t);
+ string res = trans_fsm_.currentState->deadkey(c, i);
+ insert(res, t);
} else {
// Go through the translation
- TranslateAndInsert(c,t);
+ TranslateAndInsert(c, t);
}
}
// -*- C++ -*-
-#ifndef _Trans_Manager_h_
-#define _Trans_Manager_h_
+#ifndef Trans_Manager_h
+#define Trans_Manager_h
#ifdef __GNUG__
#pragma interface
#include "tex-accent.h"
#include "trans_decl.h"
+#include "chset.h"
+#include "LString.h"
class LyXText;
-class LString;
-class CharacterSet;
class Trans;
/// Translation State
///
virtual ~TransState();
///
- virtual string normalkey(char,char*)=0;
+ virtual string normalkey(char, char *) = 0;
///
- virtual bool backspace()=0;
+ virtual bool backspace() = 0;
///
- virtual string deadkey(char,KmodInfo)=0;
+ virtual string deadkey(char, KmodInfo) = 0;
///
- static const char TOKEN_SEP;
+ static char const TOKEN_SEP;
};
class TransFSMData {
protected:
///
- virtual ~TransFSMData()
- {}
+ virtual ~TransFSMData() {}
///
char deadkey_;
///
///
KmodException comb_info_;
///
- TransState* init_state_;
+ TransState * init_state_;
///
- TransState* deadkey_state_;
+ TransState * deadkey_state_;
///
- TransState* combined_state_;
+ TransState * combined_state_;
///
public:
///
TransFSMData();
///
- TransState* currentState;
+ TransState * currentState;
};
///
TransInitState();
///
- virtual string normalkey(char,char*);
+ virtual string normalkey(char, char *);
///
virtual bool backspace() { return true; }
///
- virtual string deadkey(char,KmodInfo);
+ virtual string deadkey(char, KmodInfo);
};
///
TransDeadkeyState();
///
- virtual string normalkey(char,char*);
+ virtual string normalkey(char, char *);
///
virtual bool backspace()
{
- currentState=init_state_;
+ currentState = init_state_;
return false;
}
///
- virtual string deadkey(char,KmodInfo);
+ virtual string deadkey(char, KmodInfo);
};
///
TransCombinedState();
///
- virtual string normalkey(char,char*);
+ virtual string normalkey(char, char *);
///
virtual bool backspace()
{
// cancel the second deadkey
- deadkey2_=0;
- deadkey2_info_.accent=TEX_NOACCENT;
- currentState=deadkey_state_;
+ deadkey2_ = 0;
+ deadkey2_info_.accent = TEX_NOACCENT;
+ currentState = deadkey_state_;
return false;
}
///
- virtual string deadkey(char,KmodInfo);
+ virtual string deadkey(char, KmodInfo);
};
///
TransFSM trans_fsm_;
///
- Trans* active_;
+ Trans * active_;
///
- Trans* t1_;
+ Trans * t1_;
///
- Trans* t2_;
+ Trans * t2_;
///
- static Trans* default_;
+ static Trans * default_;
///
- CharacterSet* chset_;
+ CharacterSet chset_;
///
- void insert(string,LyXText*);
+ void insert(string, LyXText *);
///
- void insertVerbatim(const string&,LyXText*);
+ void insertVerbatim(string const &, LyXText *);
public:
///
TransManager();
///
void DisableKeymap();
///
- bool setCharset(const char*);
+ bool setCharset(const char *);
///
bool backspace()
{
return trans_fsm_.currentState->backspace();
}
///
- void TranslateAndInsert(char,LyXText*);
+ void TranslateAndInsert(char, LyXText *);
///
- inline string deadkey(char,KmodInfo);
+ inline string deadkey(char, KmodInfo);
///
- inline string normalkey(char,char*);
+ inline string normalkey(char, char *);
///
- void deadkey(char,tex_accent,LyXText*);
+ void deadkey(char, tex_accent, LyXText *);
};
-string TransManager::normalkey(char c,char *t)
+string TransManager::normalkey(char c, char * t)
{
- return trans_fsm_.currentState->normalkey(c,t);
+ return trans_fsm_.currentState->normalkey(c, t);
}
-string TransManager::deadkey(char c,KmodInfo t)
+string TransManager::deadkey(char c, KmodInfo t)
{
- return trans_fsm_.currentState->deadkey(c,t);
+ return trans_fsm_.currentState->deadkey(c, t);
}
#endif
--- /dev/null
+/* This file is part of
+ * ======================================================
+ *
+ * LyX, The Document Processor
+ *
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-1999 The LyX Team.
+ *
+ * ====================================================== */
+
+#include <config.h>
+
+#include "undo.h"
+
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
+UndoStack::UndoStack()
+ : limit(100) {}
+
+
+Undo * UndoStack::Pop()
+{
+ if (stakk.empty()) return 0;
+ Undo * result = stakk.front();
+ stakk.pop_front();
+ return result;
+}
+
+
+Undo * UndoStack::Top()
+{
+ if (stakk.empty()) return 0;
+ return stakk.front();
+}
+
+
+UndoStack::~UndoStack()
+{
+ Clear();
+}
+
+
+void UndoStack::Clear()
+{
+ while (!stakk.empty()) {
+ Undo * tmp = stakk.front();
+ stakk.pop_front();
+ delete tmp;
+ }
+}
+
+
+void UndoStack::SetStackLimit(Stakk::size_type l)
+{
+ limit = l;
+}
+
+
+void UndoStack::Push(Undo * undo_arg)
+{
+ if (!undo_arg) return;
+
+ stakk.push_front(undo_arg);
+ if (stakk.size() > limit) {
+ Undo * tmp = stakk.back();
+ stakk.pop_back();
+ delete tmp;
+ }
+}
*
* LyX, The Document Processor
*
- * Copyright (C) 1995 Matthias Ettrich, 1995, 1996 LyX Team
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-1999 The LyX Team.
*
- *======================================================*/
-#ifndef _UNDO_H
-#define _UNDO_H
+ * ====================================================== */
+
+#ifndef UNDO_H
+#define UNDO_H
#ifdef __GNUG__
#pragma interface
#endif
-#include "definitions.h"
+#include <list>
+using std::list;
+
#include "lyxparagraph.h"
///
int cursor_pos; // valid if >= 0
///
- LyXParagraph* par;
+ LyXParagraph * par;
///
Undo(undo_kind kind_arg,
int number_before_arg, int number_behind_arg,
int cursor_par_arg, int cursor_pos_arg,
- LyXParagraph* par_arg)
+ LyXParagraph * par_arg)
{
kind = kind_arg;
number_of_before_par = number_before_arg;
par = par_arg;
}
///
- ~Undo(){
- LyXParagraph* tmppar;
+ ~Undo() {
+ LyXParagraph * tmppar;
while (par) {
tmppar = par;
par = par->next;
};
-/// A limited Stack for the undo informations. Matthias 290496
+/// A limited Stack for the undo informations.
class UndoStack{
private:
///
- struct StackAtom{
- ///
- StackAtom* previous;
- ///
- Undo* undo;
- };
- ///
- StackAtom* current;
- ///
- StackAtom *tmp;
- ///
- int size;
+ typedef list<Undo*> Stakk;
///
- int limit;
+ Stakk stakk;
+ /// the maximum number of undo steps stored.
+ Stakk::size_type limit;
public:
///
- UndoStack(){
- current = 0;
- // size must be initialised (thornley)
- size = 0;
- limit = 100; // the maximum number of undo steps stored. 0 means NO LIMIT.
- // Limit can be changed with UndoStack::SetStackLimit(int)
- }
+ UndoStack();
///
- Undo *Pop(){
- Undo* result = 0;
- if (current){
- result = current->undo;
- tmp = current;
- current = current->previous;
- delete tmp;
- size--;
- }
- else {
- size = 0; // for safety...
- }
- return result;
- }
+ Undo * Pop();
///
- Undo* Top(){
- if (current)
- return current->undo;
- else
- return 0;
- }
+ Undo * Top();
///
- ~UndoStack(){
- Clear();
- }
+ ~UndoStack();
///
- void Clear(){
- Undo* tmp_undo = Pop();
- while (tmp_undo){
- delete tmp_undo;
- tmp_undo = Pop();
- }
- }
+ void Clear();
///
- void SetStackLimit(int limit_arg) {
- limit = limit_arg;
- }
-
- ///
- void Push(Undo* undo_arg){
- int i;
- StackAtom* tmp2;
- if (undo_arg){
- tmp = new StackAtom;
- tmp->undo = undo_arg;
- tmp->previous = current;
- current = tmp;
- size++;
- if (limit && size > limit){
- for (i=0; i<limit && tmp; i++)
- tmp = tmp->previous;
- while(tmp && tmp->previous){
- tmp2 = tmp->previous->previous;
- delete tmp->previous;
- size--;
- tmp->previous = tmp2;
- }
- }
- }
- }
+ void SetStackLimit(Stakk::size_type l);
+ ///
+ void Push(Undo * undo_arg);
};
#endif
string tmpf = "/" + OnlyFilename(file_) + "/";
lyxerr[Debug::LYXVC] << "\tlooking for `" << tmpf << "'" << endl;
string line;
+ LRegex reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
while(getline(ifs, line)) {
lyxerr[Debug::LYXVC] << "\t line: " << line << endl;
if (contains(line, tmpf)) {
// Ok extract the fields.
- LRegex reg("/(.*)/(.*)/(.*)/(.*)/(.*)");
LRegex::SubMatches const & sm = reg.exec(line);
//sm[0]; // whole matched string
//sm[1]; // filename
locker_ = "Locked";
vcstat = LOCKED;
}
-#if 0
- for (LRegex::SubMatches::const_iterator cit = sm.begin();
- cit != sm.end(); ++cit) {
- if ((*cit).first != string::npos)
- lyxerr << string(line, (*cit).first,
- (*cit).second) << endl;
- }
-#endif
break;
}
}
void CVS::registrer(string const & msg)
{
- // cvs add
+ doVCCommand("cvs -q add -m \"" + msg + "\" \""
+ + OnlyFilename(owner_->getFileName()) + "\"");
+ owner_->getUser()->owner()->getLyXFunc()->Dispatch("buffer-reload");
}
void CVS::checkIn(string const & msg)
{
- // cvs commit
+ doVCCommand("cvs -q commit -m \"" + msg + "\" \""
+ + OnlyFilename(owner_->getFileName()) + "\"");
+ owner_->getUser()->owner()->getLyXFunc()->Dispatch("buffer-reload");
}
void CVS::checkOut()
{
- // cvs update
+ // cvs update or perhaps for cvs this should be a noop
+ lyxerr << "Sorry not implemented." << endl;
}
{
// not sure how to do this...
// rm file
- // cvs update
+ // cvs update
+ lyxerr << "Sorry not implemented." << endl;
}
// merge the current with the previous version
// in a reverse patch kind of way, so that the
// result is to revert the last changes.
+ lyxerr << "Sorry not implemented." << endl;
}
void CVS::getLog(string const &)
{
+ lyxerr << "Sorry not implemented." << endl;
}
*
* LyX, the High Level Word Processor
*
-* Copyright (C) 1995,1996 Matthias Ettrich
+* Copyright (C) 1995, 1996 Matthias Ettrich
*
-*======================================================
+* ======================================================
A few prototypes and definitions needed for VMS / OpenVMS */
-#ifndef _VMS_DEFINES_H
-#define _VMS_DEFINES_H
+#ifndef VMS_DEFINES_H
+#define VMS_DEFINES_H
/* Currently empty. */
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-1999 The LyX Team.
*
- * ======================================================*/
+ * ====================================================== */
#include <config.h>
LyXLength::UNIT unitFromString (string const & data)
{
- int i=0;
+ int i = 0;
while ((i<num_units) && (data != unit_name[i])) ++i;
return (LyXLength::UNIT)i;
}
else {
string::size_type i;
- // I really mean assignment ("=") below, not equality!
+ // I really mean assignment ("= ") below, not equality!
if ((i = data.find_last_of("0123456789.")) != string::npos) {
if (number_index > 3) return 'E'; // Error
string buffer = data.substr(0, i + 1);
return 'n';
} else
return 'E'; // Error
- } else if ((i=data.find_last_of("abcdefghijklmnopqrstuvwxyz"))
+ } else if ((i = data.find_last_of("abcdefghijklmnopqrstuvwxyz"))
!= string::npos) {
if (unit_index > 3) return 'E'; // Error
string buffer = data.substr(0, i + 1);
if (!isValidGlueLength (data, &tmp))
return; // should raise an exception
else {
- val=tmp.val;
- uni=tmp.uni;
- plus_val =tmp.plus_val;
- plus_uni =tmp.plus_uni;
- minus_val=tmp.minus_val;
- minus_uni=tmp.minus_uni;
+ val = tmp.val;
+ uni = tmp.uni;
+ plus_val = tmp.plus_val;
+ plus_uni = tmp.plus_uni;
+ minus_val = tmp.minus_val;
+ minus_uni = tmp.minus_uni;
}
}
}
-bool VSpace::operator== (VSpace const & other) const
+bool VSpace::operator==(VSpace const & other) const
{
if (this->kin == other.kin)
if (this->kin == LENGTH)
// -*- C++ -*-
/* This file is part of
- * ======================================================
+ * ======================================================
*
* LyX, The Document Processor
*
* Copyright (C) 1995 1996 Matthias Ettrich
* and the LyX Team.
*
- *======================================================*/
+ * ====================================================== */
#ifndef VSPACE_H
#define VSPACE_H
//@}
///
- bool operator==(LyXLength const &) const;
+ bool operator== (LyXLength const &) const;
/// conversion
virtual string asString() const;
/** If "data" is valid, the length represented by it is
stored into "result", if that is not 0. */
friend bool isValidLength(string const & data,
- LyXLength * result=0);
+ LyXLength * result= 0);
protected:
///
//@{
///
LyXGlueLength(float v, LyXLength::UNIT u,
- float pv=0.0, LyXLength::UNIT pu=LyXLength::UNIT_NONE,
- float mv=0.0, LyXLength::UNIT mu=LyXLength::UNIT_NONE)
+ float pv= 0.0, LyXLength::UNIT pu= LyXLength::UNIT_NONE,
+ float mv= 0.0, LyXLength::UNIT mu= LyXLength::UNIT_NONE)
: LyXLength (v, u),
plus_val(pv), minus_val(mv),
plus_uni(pu), minus_uni(mu) {}
//@}
///
- bool operator==(LyXGlueLength const &) const;
+ bool operator == (LyXGlueLength const &) const;
/// conversion
virtual string asString() const;
/** If "data" is valid, the length represented by it is
stored into "result", if that is not 0. */
friend bool isValidGlueLength(string const & data,
- LyXGlueLength* result=0);
+ LyXGlueLength* result= 0);
protected:
///
///
void setKeep(bool val) { kp = val; }
///
- bool operator==(VSpace const &) const;
+ bool operator == (VSpace const &) const;
// conversion
///