bool canExecuteEditingCommand(const char* command)
 {
     m_canExecuteEditingCommand = false;
     webkit_web_view_can_execute_editing_command(m_webView, command, 0, reinterpret_cast<GAsyncReadyCallback>(canExecuteEditingCommandReadyCallback), this);
     g_main_loop_run(m_mainLoop);
     return m_canExecuteEditingCommand;
 }
Esempio n. 2
0
bool wxWebViewWebKit::CanExecuteEditingCommand(const gchar* command) const
{
    GAsyncResult *result = NULL;
    webkit_web_view_can_execute_editing_command(m_web_view,
                                                command,
                                                NULL,
                                                (GAsyncReadyCallback)wxgtk_can_execute_editing_command_cb,
                                                &result);

    GMainContext *main_context = g_main_context_get_thread_default();
    while (!result)
    {
        g_main_context_iteration(main_context, TRUE);
    }

    gboolean can_execute = webkit_web_view_can_execute_editing_command_finish(m_web_view,
                                                                              result,
                                                                              NULL);
    g_object_unref(result);

    return can_execute;
}