Discussion:
[Conglomerate] Paste should be insensitive when unavailable
Paul Smith
2004-10-23 10:12:49 UTC
Permalink
I remember why I stopped working on this patch now - there was too much
missing from it that I didn't know how to fix without some discussion,
so here it goes:

1) When should Paste be available?

Under what conditions should paste be available? Or, if it's easier to
implement, when should it not be available? I'm thinking of things
like current cursor position being valid, something actually being in
the clipboard to paste, things like that.

2) When should the Paste sensitivity change?

Very much related to the above, we should check to see whether paste is
still available in response to certain signals, but I can't figure
which of the following should be connected to, or indeed if a new
signal is needed. (I dimly remember Dave saying something about a
signal coming from X when the clipboard contents change, any ideas
where I can get more info?)

The current signals I can see are:

cong-command-history.c: "changed"
cong-document.c: "begin_edit"
cong-document.c: "end_edit"
cong-document.c: "node_make_orphan"
cong-document.c: "node_add_after"
cong-document.c: "node_add_before"
cong-document.c: "node_set_parent"
cong-document.c: "node_set_text"
cong-document.c: "node_set_attribute"
cong-document.c: "node_remove_attribute"
cong-document.c: "selection_change"
cong-document.c: "cursor_change"
cong-document.c: "set_dtd_ptr"
cong-document-traversal.c: "traversal_node_added"
cong-document-traversal.c: "traversal_node_removed"
cong-editor-area.c: "button_press_event"
cong-editor-area.c: "enter_notify_event"
cong-editor-area.c: "leave_notify_event"
cong-editor-area.c: "motion_notify_event"
cong-editor-area.c: "key_press_event"
cong-editor-area.c: "flush_requisition_cache"
cong-editor-area.c: "state_changed"
cong-editor-area-container.c: "children_changed"
cong-editor-area-expander.c: "expansion_changed"
cong-editor-node.c: "line_regeneration_required"
cong-editor-node.c: "is_selected_changed"
cong-xpath-expression.c: "string_result_changed",
plugin-lists-node-element-listitem.c: "label_changed"

The patch I have merely sets up a call in various places to a
cong_document_can_paste(CongDocument*) function that only returns true,
should I attach this to Bugzilla anyway?

Paul

--- bugzilla-***@widget.gnome.org wrote: > Please do not reply to
this email- if you want to comment on the bug,
go to the
URL shown below and enter your comments there.
http://bugzilla.gnome.org/show_bug.cgi?id=126089
--- shadow/126089 Mon Nov 3 05:16:02 2003
+++ shadow/126089.tmp.2459 Mon Jan 5 21:16:19 2004
@@ -1,12 +1,12 @@
Bug#: 126089
Product: conglomerate
Version: cvs
OS: Linux
-Status: NEW
+Status: NEEDINFO
Severity: normal
Priority: Normal
Component: Code
@@ -18,6 +18,11 @@
pasting is not possible. I have a patch which does some of the
work, and
I'm waiting for Anon CVS to catch up before submitting it.
However, the conditions for pasting to be possible are not complete,
and
should be recalculated when clipboard contents change (this one
requires a
new signal somewhere)
+
2004-01-05 21:16 -------
+Do you still have that patch? I suspect that it might no longer be
+directly applicable as I did a big rewrite of the clipboard handling
+for 0.7.9 But it'd be worth seeing in any case.
_______________________________________________
Conglomerate-auto mailing list
http://lists.copyleft.no/mailman/listinfo/conglomerate-auto
=====
-----------------------------------------------------
Paul Smith
Postgraduate Student
Department of Mathematics
School of Engineering, Computer Science,
and Mathematics
University of Exeter

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
Paul Smith
2004-10-23 10:12:49 UTC
Permalink
I tried a reply to this earlier today, but it seems to have gotten lost
in CyberSpace somewhere, so here's take 2

There are 2 problems with the patchthe I have for this:

What the patch does:

Sets sensitivity of the Paste button/toolbar/context menu depending on
the results of cong_document_can_paste(CongDocument*)

What the patch does not do:

Actually assess whether pasting is available, as
cong_document_can_paste always returns TRUE;
Attach to any signal to re-assess pastability at an opportune moment.

So, I need some pointers here. What conditions should actually be
checked here? I'm guessing things like cursor should be a valid
position, probably should check cong_range_can_be_cut if there is a
selection?

Once I have some idea of what needs checking, I'd need to know (but
could probably guess) when it needs rechecking. Last time round I
remember Dave mentioning that X sends out a signal when clipboard
contents change, does anyone know where I can get any more information
from on this?

As for current signals in Conglomerate, which of these could
pontentially alter the sensitivity of Paste?

cong-command-history.c: "changed",
cong-document.c: "begin_edit",
cong-document.c: "end_edit",
cong-document.c: "node_make_orphan",
cong-document.c: "node_add_after",
cong-document.c: "node_add_before",
cong-document.c: "node_set_parent",
cong-document.c: "node_set_text",
cong-document.c: "node_set_attribute",
cong-document.c: "node_remove_attribute",
cong-document.c: "selection_change",
cong-document.c: "cursor_change",
cong-document.c: "set_dtd_ptr",
cong-document-traversal.c: "traversal_node_added",
cong-document-traversal.c: "traversal_node_removed",
cong-editor-area.c: "button_press_event",
cong-editor-area.c: "enter_notify_event",
cong-editor-area.c: "leave_notify_event",
cong-editor-area.c: "motion_notify_event",
cong-editor-area.c: "key_press_event",
cong-editor-area.c: "flush_requisition_cache",
cong-editor-area.c: "state_changed",
cong-editor-area-container.c: "children_changed",
cong-editor-area-expander.c: "expansion_changed",
cong-editor-node.c: "line_regeneration_required",
cong-editor-node.c: "is_selected_changed",
cong-xpath-expression.c: "string_result_changed",
plugin-lists-node-element-listitem.c: "label_changed"

Should I attach the patch to Bugzilla anyway?

--- bugzilla-***@widget.gnome.org wrote: > Please do not reply to
this email- if you want to comment on the bug,
go to the
URL shown below and enter your comments there.
http://bugzilla.gnome.org/show_bug.cgi?id=126089
--- shadow/126089 Mon Nov 3 05:16:02 2003
+++ shadow/126089.tmp.2459 Mon Jan 5 21:16:19 2004
@@ -1,12 +1,12 @@
Bug#: 126089
Product: conglomerate
Version: cvs
OS: Linux
-Status: NEW
+Status: NEEDINFO
Severity: normal
Priority: Normal
Component: Code
@@ -18,6 +18,11 @@
pasting is not possible. I have a patch which does some of the
work, and
I'm waiting for Anon CVS to catch up before submitting it.
However, the conditions for pasting to be possible are not complete,
and
should be recalculated when clipboard contents change (this one
requires a
new signal somewhere)
+
2004-01-05 21:16 -------
+Do you still have that patch? I suspect that it might no longer be
+directly applicable as I did a big rewrite of the clipboard handling
+for 0.7.9 But it'd be worth seeing in any case.
_______________________________________________
Conglomerate-auto mailing list
http://lists.copyleft.no/mailman/listinfo/conglomerate-auto
=====
-----------------------------------------------------
Paul Smith
Postgraduate Student
Department of Mathematics
School of Engineering, Computer Science,
and Mathematics
University of Exeter

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
Dave Malcolm
2004-10-23 10:12:49 UTC
Permalink
Post by Paul Smith
I tried a reply to this earlier today, but it seems to have gotten lost
in CyberSpace somewhere, so here's take 2
Sets sensitivity of the Paste button/toolbar/context menu depending on
the results of cong_document_can_paste(CongDocument*)
It would be nice to have the code to do this, even if we can't yet use
it effectively.
Post by Paul Smith
Actually assess whether pasting is available, as
cong_document_can_paste always returns TRUE;
Attach to any signal to re-assess pastability at an opportune moment.
So, I need some pointers here. What conditions should actually be
checked here? I'm guessing things like cursor should be a valid
position, probably should check cong_range_can_be_cut if there is a
selection?
You should look at the paste routine and test for all the conditions in
which it can fail. Look in src/xmledit.c, in function
cong_document_paste_clipboard_or_selection, and potentially in the
functions it calls.
Post by Paul Smith
Once I have some idea of what needs checking, I'd need to know (but
could probably guess) when it needs rechecking. Last time round I
remember Dave mentioning that X sends out a signal when clipboard
contents change, does anyone know where I can get any more information
from on this?
I'm now a lot more knowledgable on how the X clipboard works, so I can
have a look into this if you like.
Post by Paul Smith
As for current signals in Conglomerate, which of these could
pontentially alter the sensitivity of Paste?
cong-command-history.c: "changed",
cong-document.c: "begin_edit",
cong-document.c: "end_edit",
cong-document.c: "node_make_orphan",
cong-document.c: "node_add_after",
cong-document.c: "node_add_before",
cong-document.c: "node_set_parent",
cong-document.c: "node_set_text",
cong-document.c: "node_set_attribute",
cong-document.c: "node_remove_attribute",
cong-document.c: "selection_change",
cong-document.c: "cursor_change",
cong-document.c: "set_dtd_ptr",
cong-document-traversal.c: "traversal_node_added",
cong-document-traversal.c: "traversal_node_removed",
cong-editor-area.c: "button_press_event",
cong-editor-area.c: "enter_notify_event",
cong-editor-area.c: "leave_notify_event",
cong-editor-area.c: "motion_notify_event",
cong-editor-area.c: "key_press_event",
cong-editor-area.c: "flush_requisition_cache",
cong-editor-area.c: "state_changed",
cong-editor-area-container.c: "children_changed",
cong-editor-area-expander.c: "expansion_changed",
cong-editor-node.c: "line_regeneration_required",
cong-editor-node.c: "is_selected_changed",
cong-xpath-expression.c: "string_result_changed",
plugin-lists-node-element-listitem.c: "label_changed"
Looking at cong_document_paste_clipboard_or_selection, it looks like
it'll be affected by CongDocument "cursor_change", and by whatever
signal we can set up to monitor the X clipboard.
Post by Paul Smith
Should I attach the patch to Bugzilla anyway?
Yes please, with an appropriate comment.

Thanks!

Dave
Post by Paul Smith
this email- if you want to comment on the bug,
go to the
URL shown below and enter your comments there.
http://bugzilla.gnome.org/show_bug.cgi?id=126089
--- shadow/126089 Mon Nov 3 05:16:02 2003
+++ shadow/126089.tmp.2459 Mon Jan 5 21:16:19 2004
@@ -1,12 +1,12 @@
Bug#: 126089
Product: conglomerate
Version: cvs
OS: Linux
-Status: NEW
+Status: NEEDINFO
Severity: normal
Priority: Normal
Component: Code
@@ -18,6 +18,11 @@
pasting is not possible. I have a patch which does some of the
work, and
I'm waiting for Anon CVS to catch up before submitting it.
However, the conditions for pasting to be possible are not complete,
and
should be recalculated when clipboard contents change (this one
requires a
new signal somewhere)
+
2004-01-05 21:16 -------
+Do you still have that patch? I suspect that it might no longer be
+directly applicable as I did a big rewrite of the clipboard handling
+for 0.7.9 But it'd be worth seeing in any case.
_______________________________________________
Conglomerate-auto mailing list
http://lists.copyleft.no/mailman/listinfo/conglomerate-auto
=====
-----------------------------------------------------
Paul Smith
Postgraduate Student
Department of Mathematics
School of Engineering, Computer Science,
and Mathematics
University of Exeter
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
_______________________________________________
Conglomerate mailing list
http://lists.copyleft.no/mailman/listinfo/conglomerate
--
David Malcolm
www.conglomerate.org
Paul Smith
2004-10-23 10:12:49 UTC
Permalink
Post by Dave Malcolm
Post by Paul Smith
Sets sensitivity of the Paste button/toolbar/context menu depending
on
Post by Paul Smith
the results of cong_document_can_paste(CongDocument*)
It would be nice to have the code to do this, even if we can't yet
use
it effectively.
Patch attached to Bugzilla (Bug 126089)
Post by Dave Malcolm
You should look at the paste routine and test for all the conditions
in
which it can fail. Look in src/xmledit.c, in function
cong_document_paste_clipboard_or_selection, and potentially in the
functions it calls.
I've attached this comment to Bugzilla to remind me :)
Post by Dave Malcolm
I'm now a lot more knowledgable on how the X clipboard works, so I
can
have a look into this if you like.
Yes please.
Post by Dave Malcolm
Looking at cong_document_paste_clipboard_or_selection, it looks like
it'll be affected by CongDocument "cursor_change", and by whatever
signal we can set up to monitor the X clipboard.
Also noted in Bugzilla (Bug 126089)

Thanks!

Paul

=====
-----------------------------------------------------
Paul Smith
Postgraduate Student
Department of Mathematics
School of Engineering, Computer Science,
and Mathematics
University of Exeter

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
Paul Smith
2004-10-23 10:12:49 UTC
Permalink
Post by Dave Malcolm
Post by Paul Smith
Should I attach the patch to Bugzilla anyway?
Yes please, with an appropriate comment.
Thanks!
Dave
Done, did it get applied? (Not meaning to sound rude, I know you're
very busy)

PS You might want to stop annotating the Changelog with 2003...

=====
-----------------------------------------------------
Paul Smith
Postgraduate Student
Department of Mathematics
School of Engineering, Computer Science,
and Mathematics
University of Exeter

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
Geert Stappers
2004-10-23 10:12:49 UTC
Permalink
Post by Paul Smith
Post by Dave Malcolm
Post by Paul Smith
Should I attach the patch to Bugzilla anyway?
Yes please, with an appropriate comment.
Thanks!
Dave
Done, did it get applied? (Not meaning to sound rude, I know you're
very busy)
It is applied by stappers. That why 'CVS blame' can identify easy
that is was none Dave Malcolm code.
Post by Paul Smith
PS You might want to stop annotating the Changelog with 2003...
;-)
Post by Paul Smith
=====
-----------------------------------------------------
Paul Smith
Geert Stappers

Loading...