---
name: "Gtk2::MozEmbed::main"
section: "3pm"
platform: "linux"
package: "libgtk2-mozembed-perl"
version: "0.08-4"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::MozEmbed::main"
---

# Gtk2::MozEmbed::main(3pm)

Perl interface to the Mozilla embedding widget

## NAME

Gtk2::MozEmbed::main - Perl interface to the Mozilla embedding widget

## SIGNALS

- **link\_message** (Gtk2::MozEmbed)

  This signal is emitted when the link message changes. This happens when the user moves the mouse over a link in a web page. Please use Gtk2::MozEmbed::get\_link\_message to get the actual value of the link message.

- **js\_status** (Gtk2::MozEmbed)

  This signal is emitted when the JavaScript status message changes. Please use Gtk2::MozEmbed::get\_js\_status to get the actual value of the js status message.

- **location** (Gtk2::MozEmbed)

  This signal is emitted any time that the location of the document has changed. Please use Gtk2::MozEmbed::get\_location to get the actual value of the location.

- **title** (Gtk2::MozEmbed)

  This signal is emitted any time that the title of a document has changed. Please use the Gtk2::MozEmbed::get\_title call to get the actual value of the title.

- **progress** (Gtk2::MozEmbed, integer (cur), integer (max))

  This signal is emitted any time that there is a change in the progress of loading a document.

  The cur value indicates how much of the document has been downloaded.

  The max value indicates the length of the document. If the value of max is less than one the full length of the document can not be determined.

- **net\_state** (Gtk2::MozEmbed, integer (flags), unsigned integer (status))

  This signal is emitted when there's a change in the state of the loading of a document.

- **net\_start** (Gtk2::MozEmbed)

  This signal is emitted any time that the load of a document has been started.

- **net\_stop** (Gtk2::MozEmbed)

  This signal is emitted any time that the loading of a document has completed.

- Gtk2::MozEmbed **new\_window** (Gtk2::MozEmbed, Gtk2::MozEmbed::Chrome)

  This signal is emitted any time that a new toplevel window is requested by the document. This will happen in the case of a window.*open()* in JavaScript. Responding to this signal allows you to surround a new toplevel window with your chrome.

  You should return the newly created GtkMozEmbed object.

- **visibility** (Gtk2::MozEmbed, boolean)

  This signal is emitted when the toplevel window in question needs to be shown or hidden. If the visibility argument is *TRUE* then the window should be shown. If it's *FALSE* it should be hidden.

- **destroy\_browser** (Gtk2::MozEmbed)

  This signal is emitted when the document as requested that the toplevel window be closed. This will happen in the case of a JavaScript window.*close()*.

- boolean **open\_uri** (Gtk2::MozEmbed, string)

  This signal is emitted when the document tries to load a new document, for example when someone clicks on a link in a web page. This signal gives the embedder the opportunity to keep the new document from being loaded. The uri argument is the uri that's going to be loaded.

  If you return *TRUE* from this signal, the new document will NOT be loaded. If you return *FALSE* the new document will be loaded. This is somewhat non-intuitive. Think of it as the Mozilla engine is asking if you want to interrupt the loading of a new document. By returning *TRUE* you are saying "don't load this document."

- integer **dom\_key\_down** (Gtk2::MozEmbed, Gtk2::MozEmbed::KeyEvent)

  This signal is emitted when a key is pressed down. See the DOM Level 3 specification for more details.

- integer **dom\_key\_up** (Gtk2::MozEmbed, Gtk2::MozEmbed::KeyEvent)

  This signal is emitted when a key is released. See the DOM Level 3 specification for more details.

- integer **dom\_key\_press** (Gtk2::MozEmbed, Gtk2::MozEmbed::KeyEvent)

  This signal is presumably emitted when a key is pressed and released, i.e. i.e. a combination of "dom\_key\_down" in Gtk2::MozEmbed::main and "dom\_key\_up" in Gtk2::MozEmbed::main. (Note however that it seems to also get emitted repeatedly if you hold the key down.)

- integer **dom\_mouse\_down** (Gtk2::MozEmbed, Gtk2::MozEmbed::MouseEvent)

  This signal is emitted when "a pointing device button is pressed over an element. In the case of nested elements, this event type is always targeted at the most deeply nested element." See the DOM Level 3 specification for more details.

- integer **dom\_mouse\_up** (Gtk2::MozEmbed, Gtk2::MozEmbed::MouseEvent)

  This signal is emitted when "a pointing device button is released over an element. In the case of nested elements, this event type is always targeted at the most deeply nested element. See the DOM Level 3 specification for more details.

- integer **dom\_mouse\_click** (Gtk2::MozEmbed, Gtk2::MozEmbed::MouseEvent)

  This signal is emitted when "a pointing device button is clicked over an element. The definition of a click depends on the environment configuration; i.e. may depend on the screen location or the delay between the press and release of the pointing device button. In any case, the target node must be the same between the mousedown, mouseup, and click." In other words, it's basically "dom\_mouse\_down" in Gtk2::MozEmbed::main followed quickly by "dom\_mouse\_up" in Gtk2::MozEmbed::main. See the DOM Level 3 specification for more details.

- integer **dom\_mouse\_dbl\_click** (Gtk2::MozEmbed, Gtk2::MozEmbed::MouseEvent)

  This signal is emitted when a mouse button is double clicked on an element. (The only thing I found in the DOM Level 3 specification was an example showing that two click events occur for a double click.)

- integer **dom\_mouse\_over** (Gtk2::MozEmbed, Gtk2::MozEmbed::MouseEvent)

  This signal is emitted when "a pointing device is moved onto an element. In the case of nested elements, this event type is always targeted at the most deeply nested element." See the DOM Level 3 specification for more details.

- integer **dom\_mouse\_out** (Gtk2::MozEmbed, Gtk2::MozEmbed::MouseEvent)

  This signal is emitted when "a pointing device is moved away from an element. In the case of nested elements, this event type is always targeted at the most deeply nested element." See the DOM Level 3 specification for more details.

## METHODS

### widget or undef = Gtk2::MozEmbed-\>new

This function returns a new Gtk Mozilla embedding widget. On failure it will return *undef*.

### $embed-\>append\_data ($data)

- •

  `$data` (scalar)

This function allows you to append data to an already opened stream in the widget. You need to pass in the data that you want to append to the document.

### boolean = $embed-\>can\_go\_back

This function will return whether or not you can go backwards in the document's navigation history. It will return *TRUE* if it can go backwards, *FALSE* if it can't.

### boolean = $embed-\>can\_go\_forward

This function will return whether or not you can go forwards in the document's navigation history. It will return *TRUE* if it can go forwards, *FALSE* if it can't.

### chrome = $embed-\>get\_chrome\_mask

This function gets the current chome mask for this window. Please see the documentation for Gtk2::MozEmbed::set\_chrome\_mask for the value of the return mask.

### $embed-\>set\_chrome\_mask ($flags)

- •

  `$flags` (Gtk2::MozEmbed::Chrome)

This function is used to set the chome mask for this window.

### $embed-\>close\_stream

This function closes the stream that you have been using to append data manually to the embedding widget.

### Gtk2::MozEmbed-\>set\_comp\_path ($aPath)

- •

  `$aPath` (string)

This function must be called before the first widget is created or XPCOM is initialized. It allows you to set the path to the mozilla components.

### $embed-\>go\_back

This function will go backwards one step in the document's navigation history.

### $embed-\>go\_forward

This function will go forward one step in the document's navigation history.

### string = $embed-\>get\_js\_status

This function returns the js\_status message if there is one.

### string = $embed-\>get\_link\_message

This function returns the current link message of the document if there is one.

### $embed-\>load\_url ($url)

- •

  `$url` (string)

This function starts loading a url in the embedding widget. All loads are asynchronous. The url argument should be in the form of http://www.gnome.org.

### string = $embed-\>get\_location

This function will return the current location of the document.

### $embed-\>open\_stream ($base\_uri, $mime\_type)

- •

  `$base_uri` (string)

- •

  `$mime_type` (string)

This function is used to start loading a document from an external source into the embedding widget. You need to pass in the `$base_uri` for resolving internal links and and the `$mime_type` of the document.

### Gtk2::MozEmbed-\>pop\_startup

### Gtk2::MozEmbed-\>set\_profile\_path ($aDir, $aName)

- •

  `$aDir` (string)

- •

  `$aName` (string)

### Gtk2::MozEmbed-\>push\_startup

### $embed-\>reload ($flags)

- •

  `$flags` (Gtk2::MozEmbed::Reload)

This function reloads the document. The flags argument can be used to control the behaviour of the reload.

### $embed-\>render\_data ($data, $base\_uri, $mime\_type)

- •

  `$data` (scalar)

- •

  `$base_uri` (string)

- •

  `$mime_type` (string)

This function will allow you to take a chunk of random data and render it into the document. You need to pass in the data and the length of the data. The `$base_uri` is used to resolve internal references in the document and the `$mime_type` is used to determine how to render the document internally.

### $embed-\>stop\_load

This function will allow you to stop the load of a document that is being loaded in the widget.

### string = $embed-\>get\_title

This function will get the current title for a document.

## ENUMS AND FLAGS

### flags Gtk2::MozEmbed::Chrome

- •

  'defaultchrome' / 'GTK\_MOZ\_EMBED\_FLAG\_DEFAULTCHROME'

- •

  'windowborderson' / 'GTK\_MOZ\_EMBED\_FLAG\_WINDOWBORDERSON'

- •

  'windowcloseon' / 'GTK\_MOZ\_EMBED\_FLAG\_WINDOWCLOSEON'

- •

  'windowresizeon' / 'GTK\_MOZ\_EMBED\_FLAG\_WINDOWRESIZEON'

- •

  'menubaron' / 'GTK\_MOZ\_EMBED\_FLAG\_MENUBARON'

- •

  'toolbaron' / 'GTK\_MOZ\_EMBED\_FLAG\_TOOLBARON'

- •

  'locationbaron' / 'GTK\_MOZ\_EMBED\_FLAG\_LOCATIONBARON'

- •

  'statusbaron' / 'GTK\_MOZ\_EMBED\_FLAG\_STATUSBARON'

- •

  'personaltoolbaron' / 'GTK\_MOZ\_EMBED\_FLAG\_PERSONALTOOLBARON'

- •

  'scrollbarson' / 'GTK\_MOZ\_EMBED\_FLAG\_SCROLLBARSON'

- •

  'titlebaron' / 'GTK\_MOZ\_EMBED\_FLAG\_TITLEBARON'

- •

  'extrachromeon' / 'GTK\_MOZ\_EMBED\_FLAG\_EXTRACHROMEON'

- •

  'allchrome' / 'GTK\_MOZ\_EMBED\_FLAG\_ALLCHROME'

- •

  'windowraised' / 'GTK\_MOZ\_EMBED\_FLAG\_WINDOWRAISED'

- •

  'windowlowered' / 'GTK\_MOZ\_EMBED\_FLAG\_WINDOWLOWERED'

- •

  'centerscreen' / 'GTK\_MOZ\_EMBED\_FLAG\_CENTERSCREEN'

- •

  'dependent' / 'GTK\_MOZ\_EMBED\_FLAG\_DEPENDENT'

- •

  'modal' / 'GTK\_MOZ\_EMBED\_FLAG\_MODAL'

- •

  'openasdialog' / 'GTK\_MOZ\_EMBED\_FLAG\_OPENASDIALOG'

- •

  'openaschrome' / 'GTK\_MOZ\_EMBED\_FLAG\_OPENASCHROME'

### flags Gtk2::MozEmbed::Reload

- •

  'reloadnormal' / 'GTK\_MOZ\_EMBED\_FLAG\_RELOADNORMAL'

- •

  'reloadbypasscache' / 'GTK\_MOZ\_EMBED\_FLAG\_RELOADBYPASSCACHE'

- •

  'reloadbypassproxy' / 'GTK\_MOZ\_EMBED\_FLAG\_RELOADBYPASSPROXY'

- •

  'reloadbypassproxyandcache' / 'GTK\_MOZ\_EMBED\_FLAG\_RELOADBYPASSPROXYANDCACHE'

- •

  'reloadcharset' / 'GTK\_MOZ\_EMBED\_FLAG\_RELOADCHARSETCHANGE'

## SEE ALSO

Gtk2::MozEmbed

## COPYRIGHT

Copyright (C) 2004-2008 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gtk2::MozEmbed for a full notice.
