Home | History | Annotate | Download | only in webkit

Lines Matching refs:viewport

34  * @short_description: Represents the viewport properties of a web page
35 * @see_also: #WebKitWebView::viewport-attributes-recompute-requested
36 * @see_also: #WebKitWebView::viewport-attributes-changed
38 * #WebKitViewportAttributes offers the viewport properties to user agents to
39 * control the viewport layout. It contains the viewport size, initial scale with limits,
40 * and information about whether a user is able to scale the contents in the viewport.
43 * The #WebKitWebView::viewport-attributes-changed signal will be emitted with #WebKitViewportAttributes
44 * when the viewport attributes are updated in the case of loading web pages contain
45 * the viewport properties and calling webkit_viewport_attributes_recompute.
49 * You should call #webkit_viewport_attributes_recompute to recompute the viewport properties and
50 * override those values in the handler of #WebKitWebView::viewport-attributes-recompute-requested signal.
52 * For more information on the viewport properties, refer to the Safari reference library at
56 * /<!-- -->* Connect to the viewport-attributes-changes signal *<!-- -->/
58 * g_signal_connect (web_view, "viewport-attributes-recompute-requested", G_CALLBACK (viewport_recompute_cb), window);
59 * g_signal_connect (web_view, "viewport-attributes-changed", G_CALLBACK (viewport_changed_cb), window);
62 * /<!-- -->* Handle the viewport-attributes-recompute-requested signal to override the device width *<!-- -->/
70 * /<!-- -->* Handle the viewport-attributes-changed signal to recompute the initial scale factor *<!-- -->/
128 * pre-computed during a viewport attributes recomputation, and
130 * WebKitWebView::viewport-attributes-recompute-requested. You
150 * pre-computed during a viewport attributes recomputation, and
152 * WebKitWebView::viewport-attributes-recompute-requested. You
176 * of WebKitWebView::viewport-attributes-recompute-requested to
200 * of WebKitWebView::viewport-attributes-recompute-requested to
219 * The width of viewport that works well for most web pages designed for
221 * during a viewport attributes recomputation. Also, it can be overriden by
222 * the handler of WebKitWebView::viewport-attributes-recompute-requested.
232 _("The width of viewport that works well for most web pages designed for desktop."),
242 * initialized to 160 dpi by default and used during a viewport
245 * handler of WebKitWebView::viewport-attributes-recompute-requested.
264 * The width of the viewport. Before getting this property,
274 _("The width of the viewport."),
283 * The height of the viewport. Before getting this property,
293 _("The height of the viewport."),
302 * The initial scale of the viewport. Before getting this property,
312 _("The initial scale of the viewport."),
321 * The minimum scale of the viewport. Before getting this property,
331 _("The minimum scale of the viewport."),
340 * The maximum scale of the viewport. Before getting this property,
350 _("The maximum scale of the viewport."),
359 * The device pixel ratio of the viewport. Before getting this property,
369 _("The device pixel ratio of the viewport."),
398 * which have a viewport meta tag, and have already
415 static void webkit_viewport_attributes_init(WebKitViewportAttributes* viewport)
417 viewport->priv = G_TYPE_INSTANCE_GET_PRIVATE(viewport, WEBKIT_TYPE_VIEWPORT_ATTRIBUTES, WebKitViewportAttributesPrivate);
419 viewport->priv->deviceWidth = 0;
420 viewport->priv->deviceHeight = 0;
421 viewport->priv->availableWidth = 0;
422 viewport->priv->availableHeight = 0;
423 viewport->priv->desktopWidth = 980; // This value works well for most web pages designed for desktop browsers.
424 viewport->priv->deviceDPI = 160; // It is the dpi of the original iPhone and Android devices.
425 viewport->priv->width = 0;
426 viewport->priv->height = 0;
427 viewport->priv->initialScaleFactor = -1;
428 viewport->priv->minimumScaleFactor = -1;
429 viewport->priv->maximumScaleFactor = -1;
430 viewport->priv->devicePixelRatio = -1;
431 viewport->priv->userScalable = TRUE;
432 viewport->priv->isValid = FALSE;
533 g_signal_emit_by_name(webView, "viewport-attributes-recompute-requested", viewportAttributes);
553 g_signal_emit_by_name(webView, "viewport-attributes-changed", viewportAttributes);
560 * Recompute the optimal viewport attributes and emit the viewport-attribute-changed signal.
561 * The viewport-attributes-recompute-requested signal also will be handled to override