fix for bug 19559. fix the test plugin on linux. r=pavlov

This commit is contained in:
blizzard%redhat.com 1999-12-07 23:50:00 +00:00
Родитель 4c6d1eb90a
Коммит d87f0b4f02
4 изменённых файлов: 40 добавлений и 18 удалений

Просмотреть файл

@ -34,6 +34,8 @@ CPPSRCS = npsimple.cpp
LOCAL_INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../../public
EXTRA_DSO_LDOPTS += -L$(DIST)/lib -lgtksuperwin $(TK_LIBS)
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS)

Просмотреть файл

@ -48,6 +48,8 @@
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
#include <gtk/gtk.h>
#include <gdksuperwin.h>
#include <gtkmozbox.h>
/*------------------------------------------------------------------------------
* Windows Includes
@ -98,7 +100,8 @@ typedef struct _PlatformInstance
typedef struct _PlatformInstance
{
Window window;
GtkWidget *widget;
GtkWidget *moz_box;
GdkSuperWin *superwin;
Display * display;
uint32 x, y;
uint32 width, height;
@ -1057,7 +1060,8 @@ SimplePluginInstance::PlatformNew(void)
nsresult
SimplePluginInstance::PlatformDestroy(void)
{
gtk_widget_destroy(fPlatform.widget);
gtk_widget_destroy(fPlatform.moz_box);
fPlatform.moz_box = 0;
return NS_OK;
}
@ -1070,17 +1074,22 @@ SimplePluginInstance::PlatformDestroy(void)
nsresult
SimplePluginInstance::PlatformSetWindow(nsPluginWindow* window)
{
#ifdef NS_DEBUG
printf("SimplePluginInstance::PlatformSetWindow\n");
#endif
if (window == NULL || window->window == NULL)
return NS_ERROR_NULL_POINTER;
fPlatform.widget = (GtkWidget *)window->window;
fPlatform.superwin = (GdkSuperWin *)window->window;
fPlatform.moz_box = gtk_mozbox_new(fPlatform.superwin->bin_window);
GtkWidget *button;
button = gtk_button_new_with_label("Hello World");
gtk_layout_put(GTK_LAYOUT(fPlatform.widget), button, 0, 0);
gtk_container_add(GTK_CONTAINER(fPlatform.moz_box), button);
gtk_widget_show(button);
gtk_widget_show(fPlatform.widget);
gtk_widget_show(fPlatform.moz_box);
return NS_OK;
}

Просмотреть файл

@ -34,6 +34,8 @@ CPPSRCS = npsimple.cpp
LOCAL_INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../../public
EXTRA_DSO_LDOPTS += -L$(DIST)/lib -lgtksuperwin $(TK_LIBS)
include $(topsrcdir)/config/rules.mk
CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS)

Просмотреть файл

@ -48,6 +48,8 @@
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
#include <gtk/gtk.h>
#include <gdksuperwin.h>
#include <gtkmozbox.h>
/*------------------------------------------------------------------------------
* Windows Includes
@ -98,7 +100,8 @@ typedef struct _PlatformInstance
typedef struct _PlatformInstance
{
Window window;
GtkWidget *widget;
GtkWidget *moz_box;
GdkSuperWin *superwin;
Display * display;
uint32 x, y;
uint32 width, height;
@ -1057,7 +1060,8 @@ SimplePluginInstance::PlatformNew(void)
nsresult
SimplePluginInstance::PlatformDestroy(void)
{
gtk_widget_destroy(fPlatform.widget);
gtk_widget_destroy(fPlatform.moz_box);
fPlatform.moz_box = 0;
return NS_OK;
}
@ -1070,17 +1074,22 @@ SimplePluginInstance::PlatformDestroy(void)
nsresult
SimplePluginInstance::PlatformSetWindow(nsPluginWindow* window)
{
#ifdef NS_DEBUG
printf("SimplePluginInstance::PlatformSetWindow\n");
#endif
if (window == NULL || window->window == NULL)
return NS_ERROR_NULL_POINTER;
fPlatform.widget = (GtkWidget *)window->window;
fPlatform.superwin = (GdkSuperWin *)window->window;
fPlatform.moz_box = gtk_mozbox_new(fPlatform.superwin->bin_window);
GtkWidget *button;
button = gtk_button_new_with_label("Hello World");
gtk_layout_put(GTK_LAYOUT(fPlatform.widget), button, 0, 0);
gtk_container_add(GTK_CONTAINER(fPlatform.moz_box), button);
gtk_widget_show(button);
gtk_widget_show(fPlatform.widget);
gtk_widget_show(fPlatform.moz_box);
return NS_OK;
}