1.6 <WebKitColorChooserRequest>

Class: <WebKitColorChooserRequest>

It derives from <GObject>.

A request to open a color chooser.

Whenever the user interacts with an <input type=’color’ /> HTML element, WebKit will need to show a dialog to choose a color. For that to happen in a general way, instead of just opening a GtkColorChooser (which might be not desirable in some cases, which could prefer to use their own color chooser dialog), WebKit will fire the web-view:run-color-chooser signal with a <WebKitColorChooserRequest> object, which will allow the client application to specify the color to be selected, to inspect the details of the request (e.g. to get initial color) and to cancel the request, in case nothing was selected.

In case the client application does not wish to handle this signal, WebKit will provide a default handler which will asynchronously run a regular GtkColorChooserDialog for the user to interact with.

Properties

Property: color-chooser-request:rgba self

The <GdkRGBA> color of the request

Its value is a <GdkRGBA>, or #f.

Set it with (set! (color-chooser-request:rgba self) value).

Procedures

Method: color-chooser-request:cancel self
Method: cancel self

Cancels self and the input element changes to use the initial color.

Cancels self and the input element changes to use the initial color it has before the request started. The signal color-chooser-request:finished is emitted to notify that the request has finished.

self

Passed: a <WebKitColorChooserRequest>.

a <WebKitColorChooserRequest>

Method: color-chooser-request:finish self
Method: finish self

Finishes self and the input element keeps the current value of color-chooser-request:rgba.

Finishes self and the input element keeps the current value of color-chooser-request:rgba. The signal color-chooser-request:finished is emitted to notify that the request has finished.

self

Passed: a <WebKitColorChooserRequest>.

a <WebKitColorChooserRequest>

Method: color-chooser-request:get-element-rectangle! self rect ⇒ rect
Method: get-element-rectangle! self rect ⇒ rect

Gets the bounding box of the color input element.

self

Passed: a <WebKitColorChooserRequest>.

a <WebKitColorChooserRequest>

rect

Passed, filled in, and returned: a <GdkRectangle>.

a <GdkRectangle> to fill in with the element area

Method: color-chooser-request:get-rgba! self rgba ⇒ rgba
Method: get-rgba! self rgba ⇒ rgba

Gets the current <GdkRGBA> color of self

self

Passed: a <WebKitColorChooserRequest>.

a <WebKitColorChooserRequest>

rgba

Passed, filled in, and returned: a <GdkRGBA>.

a <GdkRGBA> to fill in with the current color.

Method: color-chooser-request:set-rgba self rgba
Method: set-rgba self rgba

Sets the current <GdkRGBA> color of self

self

Passed: a <WebKitColorChooserRequest>.

a <WebKitFileChooserRequest>

rgba

Passed: a <GdkRGBA>.

a pointer <GdkRGBA>

Signals

Signal: color-chooser-request:finished

Connect a handler with (connect object color-chooser-request:finished handler). It is called as (handler self).

Emitted when the request finishes. This signal can be emitted because the user completed the request calling color-chooser-request:finish, or cancelled it with color-chooser-request:cancel or because the color input element is removed from the DOM.

self

Passed: a <WebKitColorChooserRequest>.