зеркало из https://github.com/mozilla/gecko-dev.git
back out changes since they included a patch that happened to be in my tree
This commit is contained in:
Родитель
40aff6c1d0
Коммит
3115f445cc
|
@ -69,7 +69,6 @@ nsVoidArray *EmbedPrivate::sWindowList = nsnull;
|
|||
char *EmbedPrivate::sProfileDir = nsnull;
|
||||
char *EmbedPrivate::sProfileName = nsnull;
|
||||
nsIPref *EmbedPrivate::sPrefs = nsnull;
|
||||
GtkWidget *EmbedPrivate::sOffscreenWindow = 0;
|
||||
|
||||
EmbedPrivate::EmbedPrivate(void)
|
||||
{
|
||||
|
@ -83,7 +82,6 @@ EmbedPrivate::EmbedPrivate(void)
|
|||
mIsChrome = PR_FALSE;
|
||||
mChromeLoaded = PR_FALSE;
|
||||
mListenersAttached = PR_FALSE;
|
||||
mMozWindow = 0;
|
||||
|
||||
PushStartup();
|
||||
if (!sWindowList) {
|
||||
|
@ -101,10 +99,6 @@ EmbedPrivate::~EmbedPrivate()
|
|||
nsresult
|
||||
EmbedPrivate::Init(GtkMozEmbed *aOwningWidget)
|
||||
{
|
||||
// are we being re-initialized?
|
||||
if (mOwningWidget)
|
||||
return NS_OK;
|
||||
|
||||
// hang on with a reference to the owning widget
|
||||
mOwningWidget = aOwningWidget;
|
||||
|
||||
|
@ -160,26 +154,8 @@ EmbedPrivate::Init(GtkMozEmbed *aOwningWidget)
|
|||
}
|
||||
|
||||
nsresult
|
||||
EmbedPrivate::Realize(PRBool *aAlreadyRealized)
|
||||
EmbedPrivate::Realize(void)
|
||||
{
|
||||
|
||||
*aAlreadyRealized = PR_FALSE;
|
||||
|
||||
// create the offscreen window if we have to
|
||||
if (!sOffscreenWindow)
|
||||
CreateOffscreenWindow();
|
||||
|
||||
// Have we ever been initialized before? If so then just reparent
|
||||
// from the offscreen window.
|
||||
if (mMozWindow) {
|
||||
gdk_window_reparent(mMozWindow,
|
||||
GTK_WIDGET(mOwningWidget)->window,
|
||||
GTK_WIDGET(mOwningWidget)->allocation.x,
|
||||
GTK_WIDGET(mOwningWidget)->allocation.y);
|
||||
*aAlreadyRealized = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Get the nsIWebBrowser object for our embedded window.
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
|
@ -209,61 +185,12 @@ EmbedPrivate::Realize(PRBool *aAlreadyRealized)
|
|||
uriListener = do_QueryInterface(mContentListenerGuard);
|
||||
webBrowser->SetParentURIContentListener(uriListener);
|
||||
|
||||
// save the window id of the newly created window
|
||||
nsCOMPtr<nsIWidget> mozWidget;
|
||||
mWindow->mBaseWindow->GetMainWidget(getter_AddRefs(mozWidget));
|
||||
// get the native drawing area
|
||||
GdkWindow *tmp_window =
|
||||
NS_STATIC_CAST(GdkWindow *,
|
||||
mozWidget->GetNativeData(NS_NATIVE_WINDOW));
|
||||
// and, thanks to superwin we actually need the parent of that.
|
||||
tmp_window = gdk_window_get_parent(tmp_window);
|
||||
mMozWindow = tmp_window;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::Unrealize(void)
|
||||
{
|
||||
// move the widget to the offscreen window
|
||||
gdk_window_reparent(mMozWindow, sOffscreenWindow->window, 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::Show(void)
|
||||
{
|
||||
// Get the nsIWebBrowser object for our embedded window.
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
|
||||
// and set the visibility on the thing
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(webBrowser);
|
||||
baseWindow->SetVisibility(PR_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::Hide(void)
|
||||
{
|
||||
// Get the nsIWebBrowser object for our embedded window.
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
|
||||
// and set the visibility on the thing
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(webBrowser);
|
||||
baseWindow->SetVisibility(PR_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::Resize(PRUint32 aWidth, PRUint32 aHeight)
|
||||
{
|
||||
mWindow->SetDimensions(nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION |
|
||||
nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER,
|
||||
0, 0, aWidth, aHeight);
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::Destroy(void)
|
||||
{
|
||||
// Get the nsIWebBrowser object for our embedded window.
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
|
@ -303,8 +230,38 @@ EmbedPrivate::Destroy(void)
|
|||
mEventReceiver = nsnull;
|
||||
|
||||
mOwningWidget = nsnull;
|
||||
}
|
||||
|
||||
mMozWindow = 0;
|
||||
void
|
||||
EmbedPrivate::Show(void)
|
||||
{
|
||||
// Get the nsIWebBrowser object for our embedded window.
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
|
||||
// and set the visibility on the thing
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(webBrowser);
|
||||
baseWindow->SetVisibility(PR_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::Hide(void)
|
||||
{
|
||||
// Get the nsIWebBrowser object for our embedded window.
|
||||
nsCOMPtr<nsIWebBrowser> webBrowser;
|
||||
mWindow->GetWebBrowser(getter_AddRefs(webBrowser));
|
||||
|
||||
// and set the visibility on the thing
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(webBrowser);
|
||||
baseWindow->SetVisibility(PR_FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
EmbedPrivate::Resize(PRUint32 aWidth, PRUint32 aHeight)
|
||||
{
|
||||
mWindow->SetDimensions(nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION |
|
||||
nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER,
|
||||
0, 0, aWidth, aHeight);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -371,9 +328,6 @@ EmbedPrivate::PopStartup(void)
|
|||
sWidgetCount--;
|
||||
if (sWidgetCount == 0) {
|
||||
|
||||
// destroy the offscreen window
|
||||
DestroyOffscreenWindow();
|
||||
|
||||
// shut down the profiles
|
||||
ShutdownProfile();
|
||||
|
||||
|
@ -780,19 +734,3 @@ EmbedPrivate::ShutdownProfile(void)
|
|||
sPrefs = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
EmbedPrivate::CreateOffscreenWindow(void)
|
||||
{
|
||||
sOffscreenWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||
gtk_widget_realize(sOffscreenWindow);
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
EmbedPrivate::DestroyOffscreenWindow(void)
|
||||
{
|
||||
gtk_widget_destroy(sOffscreenWindow);
|
||||
sOffscreenWindow = 0;
|
||||
}
|
||||
|
|
|
@ -54,12 +54,11 @@ class EmbedPrivate {
|
|||
~EmbedPrivate();
|
||||
|
||||
nsresult Init (GtkMozEmbed *aOwningWidget);
|
||||
nsresult Realize (PRBool *aAlreadRealized);
|
||||
nsresult Realize (void);
|
||||
void Unrealize (void);
|
||||
void Show (void);
|
||||
void Hide (void);
|
||||
void Resize (PRUint32 aWidth, PRUint32 aHeight);
|
||||
void Destroy (void);
|
||||
void SetURI (const char *aURI);
|
||||
void LoadCurrentURI (void);
|
||||
|
||||
|
@ -140,8 +139,6 @@ class EmbedPrivate {
|
|||
PRBool mIsChrome;
|
||||
// has the chrome finished loading?
|
||||
PRBool mChromeLoaded;
|
||||
// saved window ID for reparenting later
|
||||
GdkWindow *mMozWindow;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -157,12 +154,6 @@ class EmbedPrivate {
|
|||
|
||||
static nsresult StartupProfile (void);
|
||||
static void ShutdownProfile(void);
|
||||
|
||||
// offscreen window methods and the offscreen widget
|
||||
static void CreateOffscreenWindow(void);
|
||||
static void DestroyOffscreenWindow(void);
|
||||
static GtkWidget *sOffscreenWindow;
|
||||
|
||||
};
|
||||
|
||||
#endif /* __EmbedPrivate_h */
|
||||
|
|
|
@ -431,15 +431,5 @@ EmbedWindow::OnHideTooltip(void)
|
|||
NS_IMETHODIMP
|
||||
EmbedWindow::GetInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = QueryInterface(aIID, aInstancePtr);
|
||||
|
||||
// pass it up to the web browser object
|
||||
if (NS_FAILED(rv) || !*aInstancePtr) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> ir = do_QueryInterface(mWebBrowser);
|
||||
return ir->GetInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
return rv;
|
||||
return QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
|
|
@ -69,12 +69,11 @@ class EmbedWindow : public nsIWebBrowserChrome,
|
|||
nsString mJSStatus;
|
||||
nsString mLinkMessage;
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> mBaseWindow; // [OWNER]
|
||||
|
||||
private:
|
||||
|
||||
EmbedPrivate *mOwner;
|
||||
nsCOMPtr<nsIWebBrowser> mWebBrowser; // [OWNER]
|
||||
nsCOMPtr<nsIBaseWindow> mBaseWindow; // [OWNER]
|
||||
static GtkWidget *sTipWindow;
|
||||
PRBool mVisibility;
|
||||
PRBool mIsModal;
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
#include "EmbedPrivate.h"
|
||||
#include "EmbedWindow.h"
|
||||
|
||||
// in order to create orphaned windows
|
||||
#include "gtkmozembedprivate.h"
|
||||
|
||||
EmbedWindowCreator::EmbedWindowCreator(void)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
@ -46,12 +43,6 @@ EmbedWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent,
|
|||
|
||||
GtkMozEmbed *newEmbed = nsnull;
|
||||
|
||||
// No parent? Ask via the singleton object instead.
|
||||
if (!aParent) {
|
||||
gtk_moz_embed_single_create_window(&newEmbed,
|
||||
(guint)aChromeFlags);
|
||||
}
|
||||
else {
|
||||
// Find the EmbedPrivate object for this web browser chrome object.
|
||||
EmbedPrivate *embedPrivate = EmbedPrivate::FindPrivateForBrowser(aParent);
|
||||
|
||||
|
@ -62,9 +53,6 @@ EmbedWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent,
|
|||
moz_embed_signals[NEW_WINDOW],
|
||||
&newEmbed, (guint)aChromeFlags);
|
||||
|
||||
}
|
||||
|
||||
// check to make sure that we made a new window
|
||||
if (!newEmbed)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -76,11 +64,6 @@ EmbedWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent,
|
|||
|
||||
EmbedPrivate *newEmbedPrivate = NS_STATIC_CAST(EmbedPrivate *,
|
||||
newEmbed->data);
|
||||
|
||||
// set the chrome flag on the new window if it's a chrome open
|
||||
if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)
|
||||
newEmbedPrivate->mIsChrome = PR_TRUE;
|
||||
|
||||
*_retval = NS_STATIC_CAST(nsIWebBrowserChrome *,
|
||||
(newEmbedPrivate->mWindow));
|
||||
|
||||
|
|
|
@ -192,29 +192,6 @@ typedef enum
|
|||
GTK_MOZ_EMBED_FLAG_OPENASCHROME = 2147483648U
|
||||
} GtkMozEmbedChromeFlags;
|
||||
|
||||
/* this is a singleton object that you can hook up to to get signals
|
||||
that are not handed out on a per widget basis. */
|
||||
|
||||
typedef struct _GtkMozEmbedSingle GtkMozEmbedSingle;
|
||||
typedef struct _GtkMozEmbedSingleClass GtkMozEmbedSingleClass;
|
||||
|
||||
struct _GtkMozEmbedSingle
|
||||
{
|
||||
GtkObject object;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct _GtkMozEmbedSingleClass
|
||||
{
|
||||
GtkObjectClass parent_class;
|
||||
|
||||
void (* new_window_orphan) (GtkMozEmbedSingle *embed,
|
||||
GtkMozEmbed **newEmbed,
|
||||
guint chromemask);
|
||||
};
|
||||
|
||||
GtkMozEmbedSingle *
|
||||
gtk_moz_embed_single_get(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -188,9 +188,9 @@ handle_toplevel_focus_out(GtkMozArea *aArea,
|
|||
|
||||
// globals for this type of widget
|
||||
|
||||
static GtkBinClass *embed_parent_class;
|
||||
static GtkBinClass *parent_class;
|
||||
|
||||
guint moz_embed_signals[EMBED_LAST_SIGNAL] = { 0 };
|
||||
guint moz_embed_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
// GtkObject + class-related functions
|
||||
|
||||
|
@ -230,7 +230,7 @@ gtk_moz_embed_class_init(GtkMozEmbedClass *klass)
|
|||
widget_class = GTK_WIDGET_CLASS(klass);
|
||||
object_class = GTK_OBJECT_CLASS(klass);
|
||||
|
||||
embed_parent_class = (GtkBinClass *)gtk_type_class(gtk_bin_get_type());
|
||||
parent_class = (GtkBinClass *)gtk_type_class(gtk_bin_get_type());
|
||||
|
||||
widget_class->realize = gtk_moz_embed_realize;
|
||||
widget_class->unrealize = gtk_moz_embed_unrealize;
|
||||
|
@ -240,6 +240,8 @@ gtk_moz_embed_class_init(GtkMozEmbedClass *klass)
|
|||
|
||||
object_class->destroy = gtk_moz_embed_destroy;
|
||||
|
||||
|
||||
|
||||
// set up our signals
|
||||
|
||||
moz_embed_signals[LINK_MESSAGE] =
|
||||
|
@ -413,8 +415,7 @@ gtk_moz_embed_class_init(GtkMozEmbedClass *klass)
|
|||
gtk_marshal_BOOL__POINTER,
|
||||
GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER);
|
||||
|
||||
gtk_object_class_add_signals(object_class, moz_embed_signals,
|
||||
EMBED_LAST_SIGNAL);
|
||||
gtk_object_class_add_signals(object_class, moz_embed_signals, LAST_SIGNAL);
|
||||
|
||||
}
|
||||
|
||||
|
@ -446,7 +447,6 @@ gtk_moz_embed_destroy(GtkObject *object)
|
|||
embedPrivate = (EmbedPrivate *)embed->data;
|
||||
|
||||
if (embedPrivate) {
|
||||
embedPrivate->Destroy();
|
||||
delete embedPrivate;
|
||||
embed->data = NULL;
|
||||
}
|
||||
|
@ -489,19 +489,13 @@ gtk_moz_embed_realize(GtkWidget *widget)
|
|||
widget->style = gtk_style_attach (widget->style, widget->window);
|
||||
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
|
||||
|
||||
// initialize the window
|
||||
// initialize the widget now that we have a window
|
||||
nsresult rv;
|
||||
rv = embedPrivate->Init(embed);
|
||||
g_return_if_fail(NS_SUCCEEDED(rv));
|
||||
|
||||
PRBool alreadyRealized = PR_FALSE;
|
||||
rv = embedPrivate->Realize(&alreadyRealized);
|
||||
rv = embedPrivate->Realize();
|
||||
g_return_if_fail(NS_SUCCEEDED(rv));
|
||||
|
||||
// if we're already realized we don't need to hook up to anything below
|
||||
if (alreadyRealized)
|
||||
return;
|
||||
|
||||
if (embedPrivate->mURI.Length())
|
||||
embedPrivate->LoadCurrentURI();
|
||||
|
||||
|
@ -546,8 +540,6 @@ gtk_moz_embed_unrealize(GtkWidget *widget)
|
|||
embed = GTK_MOZ_EMBED(widget);
|
||||
embedPrivate = (EmbedPrivate *)embed->data;
|
||||
|
||||
GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED);
|
||||
|
||||
if (embedPrivate) {
|
||||
embedPrivate->Unrealize();
|
||||
}
|
||||
|
@ -1039,116 +1031,3 @@ gtk_moz_embed_get_title_unichar (GtkMozEmbed *embed)
|
|||
|
||||
return retval;
|
||||
}
|
||||
|
||||
// class and instance initialization
|
||||
|
||||
GtkType
|
||||
gtk_moz_embed_single_get_type(void);
|
||||
|
||||
static void
|
||||
gtk_moz_embed_single_class_init(GtkMozEmbedSingleClass *klass);
|
||||
|
||||
static void
|
||||
gtk_moz_embed_single_init(GtkMozEmbedSingle *embed);
|
||||
|
||||
GtkMozEmbedSingle *
|
||||
gtk_moz_embed_single_new(void);
|
||||
|
||||
enum {
|
||||
NEW_WINDOW_ORPHAN,
|
||||
SINGLE_LAST_SIGNAL
|
||||
};
|
||||
|
||||
guint moz_embed_single_signals[SINGLE_LAST_SIGNAL] = { 0 };
|
||||
|
||||
// GtkObject + class-related functions
|
||||
|
||||
GtkType
|
||||
gtk_moz_embed_single_get_type(void)
|
||||
{
|
||||
static GtkType moz_embed_single_type = 0;
|
||||
if (!moz_embed_single_type)
|
||||
{
|
||||
static const GtkTypeInfo moz_embed_single_info =
|
||||
{
|
||||
"GtkMozEmbedSingle",
|
||||
sizeof(GtkMozEmbedSingle),
|
||||
sizeof(GtkMozEmbedSingleClass),
|
||||
(GtkClassInitFunc)gtk_moz_embed_single_class_init,
|
||||
(GtkObjectInitFunc)gtk_moz_embed_single_init,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
moz_embed_single_type = gtk_type_unique(GTK_TYPE_OBJECT,
|
||||
&moz_embed_single_info);
|
||||
}
|
||||
|
||||
return moz_embed_single_type;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_moz_embed_single_class_init(GtkMozEmbedSingleClass *klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
|
||||
object_class = GTK_OBJECT_CLASS(klass);
|
||||
|
||||
// set up our signals
|
||||
|
||||
moz_embed_single_signals[NEW_WINDOW_ORPHAN] =
|
||||
gtk_signal_new("new_window_orphan",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET(GtkMozEmbedSingleClass,
|
||||
new_window_orphan),
|
||||
gtk_marshal_NONE__POINTER_UINT,
|
||||
GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_UINT);
|
||||
|
||||
gtk_object_class_add_signals(object_class, moz_embed_single_signals,
|
||||
SINGLE_LAST_SIGNAL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_moz_embed_single_init(GtkMozEmbedSingle *embed)
|
||||
{
|
||||
// this is a placeholder for later in case we need to stash data at
|
||||
// a later data and maintain backwards compatibility.
|
||||
embed->data = nsnull;
|
||||
}
|
||||
|
||||
GtkMozEmbedSingle *
|
||||
gtk_moz_embed_single_new(void)
|
||||
{
|
||||
return (GtkMozEmbedSingle *)gtk_type_new(gtk_moz_embed_single_get_type());
|
||||
}
|
||||
|
||||
GtkMozEmbedSingle *
|
||||
gtk_moz_embed_single_get(void)
|
||||
{
|
||||
static GtkMozEmbedSingle *singleton_object = nsnull;
|
||||
if (!singleton_object)
|
||||
{
|
||||
singleton_object = gtk_moz_embed_single_new();
|
||||
}
|
||||
|
||||
return singleton_object;
|
||||
}
|
||||
|
||||
// our callback from the window creator service
|
||||
void
|
||||
gtk_moz_embed_single_create_window(GtkMozEmbed **aNewEmbed,
|
||||
guint aChromeFlags)
|
||||
{
|
||||
GtkMozEmbedSingle *single = gtk_moz_embed_single_get();
|
||||
|
||||
*aNewEmbed = nsnull;
|
||||
|
||||
if (!single)
|
||||
return;
|
||||
|
||||
gtk_signal_emit(GTK_OBJECT(single),
|
||||
moz_embed_single_signals[NEW_WINDOW_ORPHAN],
|
||||
aNewEmbed, aChromeFlags);
|
||||
|
||||
}
|
||||
|
|
|
@ -55,13 +55,10 @@ enum {
|
|||
DOM_MOUSE_DBL_CLICK,
|
||||
DOM_MOUSE_OVER,
|
||||
DOM_MOUSE_OUT,
|
||||
EMBED_LAST_SIGNAL
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
extern guint moz_embed_signals[EMBED_LAST_SIGNAL];
|
||||
|
||||
extern void gtk_moz_embed_single_create_window(GtkMozEmbed **aNewEmbed,
|
||||
guint aChromeFlags);
|
||||
extern guint moz_embed_signals[LAST_SIGNAL];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -30,9 +30,7 @@ REQUIRES = xpcom string dom
|
|||
|
||||
CPPSRCS = \
|
||||
TestGtkEmbed.cpp \
|
||||
TestGtkEmbedNotebook.cpp \
|
||||
TestGtkEmbedSocket.cpp \
|
||||
TestGtkEmbedChild.cpp
|
||||
TestGtkEmbedNotebook.cpp
|
||||
|
||||
SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
|
||||
|
||||
|
|
|
@ -144,11 +144,6 @@ static gint dom_mouse_over_cb (GtkMozEmbed *embed, nsIDOMMouseEvent *event,
|
|||
static gint dom_mouse_out_cb (GtkMozEmbed *embed, nsIDOMMouseEvent *event,
|
||||
TestGtkBrowser *browser);
|
||||
|
||||
// callbacks from the singleton object
|
||||
static void new_window_orphan_cb (GtkMozEmbedSingle *embed,
|
||||
GtkMozEmbed **retval, guint chromemask,
|
||||
gpointer data);
|
||||
|
||||
// some utility functions
|
||||
static void update_status_bar_text (TestGtkBrowser *browser);
|
||||
static void update_temp_message (TestGtkBrowser *browser,
|
||||
|
@ -183,20 +178,6 @@ main(int argc, char **argv)
|
|||
if (argc > 1)
|
||||
gtk_moz_embed_load_url(GTK_MOZ_EMBED(browser->mozEmbed), argv[1]);
|
||||
|
||||
// get the singleton object and hook up to its new window callback
|
||||
// so we can create orphaned windows.
|
||||
|
||||
GtkMozEmbedSingle *single;
|
||||
|
||||
single = gtk_moz_embed_single_get();
|
||||
if (!single) {
|
||||
fprintf(stderr, "Failed to get singleton embed object!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
gtk_signal_connect(GTK_OBJECT(single), "new_window_orphan",
|
||||
GTK_SIGNAL_FUNC(new_window_orphan_cb), NULL);
|
||||
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
|
@ -924,17 +905,6 @@ gint dom_mouse_out_cb (GtkMozEmbed *embed, nsIDOMMouseEvent *event,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void new_window_orphan_cb (GtkMozEmbedSingle *embed,
|
||||
GtkMozEmbed **retval, guint chromemask,
|
||||
gpointer data)
|
||||
{
|
||||
g_print("new_window_orphan_cb\n");
|
||||
g_print("chromemask is %d\n", chromemask);
|
||||
TestGtkBrowser *newBrowser = new_gtk_browser(chromemask);
|
||||
*retval = GTK_MOZ_EMBED(newBrowser->mozEmbed);
|
||||
g_print("new browser is %p\n", (void *)*retval);
|
||||
}
|
||||
|
||||
// utility functions
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче