[kazehakase-svn] [3814] * module/embed/per-process/kz-dbus-embed-delegate. c,

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Wed Sep 2 15:46:34 JST 2009


Revision: 3814
          http://sourceforge.jp/projects/kazehakase/svn/view?view=rev&revision=3814
Author:   ikezoe
Date:     2009-09-02 15:46:34 +0900 (Wed, 02 Sep 2009)

Log Message:
-----------
	* module/embed/per-process/kz-dbus-embed-delegate.c,
	module/embed/per-process/kz-embed-process.c: DOM mouse event became signal since the
	return value of these signals is always FALSE so we does not need to get 
	this return value.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/module/embed/per-process/kazehakase-embed-server.xml
    kazehakase/trunk/module/embed/per-process/kazehakase-embed.xml
    kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c
    kazehakase/trunk/module/embed/per-process/kz-embed-process.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-09-02 06:08:18 UTC (rev 3813)
+++ kazehakase/trunk/ChangeLog	2009-09-02 06:46:34 UTC (rev 3814)
@@ -7,6 +7,10 @@
 	GList pointer which stores URI and title list.
 	* module/embed/per-process/kz-dbus-embed-delegate.c,
 	module/embed/per-process/kz-embed-process.c: Use current_position in site liste.
+	* module/embed/per-process/kz-dbus-embed-delegate.c,
+	module/embed/per-process/kz-embed-process.c: DOM mouse event became signal since the
+	return value of these signals is always FALSE so we does not need to get 
+	this return value.
 
 2009-09-01  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/module/embed/per-process/kazehakase-embed-server.xml
===================================================================
--- kazehakase/trunk/module/embed/per-process/kazehakase-embed-server.xml	2009-09-02 06:08:18 UTC (rev 3813)
+++ kazehakase/trunk/module/embed/per-process/kazehakase-embed-server.xml	2009-09-02 06:46:34 UTC (rev 3814)
@@ -7,54 +7,6 @@
       <arg type="u" name="embed_id" direction="out" />
       <arg type="s" name="engine_name" direction="out" />
     </method>
-    <method name="DomMouseDown">
-      <arg type="i" name="event_context" direction="in" />
-      <arg type="s" name="link_uri" direction="in" />
-      <arg type="s" name="link_text" direction="in" />
-      <arg type="s" name="image_uri" direction="in" />
-      <arg type="s" name="frame_src" direction="in" />
-      <arg type="i" name="button" direction="in" />
-      <arg type="i" name="modifier" direction="in" />
-      <arg type="i" name="x" direction="in" />
-      <arg type="i" name="y" direction="in" />
-      <arg type="b" name="propagate" direction="out" />
-    </method>
-    <method name="DomMouseUp">
-      <arg type="i" name="event_context" direction="in" />
-      <arg type="s" name="link_uri" direction="in" />
-      <arg type="s" name="link_text" direction="in" />
-      <arg type="s" name="image_uri" direction="in" />
-      <arg type="s" name="frame_src" direction="in" />
-      <arg type="i" name="button" direction="in" />
-      <arg type="i" name="modifier" direction="in" />
-      <arg type="i" name="x" direction="in" />
-      <arg type="i" name="y" direction="in" />
-      <arg type="b" name="propagate" direction="out" />
-    </method>
-    <method name="DomMouseClick">
-      <arg type="i" name="event_context" direction="in" />
-      <arg type="s" name="link_uri" direction="in" />
-      <arg type="s" name="link_text" direction="in" />
-      <arg type="s" name="image_uri" direction="in" />
-      <arg type="s" name="frame_src" direction="in" />
-      <arg type="i" name="button" direction="in" />
-      <arg type="i" name="modifier" direction="in" />
-      <arg type="i" name="x" direction="in" />
-      <arg type="i" name="y" direction="in" />
-      <arg type="b" name="propagate" direction="out" />
-    </method>
-    <method name="DomMouseOver">
-      <arg type="i" name="event_context" direction="in" />
-      <arg type="s" name="link_uri" direction="in" />
-      <arg type="s" name="link_text" direction="in" />
-      <arg type="s" name="image_uri" direction="in" />
-      <arg type="s" name="frame_src" direction="in" />
-      <arg type="i" name="button" direction="in" />
-      <arg type="i" name="modifier" direction="in" />
-      <arg type="i" name="x" direction="in" />
-      <arg type="i" name="y" direction="in" />
-      <arg type="b" name="propagate" direction="out" />
-    </method>
   </interface>
 </node>
 

Modified: kazehakase/trunk/module/embed/per-process/kazehakase-embed.xml
===================================================================
--- kazehakase/trunk/module/embed/per-process/kazehakase-embed.xml	2009-09-02 06:08:18 UTC (rev 3813)
+++ kazehakase/trunk/module/embed/per-process/kazehakase-embed.xml	2009-09-02 06:46:34 UTC (rev 3814)
@@ -16,6 +16,39 @@
     </signal>
     <signal name="NetStart" />
     <signal name="NetStop" />
+    <signal name="DomMouseDown">
+      <arg type="i" name="event_context" />
+      <arg type="s" name="link_uri" />
+      <arg type="s" name="link_text" />
+      <arg type="s" name="image_uri" />
+      <arg type="s" name="frame_src" />
+      <arg type="i" name="button" />
+      <arg type="i" name="modifier" />
+      <arg type="i" name="x" />
+      <arg type="i" name="y" />
+    </signal>
+    <signal name="DomMouseUp">
+      <arg type="i" name="event_context" />
+      <arg type="s" name="link_uri" />
+      <arg type="s" name="link_text" />
+      <arg type="s" name="image_uri" />
+      <arg type="s" name="frame_src" />
+      <arg type="i" name="button" />
+      <arg type="i" name="modifier" />
+      <arg type="i" name="x" />
+      <arg type="i" name="y" />
+    </signal>
+    <signal name="DomMouseClick">
+      <arg type="i" name="event_context" />
+      <arg type="s" name="link_uri" />
+      <arg type="s" name="link_text" />
+      <arg type="s" name="image_uri" />
+      <arg type="s" name="frame_src" />
+      <arg type="i" name="button" />
+      <arg type="i" name="modifier" />
+      <arg type="i" name="x" />
+      <arg type="i" name="y" />
+    </signal>
     <method name="StopLoad" />
     <method name="Reload" />
     <method name="LoadUri">

Modified: kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c
===================================================================
--- kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c	2009-09-02 06:08:18 UTC (rev 3813)
+++ kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c	2009-09-02 06:46:34 UTC (rev 3814)
@@ -124,54 +124,6 @@
 static gboolean kz_dbus_embed_delegate_ready(KzDBusEmbedDelegate *object,
                                              gint process_id, guint *embed_id, gchar **engine_name,
                                              GError **error);
-static gboolean kz_dbus_embed_delegate_dom_mouse_up (KzDBusEmbedDelegate *object,
-                                            gint event_context,
-                                            gchar *link_uri,
-                                            gchar *link_text,
-                                            gchar *image_uri,
-                                            gchar *frame_src,
-                                            gint button,
-                                            gint modifier,
-                                            gint x,
-                                            gint y,
-                                            gboolean *ret,
-                                            GError **error);
-static gboolean kz_dbus_embed_delegate_dom_mouse_down (KzDBusEmbedDelegate *object,
-                                            gint event_context,
-                                            gchar *link_uri,
-                                            gchar *link_text,
-                                            gchar *image_uri,
-                                            gchar *frame_src,
-                                            gint button,
-                                            gint modifier,
-                                            gint x,
-                                            gint y,
-                                            gboolean *ret,
-                                            GError **error);
-static gboolean kz_dbus_embed_delegate_dom_mouse_click (KzDBusEmbedDelegate *object,
-                                            gint event_context,
-                                            gchar *link_uri,
-                                            gchar *link_text,
-                                            gchar *image_uri,
-                                            gchar *frame_src,
-                                            gint button,
-                                            gint modifier,
-                                            gint x,
-                                            gint y,
-                                            gboolean *ret,
-                                            GError **error);
-static gboolean kz_dbus_embed_delegate_dom_mouse_over (KzDBusEmbedDelegate *object,
-                                            gint event_context,
-                                            gchar *link_uri,
-                                            gchar *link_text,
-                                            gchar *image_uri,
-                                            gchar *frame_src,
-                                            gint button,
-                                            gint modifier,
-                                            gint x,
-                                            gint y,
-                                            gboolean *ret,
-                                            GError **error);
 
 #include "kz-dbus-embed-server-bindings.h"
 
@@ -305,122 +257,6 @@
     return ret;
 }
 
-static gboolean
-kz_dbus_embed_delegate_dom_mouse_up (KzDBusEmbedDelegate *object,
-                                     gint event_context,
-                                     gchar *link_uri,
-                                     gchar *link_text,
-                                     gchar *image_uri,
-                                     gchar *frame_src,
-                                     gint button,
-                                     gint modifier,
-                                     gint x,
-                                     gint y,
-                                     gboolean *ret,
-                                     GError **error)
-{
-    *ret = emit_dom_mouse_event(object,
-                                "kz-dom-mouse-up",
-                                event_context,
-                                link_uri,
-                                link_text,
-                                image_uri,
-                                frame_src,
-                                button,
-                                modifier,
-                                x,
-                                y);
-
-    return TRUE;
-}
-
-static gboolean
-kz_dbus_embed_delegate_dom_mouse_down (KzDBusEmbedDelegate *object,
-                                     gint event_context,
-                                     gchar *link_uri,
-                                     gchar *link_text,
-                                     gchar *image_uri,
-                                     gchar *frame_src,
-                                     gint button,
-                                     gint modifier,
-                                     gint x,
-                                     gint y,
-                                     gboolean *ret,
-                                     GError **error)
-{
-    *ret = emit_dom_mouse_event(object,
-                                "kz-dom-mouse-down",
-                                event_context,
-                                link_uri,
-                                link_text,
-                                image_uri,
-                                frame_src,
-                                button,
-                                modifier,
-                                x,
-                                y);
-
-    return TRUE;
-}
-
-static gboolean
-kz_dbus_embed_delegate_dom_mouse_click (KzDBusEmbedDelegate *object,
-                                     gint event_context,
-                                     gchar *link_uri,
-                                     gchar *link_text,
-                                     gchar *image_uri,
-                                     gchar *frame_src,
-                                     gint button,
-                                     gint modifier,
-                                     gint x,
-                                     gint y,
-                                     gboolean *ret,
-                                     GError **error)
-{
-    *ret = emit_dom_mouse_event(object,
-                                "kz-dom-mouse-click",
-                                event_context,
-                                link_uri,
-                                link_text,
-                                image_uri,
-                                frame_src,
-                                button,
-                                modifier,
-                                x,
-                                y);
-
-    return TRUE;
-}
-
-static gboolean
-kz_dbus_embed_delegate_dom_mouse_over (KzDBusEmbedDelegate *object,
-                                     gint event_context,
-                                     gchar *link_uri,
-                                     gchar *link_text,
-                                     gchar *image_uri,
-                                     gchar *frame_src,
-                                     gint button,
-                                     gint modifier,
-                                     gint x,
-                                     gint y,
-                                     gboolean *ret,
-                                     GError **error)
-{
-    *ret = emit_dom_mouse_event(object,
-                                "kz-dom-mouse-over",
-                                event_context,
-                                link_uri,
-                                link_text,
-                                image_uri,
-                                frame_src,
-                                button,
-                                modifier,
-                                x,
-                                y);
-
-    return TRUE;
-}
-
 static void
 cb_location (DBusGProxy *proxy, const gchar *location, KzDBusEmbedDelegate *object)
 {
@@ -476,6 +312,84 @@
 }
 
 static void
+cb_dom_mouse_down (DBusGProxy *proxy,
+                    gint event_context,
+                    gchar *link_uri,
+                    gchar *link_text,
+                    gchar *image_uri,
+                    gchar *frame_src,
+                    gint button,
+                    gint modifier,
+                    gint x,
+                    gint y,
+                    KzDBusEmbedDelegate *object)
+{
+    emit_dom_mouse_event(object,
+                         "kz-dom-mouse-down",
+                         event_context,
+                         link_uri,
+                         link_text,
+                         image_uri,
+                         frame_src,
+                         button,
+                         modifier,
+                         x,
+                         y);
+}
+
+static void
+cb_dom_mouse_up (DBusGProxy *proxy,
+                    gint event_context,
+                    gchar *link_uri,
+                    gchar *link_text,
+                    gchar *image_uri,
+                    gchar *frame_src,
+                    gint button,
+                    gint modifier,
+                    gint x,
+                    gint y,
+                    KzDBusEmbedDelegate *object)
+{
+    emit_dom_mouse_event(object,
+                         "kz-dom-mouse-up",
+                         event_context,
+                         link_uri,
+                         link_text,
+                         image_uri,
+                         frame_src,
+                         button,
+                         modifier,
+                         x,
+                         y);
+}
+
+static void
+cb_dom_mouse_click (DBusGProxy *proxy,
+                    gint event_context,
+                    gchar *link_uri,
+                    gchar *link_text,
+                    gchar *image_uri,
+                    gchar *frame_src,
+                    gint button,
+                    gint modifier,
+                    gint x,
+                    gint y,
+                    KzDBusEmbedDelegate *object)
+{
+    emit_dom_mouse_event(object,
+                         "kz-dom-mouse-click",
+                         event_context,
+                         link_uri,
+                         link_text,
+                         image_uri,
+                         frame_src,
+                         button,
+                         modifier,
+                         x,
+                         y);
+}
+
+static void
 kz_embed_iface_init (KzEmbedIFace *iface)
 {
     iface->load_url               = load_uri;
@@ -819,6 +733,18 @@
     dbus_g_proxy_connect_signal(priv->proxy, "Progress", G_CALLBACK(cb_progress), object, NULL);
     dbus_g_proxy_add_signal(priv->proxy, "LinkMessage", G_TYPE_STRING, G_TYPE_INVALID);
     dbus_g_proxy_connect_signal(priv->proxy, "LinkMessage", G_CALLBACK(cb_link_message), object, NULL);
+    dbus_g_proxy_add_signal(priv->proxy, "DomMouseDown",
+                            G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+                            G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID);
+    dbus_g_proxy_connect_signal(priv->proxy, "DomMouseDown", G_CALLBACK(cb_dom_mouse_down), object, NULL);
+    dbus_g_proxy_add_signal(priv->proxy, "DomMouseUp",
+                            G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+                            G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID);
+    dbus_g_proxy_connect_signal(priv->proxy, "DomMouseUp", G_CALLBACK(cb_dom_mouse_up), object, NULL);
+    dbus_g_proxy_add_signal(priv->proxy, "DomMouseClick",
+                            G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+                            G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID);
+    dbus_g_proxy_connect_signal(priv->proxy, "DomMouseClick", G_CALLBACK(cb_dom_mouse_click), object, NULL);
 }
 
 void

Modified: kazehakase/trunk/module/embed/per-process/kz-embed-process.c
===================================================================
--- kazehakase/trunk/module/embed/per-process/kz-embed-process.c	2009-09-02 06:08:18 UTC (rev 3813)
+++ kazehakase/trunk/module/embed/per-process/kz-embed-process.c	2009-09-02 06:46:34 UTC (rev 3814)
@@ -254,37 +254,37 @@
 static void
 cb_net_stop (KzEmbed *embed, KzEmbedProcess *process)
 {
-    g_signal_emit_by_name(process, "net-stop", 0);
+    g_signal_emit(process, signals[NET_STOP], 0);
 }
 
 static void
 cb_net_start (KzEmbed *embed, KzEmbedProcess *process)
 {
-    g_signal_emit_by_name(process, "net-start", 0);
+    g_signal_emit(process, signals[NET_START], 0);
 }
 
 static void
 cb_title (KzEmbed *embed, const gchar *title, KzEmbedProcess *process)
 {
-    g_signal_emit_by_name(process, "title", title);
+    g_signal_emit(process, signals[TITLE], 0, title);
 }
 
 static void
 cb_location (KzEmbed *embed, const gchar *location, KzEmbedProcess *process)
 {
-    g_signal_emit_by_name(process, "location", location);
+    g_signal_emit(process, signals[LOCATION], 0, location);
 }
 
 static void
 cb_progress (KzEmbed *embed, gdouble progress, KzEmbedProcess *process)
 {
-    g_signal_emit_by_name(process, "progress", progress);
+    g_signal_emit(process, signals[PROGRESS], 0, progress);
 }
 
 static void
 cb_link_message (KzEmbed *embed, const gchar *message, KzEmbedProcess *process)
 {
-    g_signal_emit_by_name(process, "link-message", message);
+    g_signal_emit(process, signals[LINK_MESSAGE], 0, message);
 }
 
 static void
@@ -301,14 +301,10 @@
 }
 
 #define DEFINE_DOM_MOUSE_EVENT(type)                                            \
-static gint                                                                     \
+static gboolean                                                                 \
 cb_ ## type (KzEmbed *embed, KzEmbedEventMouse *event, KzEmbedProcess *process) \
 {                                                                               \
-    gint ret = FALSE;                                                           \
-    GError *error = NULL;                                                       \
-                                                                                \
-    KzEmbedProcessPrivate *priv = KZ_EMBED_PROCESS_GET_PRIVATE(process);        \
-    if (!org_kazehakase_Embed_Delegate_ ## type(priv->proxy,                    \
+    g_signal_emit_by_name(process, #type,                                       \
                           event->cinfo.context,                                 \
                           event->cinfo.link,                                    \
                           event->cinfo.linktext,                                \
@@ -317,19 +313,13 @@
                           event->button,                                        \
                           event->modifier,                                      \
                           event->x,                                             \
-                          event->y,                                             \
-                          &ret,                                                 \
-                          &error)) {                                            \
-        g_print("%s\n", error->message);                                        \
-        g_error_free(error);                                                    \
-    }                                                                           \
-    return ret;                                                                 \
+                          event->y);                                            \
+    return FALSE;                                                               \
 }
 
 DEFINE_DOM_MOUSE_EVENT(dom_mouse_down)
 DEFINE_DOM_MOUSE_EVENT(dom_mouse_up)
 DEFINE_DOM_MOUSE_EVENT(dom_mouse_click)
-DEFINE_DOM_MOUSE_EVENT(dom_mouse_over)
 
 static void
 connect_embed_dom_signals (KzEmbedProcess *process)
@@ -339,7 +329,6 @@
     g_signal_connect(priv->embed, "kz-dom-mouse-down", G_CALLBACK(cb_dom_mouse_down), process);
     g_signal_connect(priv->embed, "kz-dom-mouse-up", G_CALLBACK(cb_dom_mouse_up), process);
     g_signal_connect(priv->embed, "kz-dom-mouse-click", G_CALLBACK(cb_dom_mouse_click), process);
-    g_signal_connect(priv->embed, "kz-dom-mouse-over", G_CALLBACK(cb_dom_mouse_over), process);
 }
 
 static void
@@ -350,7 +339,6 @@
     g_signal_handlers_disconnect_by_func(priv->embed, G_CALLBACK(cb_dom_mouse_down), process);
     g_signal_handlers_disconnect_by_func(priv->embed, G_CALLBACK(cb_dom_mouse_up), process);
     g_signal_handlers_disconnect_by_func(priv->embed, G_CALLBACK(cb_dom_mouse_click), process);
-    g_signal_handlers_disconnect_by_func(priv->embed, G_CALLBACK(cb_dom_mouse_over), process);
 }
 
 static gboolean




More information about the Kazehakase-cvs mailing list
Back to archive index