gecko/modules/plugin/samples/testevents
2007-07-08 00:08:04 -07:00
..
Makefile Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT, 2007-03-22 10:30:00 -07:00
Makefile.in Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT, 2007-03-22 10:30:00 -07:00
npevents.cpp Bug 348748 - Replace all instances of NS_STATIC_CAST and friends with C++ casts (and simultaneously bitrot nearly every patch in existence). r=bsmedberg on the script that did this. Tune in next time for Macro Wars: Episode II: Attack on the LL_* Macros. 2007-07-08 00:08:04 -07:00
nsIEventsPluginInstance.idl Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT, 2007-03-22 10:30:00 -07:00
README.txt Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT, 2007-03-22 10:30:00 -07:00
SimpleEventsTest.html Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT, 2007-03-22 10:30:00 -07:00

README for the plugin event sample.

INTENT:
-------
The intent of this plugin is to demonstrate how to implement a
"real", native control as a plugin.

This sample shows how a plugin can sit "nicely" with the Mozilla event 
framework - for example, getting and losing focus, and allowing keyboard, 
mouse and resize events to be either consumed or passed on at the 
plugin's discretion.

In this sample, we create a standard "edit" control using the
platform's native edit widget.  Obviously if you really needed a simple 
edit control, you would use a standard HTML or XUL widget - but a native
edit control was chosen for this demonstration as it is generally a simple
native widget, and allows us to concentrate on the event interaction.

WINDOWS NOTES:
--------------
A standard Windows edit control is created and subclassed.  All keyboard and 
mouse messages are passed back to Mozilla itself rather than passed to the
edit control.  These messages then wind themselves back around the event 
framework, and end up as calls to nsIPlugin::HandleEvent() calls.

If we let the keyboard messages go directly to the edit control,
we have no way of allowing the keystrokes we _dont_ want to be passed back. If
we let the mouse messages go directly to the control, we don't interact correctly
with focus.

PROBLEMS:
* Plugins on Windows don't have event messages.
* Plugins on Windows don't have key-pressed messages (only keyup and down)
* Focus interaction is not correct (probably need a focus event)


LINUX NOTES:
-----------
A standard Gtk edit control is used.  

PROBLEMS:
* Focus has problems.  If you click in the plugin window, then click in the
  HTML edit widget, you get cursors in both places.  Typing is still directed
  at the plugin, even though focus was just set to the HTML widget.  Using the
  TAB key to change focus yields better results.

MAC NOTES:
----------
No Mac support at all.