It derives from <GObject>.
Represents the context menu in a <WebKitWebView>.
<WebKitContextMenu> represents a context menu
containing <WebKitContextMenuItem><!–
–>s in a <WebKitWebView>.
When a <WebKitWebView> is about to display the
context menu, it emits the web-view:context-menu signal, which has the
<WebKitContextMenu> as an argument. You can
modify it, adding new submenus that you can create with
context-menu:new, adding new
<WebKitContextMenuItem><!– –>s with
context-menu:prepend,
context-menu:append or
context-menu:insert, maybe after having
removed the existing ones with context-menu:remove-all.
Adds item at the end of the self.
Passed: a <WebKitContextMenu>.
Passed: a <WebKitContextMenuItem>.
the <WebKitContextMenuItem> to add
Gets the first item in the self.
Passed: a <WebKitContextMenu>.
Returned: a <WebKitContextMenuItem>.
the first <WebKitContextMenuItem> of
self, or #f if the
<WebKitContextMenu> is empty.
Gets the <GdkEvent> that triggered the context
menu. This function only returns a valid
<GdkEvent> when called for a
<WebKitContextMenu> passed to
web-view:context-menu signal;
in all other cases, #f is returned.
The returned <GdkEvent> is expected to be one of
the following types:
GdkEventButton of type button-press
when the context menu was triggered with mouse.
GdkEventKey of type key-press if
the keyboard was used to show the menu.
<GdkEvent> of type GDK_NOTHING
when the "popup-menu" signal was used to show the context menu.
Passed: a <WebKitContextMenu>.
Returned: a <GdkEvent>.
the menu event or #f.
Gets the item at the given position in the self.
Passed: a <WebKitContextMenu>.
Passed: an unsigned 32-bit integer.
the position of the item, counting from 0
Returned: a <WebKitContextMenuItem>.
the <WebKitContextMenuItem> at position
position in self, or #f if the position is off the
end of the self.
Returns the item list of self.
Passed: a <WebKitContextMenu>.
Returned: a list, each a
<WebKitContextMenuItem>.
a GList of
<WebKitContextMenuItem><!– –>s
Gets the length of the self.
Passed: a <WebKitContextMenu>.
Returned: an unsigned 32-bit integer.
the number of <WebKitContextMenuItem><!–
–>s in self
Gets the position in view coordinates where the context menu was triggered.
This function only returns valid coordinates when called for a
<WebKitContextMenu> passed to
web-view:context-menu signal.
Passed: a <WebKitContextMenu>.
Returned: a boolean.
#t if valid position coordinates are available, #f
otherwise
Returned: a 32-bit integer.
return location for the x coordinate
Returned: a 32-bit integer.
return location for the y coordinate
Gets the user data of self.
This function can be used from the UI Process to get user data
previously set from the Web Process with context-menu:set-user-data.
Passed: a <WebKitContextMenu>.
Returned: a <GVariant>.
the user data of self, or #f if self doesn’t have
user data
Inserts item into the self at the given position.
If position is negative, or is larger than the number of items in
the <WebKitContextMenu>, the item is added on
to the end of the self. The first position is 0.
Passed: a <WebKitContextMenu>.
Passed: a <WebKitContextMenuItem>.
the <WebKitContextMenuItem> to add
Passed: a 32-bit integer.
the position to insert the item
Gets the last item in the self.
Passed: a <WebKitContextMenu>.
Returned: a <WebKitContextMenuItem>.
the last <WebKitContextMenuItem> of
self, or #f if the
<WebKitContextMenu> is empty.
Moves item to the given position in the self.
If position is negative, or is larger than the number of items in
the <WebKitContextMenu>, the item is added on
to the end of the self. The first position is 0.
Passed: a <WebKitContextMenu>.
Passed: a <WebKitContextMenuItem>.
the <WebKitContextMenuItem> to add
Passed: a 32-bit integer.
the new position to move the item
Creates a new <WebKitContextMenu> object.
Creates a new <WebKitContextMenu> object to be
used as a submenu of an existing
<WebKitContextMenu>. The context menu of a
<WebKitWebView> is created by the view and passed
as an argument of web-view:context-menu signal. To add items to the menu
use context-menu:prepend,
context-menu:append or
context-menu:insert. See also
context-menu:new-with-items to
create a <WebKitContextMenu> with a list of
initial items.
Returned: a <WebKitContextMenu>.
The newly created <WebKitContextMenu> object
Creates a new <WebKitContextMenu> object with
the given items.
Creates a new <WebKitContextMenu> object to be
used as a submenu of an existing
<WebKitContextMenu> with the given initial
items. See also context-menu:new
Passed: a list, each a
<WebKitContextMenuItem>.
a GList of <WebKitContextMenuItem>
Returned: a <WebKitContextMenu>.
The newly created <WebKitContextMenu> object
Adds item at the beginning of the self.
Passed: a <WebKitContextMenu>.
Passed: a <WebKitContextMenuItem>.
the <WebKitContextMenuItem> to add
Removes item from the self.
See also context-menu:remove-all to
remove all items.
Passed: a <WebKitContextMenu>.
Passed: a <WebKitContextMenuItem>.
the <WebKitContextMenuItem> to remove
Removes all items of the self.
Passed: a <WebKitContextMenu>.
Sets user data to self.
This function can be used from a Web Process extension to set user data
that can be retrieved from the UI Process using context-menu:get-user-data. If the user-data
<GVariant> is floating, it is consumed.
Passed: a <WebKitContextMenu>.
Passed: a <GVariant>.