NanoX modificati
NanoX modifications git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14331 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -122,7 +122,7 @@ public:
|
||||
|
||||
protected:
|
||||
bool CreateFromXpm(const char **bits);
|
||||
bool CreateFromImage(const wxImage& image, int depth);
|
||||
bool CreateFromImage(const wxImage& image, int depth = -1);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||
|
@@ -2,13 +2,21 @@
|
||||
* Xlib compatibility
|
||||
*/
|
||||
|
||||
#include "XtoNX.h"
|
||||
#ifndef _DUMMY_XLIBH_
|
||||
#define _DUMMY_XLIBH_
|
||||
|
||||
#include <XtoNX.h>
|
||||
|
||||
/* Data types */
|
||||
|
||||
typedef GR_PALETTE Colormap;
|
||||
typedef GR_PALETTE* Colormap;
|
||||
typedef GR_DRAW_ID Drawable ;
|
||||
typedef int Status;
|
||||
typedef unsigned long VisualID;
|
||||
typedef int Bool;
|
||||
typedef long XID;
|
||||
typedef XID KeySym;
|
||||
/* typedef unsigned long Time; */
|
||||
|
||||
#define Success 0
|
||||
#define GrabSuccess Success
|
||||
@@ -18,6 +26,99 @@ typedef int Status;
|
||||
#define IsUnmapped 0
|
||||
#define IsUnviewable 1
|
||||
#define IsViewable 2
|
||||
/* Is this right? */
|
||||
#define PropertyChangeMask GR_EVENT_MASK_SELECTION_CHANGED
|
||||
#define GraphicsExpose GR_EVENT_TYPE_EXPOSURE
|
||||
#define GraphicsExposeMask GR_EVENT_MASK_EXPOSURE
|
||||
|
||||
#define XSynchronize(display,sync)
|
||||
#define XDefaultRootWindow(d) GR_ROOT_WINDOW_ID
|
||||
#define XFreePixmap(d, p) GrDestroyWindow(p)
|
||||
#define XFreeCursor(d, c) GrDestroyCursor(c)
|
||||
#define DefaultVisual(d, s) ((Visual*) NULL)
|
||||
|
||||
/* These defines are wrongly defined in XtoNX.h, IMHO,
|
||||
* since they reference a static global.
|
||||
* Redefined as functions, below.
|
||||
*/
|
||||
|
||||
#undef DisplayWidth
|
||||
#undef DisplayHeight
|
||||
#undef DefaultDepth
|
||||
|
||||
/*
|
||||
* Data structure used by color operations
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned long pixel;
|
||||
unsigned short red, green, blue;
|
||||
char flags; /* do_red, do_green, do_blue */
|
||||
char pad;
|
||||
} XColor;
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
Display *display; /* Display the event was read from */
|
||||
XID resourceid; /* resource id */
|
||||
unsigned long serial; /* serial number of failed request */
|
||||
unsigned char error_code; /* error code of failed request */
|
||||
unsigned char request_code; /* Major op-code of failed request */
|
||||
unsigned char minor_code; /* Minor op-code of failed request */
|
||||
} XErrorEvent;
|
||||
|
||||
/*
|
||||
* Visual structure; contains information about colormapping possible.
|
||||
*/
|
||||
typedef struct {
|
||||
void *ext_data; /* hook for extension to hang data */
|
||||
VisualID visualid; /* visual id of this visual */
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
int c_class; /* C++ class of screen (monochrome, etc.) */
|
||||
#else
|
||||
int class; /* class of screen (monochrome, etc.) */
|
||||
#endif
|
||||
unsigned long red_mask, green_mask, blue_mask; /* mask values */
|
||||
int bits_per_rgb; /* log base 2 of distinct color values */
|
||||
int map_entries; /* color map entries */
|
||||
} Visual;
|
||||
|
||||
/*
|
||||
* Depth structure; contains information for each possible depth.
|
||||
*/
|
||||
typedef struct {
|
||||
int depth; /* this depth (Z) of the depth */
|
||||
int nvisuals; /* number of Visual types at this depth */
|
||||
Visual *visuals; /* list of visuals possible at this depth */
|
||||
} Depth;
|
||||
|
||||
/*
|
||||
* Information about the screen. The contents of this structure are
|
||||
* implementation dependent. A Screen should be treated as opaque
|
||||
* by application code.
|
||||
*/
|
||||
|
||||
struct _XDisplay; /* Forward declare before use for C++ */
|
||||
|
||||
typedef struct {
|
||||
void *ext_data; /* hook for extension to hang data */
|
||||
struct _XDisplay *display;/* back pointer to display structure */
|
||||
Window root; /* Root window id. */
|
||||
int width, height; /* width and height of screen */
|
||||
int mwidth, mheight; /* width and height of in millimeters */
|
||||
int ndepths; /* number of depths possible */
|
||||
Depth *depths; /* list of allowable depths on the screen */
|
||||
int root_depth; /* bits per pixel */
|
||||
Visual *root_visual; /* root visual */
|
||||
GC default_gc; /* GC for the root root visual */
|
||||
Colormap cmap; /* default color map */
|
||||
unsigned long white_pixel;
|
||||
unsigned long black_pixel; /* White and Black pixel values */
|
||||
int max_maps, min_maps; /* max and min color maps */
|
||||
int backing_store; /* Never, WhenMapped, Always */
|
||||
Bool save_unders;
|
||||
long root_input_mask; /* initial root input mask */
|
||||
} Screen;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int x, y; /* location of window */
|
||||
@@ -26,7 +127,7 @@ typedef struct {
|
||||
int depth; /* depth of window */
|
||||
Visual *visual; /* the associated visual structure */
|
||||
Window root; /* root of screen containing window */
|
||||
int class; /* InputOutput, InputOnly*/
|
||||
int _class; /* InputOutput, InputOnly*/
|
||||
int bit_gravity; /* one of the bit gravity values */
|
||||
int win_gravity; /* one of the window gravity values */
|
||||
int backing_store; /* NotUseful, WhenMapped, Always */
|
||||
@@ -43,6 +144,11 @@ typedef struct {
|
||||
Screen *screen; /* back pointer to correct screen */
|
||||
} XWindowAttributes;
|
||||
|
||||
typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */
|
||||
Display* /* display */,
|
||||
XErrorEvent* /* error_event */
|
||||
);
|
||||
|
||||
/* events*/
|
||||
|
||||
/* What should this be? */
|
||||
@@ -69,7 +175,7 @@ typedef struct {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Colormap DefaultColormapOfScreen(Screen /* screen */) ;
|
||||
Colormap DefaultColormapOfScreen(Screen* /* screen */) ;
|
||||
int XSetGraphicsExposures( Display* /* display */, GC /* gc */, Bool /* graphics_exposures */) ;
|
||||
int XWarpPointer( Display* /* display */, Window /* srcW */, Window /* srcW */,
|
||||
int /* srcX */, int /* srcY */,
|
||||
@@ -90,9 +196,23 @@ int XCopyPlane(Display* /* display */, Drawable src, Drawable dest, GC gc,
|
||||
int src_x, int src_y, unsigned int width, unsigned int height,
|
||||
int dest_x, int dest_y, unsigned long /* plane */) ;
|
||||
|
||||
XErrorHandler XSetErrorHandler (XErrorHandler /* handler */);
|
||||
Display *XOpenDisplay(const char *name);
|
||||
Screen *XScreenOfDisplay(Display* /* display */,
|
||||
int /* screen_number */);
|
||||
int DisplayWidth(Display* /* display */, int /* screen */);
|
||||
int DisplayHeight(Display* /* display */, int /* screen */);
|
||||
int DefaultDepth(Display* /* display */, int /* screen */);
|
||||
int XAllocColor(Display* /* display */, Colormap /* cmap */,
|
||||
XColor* color);
|
||||
int XParseColor(Display* display, Colormap cmap,
|
||||
const char* cname, XColor* color);
|
||||
|
||||
#ifdef __cpluplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define XGetMaxRequestSize(display) 16384
|
||||
#define XMaxRequestSize(display) 16384
|
||||
|
||||
#endif
|
||||
/* _DUMMY_XLIBH_ */
|
||||
|
@@ -65,5 +65,23 @@ wxString wxGetXEventName(XEvent& event);
|
||||
// Is the window visible?
|
||||
bool wxWindowIsVisible(Window win);
|
||||
|
||||
#if wxUSE_NANOX
|
||||
#define XEventGetWindow(event) event->general.wid
|
||||
#define XConfigureEventGetWidth(event) ((int) event->update.width)
|
||||
#define XConfigureEventGetHeight(event) ((int) event->update.height)
|
||||
#define XExposeEventGetX(event) event->exposure.x
|
||||
#define XExposeEventGetY(event) event->exposure.y
|
||||
#define XExposeEventGetWidth(event) event->exposure.width
|
||||
#define XExposeEventGetHeight(event) event->exposure.height
|
||||
#else
|
||||
#define XEventGetWindow(event) event->xany.window
|
||||
#define XConfigureEventGetWidth(event) event->xconfigure.width
|
||||
#define XConfigureEventGetHeight(event) event->xconfigure.height
|
||||
#define XExposeEventGetX(event) event->xexpose.x
|
||||
#define XExposeEventGetY(event) event->xexpose.y
|
||||
#define XExposeEventGetWidth(event) event->xexpose.width
|
||||
#define XExposeEventGetHeight(event) event->xexpose.height
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_PRIVX_H_
|
||||
|
Reference in New Issue
Block a user