diamondx.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /***********************************************************************
  2. DiamondX plugin
  3. Example XEmbed-aware Mozilla browser plugin by Adobe.
  4. Copyright (c) 2007 Adobe Systems Incorporated
  5. Permission is hereby granted, free of charge, to any person obtaining a
  6. copy of this software and associated documentation files (the "Software"),
  7. to deal in the Software without restriction, including without limitation
  8. the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. and/or sell copies of the Software, and to permit persons to whom the
  10. Software is furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  14. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  16. THE AUTHORS OR
  17. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  18. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
  19. OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. SOFTWARE. *
  21. ***********************************************************************/
  22. #ifndef DIAMONDX_H
  23. #define DIAMONDX_H
  24. #include <Xlib.h>
  25. #include "gtk/gtk.h"
  26. #define PLUGIN_NAME "DiamondX Plugin"
  27. #define MIME_TYPES_HANDLED "application/x-diamondx:diamondx:Plugin to test browser XEmbed capabilities"
  28. #define PLUGIN_DESCRIPTION "Plugin that tests XEmbed capabilities"
  29. typedef struct {
  30. uint16 mode;
  31. NPWindow *window;
  32. uint32 x, y;
  33. uint32 width, height;
  34. NPP instance;
  35. NPBool pluginsHidden;
  36. GtkWidget *container;
  37. GtkWidget *canvas;
  38. guchar *four_quads;
  39. gboolean dialog_up;
  40. gboolean windowless;
  41. /* when we have to go raw */
  42. XImage *ximage;
  43. } PluginInstance;
  44. NPError DiamondXSetWindow(NPP instance, NPWindow* window);
  45. int16 DiamondXHandleEvent(NPP instance, void* event);
  46. #endif /* DIAMONDX_H */