Re: makepsres: command not found

2003-12-12 Thread Jean-Marc Lasgouttes
> "Kuba" == Kuba Ober <[EMAIL PROTECTED]> writes:

Kuba> Isn't DPS practically dead? I'd actually like to hear from
Kuba> somebody whose X server is DPS-aware and needs makepsres run on
Kuba> font directories...

Solaris

Kuba> I would just comment it out and forget unless somebody
Kuba> complains.

It was requested by a solaris user.

JMarc


gnuplot graphics with lyx.

2003-12-12 Thread jamatos
Hi all,
I have been trying to make gnuplot graphics to work
directly in lyx. That is I insert the gnuplot file with the
necessary commands to make the graphic, and then lyx decides
what is the best format for that export.

I have used a script to wrap the gnuplot call (as I
discrive in message that is in limbo, but it will reach
eventually the lyx-users as soon as the mail server here
decides to cooperate).

This works fines for png, so that I insert the and
can see its output. My problem is when exporting for ps,
then the gnuplot file is moved to a temporary file and only
then it is converted. Since most of the time the gnuplot
files look like this:

f(x)=a*x+b
## fit f(x) 'fecho.dfa' via a,b
a = 1.57519130830781
b = 0.705572828280984

plot 'fecho.dfa', f(x)

Notice that I take advantage of the the relative location
of 'fecho.dat' to this script.  When this file is moved all the
relative links are lost and this file now longer produces a
valid file.

There are two possible solutions for this:
1) Use absolute paths in the gnuplot file.

2) LyX does not move the file before the convertion. The
  resulting file can be moved without problem.

3) Do not use temporary directories.

Is a request for 2), or something related, asking too much?

:-)
--
José


Re: [patch] splash crash

2003-12-12 Thread Angus Leeming
Alfredo Braunstein wrote:
> avoid crashing when dragging over the splash screen:

Committed.

-- 
Angus



Re: gnuplot graphics with lyx.

2003-12-12 Thread Angus Leeming
[EMAIL PROTECTED] wrote:
> Is a request for 2), or something related, asking too much?

Yes.

Certainly it is too much to ask for 1.3.x.

For 1.4.x? Things are a lot more robust and straightforward than they 
were so I would say that such a change _could_ be made to work 
wothout totally foo-barring things. However, at the moment we compare 
the time stamps (and check sums) of the original and copied files to 
decide whether the generated file needs to be updated. This data 
could be stored of course, but you can see that the whole thing is 
non-trivial.

Feel free to have a go ;-)

-- 
Angus



InsetBranch questions

2003-12-12 Thread Angus Leeming
Martin,

I note that the branches dialog isn't very useful at the moment and 
suspect that this is my doing. The choice of available branches is 
empty. I'll sort it out but have a few questions of my own:

1 Looking at the code in FormBranch.C, QBranch.C:
why do you bother filling the choice in 'build'? It is subsequently 
overwritten in 'update', so this is just a waste of cycles.

2 Why do you store a copy of the list of available branches in the 
inset? Why not provide an accessor from the controller. Eg

std::vector const
ControlBranches::all_branches() const
{
BranchList const & branchlist =
kernel().buffer().params().branchlist();

...
}

3. Why do you store the list of all branch names in BranchList as a 
'|'-separated string. Why not use a vector?

If you're worried about filling the choice in the xforms frontend, 
then don't be:
string const all_branches =
' ' +
getStringFromVector(controller().all_branches(), " | ") +
' ';
fl_clear_choice(dialog_->choice_branch);
fl_addto_choice(dialog_->choice_branch, all_branches.c_str());

4. I notice a bug in the display of new branches. For example:
* I created a branch 'Purple' and a branch 'Green' in that order and 
set the colours of both appropriately.
* I created a 'Purple' branch inset and discovered it was displayed 
with a green background. I subsequently created a 'Green' inset. It 
also had a green background.
* Close the file and re-open and all is Ok. (Maybe I restarted LyX.)

I propose to address questions 1-3 myself and to fix the currently 
useless Branch dialog. Ok?

-- 
Angus



Re: gnuplot graphics with lyx.

2003-12-12 Thread jamatos
Hi Angus,
why do we need to move the graphics to
the temporary directory?

This I don't get. (And many other things
as well ;-).

/me puzzeled. :-)

--
José


Re: gnuplot graphics with lyx.

2003-12-12 Thread Angus Leeming
[EMAIL PROTECTED] wrote:

> Hi Angus,
> why do we need to move the graphics to
> the temporary directory?
> 
> This I don't get. (And many other things
> as well ;-).
> 
> /me puzzeled. :-)

Let's call it 'an accident of history'. The code used to be much more 
convoluted than it is now. However, I think that the primary reason 
is that InsetGraphics can handle compressed files and needs to 
uncompress them to ascertain the 'hidden' file format. Herbert just 
found it easiest to unconditionally copy the file and then play from 
there.

Note also the stuff about timestamps and checksums. Have a look at the 
code in InsetGraphics: it is anything but trivial. Have a look also 
at the equivalent code in InsetExternal (ExternalSupport.C). The 
use-case is simpler (I don't worry about .gz files) but it is still 
not trivial.

-- 
Angus



Re: [PATCH] frameless boxes for tex2lyx

2003-12-12 Thread Andre Poenitz
On Thu, Dec 11, 2003 at 10:24:05PM +0100, Georg Baum wrote:
> The attached patch makes tex2lyx output file format 227 with minipages and 
> parboxes converted to frameless box insets.

Would be nice if your comment lines would not exceed 72 char or so.

Andre'


[PATCH] CollapseStatus

2003-12-12 Thread Michael Schmitt
Hello,

this patch moves all code for 'CollapseStatus' from insetert to 
insetcollapsable. Insetcollapsable has three states now just like ERTs 
before. You get into the "Inlined" mode, if you press CTRL-I inside an 
open inset.

Please have a look at the patch. If you like it, please apply it. There 
are still a couple of open issues but I would like to address them after 
I got your OK.

  - lyx2lyx converter for the new file format
(I will provide it this afternoon, if the patch is applied)
  - move ERT dialog (and mailer) to inset Collapsable (?)
  - move Martin's inlined mode from CharStyle to Collapsable
BTW: Why does insetert need metrics(...) & draw(...)? If they are really 
needed, then we have to fix insetcollapsable instead.

Kind regards,

Michael

PS: I slowly understand why Andre wants to continue the code cleanup for 
a while. Everything looks much too complicated. Even this simple patch 
saves us 154 lines of code.


? collapse-patch
Index: src/insets/ChangeLog
===
RCS file: /cvs/lyx/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.947
diff -u -r1.947 ChangeLog
--- src/insets/ChangeLog2003/12/12 10:20:17 1.947
+++ src/insets/ChangeLog2003/12/12 11:33:49
@@ -1,3 +1,10 @@
+2003-12-12  Michael Schmitt  <[EMAIL PROTECTED]>
+
+   * insetert.[Ch]:
+   * insetcollapsable.[Ch]: Move all CollapseStatus code from
+   insetert to insetcollapsable; introduce virtual function
+   setButtonLabel and invoke it from collapsable
+
 2003-12-12  Angus Leeming  <[EMAIL PROTECTED]>
 
* insetinclude.C (draw): cache x,y and so enable the
Index: src/insets/insetcharstyle.C
===
RCS file: /cvs/lyx/lyx-devel/src/insets/insetcharstyle.C,v
retrieving revision 1.8
diff -u -r1.8 insetcharstyle.C
--- src/insets/insetcharstyle.C 2003/12/06 09:31:30 1.8
+++ src/insets/insetcharstyle.C 2003/12/12 11:33:50
@@ -105,7 +105,7 @@
xo_ = x;
yo_ = y;
 
-   status_ = Inlined;
+   // FIXME: setStatus(Inlined); this is not a const operation
inset.setDrawFrame(InsetText::NEVER);
inset.draw(pi, x, y);
 
Index: src/insets/insetcollapsable.C
===
RCS file: /cvs/lyx/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.222
diff -u -r1.222 insetcollapsable.C
--- src/insets/insetcollapsable.C   2003/12/10 09:45:30 1.222
+++ src/insets/insetcollapsable.C   2003/12/12 11:33:51
@@ -39,55 +39,93 @@
 using std::ostream;
 
 
-InsetCollapsable::InsetCollapsable(BufferParams const & bp, bool collapsed)
-   : UpdatableInset(), inset(bp), status_(collapsed ? Collapsed : Open),
+InsetCollapsable::InsetCollapsable(BufferParams const & bp, CollapseStatus status)
+   : UpdatableInset(), inset(bp), status_(status),
  label("Label")
-#if 0
-   ,autocollapse(false)
-#endif
 {
inset.setOwner(this);
inset.setAutoBreakRows(true);
inset.setDrawFrame(InsetText::ALWAYS);
inset.setFrameColor(LColor::collapsableframe);
setInsetName("Collapsable");
+
+   setButtonLabel();
 }
 
 
 InsetCollapsable::InsetCollapsable(InsetCollapsable const & in)
: UpdatableInset(in), inset(in.inset), status_(in.status_),
  labelfont_(in.labelfont_), label(in.label)
-#if 0
- ,autocollapse(in.autocollapse)
-#endif
 {
inset.setOwner(this);
+
+   setButtonLabel();
 }
 
 
 void InsetCollapsable::write(Buffer const & buf, ostream & os) const
 {
-   os << "collapsed " << (status_ == Collapsed ? "true" : "false") << "\n";
-   inset.text_.write(buf, os);
+   string st;
+
+   switch (status_) {
+   case Open:
+   st = "open";
+   break;
+   case Collapsed:
+   st = "collapsed";
+   break;
+   case Inlined:
+   st = "inlined";
+   break;
+   }
+   os << "status "<< st << "\n";
+
+inset.text_.write(buf, os);
 }
 
 
 void InsetCollapsable::read(Buffer const & buf, LyXLex & lex)
 {
+   bool token_found = false;
if (lex.isOK()) {
lex.next();
string const token = lex.getString();
-   if (token == "collapsed") {
+   if (token == "status") {
lex.next();
-   status_ = lex.getBool() ? Collapsed : Open;
+   string const tmp_token = lex.getString();
+
+   if (tmp_token == "inlined") {
+   status_ = Inlined;
+   token_found = true;
+   } else if (tmp_token == "collapsed") {
+   status_ = Collapsed;
+   token_found = true;
+   } else if (tmp_token == "open") {
+   stat

Re: [PATCH] CollapseStatus

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 12:48:32PM +0100, Michael Schmitt wrote:
> BTW: Why does insetert need metrics(...) & draw(...)? If they are really 
> needed, then we have to fix insetcollapsable instead.

They change the font to 'red typewriter', don't they?

Andre'


Re: Hollywood class

2003-12-12 Thread Garst R. Reese
"Kayvan A. Sylvan" wrote:
> 
> In the current CVS, when writing a document with the hollywood class,
> I am noticing that the author's address (entered in the "Right Address"
> paragraph style) is not rendered in the final output.
> 
> Does anyone know what is happening there?
> 
> Garst, if you are reading this, can you check? It happens with the
> examples/script_form.lyx as well.
> 
> Thanks!
Hi folks, I don't have current CVS up. With 1.3.2 script_form.lyx works
fine.
Here's the lyx entry with format 221.

FOR A FEW DAYS MORE
\layout Author
\added_space_bottom vfill 
by
\newline 
April Rider
\layout Right Address
\pagebreak_bottom 
April Rider
\newline 
555 George St.
 NNW
\newline 
Kaplan, ND 7 
\newline 
999-999-

I'm in the midst of moving, so pressed for time.
What is the status of 1.4CVS now?
I'll resubsribed after the holidays.

Cheers,
   Garst


Re: InsetBox and format 227

2003-12-12 Thread Jose' Matos
On Wednesday 10 December 2003 18:34, Angus Leeming wrote:
> The attached patch changes the lyx format to 227
...
> However, I'll hold off applying it because I'm unsure how best to
> proceed with lyx2lyx. The patch removes the just committed
> lyxconvert_225.py, lyxrevert_226.py, moving their contents into the
> new files lyxconvert_226.py, lyxrevert_227.py and augments these new
> files with convert_box functions. However, I can see that this is
> ugly.

  Why do you want to move its content?
  I don't get your intent here...

> Would it be best to do this only once we freeze for a 1.4 release so
> that a released lyx2lyx would contain the equivalent of
> lyxconvert_13xformat.py and lyxrevert_14xformat.py?

  No need, but if you want to... :-)

> José, I wonder if the present scheme, where conversion to the latest
> format is dictated by the names of the lyxconvert_xyz.py files would
> not be better served by this in lyx2lyx:
>
> most_uptodate_format = 227
>
> Thereafter, lyxconvert_225.py would just be a convenient placeholder
> for all functions needed to convert format 225 to the
> most_uptodate_format rather than conversion being implicitly defined
> to produce format 226.

  The scheme we have is need to get the chain effect, we want to make the 
convertion from any given format to the intend by small steps.

  I have some preliminary support for 2.00 format, the first that I ever 
found, do you propose me to put all lyx2lyx scripts in the one used to 
convert that relic files to the present.

  And then when we have a new format we need to add those convertion functions 
also there. That is crazy. ;-)

[Answered yesterday]

-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: InsetBox and format 227

2003-12-12 Thread Jose' Matos
On Wednesday 10 December 2003 20:20, Georg Baum wrote:
>
> A side note: I find the filenames very confusing. I never know what
> lyxrevert_225.py or lyxconvert_225.py does: revert/convert _to_ 225 or
> _from_ 225?

  - lyxconvert_xxx.py converts from xxx format to its successor.
  - lyxrevert_xxx.py reverts from xxx format to its predecessor.

  Do you want me to put this comment in lyx2lyx?

> Georg

-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: Adding a draft option to InsetExternal

2003-12-12 Thread Jose' Matos
On Thursday 11 December 2003 00:06, Angus Leeming wrote:
> See attached. I'd appreciate it if the LaTeX-savvy would cast an eye
> over this:
>
>  int InsetExternal::latex(Buffer const & buf, ostream & os,
>  OutputParams const & runparams) const
>  {
> +   if (params_.draft) {
> +   os << "\\fbox{\\ttfamily{}"
> +  << params_.filename.outputFilename(buf.filePath())
> +  << "}\n";
> +   return 1;
> +   }
>
> José, how would we do this (or similar) in docbook and linuxdoc?

   I will give a look to it soon, for now
   os << "" << params_.filename.outputFilename(buf.filePath()) << 
"\n";

  should be ok.

-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: [patch] splash crash

2003-12-12 Thread Alfredo Braunstein
Angus Leeming wrote:

>> avoid crashing when dragging over the splash screen:
> Committed.

Thanks!

Alfredo




Re: InsetBranch questions

2003-12-12 Thread Martin Vermeer
On Fri, Dec 12, 2003 at 11:12:34AM +, Angus Leeming spake thusly:

> Martin,
> 
> I note that the branches dialog isn't very useful at the moment and 
> suspect that this is my doing. The choice of available branches is 
> empty. I'll sort it out but have a few questions of my own:
> 
> 1 Looking at the code in FormBranch.C, QBranch.C:
> why do you bother filling the choice in 'build'? It is subsequently 
> overwritten in 'update', so this is just a waste of cycles.

Is it? I.e. does build do an implicit update? If so, it is
unnecessary. I do vaguely remember that it was necessary, but see if
you can get rid of it.
 
> 2 Why do you store a copy of the list of available branches in the 
> inset? Why not provide an accessor from the controller. Eg
> 
> std::vector const
> ControlBranches::all_branches() const
> {
> BranchList const & branchlist =
> kernel().buffer().params().branchlist();
> 
> ...
> }

Sure. But remember you have to store the branchlist in the .lyx file.
If you can make it work, fine... I was already very happy getting this
to work at all.
 
> 3. Why do you store the list of all branch names in BranchList as a 
> '|'-separated string. Why not use a vector?

Seemed the easiest, as this is immediately used in filling in the
choice box in the xforms frontend (yes, this an xforms-ism. Not
nice).  Also I chose this as the storage format in the .lyx file, as
it is nice and compact. A vector would require extra logic -- and/or
change the file format again.

Might be a little cleaner though.

> If you're worried about filling the choice in the xforms frontend, 
> then don't be:
> string const all_branches =
> ' ' +
> getStringFromVector(controller().all_branches(), " | ") +
> ' ';
> fl_clear_choice(dialog_->choice_branch);
> fl_addto_choice(dialog_->choice_branch, all_branches.c_str());

Sure... I've seen that in other places. So using '|' wasn't even my
invention ;-)
 
> 4. I notice a bug in the display of new branches. For example:
> * I created a branch 'Purple' and a branch 'Green' in that order and 
> set the colours of both appropriately.
> * I created a 'Purple' branch inset and discovered it was displayed 
> with a green background. I subsequently created a 'Green' inset. It 
> also had a green background.
> * Close the file and re-open and all is Ok. (Maybe I restarted LyX.)

Ah... this *did* work OK earlier. Could it have to do with the change
in the ColorHandler logic -- a lack of refresh of the colour lookup
table?
 
> I propose to address questions 1-3 myself and to fix the currently 
> useless Branch dialog. Ok?

OK. 1 is just verifying if you can remove it, 2 is tricky but should
be possible (thorough testing!) 3: go right ahead if you think it is
The Right Thing. 4. ... testing needed. I suspect colour lookup table
refresh/caching (is there still such a thing?)
 
> -- 
> Angus

- Martin 



pgp0.pgp
Description: PGP signature


Re: lyx2lyx questions.

2003-12-12 Thread Jose' Matos
On Thursday 11 December 2003 20:24, Angus Leeming wrote:
>
> The advantage of this scheme would be that each format change would
> not require a new lyxconvert_xyz.py file, yet files generated with
> recent cvs versions of LyX would continue to be upgraded.

  So the only problem is the number of files?
  The files now are self-contained, and easier to read.

  Also I don't understand what is the policy used to inflate the file format 
number. :-)

  Really, if we decide to increase the file format everytime that we change 
the format I can understand that. Then I would gladly change the 
transformation scheme to one file by release.

  Am I so dumb that cann't understand the issue? :-)
  A simple yes is not an answer. ;-)
-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: [PATCH] CollapseStatus

2003-12-12 Thread Michael Schmitt
Andre Poenitz wrote:
On Fri, Dec 12, 2003 at 12:48:32PM +0100, Michael Schmitt wrote:

BTW: Why does insetert need metrics(...) & draw(...)? If they are really 
needed, then we have to fix insetcollapsable instead.


They change the font to 'red typewriter', don't they?


So, this is the code to change the font to 'red typewriter'? Oh my God!

void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
{
LyXFont tmpfont = mi.base.font;
getDrawFont(mi.base.font);
InsetCollapsable::metrics(mi, dim);
mi.base.font = tmpfont;
dim_ = dim;
}
void InsetERT::draw(PainterInfo & pi, int x, int y) const
{
LyXFont tmpfont = pi.base.font;
getDrawFont(pi.base.font);
InsetCollapsable::draw(pi, x, y);
pi.base.font = tmpfont;
}








Re: [PATCH] CollapseStatus

2003-12-12 Thread Martin Vermeer
On Fri, Dec 12, 2003 at 02:04:45PM +0100, Michael Schmitt spake thusly:
> 
> Andre Poenitz wrote:
> > On Fri, Dec 12, 2003 at 12:48:32PM +0100, Michael Schmitt wrote:
> > 
> >>BTW: Why does insetert need metrics(...) & draw(...)? If they are really 
> >>needed, then we have to fix insetcollapsable instead.
> > 
> > 
> > They change the font to 'red typewriter', don't they?
> 
> 
> So, this is the code to change the font to 'red typewriter'? Oh my God!
> 
> 
> void InsetERT::metrics(MetricsInfo & mi, Dimension & dim) const
> {
>  LyXFont tmpfont = mi.base.font;
>  getDrawFont(mi.base.font);
>  InsetCollapsable::metrics(mi, dim);
>  mi.base.font = tmpfont;
>  dim_ = dim;
> }
> 
> 
> void InsetERT::draw(PainterInfo & pi, int x, int y) const
> {
>  LyXFont tmpfont = pi.base.font;
>  getDrawFont(pi.base.font);
>  InsetCollapsable::draw(pi, x, y);
>  pi.base.font = tmpfont;
> }

Yes, apparently... but do you really need metrics() and draw() for
that? E.g., insetcharstyle does it without... just 
InsetCharStyle::getDrawFont().

Otherwise, this looks like going in the right direction. 

But what about adding a fourth display mode, Labelbelow, to the set?
Is that your next step? And where does the right mouse click (that
toggles this with Inlined) go in that case?

Good work! (especially the line count reduction :-)

- Martin



pgp0.pgp
Description: PGP signature


Re: [PATCH] CollapseStatus

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 03:29:05PM +0200, Martin Vermeer wrote:
> Yes, apparently... but do you really need metrics() and draw() for
> that? E.g., insetcharstyle does it without... just 
> InsetCharStyle::getDrawFont().

Is this used anywhere?

void InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
{
InsetCollapsable::metrics(mi, dim);
dim_ = dim;
if (has_label_)
dim_.des += ascent();
}

This computes the metrics using the font of the parent. Which may work
by accident but is wrong in general.

Andre'


lyx2lyx

2003-12-12 Thread Andre Poenitz


I get

[EMAIL PROTECTED]:/usr/src/lyx/lyx-build/src > ./lyx newfile9.lyx
Traceback (most recent call last):
  File "/usr/src/lyx/lyx-devel/lib/lyx2lyx/lyx2lyx", line 197, in ?
main(sys.argv)
  File "/usr/src/lyx/lyx-devel/lib/lyx2lyx/lyx2lyx", line 168, in main
parse_options(argv)
  File "/usr/src/lyx/lyx-devel/lib/lyx2lyx/lyx2lyx", line 91, in
parse_options
opt.end = lyxformat(a)
  File "/usr/src/lyx/lyx-devel/lib/lyx2lyx/lyx2lyx", line 118, in
lyxformat
opt.err.write(fmt + ": " + error.format_not_supported)
TypeError: unsupported operand types for +: 'int' and 'str'


on one of my test files. Is this to be expected?

File attached.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
#LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/
\lyxformat 225
\textclass article
\language english
\inputencoding auto
\fontscheme default
\graphics default
\paperfontsize default
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 2
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes 0
\end_header

\begin_layout Standard

q
\begin_inset Formula $casdcasd\substack{s\\
s}
asdcasd$
\end_inset 

c
\begin_inset Formula $as\mathbf{sdas}d$
\end_inset 



\begin_layout Standard

as
\end_layout

\begin_layout Standard

cd
\end_layout

\begin_layout Standard

s sss
\end_layout

\begin_layout Standard

\end_layout

\begin_layout Standard


\end_layout

\begin_layout Standard

asd
\end_layout

\begin_layout Standard

cs
\end_layout

\begin_layout Standard

ascdcasdc asdsa dasdqasdasdes as dc asd cs ddc
\begin_inset Tabular







\begin_inset Text

\begin_layout Standard

assdd c sadcsa dc sacccd sd sd sd c 222sadascsadc ads cas dc sacds
\end_layout

\end_inset 


\begin_inset Text

\begin_layout Standard

casd cas dcas dc asdc asd cd sa
\end_layout

\end_inset 


\begin_inset Text

\begin_layout Standard

\end_layout

\end_inset 




\end_inset 


\end_layout

\begin_layout Standard

c
\end_layout

\end_document


Re: makepsres: command not found

2003-12-12 Thread Kuba Ober
On Friday 12 December 2003 04:15 am, you wrote:
> > "Kuba" == Kuba Ober <[EMAIL PROTECTED]> writes:
>
> Kuba> Isn't DPS practically dead? I'd actually like to hear from
> Kuba> somebody whose X server is DPS-aware and needs makepsres run on
> Kuba> font directories...
>
> Solaris

Wow. That's a living archaeological artifact then! Good to know somebody still 
uses that. Sun must like Adobe for whatever reason :)

Cheers, Kuba



Re: lyx2lyx questions.

2003-12-12 Thread Angus Leeming
Jose' Matos wrote:
> On Thursday 11 December 2003 20:24, Angus Leeming wrote:
>>
>> The advantage of this scheme would be that each format change would
>> not require a new lyxconvert_xyz.py file, yet files generated with
>> recent cvs versions of LyX would continue to be upgraded.
> 
>   So the only problem is the number of files?

Yes.

>   The files now are self-contained, and easier to read.
> 
>   Also I don't understand what is the policy used to inflate the
>   file format number. :-)

Each change should increment the file format by 1. That that doesn't 
happen at the moment is largely because that means adding a new pair 
of files to lyx2lyx

>   Really, if we decide to increase the file format everytime that we
>   change the format I can understand that. Then I would gladly
>   change the transformation scheme to one file by release.

Seems sensible to me.

>   Am I so dumb that cann't understand the issue? :-)
>   A simple yes is not an answer. ;-)

You have understood what I was trying to say, despite my inability to 
express myself clearly, so you clearly aren't s dumb.

-- 
Angus



[patch] fix math super/subscript

2003-12-12 Thread Andre Poenitz

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
Index: lyx_main.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.181
diff -u -p -r1.181 lyx_main.C
--- lyx_main.C  14 Oct 2003 21:30:20 -  1.181
+++ lyx_main.C  12 Dec 2003 13:44:39 -
@@ -424,10 +424,6 @@ void LyX::defaultKeyBindings(kb_keymap  
kbmap->bind("Delete", FuncRequest(LFUN_DELETE));
kbmap->bind("BackSpace", FuncRequest(LFUN_BACKSPACE));
 
-   // sub- and superscript -MV
-   kbmap->bind("~S-underscore", FuncRequest(LFUN_SUBSCRIPT));
-   kbmap->bind("~S-asciicircum", FuncRequest(LFUN_SUPERSCRIPT));
-
// kbmap->bindings to enable the use of the numeric keypad
// e.g. Num Lock set
//kbmap->bind("KP_0", FuncRequest(LFUN_SELFINSERT));
Index: lyxfunc.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxfunc.C,v
retrieving revision 1.550
diff -u -p -r1.550 lyxfunc.C
--- lyxfunc.C   10 Dec 2003 22:10:38 -  1.550
+++ lyxfunc.C   12 Dec 2003 13:44:39 -
@@ -1193,15 +1193,6 @@ void LyXFunc::dispatch(FuncRequest const
setErrorMessage(N_("This is only allowed in math mode!"));
break;
 
-   // passthrough hat and underscore outside mathed:
-   case LFUN_SUBSCRIPT:
-   dispatch(FuncRequest(view(), LFUN_SELFINSERT, "_"));
-   break;
-
-   case LFUN_SUPERSCRIPT:
-   dispatch(FuncRequest(view(), LFUN_SELFINSERT, "^"));
-   break;
-
case LFUN_DIALOG_SHOW: {
string const name = func.getArg(0);
string data = trim(func.argument.substr(name.size()));
Index: insets/insetcommandparams.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcommandparams.h,v
retrieving revision 1.9
diff -u -p -r1.9 insetcommandparams.h
--- insets/insetcommandparams.h 6 Oct 2003 15:43:00 -   1.9
+++ insets/insetcommandparams.h 12 Dec 2003 13:44:39 -
@@ -66,11 +66,9 @@ private:
 
 
 ///
-bool operator==(InsetCommandParams const &,
-   InsetCommandParams const &);
+bool operator==(InsetCommandParams const &, InsetCommandParams const &);
 
 ///
-bool operator!=(InsetCommandParams const &,
-   InsetCommandParams const &);
+bool operator!=(InsetCommandParams const &, InsetCommandParams const &);
 
 #endif
Index: mathed/formulabase.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/formulabase.C,v
retrieving revision 1.314
diff -u -p -r1.314 formulabase.C
--- mathed/formulabase.C22 Nov 2003 14:44:59 -  1.314
+++ mathed/formulabase.C12 Dec 2003 13:44:39 -
@@ -604,16 +604,7 @@ InsetFormulaBase::priv_dispatch(FuncRequ
break;
}
 
-   case LFUN_SUPERSCRIPT:
-   case LFUN_SUBSCRIPT:
-   {
-   recordUndo(bv, Undo::ATOMIC);
-   mathcursor->script(cmd.action == LFUN_SUPERSCRIPT);
-   break;
-   }
-
-   case LFUN_MATH_DELIM:
-   {
+   case LFUN_MATH_DELIM: {
//lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'" << 
endl;
string ls;
string rs = split(cmd.argument, ls, ' ');
Index: mathed/math_cursor.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v
retrieving revision 1.370
diff -u -p -r1.370 math_cursor.C
--- mathed/math_cursor.C10 Dec 2003 10:22:27 -  1.370
+++ mathed/math_cursor.C12 Dec 2003 13:44:39 -
@@ -1254,6 +1254,16 @@ bool MathCursor::interpret(char c)
return pos() != size();
}
 
+   if (c == '_') {
+   script(false);
+   return true;
+   }
+
+   if (c == '^') {
+   script(true);
+   return true;
+   }
+
if (c == '{' || c == '}' || c == '#' || c == '&' || c == '$') {
niceInsert(createMathInset(string(1, c)));
return true;


Re: lyx2lyx

2003-12-12 Thread Angus Leeming
Andre Poenitz wrote:

>   File "/usr/src/lyx/lyx-devel/lib/lyx2lyx/lyx2lyx", line 118, in
> lyxformat
> opt.err.write(fmt + ": " + error.format_not_supported)
> TypeError: unsupported operand types for +: 'int' and 'str'
> 
> 
> on one of my test files. Is this to be expected?

No. Upgrade to latest cvs and the crash will dissappear. The line 
should be
opt.err.write(str(fmt) + ": " + error.format_not_supported)

Also, current cvs supports format 227 and your version of lyx2lyx 
doesn't know anything about this format. Hence the trigger for the 
error message in the first place.

-- 
Angus



Re: [PATCH] CollapseStatus

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 12:48:32PM +0100, Michael Schmitt wrote:
> Please have a look at the patch. If you like it, please apply it.

Done.

Andre'

PS: Mind whitespace.

> + st = "inlined";
> + break;
> + }
> + os << "status "<< st << "\n";
> +
> +inset.text_.write(buf, os);
>  }



'math-mode' and Insert->Math->AMS_Multline etc

2003-12-12 Thread Christian Ridderström
Hi

This is about a _minor_ problem, for now I'm really only planning to
"bugzilla and forget" about it.

When you do for instance Insert->Math->AMS_Multline, you seem to do:
math-mode; math-mutate align;

However, if you already are in math-mode, you accidentally insert a 
\textrm{} into the mathInset which in IMO is a bug.

One solution is to replace the command 'math-mode' with 
something like 'ensure-math-mode'? Is there such an LFUN?

Which makes me think why is it that 'math-mode' in a math-inset 
actually inserts a \textrm{}?
Shouldn't the LFUN be named something like 'math-mode-toggle' then?

Or this just a side-effect of that the keyboard bindings are the same for 
textEd and MathEd, i.e. C-m -> math-mode and the rest follows?

Anyway, these are mostly random thoughts since it's Friday.

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: 'math-mode' and Insert->Math->AMS_Multline etc

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 03:06:12PM +0100, Christian Ridderström wrote:
> This is about a _minor_ problem, for now I'm really only planning to
> "bugzilla and forget" about it.
> 
> When you do for instance Insert->Math->AMS_Multline, you seem to do:
>   math-mode; math-mutate align;
> 
> However, if you already are in math-mode, you accidentally insert a 
> \textrm{} into the mathInset which in IMO is a bug.
> 
> One solution is to replace the command 'math-mode' with 
> something like 'ensure-math-mode'? Is there such an LFUN?
> 
> Which makes me think why is it that 'math-mode' in a math-inset 
> actually inserts a \textrm{}?
> Shouldn't the LFUN be named something like 'math-mode-toggle' then?

This LFUN 'overload' is a mess and I would not mind removing it at once.
Last time I tried I got heavy flak, though...

Andre'


Re: lyx2lyx

2003-12-12 Thread Alfredo Braunstein
Andre Poenitz wrote:

> on one of my test files. Is this to be expected?

cd .. before cvs up ? ;-)

Alfredo 




Re: makepsres: command not found

2003-12-12 Thread Jean-Marc Lasgouttes
> "Kuba" == Kuba Ober <[EMAIL PROTECTED]> writes:

Kuba> On Friday 12 December 2003 04:15 am, you wrote:
>> > "Kuba" == Kuba Ober <[EMAIL PROTECTED]> writes:
>> 
Kuba> Isn't DPS practically dead? I'd actually like to hear from
Kuba> somebody whose X server is DPS-aware and needs makepsres run on
Kuba> font directories...
>>  Solaris

Kuba> Wow. That's a living archaeological artifact then! Good to know
Kuba> somebody still uses that. Sun must like Adobe for whatever
Kuba> reason :)

Well, this is not very far from the Quartz imaging model apple uses,
after all...

JMarc


Re: lyx2lyx

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 11:12:20AM -0300, Alfredo Braunstein wrote:
> Andre Poenitz wrote:
> 
> > on one of my test files. Is this to be expected?
> 
> cd .. before cvs up ? ;-)

Good idea.

Andre'


Re: [PATCH] CollapseStatus

2003-12-12 Thread Michael Schmitt
Martin Vermeer wrote:

Otherwise, this looks like going in the right direction. 

But what about adding a fourth display mode, Labelbelow, to the set?
Is that your next step? And where does the right mouse click (that
toggles this with Inlined) go in that case?
My next step is to move the CharStyle modes (which I like very much) to 
InsetCollapse. One of them will effectively replace the "inlined" mode.

Concerning the mouse clicks - well, currently the right button invokes 
the inset dialog. The left button (on the button label) opens/closes the 
inset.

Since there are collapsable insets which have their own dialog, we must 
assume that the right mouse button is not longer available for toggling.
Thus, in the future, I prefer the following solution:

  - Each inset type has a predefined default "open" mode
  - Left button on button label: Toggle between default open mode
and close
  - In the "edit" menu, we add a submenu to toggle between all possible
modes.
This, of course, are dreams of the future. First, I would like to see my 
patch accepted (or rejected) so that I can continue (nowadways, the 
inset files change quite rapidly) Then the lyx2lyx converter, then the 
CharStyle unification, then ...

Have a nice weekend, Michael




Re: makepsres: command not found

2003-12-12 Thread Kuba Ober
On Friday 12 December 2003 09:12 am, you wrote:
> > "Kuba" == Kuba Ober <[EMAIL PROTECTED]> writes:
>
> Kuba> On Friday 12 December 2003 04:15 am, you wrote:
> >> > "Kuba" == Kuba Ober <[EMAIL PROTECTED]> writes:
>
> Kuba> Isn't DPS practically dead? I'd actually like to hear from
> Kuba> somebody whose X server is DPS-aware and needs makepsres run on
> Kuba> font directories...
>
> >>  Solaris
>
> Kuba> Wow. That's a living archaeological artifact then! Good to know
> Kuba> somebody still uses that. Sun must like Adobe for whatever
> Kuba> reason :)
>
> Well, this is not very far from the Quartz imaging model apple uses,
> after all...

Concept-wise, yes, but DPS is way older. I bet Quartz already is more widely 
deployed than DPS ever was. Quartz is mainstream technology sold in your 
typical computer store, DPS is... an oddity :)

Cheers, Kuba



Re: [PATCH] CollapseStatus

2003-12-12 Thread Jose' Matos
On Friday 12 December 2003 14:15, Michael Schmitt wrote:
>
> This, of course, are dreams of the future. First, I would like to see my
> patch accepted (or rejected) so that I can continue (nowadways, the
> inset files change quite rapidly) Then the lyx2lyx converter, then the
> CharStyle unification, then ...

  If you need any help with lyx2lyx convertion just tell.
  Sometimes a tip is all that is needed. :-)

> Have a nice weekend, Michael

  The same to you. :-)

  [Completly out of topic: is this expression "nice weekend" english or 
american? I'm not joking. :-)]
-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: [patch] selection

2003-12-12 Thread Alfredo Braunstein
Alfredo Braunstein wrote:

> Anyway, I'll still test it for a day or so to avoid bad surprises. ;-)

I'm willing to apply this as it seems to work correctly.

No objections (naming or otherwise)?

Alfredo
Index: BufferView.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.C,v
retrieving revision 1.213
diff -u -r1.213 BufferView.C
--- BufferView.C	1 Dec 2003 13:35:36 -	1.213
+++ BufferView.C	12 Dec 2003 14:41:12 -
@@ -68,6 +68,12 @@
 }
 
 
+void BufferView::unsetXSel()
+{
+	pimpl_->xsel_cache_.set = false;
+}
+
+
 Buffer * BufferView::buffer() const
 {
 	return pimpl_->buffer_;
Index: BufferView.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView.h,v
retrieving revision 1.154
diff -u -r1.154 BufferView.h
--- BufferView.h	28 Nov 2003 15:08:36 -	1.154
+++ BufferView.h	12 Dec 2003 14:41:13 -
@@ -182,6 +182,9 @@
 	/// return target x position of cursor
 	int x_target() const;
 
+	/// clear the X selection
+	void unsetXSel();
+
 	/// access to cursor
 	LCursor & cursor();
 	/// access to cursor
Index: BufferView_pimpl.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.477
diff -u -r1.477 BufferView_pimpl.C
--- BufferView_pimpl.C	12 Dec 2003 13:39:18 -	1.477
+++ BufferView_pimpl.C	12 Dec 2003 14:41:17 -
@@ -114,6 +114,8 @@
 	: bv_(bv), owner_(owner), buffer_(0), cursor_timeout(400),
 	  using_xterm_cursor(false), cursor_(bv)
 {
+	xsel_cache_.set = false;
+
 	workarea_.reset(WorkAreaFactory::create(xpos, ypos, width, height));
 	screen_.reset(LyXScreenFactory::create(workarea()));
 
@@ -390,10 +392,10 @@
 
 	par = bv_->text()->cursor.par();
 	pos = bv_->text()->cursor.pos();
-	selstartpar = bv_->text()->selection.start.par();
-	selstartpos = bv_->text()->selection.start.pos();
-	selendpar = bv_->text()->selection.end.par();
-	selendpos = bv_->text()->selection.end.pos();
+	selstartpar = bv_->text()->selStart().par();
+	selstartpos = bv_->text()->selStart().pos();
+	selendpar = bv_->text()->selEnd().par();
+	selendpos = bv_->text()->selEnd().pos();
 	selection = bv_->text()->selection.set();
 	mark_set = bv_->text()->selection.mark();
 	bv_->text()->textwidth_ = bv_->workWidth();
@@ -526,20 +528,22 @@
 
 	LyXText * text = bv_->getLyXText();
 
-	if (text->selection.set() &&
-		(!bv_->text()->xsel_cache.set() ||
-		 text->selection.start != bv_->text()->xsel_cache.start ||
-		 text->selection.end != bv_->text()->xsel_cache.end))
+	if (!text->selection.set()) {
+		xsel_cache_.set = false;
+		return;
+	}
+
+	if (!xsel_cache_.set ||
+	text->cursor != xsel_cache_.cursor ||
+	text->selection.cursor != xsel_cache_.selection_cursor)
 	{
-		bv_->text()->xsel_cache = text->selection;
+		xsel_cache_.cursor = text->cursor;
+		xsel_cache_.selection_cursor = text->selection.cursor;
+		xsel_cache_.set = text->selection.set();
 		sel = text->selectionAsString(*bv_->buffer(), false);
-	} else if (!text->selection.set()) {
-		sel = string();
-		bv_->text()->xsel_cache.set(false);
-	}
-	if (!sel.empty()) {
-		workarea().putClipboard(sel);
-	}
+		if (!sel.empty())
+			workarea().putClipboard(sel);
+	} 
 }
 
 
@@ -548,7 +552,7 @@
 	if (available()) {
 		screen().hideCursor();
 		bv_->getLyXText()->clearSelection();
-		bv_->text()->xsel_cache.set(false);
+		xsel_cache_.set = false;
 	}
 }
 
@@ -631,8 +635,8 @@
 	if (!text->selection.set())
 		return Change(Change::UNCHANGED);
 
-	return text->getPar(text->selection.start)
-		->lookupChangeFull(text->selection.start.pos());
+	return text->getPar(text->selStart())
+		->lookupChangeFull(text->selStart().pos());
 }
 
 
Index: BufferView_pimpl.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.h,v
retrieving revision 1.110
diff -u -r1.110 BufferView_pimpl.h
--- BufferView_pimpl.h	10 Nov 2003 18:15:52 -	1.110
+++ BufferView_pimpl.h	12 Dec 2003 14:41:17 -
@@ -193,7 +193,12 @@
 	void MenuInsertLyXFile(std::string const & filen);
 	/// our workarea
 	WorkArea & workarea() const;
-
+	/// this is used to handle XSelection events in the right manner
+	struct {
+		LyXCursor cursor;
+		LyXCursor selection_cursor;
+		bool set;
+	} xsel_cache_;
 	///
 	LCursor cursor_;
 };
Index: ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.1749
diff -u -r1.1749 ChangeLog
--- ChangeLog	12 Dec 2003 13:39:17 -	1.1749
+++ ChangeLog	12 Dec 2003 14:41:59 -
@@ -1,4 +1,17 @@
-2003-12-12  Alfredo Braunstein  <[EMAIL PROTECTED]>
+2003-12-12  Alfredo Braunstein  <[EMAIL PROTECTED]>
+
+	* textcursor.[Ch] (selStart,selEnd): add new methods 
+	remove selection::start, end, use LyXCursor::operator<
+	* lyxcursor.[Ch] (operator<): add
+

Re: [patch] selection

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 12:09:06PM -0300, Alfredo Braunstein wrote:
> Alfredo Braunstein wrote:
> 
> > Anyway, I'll still test it for a day or so to avoid bad surprises. ;-)
> 
> I'm willing to apply this as it seems to work correctly.
> 
> No objections (naming or otherwise)?

Nothing above nitpicking level.

Just commit.

Andre'


-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)


[PATCH] CollapseStatus

2003-12-12 Thread Michael Schmitt
Hi Andre,

I think you broke some part of my patch.

Please have a look at the attachment.

Thanks, Michael
Index: insetcollapsable.C
===
RCS file: /cvs/lyx/lyx-devel/src/insets/insetcollapsable.C,v
retrieving revision 1.223
diff -u -r1.223 insetcollapsable.C
--- insetcollapsable.C  2003/12/12 14:02:14 1.223
+++ insetcollapsable.C  2003/12/12 15:12:53
@@ -354,11 +354,13 @@
case LFUN_INSET_TOGGLE:
if (inset.text_.toggleInset())
return DispatchResult(true, true);
-   if (status_ == Open)
+   if (status_ == Open) {
setStatus(Inlined);
return DispatchResult(true, true);
-   setStatus(Collapsed);
-   return DispatchResult(false, FINISHED_RIGHT);
+   } else {
+   setStatus(Collapsed);
+   return DispatchResult(false, FINISHED_RIGHT);
+   }
 
default:
return inset.dispatch(adjustCommand(cmd));


[patch] move tabular closer to 'one cursor slice'

2003-12-12 Thread Andre Poenitz

I think I've made my mind up (after a while of experimentation).
We should have a single slice for InsetTabular.

Reasons are consistency with the rest of 'texted' (InsetCollapsable) and
implementation is not much harder than the two slices. So better move
forward on the IU path.

This patch does not much. It introduces a new 'locked_cell' instead of
the 'lockinginset', which should go in the end again and the idx_ field
of the top slice of the cursor used instead..

Andre'


-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)
Index: cursor.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
retrieving revision 1.27
diff -u -p -r1.27 cursor.C
--- cursor.C10 Dec 2003 09:45:26 -  1.27
+++ cursor.C12 Dec 2003 15:09:01 -
@@ -37,6 +37,7 @@ std::ostream & operator<<(std::ostream &
os << " inset: " << item.inset_
   << " code: " << item.inset_->lyxCode()
   << " text: " << item.text()
+  << " idx: " << item.idx_
 //<< " par: " << item.par_
 //<< " pos: " << item.pos_
   << " x: " << item.inset_->x()
Index: cursor.h
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.h,v
retrieving revision 1.10
diff -u -p -r1.10 cursor.h
--- cursor.h13 Nov 2003 08:50:23 -  1.10
+++ cursor.h12 Dec 2003 15:09:01 -
@@ -34,10 +34,10 @@ class InsetTabular;
 class CursorItem {
 public:
///
-   CursorItem() : inset_(0), par_(0), pos_(0) {}
+   CursorItem() : inset_(0), idx_(0), par_(0), pos_(0) {}
///
explicit CursorItem(UpdatableInset * inset)
-   : inset_(inset), par_(0), pos_(0)
+   : inset_(inset), idx_(0), par_(0), pos_(0)
{}
///
LyXText * text() const;
@@ -46,6 +46,8 @@ public:
 public:
///
UpdatableInset * inset_;
+   ///
+   int idx_;
///
int par_;
///
Index: insets/insettabular.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettabular.C,v
retrieving revision 1.385
diff -u -p -r1.385 insettabular.C
--- insets/insettabular.C   10 Dec 2003 09:45:30 -  1.385
+++ insets/insettabular.C   12 Dec 2003 15:09:01 -
@@ -159,9 +159,9 @@ InsetTabular::InsetTabular(Buffer const 
  buffer_(&buf), cursorx_(0), cursory_(0)
 {
tabular.setOwner(this);
-   the_locking_inset = 0;
actrow = 0;
actcell = 0;
+   locked_cell = -1;
clearSelection();
in_reset_pos = 0;
 }
@@ -172,10 +172,10 @@ InsetTabular::InsetTabular(InsetTabular 
buffer_(tab.buffer_), cursorx_(0), cursory_(0)
 {
tabular.setOwner(this);
-   the_locking_inset = 0;
actrow = 0;
actcell = 0;
clearSelection();
+   locked_cell = -1;
in_reset_pos = 0;
 }
 
@@ -282,13 +282,12 @@ void InsetTabular::draw(PainterInfo & pi
break;
if (tabular.isPartOfMultiColumn(i, j))
continue;
-   int cx = nx + tabular.getBeginningOfTextInCell(cell);
if (first_visible_cell < 0)
first_visible_cell = cell;
-   if (hasSelection()) {
+   if (hasSelection()) 
drawCellSelection(pi.pain, nx, y, i, j, cell);
-   }
 
+   int const cx = nx + tabular.getBeginningOfTextInCell(cell);
tabular.getCellInset(cell).draw(pi, cx, y);
drawCellLines(pi.pain, nx, y, i, cell);
nx += tabular.getWidthOfColumn(cell);
@@ -351,6 +350,9 @@ void InsetTabular::drawCellLines(Painter
 void InsetTabular::drawCellSelection(Painter & pain, int x, int y,
 int row, int column, int cell) const
 {
+   if (locked_cell != -1)
+   return;
+
BOOST_ASSERT(hasSelection());
int cs = tabular.column_of_cell(sel_cell_start);
int ce = tabular.column_of_cell(sel_cell_end);
@@ -387,6 +389,9 @@ void InsetTabular::updateLocal(BufferVie
resetPos(bv);
 }
 
+extern LCursor theTempCursor;
+
+
 
 void InsetTabular::lfunMousePress(FuncRequest const & cmd)
 {
@@ -401,12 +406,17 @@ void InsetTabular::lfunMousePress(FuncRe
int cell = getCell(cmd.x + xo_, cmd.y + yo_);
lyxerr << "# InsetTabular::lfunMousePress cell: " << cell << endl;
if (cell == -1) {
+   bv->cursor() = theTempCursor;
+   bv->cursor().data_.push_back(CursorItem(this));
+   bv->cursor().data_.back().idx_ = cell;
} else {
-   t

Re: [PATCH] CollapseStatus

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 04:16:27PM +0100, Michael Schmitt wrote:
> Hi Andre,
> 
> I think you broke some part of my patch.

Looks like I mis-merged something. Sorry.

Andre'


Re: gnuplot graphics with lyx.

2003-12-12 Thread Jose' Matos
On Friday 12 December 2003 11:34, Angus Leeming wrote:
>
> Let's call it 'an accident of history'. The code used to be much more
> convoluted than it is now. However, I think that the primary reason
> is that InsetGraphics can handle compressed files and needs to
> uncompress them to ascertain the 'hidden' file format. Herbert just
> found it easiest to unconditionally copy the file and then play from
> there.

  That could probably be done using a flag, in the converter, something like 
originalfile, as an anology to original dir.

> Note also the stuff about timestamps and checksums. Have a look at the
> code in InsetGraphics: it is anything but trivial. Have a look also
> at the equivalent code in InsetExternal (ExternalSupport.C). The
> use-case is simpler (I don't worry about .gz files) but it is still
> not trivial.

  Since there is no chance this could work for 1.3 you are telling me to bet 
on the insetexternal inset instead for 1.4, is it?

-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: [patch] selection

2003-12-12 Thread Alfredo Braunstein
Andre Poenitz wrote:

>> No objections (naming or otherwise)?
> 
> Nothing above nitpicking level.

Fire.

> Just commit.

done. 

btw, we are down from 7(!) cached cursors per LyXText (7 = cursor + 2 *
selection with selection = 3 cursors) to just 2 (cursor + selection, with
selection = 1 cursor). 

So we are approaching 0 now... ;-)

Alfredo




Re: [patch] selection

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 12:43:19PM -0300, Alfredo Braunstein wrote:
> Andre Poenitz wrote:
> 
> >> No objections (naming or otherwise)?
> > 
> > Nothing above nitpicking level.
> 
> Fire.

Some whitespace somewhere. I forgot.

> btw, we are down from 7(!) cached cursors per LyXText (7 = cursor + 2 *
> selection with selection = 3 cursors) to just 2 (cursor + selection, with
> selection = 1 cursor). 
> 
> So we are approaching 0 now... ;-)

I'd think we should stop at this point.

Andre'


Re: gnuplot graphics with lyx.

2003-12-12 Thread Angus Leeming
Jose' Matos wrote:

>   Since there is no chance this could work for 1.3 you are telling
>   me to bet on the insetexternal inset instead for 1.4, is it?

Sort of.

I am telling you that the conversion code is duplicated in 
InsetExternal and InsetGraphics. The code controlling file conversion 
is simpler in InsetExternal than in InsetGraphics because 
InsetExternal is not (currently?) worried about compressed files.

My aim is to scrap InsetGraphics eventually but that time has not yet 
come. In the meantime, I certainly don't want to mess with the 
complex conversion code.

If you do, feel free, but you'll have to make sure that both 
InsetExternal and InsetGraphics continue to work...

-- 
Angus



Re: [patch] selection

2003-12-12 Thread Andre Poenitz
On Fri, Dec 12, 2003 at 12:43:19PM -0300, Alfredo Braunstein wrote:
> btw, we are down from 7(!) cached cursors per LyXText (7 = cursor + 2 *
> selection with selection = 3 cursors) to just 2 (cursor + selection, with
> selection = 1 cursor). 

So this means we could start using bv()->cursor() instead of the
TextCursor part of LyXText?

Would be nice...

Andre'


Re: [patch] selection

2003-12-12 Thread Alfredo Braunstein
Andre Poenitz wrote:

> On Fri, Dec 12, 2003 at 12:43:19PM -0300, Alfredo Braunstein wrote:
>> btw, we are down from 7(!) cached cursors per LyXText (7 = cursor + 2 *
>> selection with selection = 3 cursors) to just 2 (cursor + selection, with
>> selection = 1 cursor).
> 
> So this means we could start using bv()->cursor() instead of the
> TextCursor part of LyXText?
> 
> Would be nice...

That's what I was refering to with "we are approaching 0"...

I think we are pretty close of being able to do this. (maybe not for 1.4.0
anyway because it will still need some IU) 

Alfredo




Re: gnuplot graphics with lyx.

2003-12-12 Thread Jose' Matos
On Friday 12 December 2003 15:55, Angus Leeming wrote:
>
> I am telling you that the conversion code is duplicated in
> InsetExternal and InsetGraphics. The code controlling file conversion
> is simpler in InsetExternal than in InsetGraphics because
> InsetExternal is not (currently?) worried about compressed files.

  Got the message, thanks for your patience. :-)

-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: InsetBranch questions

2003-12-12 Thread Angus Leeming
Martin Vermeer wrote:
> OK. 1 is just verifying if you can remove it, 2 is tricky but should
> be possible (thorough testing!) 3: go right ahead if you think it is
> The Right Thing. 4. ... testing needed. I suspect colour lookup
> table refresh/caching (is there still such a thing?)

Patch attached addresses points 1-3 and results in MUCH simpler code 
although it shaves the total number of lines down by 30 only.

I'll hold off applying it to give you some chance to test it out 
yourself. Seems polite ;-)

-- 
Angus

branches.diff.bz2
Description: BZip2 compressed data


Cursor-related crash

2003-12-12 Thread Angus Leeming
Current cvs with my own changes to Martin's branches code, but that's 
irrelevant here.

Start LyX
File->New
Insert->Special Formatting->Superscript
Shift-Right arrow to select the blue box.
Note that the cursor remains on the left hand side...
Backspace
Crash.


#0  0x080bdcd5 in CursorItem::text() const (this=0x85635d8)
at ../../src/cursor.C:52
#1  0x080be424 in LCursor::innerText() const (this=0x84b53c0)
at /usr/include/c++/3.2/bits/stl_vector.h:300
#2  0x08064f1a in BufferView::getLyXText() const (this=0x84b5288)
at ../../src/BufferView.C:402
#3  0x080b0360 in bv_funcs::currentState(BufferView*) (bv=0x84b5288)
at ../../src/bufferview_funcs.C:180
#4  0x080f208d in LyXFunc::view_status_message() (this=0x84b4410)
at ../../src/lyxfunc.C:1796
#5  0x08252dd6 in QtView::update_view_state() (this=0x845ee48)
at ../../../../src/frontends/LyXView.h:78
#6  0x08253043 in 
boost::detail::function::void_function_obj_invoker0, 
boost::_bi::list1 > >, 
void>::invoke(boost::detail::function::any_pointer) (
function_obj_ptr=
  {obj_ptr = 0x0, const_obj_ptr = 0x0, func_ptr = 0, data = ""})
at ../../../../boost/boost/bind/mem_fn_template.hpp:46
#7  0x080a2cd4 in boost::signal0, int, 
std::less, boost::function0 > >::operator()() 
(this=0x845eedc) at 
../../boost/boost/function/function_template.hpp:321
#8  0x08146c12 in LyXText::dispatch(FuncRequest const&) 
(this=0x85294ec,
[EMAIL PROTECTED]) at ../../src/text3.C:767
#9  0x080be0ee in LCursor::dispatch(FuncRequest const&) 
(this=0x84b53c0,
[EMAIL PROTECTED]) at ../../src/cursor.C:107
#10 0x080ef446 in LyXFunc::dispatch(FuncRequest const&, bool) 
(this=0x84b4410,
[EMAIL PROTECTED], verbose=false) at ../../src/lyxfunc.C:1456
#11 0x080ea622 in LyXFunc::processKeySym(boost::shared_ptr, 
key_modifier::state) (this=0x84b4410, keysym={px = 0x8527b68, pn = 
{pi_ = 0x84ea088}},
state=none) at ../../src/lyxfunc.C:266
#12 0x0806a843 in 
BufferView::Pimpl::workAreaKeyPress(boost::shared_ptr, 
key_modifier::state) (this=0x84b52e8, key=
{px = 0x85378c8, pn = {pi_ = 0x0}}, state=none)
at ../../src/frontends/LyXView.h:78
#13 0x0806e9d4 in 
boost::detail::function::void_function_obj_invoker2, key_modifier::state>, 
boost::_bi::list3, 
boost::arg<1>, boost::arg<2> > >, void, boost::shared_ptr, 
key_modifier::state>::invoke(boost::detail::function::any_pointer, 
boost::shared_ptr, key_modifier::state) (function_obj_ptr=
  {obj_ptr = 0x84b52e8, const_obj_ptr = 0x84b52e8, func_ptr = 
0x84b52e8, data = "è"}, a0=Cannot access memory at address 0x0
) at ../../boost/boost/detail/shared_count.hpp:125
#14 0x082dc542 in boost::signal2, 
key_modifier::state, boost::last_value, int, std::less, 
boost::function2, 
key_modifier::state, std::allocator > 
>::operator()(boost::shared_ptr, key_modifier::state) (
this=0x84b544c, a1={px = 0x83cc840, pn = {pi_ = 0x9}}, a2=none)
at ../../../../boost/boost/detail/shared_count.hpp:125
#15 0x082db5af in QContentPane::keyPressEvent(QKeyEvent*) (this=0x0, 
e=0x0)
at ../../../../boost/boost/shared_ptr.hpp:81
#16 0x402943cc in QWidget::event(QEvent*) ()
   from /usr/lib/qt-3.0.5/lib/libqt-mt.so.3
#17 0x4020bc49 in QApplication::internalNotify(QObject*, QEvent*) ()


-- 
Angus



Re: Cursor-related crash

2003-12-12 Thread Alfredo Braunstein
Angus Leeming wrote:

> Current cvs with my own changes to Martin's branches code, but that's
> irrelevant here.
> 
> Start LyX
> File->New
> Insert->Special Formatting->Superscript
> Shift-Right arrow to select the blue box.
> Note that the cursor remains on the left hand side...
> Backspace
> Crash.

It's not related to my selection.diff patch. (it's already present before
that).

There are also other [possibly related] strange cursor behaviour patterns
with sup/sub-script, like cursor-right not willing to exit the inset, or
cursor-left entering the inset when the cursor is on the left.

Alfredo




Re: InsetBranch questions

2003-12-12 Thread Martin Vermeer
On Fri, Dec 12, 2003 at 04:23:57PM +, Angus Leeming spake thusly:
> 
> Martin Vermeer wrote:
> > OK. 1 is just verifying if you can remove it, 2 is tricky but should
> > be possible (thorough testing!) 3: go right ahead if you think it is
> > The Right Thing. 4. ... testing needed. I suspect colour lookup
> > table refresh/caching (is there still such a thing?)
> 
> Patch attached addresses points 1-3 and results in MUCH simpler code 
> although it shaves the total number of lines down by 30 only.
> 
> I'll hold off applying it to give you some chance to test it out 
> yourself. Seems polite ;-)
> 
> -- 
> Angus

Thanks... unfortunately I'll have no time this weekend or next week to
do this. So don't wait for me.

The changes look OK as far as I can judge. (Some things I wanted to do
also, like the BranchList API streamlining. I still find myself writing
Microsoft Basic even under the guise of C++). Please make sure that it
all works especially borderline cases (forgetting to define a colour
for a branch... saving/loading docs containing branches... exiting and
re-entering the dialog... you know the drill :-)

- Martin



pgp0.pgp
Description: PGP signature


Re: [PATCH] CollapseStatus

2003-12-12 Thread Martin Vermeer
On Fri, Dec 12, 2003 at 02:28:33PM +0100, Andre Poenitz spake thusly:
> 
> On Fri, Dec 12, 2003 at 03:29:05PM +0200, Martin Vermeer wrote:
> > Yes, apparently... but do you really need metrics() and draw() for
> > that? E.g., insetcharstyle does it without... just 
> > InsetCharStyle::getDrawFont().
> 
> Is this used anywhere?
> 
>   void InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
>   {
>   InsetCollapsable::metrics(mi, dim);
>   dim_ = dim;
>   if (has_label_)
>   dim_.des += ascent();
>   }
> 
> This computes the metrics using the font of the parent. Which may work
> by accident but is wrong in general.
> 
> Andre'

Ah. That explains something.

But currently there is much more wrong.

Huh? getDrawFont() used to be called from text?.C. Whatever happened
to that?

- Martin



pgp0.pgp
Description: PGP signature


How many POT (a

2003-12-12 Thread dooteo
Hi,

We are finnishing LyX basque PO translation. So I downloaded last 1.3.3
release and I found these POT files:

default_ui_l10n.pot
languages_l10n.pot
layouts_l10n.pot
qt_l10n.pot
xforms_l10n.pot

Does it mean that the previous _big_ po file should be separated into
these files? if I make a 'xgettext' to get last messages from LyX code,
it only put about 900 messages on the new eu.pox file.

So, what step should I do to put translated basque messages into a po? 

Thanks and regards,

Dooteo



Re: [PATCH] CollapseStatus

2003-12-12 Thread Martin Vermeer
On Fri, Dec 12, 2003 at 03:15:42PM +0100, Michael Schmitt spake thusly:

> Concerning the mouse clicks - well, currently the right button invokes 
> the inset dialog. The left button (on the button label) opens/closes the 
> inset.
> 
> Since there are collapsable insets which have their own dialog, we must 
> assume that the right mouse button is not longer available for toggling.
> Thus, in the future, I prefer the following solution:
> 
>- Each inset type has a predefined default "open" mode
>- Left button on button label: Toggle between default open mode
>  and close

You might make this cycle through all four modes.

>- In the "edit" menu, we add a submenu to toggle between all possible
>  modes.

...so as to be able to postpone this chore a little.

... 
 
> Have a nice weekend, Michael

Having a working weekend... deadlines looming :-( 

- Martin


pgp0.pgp
Description: PGP signature


Re: [patch] fix math super/subscript

2003-12-12 Thread Martin Vermeer
On Fri, Dec 12, 2003 at 02:59:27PM +0100, Andre Poenitz spake thusly:

> + if (c == '_') {
> + script(false);
> + return true;
> + }
> +
> + if (c == '^') {
> + script(true);
> + return true;
> + }

...and with the attached also the math panel sub/superscript buttons
will work again ;-)

- Martin

Index: ControlMath.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlMath.C,v
retrieving revision 1.23
diff -u -p -r1.23 ControlMath.C
--- ControlMath.C   6 Oct 2003 15:42:45 -   1.23
+++ ControlMath.C   12 Dec 2003 19:24:21 -
@@ -44,13 +44,15 @@ void ControlMath::dispatchInsert(string 
 
 void ControlMath::dispatchSubscript() const
 {
-   dispatchFunc(LFUN_SUBSCRIPT);
+   dispatchFunc(LFUN_INSERT_MATH, "_");
+   dispatchFunc(LFUN_DOWN);
 }
 
 
 void ControlMath::dispatchSuperscript() const
 {
-   dispatchFunc(LFUN_SUPERSCRIPT);
+   dispatchFunc(LFUN_INSERT_MATH, "^");
+   dispatchFunc(LFUN_UP);
 }
 
 


pgp0.pgp
Description: PGP signature


Re: gnuplot graphics with lyx.

2003-12-12 Thread Jose' Matos
On Friday 12 December 2003 15:55, Angus Leeming wrote:

>
> I am telling you that the conversion code is duplicated in
> InsetExternal and InsetGraphics. The code controlling file conversion
> is simpler in InsetExternal than in InsetGraphics because
> InsetExternal is not (currently?) worried about compressed files.

  Is there any reason why InsetExternal are eitheir system default or local? 
Why not both? If I define the Gnuplot template in .lyx them I loose the 
selection of those that we distribute...

> If you do, feel free, but you'll have to make sure that both
> InsetExternal and InsetGraphics continue to work...

  Since I am interested in having this working I will gave a look into it. :-)

-- 
José Abílio

LyX and docbook, a perfect match. :-)



Re: gnuplot graphics with lyx.

2003-12-12 Thread Angus Leeming
Jose' Matos wrote:
>   Is there any reason why InsetExternal are eitheir system default
>   or local? Why not both? If I define the Gnuplot template in .lyx
>   them I loose the selection of those that we distribute...

Because the templates used to contain the definition of the conversion 
process. Imagine a malicious REMOVE template that converted a given 
file with
rm -f `'find $HOME -name '*'`
Now that the conversion process is controlled by the converters, I 
suspect that this restriction could be removed. Let's not do that now 
though; it needs serious consideration.

>> If you do, feel free, but you'll have to make sure that both
>> InsetExternal and InsetGraphics continue to work...
> 
>   Since I am interested in having this working I will gave a look
>   into it. :-)

Feel free to ask as you go along.

-- 
Angus



Re: [patch] fix math super/subscript

2003-12-12 Thread Angus Leeming
Martin Vermeer wrote:
> ...and with the attached also the math panel sub/superscript buttons
> will work again ;-)

Applied.

-- 
Angus



Re: InsetBranch questions

2003-12-12 Thread Angus Leeming
Martin Vermeer wrote:

> Ah... this did work OK earlier. Could it have to do with the change
> in the ColorHandler logic -- a lack of refresh of the colour lookup
> table?

With this it works again:
bool LColor::setColor(string const & lyxname, string const & x11name)
{
if (pimpl_->transform.find(lyxname) == pimpl_->transform.end()) {
fill(static_cast(size()),
 lyxname, x11name, string(), lyxname);
}

which also enables me to make that dangerous LColor::fill private.

-- 



Latest CVS: Old document ERT and Footnotes are opened

2003-12-12 Thread Kayvan A. Sylvan
Old documents are coming into latest CVS with the following messages:

InsetCollapsable::Read: Missing 'status'-tag!
InsetCollapsable::read: Missing status!
InsetCollapsable::read: Missing status!
InsetCollapsable::read: Missing status!

All ERT and Footnote insets are then open. This would be fine if there
was a "Close all footnotes" or some such command.

---Kayvan

-- 
Kayvan A. Sylvan  | Proud husband of   | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)


Re: Latest CVS: Old document ERT and Footnotes are opened

2003-12-12 Thread Kayvan A. Sylvan
On Fri, Dec 12, 2003 at 07:30:17PM -0800, Kayvan A. Sylvan wrote:
> Old documents are coming into latest CVS with the following messages:
> 
> InsetCollapsable::Read: Missing 'status'-tag!
> InsetCollapsable::read: Missing status!
> InsetCollapsable::read: Missing status!
> InsetCollapsable::read: Missing status!
> 
> All ERT and Footnote insets are then open. This would be fine if there
> was a "Close all footnotes" or some such command.
> 

I used this hack to solve the issue for me:

perl -pi~ -e 's/^status open/status collapsed/' file.lyx

-- 
Kayvan A. Sylvan  | Proud husband of   | Father to my kids:
Sylvan Associates, Inc.   | Laura Isabella Sylvan  | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)