However this signal is used inside this code: https://github.com/vain/lariza/blob/master/browser.c[WARNING] GLib-GObject (WARNING): gsignal.csignal 'mouse-target-changed' is invalid for instance '0x2426250' of type 'WebKitWebView'
...and it can be compiled without any problems.
Here some "quick-and-dirty" code to test:
Code: Select all
EnableExplicit
ImportC "-lgobject-2.0"
g_signal_connect_data(*Instance, Signal.P-UTF8, *Callback, *UserData, *ClosureNotify, ConnectFlags.I)
EndImport
ImportC "-lwebkitgtk-1.0"
webkit_web_navigation_action_get_original_uri(*NavigationAction)
webkit_web_policy_decision_ignore(*PolicyDecision)
webkit_web_policy_decision_use(*PolicyDecision)
EndImport
Enumeration
#WEBKIT_NAVIGATION_RESPONSE_ACCEPT
#WEBKIT_NAVIGATION_RESPONSE_IGNORE
EndEnumeration
ProcedureC WebGadgetCallback(*WebView, *Frame, *Request, *NavigationAction, *PolicyDecision, UserData)
If PeekS(webkit_web_navigation_action_get_original_uri(*NavigationAction), -1, #PB_UTF8) = "http://www.purebasic.com/news.php"
MessageRequester("", "No news today!")
webkit_web_policy_decision_ignore(*PolicyDecision)
Else
webkit_web_policy_decision_use(*PolicyDecision)
EndIf
EndProcedure
ProcedureC button_press_event(*WebView, *Frame, *Request, *NavigationAction, *PolicyDecision, UserData)
Debug "button-press-event"
EndProcedure
ProcedureC mouse_target_changed(*WebView, *Frame, *Request, *NavigationAction, *PolicyDecision, UserData)
Debug "mouse-target-changed"
EndProcedure
If OpenWindow(0, 200, 100, 600, 300, "WebGadget")
WebGadget(0, 10, 10, 580, 280, "http://johndyer.name/lab/fullscreenapi")
;WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com")
g_signal_connect_data(GadgetID(0), "navigation-policy-decision-requested", @WebGadgetCallback(), 0, 0, 0)
g_signal_connect_data(GadgetID(0), "button-press-event",@button_press_event(),0,0,0)
g_signal_connect_data(GadgetID(0), "mouse-target-changed", @mouse_target_changed(), 0,0,0);
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EDIT:
Didn't test this on Windows or OSX.
