[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kafka
Subject:    Event Filtering and Rendering Kafka Objects
From:       Jono Bacon <f9808590 () wlv ! ac ! uk>
Date:       2000-11-15 2:46:24
[Download RAW message or body]

Hello all,

Now that we have a fairly watertight design for dealing with unknown tags and 
getting them in the DOM, we need to discuss how we can interact with them 
visually and provide access to updating the DOM when and an event has been 
processed.

What we need to do is to essentially add some interactivity to rendered (in 
KHTML) object. An example is if an image is displayed in the rendered view, 
and the user wants to resize it. The user should be able to click on the 
image to present a black border and resize handles and the user can then 
resize the image visually.

To accomplish this, behind the scenes the following would need to go on:

 1. The object is first rendered from the data in the DOM.
 2. The user then clicks on the object. We need to trap this mouse click 
event and ensure that the program knows which object the user has clicked on.
 3. The object should then be re-rendered with the visual control elements 
(such as the resize handles).
 4. If the user interacts with the object, the event should be trapped and 
processed to what type of event it is (selection, resize, move etc).
 5. The DOM is then updated with the new configuration (e.g - updating the 
size attributes of the <IMG> tag).

If this is a stupid system please say so. ;-)

I developed this idea due to the logical tracing of how we go from rendered 
object to DOM updating to rendering the object again.

The difficulty that we hav with these issues is the following:

 1. Trapping the event and event type
 2. Making the object visually interactive

After mullin this one overin the shower, car and a variety of other places, I 
have a basic idea of how we can do this.

1. Trapping the event and event type

We can install an event filter over our main widget (KafkaEdit?) which can 
trap the basic mouse actions. Once a mouse event is triggered (eg) the mouse 
clicks on the object, we can look up the coordinate in a geomatry list which 
contains the coordinates for objects such as images, horizontal rules and 
clock objects such as tables and blockquotes. We should now have which object 
we are dealing with. We can then trace the users next actions and determine 
what type of event it is. E.g - if th user drags the mouse to the right and 
the mouse was not on a resize handle it is a move event, and we can then run 
the necceccery logic to move the object and re-render it.

2. Making the object visually interactive

We have a problem here in that AFAIK all objects that are rendered from the 
contents of the DOM are non-interactive. We have two options to make them 
interactive:

 - Change KHTML so an object can be made interactive.
 - Create our own part that implements the first part of KHTML (tokenizing), 
the second part (parsing), and before the third part (layout rendering) we 
can subclass from the KHTML rendering classes and add our own methods to 
implement interactivity functionality to the various objects before 
displaying them.

Any comments/ideas/flames?

	Jono



-- 
Jono Bacon - [vmlinuz] - jono@kde.org
KDE/Qt Developer - Kafka Maintainer
_______________________________________________
Kde-kafka mailing list
Kde-kafka@master.kde.org
http://master.kde.org/mailman/listinfo/kde-kafka

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic