- a/Source/WebKit/ChangeLog +20 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2022-04-04  Adrian Perez de Castro  <aperez@igalia.com>
2
3
        [WPE][GTK] Fix code examples in reference documentation
4
        https://bugs.webkit.org/show_bug.cgi?id=238770
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Replace DocBook SGML tags containing code examples with Markdown fenced code blocks
9
        as consumed by gi-docgen.
10
11
        * UIProcess/API/glib/WebKitSettings.cpp:
12
        * UIProcess/API/glib/WebKitUserContentManager.cpp:
13
        * UIProcess/API/glib/WebKitWebContext.cpp:
14
        * UIProcess/API/glib/WebKitWebView.cpp:
15
        (webkit_web_view_class_init):
16
        * UIProcess/API/glib/WebKitWebsitePolicies.cpp:
17
        * UIProcess/API/gtk/WebKitWebInspector.cpp:
18
        * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
19
        * WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp:
20
1
2022-04-04  Adrian Perez de Castro  <aperez@igalia.com>
21
2022-04-04  Adrian Perez de Castro  <aperez@igalia.com>
2
22
3
        [WPE] Mark "backend" parameters of web view constructors not nullable
23
        [WPE] Mark "backend" parameters of web view constructors not nullable
- a/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp -4 / +3 lines
Lines 97-108 struct _WebKitSettingsPrivate { a/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp_sec1
97
 * other things on a #WebKitWebView. After creation, a #WebKitSettings object
97
 * other things on a #WebKitWebView. After creation, a #WebKitSettings object
98
 * contains default settings.
98
 * contains default settings.
99
 *
99
 *
100
 * <informalexample><programlisting>
100
 * ```c
101
 * /<!-- -->* Disable JavaScript. *<!-- -->/
101
 * // Disable JavaScript
102
 * WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group);
102
 * WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group);
103
 * webkit_settings_set_enable_javascript (settings, FALSE);
103
 * webkit_settings_set_enable_javascript (settings, FALSE);
104
 *
104
 * ```
105
 * </programlisting></informalexample>
106
 */
105
 */
107
106
108
WEBKIT_DEFINE_TYPE(WebKitSettings, webkit_settings, G_TYPE_OBJECT)
107
WEBKIT_DEFINE_TYPE(WebKitSettings, webkit_settings, G_TYPE_OBJECT)
- a/Source/WebKit/UIProcess/API/glib/WebKitUserContentManager.cpp -2 / +2 lines
Lines 268-280 private: a/Source/WebKit/UIProcess/API/glib/WebKitUserContentManager.cpp_sec1
268
 * receive the signals, it is recommended to connect to the signal
268
 * receive the signals, it is recommended to connect to the signal
269
 * *before* registering the handler name:
269
 * *before* registering the handler name:
270
 *
270
 *
271
 * <informalexample><programlisting>
271
 * ```c
272
 * WebKitWebView *view = webkit_web_view_new ();
272
 * WebKitWebView *view = webkit_web_view_new ();
273
 * WebKitUserContentManager *manager = webkit_web_view_get_user_content_manager ();
273
 * WebKitUserContentManager *manager = webkit_web_view_get_user_content_manager ();
274
 * g_signal_connect (manager, "script-message-received::foobar",
274
 * g_signal_connect (manager, "script-message-received::foobar",
275
 *                   G_CALLBACK (handle_script_message), NULL);
275
 *                   G_CALLBACK (handle_script_message), NULL);
276
 * webkit_user_content_manager_register_script_message_handler (manager, "foobar");
276
 * webkit_user_content_manager_register_script_message_handler (manager, "foobar");
277
 * </programlisting></informalexample>
277
 * ```
278
 *
278
 *
279
 * Registering a script message handler will fail if the requested
279
 * Registering a script message handler will fail if the requested
280
 * name has been already registered before.
280
 * name has been already registered before.
- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp -12 / +7 lines
Lines 1215-1244 GList* webkit_web_context_get_plugins_finish(WebKitWebContext* context, GAsyncRe a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp_sec1
1215
 * when the data of the request is available or
1215
 * when the data of the request is available or
1216
 * webkit_uri_scheme_request_finish_error() in case of error.
1216
 * webkit_uri_scheme_request_finish_error() in case of error.
1217
 *
1217
 *
1218
 * <informalexample><programlisting>
1218
 * ```c
1219
 * static void
1219
 * static void
1220
 * about_uri_scheme_request_cb (WebKitURISchemeRequest *request,
1220
 * about_uri_scheme_request_cb (WebKitURISchemeRequest *request,
1221
 *                              gpointer                user_data)
1221
 *                              gpointer                user_data)
1222
 * {
1222
 * {
1223
 *     GInputStream *stream;
1223
 *     GInputStream *stream;
1224
 *     gsize         stream_length;
1224
 *     gsize         stream_length;
1225
 *     const gchar  *path;
1225
 *     const gchar  *path = webkit_uri_scheme_request_get_path (request);
1226
 *
1226
 *
1227
 *     path = webkit_uri_scheme_request_get_path (request);
1228
 *     if (!g_strcmp0 (path, "memory")) {
1227
 *     if (!g_strcmp0 (path, "memory")) {
1229
 *         /<!-- -->* Create a GInputStream with the contents of memory about page, and set its length to stream_length *<!-- -->/
1228
 *         // Create a GInputStream with the contents of memory about page, and set its length to stream_length
1230
 *     } else if (!g_strcmp0 (path, "applications")) {
1229
 *     } else if (!g_strcmp0 (path, "applications")) {
1231
 *         /<!-- -->* Create a GInputStream with the contents of applications about page, and set its length to stream_length *<!-- -->/
1230
 *         // Create a GInputStream with the contents of applications about page, and set its length to stream_length
1232
 *     } else if (!g_strcmp0 (path, "example")) {
1231
 *     } else if (!g_strcmp0 (path, "example")) {
1233
 *         gchar *contents;
1232
 *         gchar *contents = g_strdup_printf ("<html><body><p>Example about page</p></body></html>");
1234
 *
1235
 *         contents = g_strdup_printf ("&lt;html&gt;&lt;body&gt;&lt;p&gt;Example about page&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;");
1236
 *         stream_length = strlen (contents);
1233
 *         stream_length = strlen (contents);
1237
 *         stream = g_memory_input_stream_new_from_data (contents, stream_length, g_free);
1234
 *         stream = g_memory_input_stream_new_from_data (contents, stream_length, g_free);
1238
 *     } else {
1235
 *     } else {
1239
 *         GError *error;
1236
 *         GError *error = g_error_new (ABOUT_HANDLER_ERROR, ABOUT_HANDLER_ERROR_INVALID, "Invalid about:%s page.", path);
1240
 *
1241
 *         error = g_error_new (ABOUT_HANDLER_ERROR, ABOUT_HANDLER_ERROR_INVALID, "Invalid about:%s page.", path);
1242
 *         webkit_uri_scheme_request_finish_error (request, error);
1237
 *         webkit_uri_scheme_request_finish_error (request, error);
1243
 *         g_error_free (error);
1238
 *         g_error_free (error);
1244
 *         return;
1239
 *         return;
Lines 1246-1252 GList* webkit_web_context_get_plugins_finish(WebKitWebContext* context, GAsyncRe a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp_sec2
1246
 *     webkit_uri_scheme_request_finish (request, stream, stream_length, "text/html");
1241
 *     webkit_uri_scheme_request_finish (request, stream, stream_length, "text/html");
1247
 *     g_object_unref (stream);
1242
 *     g_object_unref (stream);
1248
 * }
1243
 * }
1249
 * </programlisting></informalexample>
1244
 * ```
1250
 */
1245
 */
1251
void webkit_web_context_register_uri_scheme(WebKitWebContext* context, const char* scheme, WebKitURISchemeRequestCallback callback, gpointer userData, GDestroyNotify destroyNotify)
1246
void webkit_web_context_register_uri_scheme(WebKitWebContext* context, const char* scheme, WebKitURISchemeRequestCallback callback, gpointer userData, GDestroyNotify destroyNotify)
1252
{
1247
{
- a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp -28 / +23 lines
Lines 1473-1506 static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec1
1473
     * You can handle this signal and use a switch to track any ongoing
1473
     * You can handle this signal and use a switch to track any ongoing
1474
     * load operation.
1474
     * load operation.
1475
     *
1475
     *
1476
     * <informalexample><programlisting>
1476
     * ```c
1477
     * static void web_view_load_changed (WebKitWebView  *web_view,
1477
     * static void web_view_load_changed (WebKitWebView  *web_view,
1478
     *                                    WebKitLoadEvent load_event,
1478
     *                                    WebKitLoadEvent load_event,
1479
     *                                    gpointer        user_data)
1479
     *                                    gpointer        user_data)
1480
     * {
1480
     * {
1481
     *     switch (load_event) {
1481
     *     switch (load_event) {
1482
     *     case WEBKIT_LOAD_STARTED:
1482
     *     case WEBKIT_LOAD_STARTED:
1483
     *         /<!-- -->* New load, we have now a provisional URI *<!-- -->/
1483
     *         // New load, we have now a provisional URI
1484
     *         provisional_uri = webkit_web_view_get_uri (web_view);
1484
     *         provisional_uri = webkit_web_view_get_uri (web_view);
1485
     *         /<!-- -->* Here we could start a spinner or update the
1485
     *         // Here we could start a spinner or update the
1486
     *          <!-- -->* location bar with the provisional URI *<!-- -->/
1486
     *         // location bar with the provisional URI
1487
     *         break;
1487
     *         break;
1488
     *     case WEBKIT_LOAD_REDIRECTED:
1488
     *     case WEBKIT_LOAD_REDIRECTED:
1489
     *         redirected_uri = webkit_web_view_get_uri (web_view);
1489
     *         redirected_uri = webkit_web_view_get_uri (web_view);
1490
     *         break;
1490
     *         break;
1491
     *     case WEBKIT_LOAD_COMMITTED:
1491
     *     case WEBKIT_LOAD_COMMITTED:
1492
     *         /<!-- -->* The load is being performed. Current URI is
1492
     *         // The load is being performed. Current URI is
1493
     *          <!-- -->* the final one and it won't change unless a new
1493
     *         // the final one and it won't change unless a new
1494
     *          <!-- -->* load is requested or a navigation within the
1494
     *         // load is requested or a navigation within the
1495
     *          <!-- -->* same page is performed *<!-- -->/
1495
     *         // same page is performed
1496
     *         uri = webkit_web_view_get_uri (web_view);
1496
     *         uri = webkit_web_view_get_uri (web_view);
1497
     *         break;
1497
     *         break;
1498
     *     case WEBKIT_LOAD_FINISHED:
1498
     *     case WEBKIT_LOAD_FINISHED:
1499
     *         /<!-- -->* Load finished, we can now stop the spinner *<!-- -->/
1499
     *         // Load finished, we can now stop the spinner
1500
     *         break;
1500
     *         break;
1501
     *     }
1501
     *     }
1502
     * }
1502
     * }
1503
     * </programlisting></informalexample>
1503
     * ```
1504
     */
1504
     */
1505
    signals[LOAD_CHANGED] =
1505
    signals[LOAD_CHANGED] =
1506
        g_signal_new("load-changed",
1506
        g_signal_new("load-changed",
Lines 1734-1740 static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec2
1734
     * @decision argument is a generic type, but should be casted to a more
1734
     * @decision argument is a generic type, but should be casted to a more
1735
     * specific type when making the decision. For example:
1735
     * specific type when making the decision. For example:
1736
     *
1736
     *
1737
     * <informalexample><programlisting>
1737
     * ```c
1738
     * static gboolean
1738
     * static gboolean
1739
     * decide_policy_cb (WebKitWebView *web_view,
1739
     * decide_policy_cb (WebKitWebView *web_view,
1740
     *                   WebKitPolicyDecision *decision,
1740
     *                   WebKitPolicyDecision *decision,
Lines 1743-1767 static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec3
1743
     *     switch (type) {
1743
     *     switch (type) {
1744
     *     case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: {
1744
     *     case WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION: {
1745
     *         WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
1745
     *         WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
1746
     *         /<!-- -->* Make a policy decision here. *<!-- -->/
1746
     *         // Make a policy decision here
1747
     *         break;
1747
     *         break;
1748
     *     }
1748
     *     }
1749
     *     case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: {
1749
     *     case WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION: {
1750
     *         WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
1750
     *         WebKitNavigationPolicyDecision *navigation_decision = WEBKIT_NAVIGATION_POLICY_DECISION (decision);
1751
     *         /<!-- -->* Make a policy decision here. *<!-- -->/
1751
     *         // Make a policy decision here
1752
     *         break;
1752
     *         break;
1753
     *     }
1753
     *     }
1754
     *     case WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
1754
     *     case WEBKIT_POLICY_DECISION_TYPE_RESPONSE:
1755
     *         WebKitResponsePolicyDecision *response = WEBKIT_RESPONSE_POLICY_DECISION (decision);
1755
     *         WebKitResponsePolicyDecision *response = WEBKIT_RESPONSE_POLICY_DECISION (decision);
1756
     *         /<!-- -->* Make a policy decision here. *<!-- -->/
1756
     *         // Make a policy decision here
1757
     *         break;
1757
     *         break;
1758
     *     default:
1758
     *     default:
1759
     *         /<!-- -->* Making no decision results in webkit_policy_decision_use(). *<!-- -->/
1759
     *         // Making no decision results in webkit_policy_decision_use()
1760
     *         return FALSE;
1760
     *         return FALSE;
1761
     *     }
1761
     *     }
1762
     *     return TRUE;
1762
     *     return TRUE;
1763
     * }
1763
     * }
1764
     * </programlisting></informalexample>
1764
     * ```
1765
     *
1765
     *
1766
     * It is possible to make policy decision asynchronously, by simply calling g_object_ref()
1766
     * It is possible to make policy decision asynchronously, by simply calling g_object_ref()
1767
     * on the @decision argument and returning %TRUE to block the default signal handler.
1767
     * on the @decision argument and returning %TRUE to block the default signal handler.
Lines 1798-1804 static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec4
1798
     * A possible way to use this signal could be through a dialog
1798
     * A possible way to use this signal could be through a dialog
1799
     * allowing the user decide what to do with the request:
1799
     * allowing the user decide what to do with the request:
1800
     *
1800
     *
1801
     * <informalexample><programlisting>
1801
     * ```c
1802
     * static gboolean permission_request_cb (WebKitWebView *web_view,
1802
     * static gboolean permission_request_cb (WebKitWebView *web_view,
1803
     *                                        WebKitPermissionRequest *request,
1803
     *                                        WebKitPermissionRequest *request,
1804
     *                                        GtkWindow *parent_window)
1804
     *                                        GtkWindow *parent_window)
Lines 1823-1829 static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec5
1823
     *
1823
     *
1824
     *     return TRUE;
1824
     *     return TRUE;
1825
     * }
1825
     * }
1826
     * </programlisting></informalexample>
1826
     * ```
1827
     *
1827
     *
1828
     * It is possible to handle permission requests asynchronously, by
1828
     * It is possible to handle permission requests asynchronously, by
1829
     * simply calling g_object_ref() on the @request argument and
1829
     * simply calling g_object_ref() on the @request argument and
Lines 3905-3911 void webkit_web_view_run_javascript(WebKitWebView* webView, const gchar* script, a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec6
3905
 * This is an example of using webkit_web_view_run_javascript() with a script returning
3905
 * This is an example of using webkit_web_view_run_javascript() with a script returning
3906
 * a string:
3906
 * a string:
3907
 *
3907
 *
3908
 * <informalexample><programlisting>
3908
 * ```c
3909
 * static void
3909
 * static void
3910
 * web_view_javascript_finished (GObject      *object,
3910
 * web_view_javascript_finished (GObject      *object,
3911
 *                               GAsyncResult *result,
3911
 *                               GAsyncResult *result,
Lines 3924-3934 void webkit_web_view_run_javascript(WebKitWebView* webView, const gchar* script, a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec7
3924
 *
3924
 *
3925
 *     value = webkit_javascript_result_get_js_value (js_result);
3925
 *     value = webkit_javascript_result_get_js_value (js_result);
3926
 *     if (jsc_value_is_string (value)) {
3926
 *     if (jsc_value_is_string (value)) {
3927
 *         JSCException *exception;
3927
 *         gchar        *str_value = jsc_value_to_string (value);
3928
 *         gchar        *str_value;
3928
 *         JSCException *exception = jsc_context_get_exception (jsc_value_get_context (value));
3929
 *
3930
 *         str_value = jsc_value_to_string (value);
3931
 *         exception = jsc_context_get_exception (jsc_value_get_context (value));
3932
 *         if (exception)
3929
 *         if (exception)
3933
 *             g_warning ("Error running javascript: %s", jsc_exception_get_message (exception));
3930
 *             g_warning ("Error running javascript: %s", jsc_exception_get_message (exception));
3934
 *         else
3931
 *         else
Lines 3944-3956 void webkit_web_view_run_javascript(WebKitWebView* webView, const gchar* script, a/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp_sec8
3944
 * web_view_get_link_url (WebKitWebView *web_view,
3941
 * web_view_get_link_url (WebKitWebView *web_view,
3945
 *                        const gchar   *link_id)
3942
 *                        const gchar   *link_id)
3946
 * {
3943
 * {
3947
 *     gchar *script;
3944
 *     gchar *script = g_strdup_printf ("window.document.getElementById('%s').href;", link_id);
3948
 *
3949
 *     script = g_strdup_printf ("window.document.getElementById('%s').href;", link_id);
3950
 *     webkit_web_view_run_javascript (web_view, script, NULL, web_view_javascript_finished, NULL);
3945
 *     webkit_web_view_run_javascript (web_view, script, NULL, web_view_javascript_finished, NULL);
3951
 *     g_free (script);
3946
 *     g_free (script);
3952
 * }
3947
 * }
3953
 * </programlisting></informalexample>
3948
 * ```
3954
 *
3949
 *
3955
 * Returns: (transfer full): a #WebKitJavascriptResult with the result of the last executed statement in @script
3950
 * Returns: (transfer full): a #WebKitJavascriptResult with the result of the last executed statement in @script
3956
 *    or %NULL in case of error
3951
 *    or %NULL in case of error
- a/Source/WebKit/UIProcess/API/glib/WebKitWebsitePolicies.cpp -4 / +7 lines
Lines 177-195 WebKitWebsitePolicies* webkit_website_policies_new(void) a/Source/WebKit/UIProcess/API/glib/WebKitWebsitePolicies.cpp_sec1
177
 *
177
 *
178
 * Returns: (transfer full): the newly created #WebKitWebsitePolicies
178
 * Returns: (transfer full): the newly created #WebKitWebsitePolicies
179
 *
179
 *
180
 * <informalexample><programlisting>
180
 * ```c
181
 * WebKitWebsitePolicies *default_website_policies = webkit_website_policies_new_with_policies(
181
 * WebKitWebsitePolicies *default_website_policies = webkit_website_policies_new_with_policies(
182
 *     "autoplay", WEBKIT_AUTOPLAY_DENY,
182
 *     "autoplay", WEBKIT_AUTOPLAY_DENY,
183
 *     NULL);
183
 *     NULL);
184
 * ...
184
 *
185
 * // ...
186
 *
185
 * WebKitWebView *view = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
187
 * WebKitWebView *view = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,
186
 *     "web-context", ctx,
188
 *     "web-context", ctx,
187
 *     "settings", settings,
189
 *     "settings", settings,
188
 *     "user-content-manager", content_manager,
190
 *     "user-content-manager", content_manager,
189
 *     "website-policies", default_website_policies,
191
 *     "website-policies", default_website_policies,
190
 *     NULL));
192
 *     NULL));
191
 * ...
193
 *
192
 * </programlisting></informalexample>
194
 * // ...
195
 * ```
193
 *
196
 *
194
 * Since: 2.30
197
 * Since: 2.30
195
 */
198
 */
- a/Source/WebKit/UIProcess/API/gtk/WebKitWebInspector.cpp -5 / +5 lines
Lines 44-61 using namespace WebKit; a/Source/WebKit/UIProcess/API/gtk/WebKitWebInspector.cpp_sec1
44
 * #WebKitWebView has set the #WebKitSettings:enable-developer-extras
44
 * #WebKitWebView has set the #WebKitSettings:enable-developer-extras
45
 * to true, otherwise no inspector is available.
45
 * to true, otherwise no inspector is available.
46
 *
46
 *
47
 * <informalexample><programlisting>
47
 * ```c
48
 * /<!-- -->* Enable the developer extras *<!-- -->/
48
 * // Enable the developer extras
49
 * WebKitSettings *settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW(my_webview));
49
 * WebKitSettings *settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW(my_webview));
50
 * g_object_set (G_OBJECT(settings), "enable-developer-extras", TRUE, NULL);
50
 * g_object_set (G_OBJECT(settings), "enable-developer-extras", TRUE, NULL);
51
 *
51
 *
52
 * /<!-- -->* Load some data or reload to be able to inspect the page*<!-- -->/
52
 * // Load some data or reload to be able to inspect the page
53
 * webkit_web_view_load_uri (WEBKIT_WEB_VIEW(my_webview), "http://www.gnome.org");
53
 * webkit_web_view_load_uri (WEBKIT_WEB_VIEW(my_webview), "http://www.gnome.org");
54
 *
54
 *
55
 * /<!-- -->* Show the inspector *<!-- -->/
55
 * // Show the inspector
56
 * WebKitWebInspector *inspector = webkit_web_view_get_inspector (WEBKIT_WEB_VIEW(my_webview));
56
 * WebKitWebInspector *inspector = webkit_web_view_get_inspector (WEBKIT_WEB_VIEW(my_webview));
57
 * webkit_web_inspector_show (WEBKIT_WEB_INSPECTOR(inspector));
57
 * webkit_web_inspector_show (WEBKIT_WEB_INSPECTOR(inspector));
58
 * </programlisting></informalexample>
58
 * ```
59
 */
59
 */
60
60
61
enum {
61
enum {
- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp -2 / +2 lines
Lines 432-438 GtkWidget* webkit_web_view_new_with_user_content_manager(WebKitUserContentManage a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp_sec1
432
 * Note that the parent window must have a RGBA visual and
432
 * Note that the parent window must have a RGBA visual and
433
 * #GtkWidget:app-paintable property set to %TRUE for backgrounds colors to work.
433
 * #GtkWidget:app-paintable property set to %TRUE for backgrounds colors to work.
434
 *
434
 *
435
 * <informalexample><programlisting>
435
 * ```c
436
 * static void browser_window_set_background_color (BrowserWindow *window,
436
 * static void browser_window_set_background_color (BrowserWindow *window,
437
 *                                                  const GdkRGBA *rgba)
437
 *                                                  const GdkRGBA *rgba)
438
 * {
438
 * {
Lines 449-455 GtkWidget* webkit_web_view_new_with_user_content_manager(WebKitUserContentManage a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp_sec2
449
 *     web_view = browser_window_get_web_view (window);
449
 *     web_view = browser_window_get_web_view (window);
450
 *     webkit_web_view_set_background_color (web_view, rgba);
450
 *     webkit_web_view_set_background_color (web_view, rgba);
451
 * }
451
 * }
452
 * </programlisting></informalexample>
452
 * ```
453
 *
453
 *
454
 * Since: 2.8
454
 * Since: 2.8
455
 */
455
 */
- a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp -7 / +7 lines
Lines 51-57 using namespace WebKit; a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp_sec1
51
 * This function has to be public and it has to use the #G_MODULE_EXPORT macro. It is called when the
51
 * This function has to be public and it has to use the #G_MODULE_EXPORT macro. It is called when the
52
 * web process is initialized.
52
 * web process is initialized.
53
 *
53
 *
54
 * <informalexample><programlisting>
54
 * ```c
55
 * static void
55
 * static void
56
 * web_page_created_callback (WebKitWebExtension *extension,
56
 * web_page_created_callback (WebKitWebExtension *extension,
57
 *                            WebKitWebPage      *web_page,
57
 *                            WebKitWebPage      *web_page,
Lines 69-75 using namespace WebKit; a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp_sec2
69
 *                       G_CALLBACK (web_page_created_callback),
69
 *                       G_CALLBACK (web_page_created_callback),
70
 *                       NULL);
70
 *                       NULL);
71
 * }
71
 * }
72
 * </programlisting></informalexample>
72
 * ```
73
 *
73
 *
74
 * The previous piece of code shows a trivial example of an extension that notifies when
74
 * The previous piece of code shows a trivial example of an extension that notifies when
75
 * a #WebKitWebPage is created.
75
 * a #WebKitWebPage is created.
Lines 82-95 using namespace WebKit; a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp_sec3
82
 * function, you have to call webkit_web_context_set_web_extensions_initialization_user_data() with
82
 * function, you have to call webkit_web_context_set_web_extensions_initialization_user_data() with
83
 * the desired data as parameter. You can see an example of this in the following piece of code:
83
 * the desired data as parameter. You can see an example of this in the following piece of code:
84
 *
84
 *
85
 * <informalexample><programlisting>
85
 * ```c
86
 * #define WEB_EXTENSIONS_DIRECTORY /<!-- -->* ... *<!-- -->/
86
 * #define WEB_EXTENSIONS_DIRECTORY // ...
87
 *
87
 *
88
 * static void
88
 * static void
89
 * initialize_web_extensions (WebKitWebContext *context,
89
 * initialize_web_extensions (WebKitWebContext *context,
90
 *                            gpointer          user_data)
90
 *                            gpointer          user_data)
91
 * {
91
 * {
92
 *   /<!-- -->* Web Extensions get a different ID for each Web Process *<!-- -->/
92
 *   // Web Extensions get a different ID for each Web Process
93
 *   static guint32 unique_id = 0;
93
 *   static guint32 unique_id = 0;
94
 *
94
 *
95
 *   webkit_web_context_set_web_extensions_directory (
95
 *   webkit_web_context_set_web_extensions_directory (
Lines 107-115 using namespace WebKit; a/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitWebExtension.cpp_sec4
107
 *
107
 *
108
 *   GtkWidget *view = webkit_web_view_new ();
108
 *   GtkWidget *view = webkit_web_view_new ();
109
 *
109
 *
110
 *   /<!-- -->* ... *<!-- -->/
110
 *   // ...
111
 * }
111
 * }
112
 * </programlisting></informalexample>
112
 * ```
113
 */
113
 */
114
114
115
enum {
115
enum {

Return to Bug 238770