[kazehakase-svn] [3207] * module/embed/gtk-webcore/kz-gtk-webcore.cpp: Use WebiMouseDelegation

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
Fri Apr 20 21:38:40 JST 2007


Revision: 3207
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3207
Author:   ikezoe
Date:     2007-04-20 21:38:40 +0900 (Fri, 20 Apr 2007)

Log Message:
-----------
* module/embed/gtk-webcore/kz-gtk-webcore.cpp: Use WebiMouseDelegation
interface.
Need the patch in ??

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2007-04-18 08:05:07 UTC (rev 3206)
+++ kazehakase/trunk/ChangeLog	2007-04-20 12:38:40 UTC (rev 3207)
@@ -1,3 +1,9 @@
+2007-04-20  Hiroyuki Ikezoe  <poinc****@ikezo*****>
+
+	* module/embed/gtk-webcore/kz-gtk-webcore.cpp: Use WebiMouseDelegation
+	interface.
+	Need the patch in ??
+
 2007-04-18  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 
 	* module/embed/gtk-webcore/kz-gtk-webcore.cpp: DOM like mouse event

Modified: kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp
===================================================================
--- kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp	2007-04-18 08:05:07 UTC (rev 3206)
+++ kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp	2007-04-20 12:38:40 UTC (rev 3207)
@@ -26,6 +26,7 @@
 
 #include <glib/gi18n.h>
 #include <math.h>
+#include <webi-mouse-delegate.h>
 
 #include "kazehakase.h"
 #include "kz-gtk-webcore.h"
@@ -73,14 +74,7 @@
 static Webi        *kz_gtk_webcore_req_new_window   (Webi     *webi,
 						     const gchar *url);
 static void         kz_gtk_webcore_close_window     (Webi     *webi);
-static void         kz_gtk_webcore_mouse_over       (Webi        *webi,
-						     const WebiEventInfo *event_info);
-#if HAVE_GTK_WEBCORE_MOUSE_DOWN
-static gboolean     kz_gtk_webcore_mouse_down       (Webi        *webi,
-						     const WebiEventInfo *event_info);
-static gboolean     kz_gtk_webcore_mouse_up         (Webi        *webi,
-						     const WebiEventInfo *event_info);
-#endif
+
 static gboolean     kz_gtk_webcore_set_cookie       (Webi       *webi,
 						     const gchar *url,
 						     WebiCookie *cookie);
@@ -151,6 +145,15 @@
 static gboolean	    kz_gtk_webcore_get_allow_images      (KzEmbed      *kzembed);
 static void	    kz_gtk_webcore_set_allow_images      (KzEmbed      *kzembed,
 							  gboolean      allow);
+/* WebiMouseDelegate interfaces */
+static void          kz_gtk_webcore_mouse_iface_init      (WebiMouseDelegateInterface *iface);
+static void	     kz_gtk_webcore_mouse_over		  (WebiMouseDelegate *webi,
+							   WebiEventInfo     *event_info);
+static gboolean	     kz_gtk_webcore_mouse_down		  (WebiMouseDelegate *webi,
+							   WebiEventInfo     *event_info);
+static gboolean	     kz_gtk_webcore_mouse_up		  (WebiMouseDelegate *webi,
+							   WebiEventInfo     *event_info);
+
 /* KzEmbedPrefs interfaces */
 static void          kz_gtk_webcore_prefs_iface_init      (KzEmbedPrefsIFace *iface);
 #if 0
@@ -196,6 +199,13 @@
 		NULL
 	};
 
+	const GInterfaceInfo webi_mouse_delegate_info =
+	{
+		(GInterfaceInitFunc) kz_gtk_webcore_mouse_iface_init,
+		NULL,
+		NULL
+	};
+
 	kz_type_gtk_webcore = g_type_module_register_type(module,
 						    WEBI_TYPE_WEBI,
 						    "KzGtkWebcore",
@@ -211,6 +221,11 @@
 				    KZ_TYPE_GTK_WEBCORE,
 				    KZ_TYPE_EMBED_PREFS,
 				    &kz_embed_prefs_info);
+	
+	g_type_module_add_interface(module,
+				    KZ_TYPE_GTK_WEBCORE,
+				    WEBI_TYPE_MOUSE_DELEGATE,
+				    &webi_mouse_delegate_info);
 }
 
 GType
@@ -244,11 +259,6 @@
 	gtk_webcore_class->req_auth_prompt = kz_gtk_webcore_req_auth_prompt;
 	gtk_webcore_class->req_new_window  = kz_gtk_webcore_req_new_window;
 	gtk_webcore_class->close_window    = kz_gtk_webcore_close_window;
-	gtk_webcore_class->mouse_over      = kz_gtk_webcore_mouse_over;
-#if HAVE_GTK_WEBCORE_MOUSE_DOWN
-	gtk_webcore_class->mouse_down      = kz_gtk_webcore_mouse_down;
-	gtk_webcore_class->mouse_up        = kz_gtk_webcore_mouse_up;
-#endif
 	gtk_webcore_class->set_cookie      = kz_gtk_webcore_set_cookie;
 
 	g_type_class_add_private (object_class, sizeof(KzGtkWebcorePrivate));
@@ -368,6 +378,17 @@
 }
 
 static void
+kz_gtk_webcore_mouse_iface_init (WebiMouseDelegateInterface *iface)
+{
+	iface->click  = NULL;
+	iface->down   = kz_gtk_webcore_mouse_down;
+	iface->up     = kz_gtk_webcore_mouse_up;
+	iface->over   = kz_gtk_webcore_mouse_over;
+	iface->move   = NULL;
+	iface->out    = NULL;
+}
+
+static void
 set_font_preferences (KzProfile *profile, KzGtkWebcore *gtk_webcore)
 {
 	WebiSettings *settings = KZ_GTK_WEBCORE_GET_PRIVATE(gtk_webcore)->settings;
@@ -637,6 +658,8 @@
 
 	set_default_preferences(gtk_webcore);
 	webi_set_emit_internal_status(WEBI(gtk_webcore), TRUE);
+
+	webi_set_default_mouse_delegate(WEBI(gtk_webcore), WEBI_MOUSE_DELEGATE(gtk_webcore));
 	gtk_widget_show(GTK_WIDGET(gtk_webcore));
 }
 
@@ -858,7 +881,7 @@
 }
 
 static void
-kz_gtk_webcore_mouse_over (Webi *webi, const WebiEventInfo *event_info)
+kz_gtk_webcore_mouse_over (WebiMouseDelegate *webi, WebiEventInfo *event_info)
 {
 	KzEmbedEventMouse *kzevent;
 	gint ret = FALSE;
@@ -898,9 +921,8 @@
 	kz_embed_event_free((KzEmbedEvent *) kzevent);
 }
 
-#if HAVE_GTK_WEBCORE_MOUSE_DOWN
 gboolean
-kz_gtk_webcore_mouse_down (Webi *webi, const WebiEventInfo *event_info)
+kz_gtk_webcore_mouse_down (WebiMouseDelegate *webi, WebiEventInfo *event_info)
 {
 	KzEmbedEventMouse *kzevent;
 	gint ret = FALSE;
@@ -929,7 +951,7 @@
 }
 
 static gboolean
-kz_gtk_webcore_mouse_up (Webi *webi, const WebiEventInfo *event_info)
+kz_gtk_webcore_mouse_up (WebiMouseDelegate *webi, WebiEventInfo *event_info)
 {
 	KzEmbedEventMouse *kzevent;
 	gint ret = FALSE;
@@ -964,7 +986,6 @@
 
 	return ret;
 }
-#endif
 
 static gboolean
 kz_gtk_webcore_set_cookie (Webi *webi, const gchar *url, WebiCookie *cookie)




More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index