本文整理汇总了C++中GTK_MOZ_EMBED函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_MOZ_EMBED函数的具体用法?C++ GTK_MOZ_EMBED怎么用?C++ GTK_MOZ_EMBED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_MOZ_EMBED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gtk_moz_embed_can_go_back
void WebBrowserObject::BrowserButtons(void)
{
gboolean can_go_back = gtk_moz_embed_can_go_back(GTK_MOZ_EMBED(mozilla));
gboolean can_go_forward = gtk_moz_embed_can_go_forward(GTK_MOZ_EMBED(mozilla));
gtk_widget_set_sensitive(backButton, can_go_back);
gtk_widget_set_sensitive(forwardButton, can_go_forward);
}
示例2: gtk_moz_embed_open_stream
void WebBrowserObject::BrowserData(const char *data)
{
if (data) {
gtk_moz_embed_open_stream(GTK_MOZ_EMBED(mozilla), "file://", "text/html");
gtk_moz_embed_append_data(GTK_MOZ_EMBED(mozilla), data, strlen(data));
gtk_moz_embed_close_stream(GTK_MOZ_EMBED(mozilla));
}
}
示例3: mozilla_embed_new_window
static void
mozilla_embed_new_window (GtkMozEmbed *embed,
GtkMozEmbed **newEmbed,
guint chromemask)
{
MozillaEmbed *membed = MOZILLA_EMBED (embed);
int i;
EmbedChromeMask mask = EMBED_CHROME_OPENASPOPUP;
GaleonEmbed *new_embed = NULL;
struct
{
guint chromemask;
EmbedChromeMask embed_mask;
}
conversion_map [] =
{
{ GTK_MOZ_EMBED_FLAG_DEFAULTCHROME, EMBED_CHROME_DEFAULT },
{ GTK_MOZ_EMBED_FLAG_MENUBARON, EMBED_CHROME_MENUBARON },
{ GTK_MOZ_EMBED_FLAG_TOOLBARON, EMBED_CHROME_TOOLBARON },
/* Map the bookmarks bar to the default, as otherwise _blank
* pages don't honour the gconf settings, and always have the
* bookmarks bar, which just confuses people (bug 122410) */
{ GTK_MOZ_EMBED_FLAG_PERSONALTOOLBARON, EMBED_CHROME_DEFAULT },
{ GTK_MOZ_EMBED_FLAG_STATUSBARON, EMBED_CHROME_STATUSBARON },
{ GTK_MOZ_EMBED_FLAG_WINDOWRAISED, EMBED_CHROME_WINDOWRAISED },
{ GTK_MOZ_EMBED_FLAG_WINDOWLOWERED, EMBED_CHROME_WINDOWLOWERED },
{ GTK_MOZ_EMBED_FLAG_CENTERSCREEN, EMBED_CHROME_CENTERSCREEN },
{ GTK_MOZ_EMBED_FLAG_OPENASDIALOG, EMBED_CHROME_OPENASDIALOG },
{ GTK_MOZ_EMBED_FLAG_OPENASCHROME, EMBED_CHROME_OPENASCHROME },
{ 0, EMBED_CHROME_NONE }
};
for (i = 0; conversion_map[i].chromemask != 0; i++)
{
if (chromemask & conversion_map[i].chromemask)
{
mask = (EmbedChromeMask) (mask | conversion_map[i].embed_mask);
}
}
g_signal_emit_by_name (membed, "ge_new_window", mask, &new_embed);
g_assert (new_embed != NULL);
gtk_moz_embed_set_chrome_mask (GTK_MOZ_EMBED(new_embed), chromemask);
*newEmbed = GTK_MOZ_EMBED(new_embed);
}
示例4: gtk_moz_embed_can_go_back
void
update_nav_buttons (TestGtkBrowser *browser)
{
gboolean can_go_back;
gboolean can_go_forward;
can_go_back = gtk_moz_embed_can_go_back(GTK_MOZ_EMBED(browser->mozEmbed));
can_go_forward = gtk_moz_embed_can_go_forward(GTK_MOZ_EMBED(browser->mozEmbed));
if (can_go_back)
gtk_widget_set_sensitive(browser->backButton, TRUE);
else
gtk_widget_set_sensitive(browser->backButton, FALSE);
if (can_go_forward)
gtk_widget_set_sensitive(browser->forwardButton, TRUE);
else
gtk_widget_set_sensitive(browser->forwardButton, FALSE);
}
示例5: on_save_ok_cb
void on_save_ok_cb(GtkWidget *button, OpenDialogParams *dialogParams) {
MinimoBrowser *browser = NULL;
G_CONST_RETURN gchar *filename;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialogParams->main_combo));
if (!filename || !strcmp(filename,"")) {
return ;
} else {
browser = (MinimoBrowser *) g_object_get_data(G_OBJECT(dialogParams->main_combo), "minimo");
if (!mozilla_save( GTK_MOZ_EMBED (browser->mozEmbed), (gchar *) filename, TRUE )) {
//create_dialog("Error","Save failed, did you enter a name?",0,0);
}
gtk_widget_destroy(dialogParams->main_combo);
gtk_widget_destroy(dialogParams->dialog_combo);
g_free(dialogParams);
}
return ;
}
示例6: save_image_from_popup
void save_image_from_popup(GtkWidget *menuitem, MinimoBrowser *browser)
{
gchar *href, *name, *FullPath;
FullPath= PR_GetEnv("HOME");
href = (gchar *) g_object_get_data(G_OBJECT(menuitem), "link");
if (!href) {
g_print("Could not find href to save image\n");
return;
}
name = (gchar *) g_object_get_data(G_OBJECT(menuitem), "name");
FullPath= g_strconcat(FullPath,"/downloaded_files/",NULL);
mkdir(FullPath,0755);
FullPath= g_strconcat(FullPath,name,NULL);
mozilla_save_image(GTK_MOZ_EMBED(browser->mozEmbed),href,FullPath);
g_free(FullPath);
g_free(name);
g_free(href);
return;
}
示例7: impl_load_url
static void
impl_load_url (GaleonEmbed *embed,
const char *url)
{
char *clean_url;
clean_url = gul_string_remove_outside_whitespace (url);
gtk_moz_embed_load_url (GTK_MOZ_EMBED(embed),
clean_url);
/* LOAD HACK: If we haven't loaded a url yet, remember this one,
* and flag that we are trying to load this url */
MozillaEmbed *membed = MOZILLA_EMBED (embed);
if (!membed->priv->loaded_url)
{
g_free (membed->priv->loading_url);
membed->priv->loading_url = clean_url;
/* Fake a "location" signal, so that the layer above picks up
* this url, and doesn't think there is no current url */
g_signal_emit_by_name (membed, "ge_location");
return;
}
g_free (clean_url);
return;
}
示例8: mozilla_get_content_type
extern "C" char *
mozilla_get_content_type (EphyEmbed *embed)
{
nsCOMPtr<nsIWebBrowser> browser;
gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (embed),
getter_AddRefs (browser));
NS_ENSURE_TRUE (browser, NULL);
nsCOMPtr<nsIDOMWindow> dom_window;
browser->GetContentDOMWindow (getter_AddRefs (dom_window));
NS_ENSURE_TRUE (dom_window, NULL);
nsCOMPtr<nsIDOMDocument> doc;
dom_window->GetDocument (getter_AddRefs (doc));
NS_ENSURE_TRUE (doc, NULL);
nsCOMPtr<nsIDOMNSDocument> ns_doc = do_QueryInterface (doc);
NS_ENSURE_TRUE (ns_doc, NULL);
nsresult rv;
nsString contentType;
rv = ns_doc->GetContentType (contentType);
nsCString cType;
NS_UTF16ToCString (contentType, NS_CSTRING_ENCODING_UTF8, cType);
return g_strdup (cType.get());
}
示例9: mozilla_get_doctype
extern "C" char *
mozilla_get_doctype (EphyEmbed *embed)
{
nsCOMPtr<nsIWebBrowser> browser;
gtk_moz_embed_get_nsIWebBrowser (GTK_MOZ_EMBED (embed),
getter_AddRefs (browser));
NS_ENSURE_TRUE (browser, NULL);
nsCOMPtr<nsIDOMWindow> dom_window;
browser->GetContentDOMWindow (getter_AddRefs (dom_window));
NS_ENSURE_TRUE (dom_window, NULL);
nsCOMPtr<nsIDOMDocument> doc;
dom_window->GetDocument (getter_AddRefs (doc));
NS_ENSURE_TRUE (doc, NULL);
nsCOMPtr<nsIDOMDocumentType> doctype;
doc->GetDoctype (getter_AddRefs (doctype));
NS_ENSURE_TRUE (doctype, NULL);
nsresult rv;
nsString name;
rv = doctype->GetPublicId (name);
NS_ENSURE_SUCCESS (rv, NULL);
nsCString cName;
NS_UTF16ToCString (name, NS_CSTRING_ENCODING_UTF8, cName);
return g_strdup (cName.get());
}
示例10: reload_clicked_cb
static void reload_clicked_cb (GtkButton *button, WebBrowserObject *browser)
{
gint x, y;
GdkModifierType state = (GdkModifierType)0;
gdk_window_get_pointer(NULL, &x, &y, &state);
gtk_moz_embed_reload(GTK_MOZ_EMBED(browser->mozilla), (state & GDK_SHIFT_MASK) ? GTK_MOZ_EMBED_FLAG_RELOADBYPASSCACHE : GTK_MOZ_EMBED_FLAG_RELOADNORMAL);
}
示例11: stream_clicked_cb
void
stream_clicked_cb (GtkButton *button, TestGtkBrowser *browser)
{
const char *data;
const char *data2;
data = "<html>Hi";
data2 = " there</html>\n";
g_print("stream_clicked_cb\n");
gtk_moz_embed_open_stream(GTK_MOZ_EMBED(browser->mozEmbed),
"file://", "text/html");
gtk_moz_embed_append_data(GTK_MOZ_EMBED(browser->mozEmbed),
data, strlen(data));
gtk_moz_embed_append_data(GTK_MOZ_EMBED(browser->mozEmbed),
data2, strlen(data2));
gtk_moz_embed_close_stream(GTK_MOZ_EMBED(browser->mozEmbed));
}
示例12: impl_append_data
static void
impl_append_data (GaleonEmbed *embed,
const char *data,
guint32 len)
{
gtk_moz_embed_append_data (GTK_MOZ_EMBED(embed),
data, len);
}
示例13: url_activate_cb
void
url_activate_cb (GtkEditable *widget, TestGtkBrowser *browser)
{
gchar *text = gtk_editable_get_chars(widget, 0, -1);
g_print("loading url %s\n", text);
gtk_moz_embed_load_url(GTK_MOZ_EMBED(browser->mozEmbed), text);
g_free(text);
}
示例14: Lock
void WebBrowserObject::Refresh(void)
{
Lock();
if (toplevel) {
gtk_moz_embed_reload(GTK_MOZ_EMBED(mozilla), GTK_MOZ_EMBED_FLAG_RELOADBYPASSCACHE);
}
Unlock();
}
示例15: g_print
void
menu_stream_cb (GtkMenuItem *menuitem, TestGtkBrowser *browser)
{
g_print("menu_stream_cb\n");
const char *data;
const char *data2;
data = "<html>Hi";
data2 = " <a href='foo.html'>there</a></html>\n";
g_print("stream_clicked_cb\n");
gtk_moz_embed_open_stream(GTK_MOZ_EMBED(browser->mozEmbed),
"file://", "text/html");
gtk_moz_embed_append_data(GTK_MOZ_EMBED(browser->mozEmbed),
data, strlen(data));
gtk_moz_embed_append_data(GTK_MOZ_EMBED(browser->mozEmbed),
data2, strlen(data2));
gtk_moz_embed_close_stream(GTK_MOZ_EMBED(browser->mozEmbed));
}