Re: 1.3.x changes

2003-12-29 Thread Angus Leeming
Jean-Marc Lasgouttes wrote:

>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> Attached are the changes in my 1.3.x tree.
> 
> Angus> * src/frontends/qt2 intelligent scrolling for Qt. This patch
> Angus> has been in the 1.4.x tree for weeks and no problems have
> been Angus> reported.
> 
> Yes. Actually I intended to ask for it before 1.3.4.

Ok.

> Angus> * src/text3.C LFUN_GETLAYOUT currently outputs "1" for all
> Angus> layouts rather than the more useful "Title", "Standard" etc.
> Angus> This one line patch causes it to output the useful data. An
> Angus> identical patch should go in the 1.4.x tree too.
> 
> Yes.

Ok.

> Angus> * src/frontends/xforms/xforms_helpers.C output some
> informative Angus> error messages if we fail to open
> preferences.xform for Angus> read/write. This patch should go in the
> 1.4.x tree too.
> 
> Yes. However you should consider whether you want to use _() around
> the strings (what is our policy) and use boost::format.

Good idea. I've plumped for
lyxerr << "XformsColor::read(" << filename << ")\n"
   << _("Failed to open file.") << std::endl;

> Angus> * src/insets/insetgraphics.C escape the name of the external
> Angus> file so that LaTeX can handle (f.ex) Cyrillic file names.
> This Angus> patch should go in the 1.4.x tree too.
> 
> Yes, provided you are sure it does what you think it does :)

I'll mull this one over/do some testing.

Angus




Re: 1.3.x changes

2003-12-29 Thread Jean-Marc Lasgouttes
> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Attached are the changes in my 1.3.x tree. 

Angus> * src/frontends/qt2 intelligent scrolling for Qt. This patch
Angus> has been in the 1.4.x tree for weeks and no problems have been
Angus> reported.

Yes. Actually I intended to ask for it before 1.3.4.

Angus> * src/text3.C LFUN_GETLAYOUT currently outputs "1" for all
Angus> layouts rather than the more useful "Title", "Standard" etc.
Angus> This one line patch causes it to output the useful data. An
Angus> identical patch should go in the 1.4.x tree too.

Yes.

Angus> * src/frontends/xforms/xforms_helpers.C output some informative
Angus> error messages if we fail to open preferences.xform for
Angus> read/write. This patch should go in the 1.4.x tree too.

Yes. However you should consider whether you want to use _() around
the strings (what is our policy) and use boost::format.

Angus> * src/insets/insetgraphics.C escape the name of the external
Angus> file so that LaTeX can handle (f.ex) Cyrillic file names. This
Angus> patch should go in the 1.4.x tree too.

Yes, provided you are sure it does what you think it does :)

JMarc



Re: 1.3.x changes

2003-12-28 Thread Angus Leeming
Angus Leeming wrote:
> Attached are the changes in my 1.3.x tree.

-- 
Angus? boost_changes.diff
? branches.diff
? build-qt
? build-xforms
? colors.diff
? insetgraphics.diff
? lib_images.diff
? paragraph.diff
? qt_scroll.diff
? relyx-accents.diff
? relyx-minipage-test.tex
? relyx-minipage.diff
? striplog.sed
? tmp.diff
? xpm.diff.bz2
? xpm_cleanup.sh
? development/lyxserver/server_monitor
? development/lyxserver/tmpfile
? lib/configure.diff
Index: src/text3.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.29.2.2
diff -u -p -r1.29.2.2 text3.C
--- src/text3.C	13 Jun 2003 16:15:11 -	1.29.2.2
+++ src/text3.C	28 Dec 2003 15:15:41 -
@@ -1096,7 +1096,7 @@ Inset::RESULT LyXText::dispatch(FuncRequ
 		break;
 
 	case LFUN_GETLAYOUT:
-		cmd.message(tostr(cursor.par()->layout()));
+		cmd.message(cursor.par()->layout()->name());
 		break;
 
 	case LFUN_LAYOUT: {
Index: src/frontends/qt2/ChangeLog
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.389.2.41
diff -u -p -r1.389.2.41 ChangeLog
--- src/frontends/qt2/ChangeLog	9 Dec 2003 14:15:22 -	1.389.2.41
+++ src/frontends/qt2/ChangeLog	28 Dec 2003 15:15:45 -
@@ -16,6 +16,17 @@
 	* QDocument.C: use geometry on custom, A3, B3 and B4
 	papersizes.
 
+2003-12-01  Angus Leeming  <[EMAIL PROTECTED]>
+
+* QContentPane.[Ch] (SyntheticMouseEvent): a new, helper struct.
+(QContentPane): store an instance of SyntheticMouseEvent and
+add a slot, generateSyntheticMouseEvent, that is invoked by the
+SyntheticMouseEvent::timeout.
+(mouseMoveEvent): initialize synthetic_mouse_event_ when the
+mouse button is depressed and the cursor is outside of the work area.
+(generateSyntheticMouseEvent): if the scrollbar value is different
+from the cached value, then dispatch a 'synthetic' mouse event.
+
 2003-11-14  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* ui/QMathDialogBase.ui: remove mention of \frac in tooltip, since
Index: src/frontends/qt2/QContentPane.C
===
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QContentPane.C,v
retrieving revision 1.18
diff -u -p -r1.18 QContentPane.C
--- src/frontends/qt2/QContentPane.C	17 Dec 2002 20:37:10 -	1.18
+++ src/frontends/qt2/QContentPane.C	28 Dec 2003 15:15:45 -
@@ -16,9 +16,10 @@
 
 #include "debug.h"
 
+#include 
+
 #include "QWorkArea.h"
 #include "QLyXKeySym.h"
-#include "funcrequest.h"
 #include "qt_helpers.h"
 
 #include 
@@ -82,10 +83,20 @@ mouse_button::state q_motion_state(Qt::B
 } // namespace anon
 
 
+SyntheticMouseEvent::SyntheticMouseEvent()
+	: timeout(200), restart_timeout(true),
+	  x_old(-1), y_old(-1), scrollbar_value_old(-1.0)
+{}
+
+
 QContentPane::QContentPane(QWorkArea * parent)
 	: QWidget(parent, "content_pane", WRepaintNoErase),
 	wa_(parent)
 {
+	synthetic_mouse_event_.timeout.timeout.connect(
+		boost::bind(&QContentPane::generateSyntheticMouseEvent,
+			this));
+
 	setFocusPolicy(QWidget::WheelFocus);
 	setFocus();
 	setCursor(ibeamCursor);
@@ -103,6 +114,25 @@ void QContentPane::scrollBarChanged(int 
 }
 
 
+void QContentPane::generateSyntheticMouseEvent()
+{
+	// Set things off to generate the _next_ 'pseudo' event.
+	if (synthetic_mouse_event_.restart_timeout)
+		synthetic_mouse_event_.timeout.start();
+
+	// Has anything changed on-screen since the last timeout signal
+	// was received?
+	double const scrollbar_value = wa_->scrollbar_->value();
+	if (scrollbar_value != synthetic_mouse_event_.scrollbar_value_old) {
+		// Yes it has. Store the params used to check this.
+		synthetic_mouse_event_.scrollbar_value_old = scrollbar_value;
+
+		// ... and dispatch the event to the LyX core.
+		wa_->dispatch(synthetic_mouse_event_.cmd);
+	}
+ }
+ 
+ 
 void QContentPane::mousePressEvent(QMouseEvent * e)
 {
 	if (dc_event_.active && dc_event_ == *e) {
@@ -122,6 +152,9 @@ void QContentPane::mousePressEvent(QMous
 
 void QContentPane::mouseReleaseEvent(QMouseEvent * e)
 {
+	if (synthetic_mouse_event_.timeout.running())
+		synthetic_mouse_event_.timeout.stop();
+
 	FuncRequest cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(),
 			q_button_state(e->button()));
 	wa_->dispatch(cmd);
@@ -130,9 +163,55 @@ void QContentPane::mouseReleaseEvent(QMo
 
 void QContentPane::mouseMoveEvent(QMouseEvent * e)
 {
-	FuncRequest cmd
-		(LFUN_MOUSE_MOTION, e->x(), e->y(), q_motion_state(e->state()));
-	wa_->dispatch(cmd);
+ 	FuncRequest const cmd(LFUN_MOUSE_MOTION, e->x(), e->y(),
+ 			  q_motion_state(e->state()));
+
+	// If we're above or below the work area...
+	if (e->y() <= 0 || e->y() >= height()) {
+		// Store the event, to be handled when the timeout expires.
+		synthetic_mouse_event_.cmd = cmd;
+
+		if (synthetic_mouse_event_.timeout.running()) {
+			// Discard the eve

1.3.x changes

2003-12-28 Thread Angus Leeming
Attached are the changes in my 1.3.x tree.

* src/frontends/qt2
intelligent scrolling for Qt. This patch has been in the 1.4.x tree 
for weeks and no problems have been reported.

* src/text3.C
LFUN_GETLAYOUT currently outputs "1" for all layouts rather than the 
more useful "Title", "Standard" etc. This one line patch causes it to 
output the useful data. An identical patch should go in the 1.4.x 
tree too.

* src/frontends/xforms/xforms_helpers.C
output some informative error messages if we fail to open 
preferences.xform for read/write. This patch should go in the 1.4.x 
tree too.

* src/insets/insetgraphics.C
escape the name of the external file so that LaTeX can handle (f.ex) 
Cyrillic file names. This patch should go in the 1.4.x tree too.

Jean-Marc, I understand that you want any 1.3.x patches to be applied 
to the 1.4.x tree first, but are you 'happy in principle' with these 
changes?

-- 
Angus