Bug 159554 Configure with --without-x causes compile error
patch by bjt23@cornell.edu r=timeless sr=alecf
This commit is contained in:
Родитель
139a17db7e
Коммит
6fb8a15754
|
@ -936,12 +936,14 @@ NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window)
|
|||
|
||||
// fill in window info structure
|
||||
ws->type = 0; // OK, that was a guess!!
|
||||
#ifndef NO_X11
|
||||
ws->depth = gdk_window_get_visual(win)->depth;
|
||||
ws->display = GTK_XTBIN(mXtBin)->xtdisplay;
|
||||
ws->visual = GDK_VISUAL_XVISUAL(gdk_window_get_visual(win));
|
||||
ws->colormap = GDK_COLORMAP_XCOLORMAP(gdk_window_get_colormap(win));
|
||||
|
||||
XFlush(ws->display);
|
||||
#endif
|
||||
} // !window->ws_info
|
||||
|
||||
if (!mXtBin)
|
||||
|
|
|
@ -197,6 +197,7 @@ NPP_SetWindow(NPP instance, NPWindow* window)
|
|||
|
||||
ws_info = (NPSetWindowCallbackStruct *)window->ws_info;
|
||||
|
||||
#ifndef NO_X11
|
||||
if (This->window == (Window) window->window) {
|
||||
/* The page with the plugin is being resized.
|
||||
Save any UI information because the next time
|
||||
|
@ -226,6 +227,8 @@ NPP_SetWindow(NPP instance, NPWindow* window)
|
|||
makePixmap(This);
|
||||
makeWidget(This);
|
||||
}
|
||||
#endif /* #ifndef NO_X11 */
|
||||
|
||||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,9 +38,11 @@
|
|||
#include <gdk/gdkkeysyms.h>
|
||||
|
||||
/* Xlib/Xt stuff */
|
||||
#ifndef NO_X11
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/cursorfont.h>
|
||||
#endif
|
||||
|
||||
#include "npapi.h"
|
||||
#include "nullplugin.h"
|
||||
|
@ -349,6 +351,7 @@ static GdkPixmap *nullPluginGdkPixmap = 0;
|
|||
|
||||
static GdkWindow *getGdkWindow(PluginInstance *This)
|
||||
{
|
||||
#ifndef NO_X11
|
||||
GdkWindow *gdk_window;
|
||||
Window xwin = (Window) This->window;
|
||||
Widget xt_w = XtWindowToWidget(This->display, xwin);
|
||||
|
@ -362,6 +365,9 @@ static GdkWindow *getGdkWindow(PluginInstance *This)
|
|||
}
|
||||
gdk_window = gdk_window_lookup(xwin);
|
||||
return gdk_window;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -387,8 +393,10 @@ createPixmap(PluginInstance *This)
|
|||
style = gtk_widget_get_style(widget);
|
||||
nullPluginGdkPixmap = gdk_pixmap_create_from_xpm_d(gdk_window , &mask,
|
||||
&style->bg[GTK_STATE_NORMAL], npnul320_xpm);
|
||||
#ifndef NO_X11
|
||||
/* Pixmap is created on original X session but used by new session */
|
||||
XSync(GDK_DISPLAY(), False);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -404,11 +412,13 @@ drawPixmap(PluginInstance *This)
|
|||
dest_y = This->height/2 - pixmap_height/2;
|
||||
if (dest_x >= 0 && dest_y >= 0)
|
||||
{
|
||||
#ifndef NO_X11
|
||||
GC gc;
|
||||
gc = XCreateGC(This->display, This->window, 0, NULL);
|
||||
XCopyArea(This->display, GDK_WINDOW_XWINDOW(nullPluginGdkPixmap) , This->window, gc,
|
||||
0, 0, pixmap_with, pixmap_height, dest_x, dest_y);
|
||||
XFreeGC(This->display, gc);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -416,6 +426,7 @@ drawPixmap(PluginInstance *This)
|
|||
static void
|
||||
setCursor (PluginInstance *This)
|
||||
{
|
||||
#ifndef NO_X11
|
||||
static Cursor nullPluginCursor = 0;
|
||||
if (!nullPluginCursor)
|
||||
{
|
||||
|
@ -425,8 +436,10 @@ setCursor (PluginInstance *This)
|
|||
{
|
||||
XDefineCursor(This->display, This->window, nullPluginCursor);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef NO_X11
|
||||
static void
|
||||
xt_event_handler(Widget xt_w, PluginInstance *This, XEvent *xevent, Boolean *b)
|
||||
{
|
||||
|
@ -444,10 +457,12 @@ xt_event_handler(Widget xt_w, PluginInstance *This, XEvent *xevent, Boolean *b)
|
|||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
addXtEventHandler(PluginInstance *This)
|
||||
{
|
||||
#ifndef NO_X11
|
||||
Display *dpy = (Display*) This->display;
|
||||
Window xwin = (Window) This->window;
|
||||
Widget xt_w = XtWindowToWidget(dpy, xwin);
|
||||
|
@ -457,8 +472,10 @@ addXtEventHandler(PluginInstance *This)
|
|||
XSelectInput(dpy, xwin, event_mask);
|
||||
XtAddEventHandler(xt_w, event_mask, False, (XtEventHandler)xt_event_handler, This);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
makePixmap(PluginInstance *This)
|
||||
{
|
||||
|
|
|
@ -64,8 +64,10 @@ Click OK to download Plugin."
|
|||
typedef struct _PluginInstance
|
||||
{
|
||||
uint16 mode;
|
||||
#ifndef NO_X11
|
||||
Window window;
|
||||
Display *display;
|
||||
#endif
|
||||
uint32 x, y;
|
||||
uint32 width, height;
|
||||
NPMIMEType type;
|
||||
|
@ -75,8 +77,10 @@ typedef struct _PluginInstance
|
|||
char *pluginsPageUrl;
|
||||
char *pluginsFileUrl;
|
||||
NPBool pluginsHidden;
|
||||
#ifndef NO_X11
|
||||
Visual* visual;
|
||||
Colormap colormap;
|
||||
#endif
|
||||
unsigned int depth;
|
||||
GtkWidget* dialogBox;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче