]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gtkmathview-bonobo/src/handlers.c
ocaml 3.09 transition
[helm.git] / helm / gtkmathview-bonobo / src / handlers.c
index 78dc7ee66a4d51a47ba0212bc90db2c40b27c4bc..4861b2f0b0ec6f7205d3be03e5a2c79ae80fc396 100644 (file)
@@ -38,6 +38,21 @@ set_frame(BonoboControl *control, gpointer data)
 {     
 }
 
+static void
+notify_browser(GtkMathViewControlData* control_data, const char* url)
+{
+  BonoboObject* evs = bonobo_object_query_local_interface(BONOBO_OBJECT(control_data->control),
+                                                         "IDL:Bonobo/EventSource:1.0");
+  if (evs != NULL)
+    {
+      BonoboArg* arg = bonobo_arg_new(BONOBO_ARG_STRING);
+      BONOBO_ARG_SET_STRING(arg, url);
+      bonobo_event_source_notify_listeners (evs, "URL", arg, NULL);
+      /* bonobo_arg_release(arg); */
+      bonobo_object_unref(BONOBO_OBJECT(evs));
+    }
+}
+
 void
 click_cb(GtkMathView* math_view, GdomeElement* elem, gint state,
         GtkMathViewControlData* control_data)
@@ -46,7 +61,7 @@ click_cb(GtkMathView* math_view, GdomeElement* elem, gint state,
   
   g_return_if_fail(math_view != NULL);
   g_return_if_fail(control_data != NULL);
-  
+
   if (elem != NULL)
     {
       GdomeElement* action;
@@ -55,7 +70,10 @@ click_cb(GtkMathView* math_view, GdomeElement* elem, gint state,
       if (href != NULL)
        {
           /*gtk_math_view_load_uri(math_view,href->str);*/
-         set_clipboard(href);
+
+         notify_browser(control_data, href->str);
+
+         //set_clipboard(href);
           gdome_str_unref(href);
          return;
        }