11 #include "DocLoader.h"
12 #include "DOMImplementation.h"
15 #include "EventNames.h"
19 #include "XLinkNames.h"
20 #include "SVGDocumentExtensions.h"
23 #include "RenderObject.h"
24 #include "GraphicsContext.h"
26 using namespace WebCore;
28 class LauncherFrameGdk : public FrameGdk
31 LauncherFrameGdk(Page* page, Element* element) : FrameGdk(page, element), m_exitAfterLoading(false) {}
32 LauncherFrameGdk(GdkDrawable* drawable) : FrameGdk(drawable), m_exitAfterLoading(false) {}
33 virtual void handledOnloadEvents();
34 void setExitAfterLoading(bool exitAfterLoading) { m_exitAfterLoading = exitAfterLoading; }
36 bool m_exitAfterLoading;
39 void LauncherFrameGdk::handledOnloadEvents()
41 if (m_exitAfterLoading)
45 static LauncherFrameGdk *frame;
46 static GdkWindow *win;
48 static void handle_event(GdkEvent *event)
50 if (GDK_DELETE == event->type) {
54 frame->handleGdkEvent(event);
57 int main(int argc, char *argv[])
61 gdk_init(&argc,&argv);
62 gdk_event_handler_set ((GdkEventFunc)handle_event, NULL, NULL);
66 attr.window_type = GDK_WINDOW_TOPLEVEL;
67 attr.wclass = GDK_INPUT_OUTPUT;
68 //see how where we handle motion here need to do the hint stuff
69 attr.event_mask = ((GDK_ALL_EVENTS_MASK^GDK_POINTER_MOTION_HINT_MASK));
70 win = gdk_window_new(NULL,&attr,0);
71 frame = new LauncherFrameGdk(win);
73 url = "http://www.google.com";
74 bool exitAfterLoading = false;
75 for (int argPos = 1; argPos < argc; ++argPos) {
76 if (0 == strcmp(argv[argPos], "-exit-after-loading"))
77 exitAfterLoading = true;
81 frame->setExitAfterLoading(exitAfterLoading);
83 printf("OPENING URL == %s \n", url);
87 char *pg = " <html><head><title>Google</title> <body bgcolor=#ffffff text=#000000> <p><font size=-2/>2006 Google Hello bigworld from mike</p></body></html> ";
88 frame->createEmptyDocument();
89 frame->document()->open();
90 frame->write(pg,strlen(pg));
91 frame->document()->close();
97 gdk_window_destroy(win);