Esempio n. 1
0
static void
mark_links(GtkButton *button, WebKitWebView *view)
{
    WebKitDOMDocument* document = webkit_web_view_get_dom_document(view);
    WebKitDOMHTMLCollection *collection = webkit_dom_document_get_links(document);
    gulong length = webkit_dom_html_collection_get_length(collection);
    guint i;

    for (i = 0; i < length; i++) {
        WebKitDOMNode *node = webkit_dom_html_collection_item(collection, i);
        WebKitDOMElement* element = (WebKitDOMElement*)node;
        WebKitDOMCSSStyleDeclaration *style = webkit_dom_element_get_style(element);
        webkit_dom_css_style_declaration_set_property(style, "-webkit-transition", "top 1s ease-in", "", NULL);
        webkit_dom_css_style_declaration_set_property(style, "top", "25px", "", NULL);
        webkit_dom_css_style_declaration_set_property(style, "position", "relative", "", NULL);
        g_timeout_add(1000, (GSourceFunc)bounce_back, style);
    }
}
Esempio n. 2
0
const gchar *
e_editor_selection_get_font_name (EEditorSelection *selection)
{
	WebKitDOMNode *node;
	WebKitDOMRange *range;
	WebKitDOMCSSStyleDeclaration *css;

	g_return_val_if_fail (E_IS_EDITOR_SELECTION (selection), NULL);

	range = editor_selection_get_current_range (selection);
	node = webkit_dom_range_get_common_ancestor_container (range, NULL);

	g_free (selection->priv->font_family);
	css = webkit_dom_element_get_style (WEBKIT_DOM_ELEMENT (node));
	selection->priv->font_family =
		webkit_dom_css_style_declaration_get_property_value (css, "fontFamily");

	return selection->priv->font_family;
}
Esempio n. 3
0
const gchar *
e_editor_selection_get_background_color	(EEditorSelection *selection)
{
	WebKitDOMNode *ancestor;
	WebKitDOMRange *range;
	WebKitDOMCSSStyleDeclaration *css;

	g_return_val_if_fail (E_IS_EDITOR_SELECTION (selection), NULL);

	range = editor_selection_get_current_range (selection);

	ancestor = webkit_dom_range_get_common_ancestor_container (range, NULL);

	css = webkit_dom_element_get_style (WEBKIT_DOM_ELEMENT (ancestor));
	selection->priv->background_color =
		webkit_dom_css_style_declaration_get_property_value (
			css, "background-color");

	return selection->priv->background_color;
}