diff options
author | CEST 2000 lupus <lupus@debian.org> | 2000-05-23 10:26:25 +0000 |
---|---|---|
committer | Paolo Molaro <lupus@src.gnome.org> | 2000-05-23 10:26:25 +0000 |
commit | a357ab820a415502245fa4669a6400cd1194be89 (patch) | |
tree | 3c50a6b82ec7ac8131db9b5034fef12d6f82c50d /gdk/nanox | |
parent | 1839240c72e086443e6e0e339b38fafb05a6a973 (diff) | |
download | gdk-pixbuf-a357ab820a415502245fa4669a6400cd1194be89.tar.gz |
add missing header files.
Tue May 23 12:25:07 CEST 2000 lupus <lupus@debian.org>
* gdk/nanox/*.h: add missing header files.
Diffstat (limited to 'gdk/nanox')
-rw-r--r-- | gdk/nanox/gdkinputprivate.h | 230 | ||||
-rw-r--r-- | gdk/nanox/gdkpoly-generic.h | 291 | ||||
-rw-r--r-- | gdk/nanox/gdkprivate-nanox.h | 178 | ||||
-rw-r--r-- | gdk/nanox/gdkregion-generic.h | 167 |
4 files changed, 866 insertions, 0 deletions
diff --git a/gdk/nanox/gdkinputprivate.h b/gdk/nanox/gdkinputprivate.h new file mode 100644 index 000000000..fb207d6d7 --- /dev/null +++ b/gdk/nanox/gdkinputprivate.h @@ -0,0 +1,230 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GDK_INPUTPRIVATE_H__ +#define __GDK_INPUTPRIVATE_H__ + +#include "config.h" +#include "gdkinput.h" +#include "gdkevents.h" + +typedef struct _GdkAxisInfo GdkAxisInfo; +typedef struct _GdkInputVTable GdkInputVTable; +typedef struct _GdkDevicePrivate GdkDevicePrivate; +typedef struct _GdkInputWindow GdkInputWindow; + +/* ugly stuff to get compilation going... */ +typedef void * XEvent; +typedef void * XConfigureEvent; +typedef void * XCrossingEvent; +typedef void * XDevice; +typedef void * XEventClass; +typedef void * Display; +typedef guint Window; + +struct _GdkInputVTable { + gint (*set_mode) (guint32 deviceid, GdkInputMode mode); + void (*set_axes) (guint32 deviceid, GdkAxisUse *axes); + void (*set_key) (guint32 deviceid, + guint index, + guint keyval, + GdkModifierType modifiers); + + GdkTimeCoord* (*motion_events) (GdkWindow *window, + guint32 deviceid, + guint32 start, + guint32 stop, + gint *nevents_return); + void (*get_pointer) (GdkWindow *window, + guint32 deviceid, + gdouble *x, + gdouble *y, + gdouble *pressure, + gdouble *xtilt, + gdouble *ytilt, + GdkModifierType *mask); + gint (*grab_pointer) (GdkWindow * window, + gint owner_events, + GdkEventMask event_mask, + GdkWindow * confine_to, + guint32 time); + void (*ungrab_pointer) (guint32 time); + + void (*configure_event) (XConfigureEvent *xevent, GdkWindow *window); + void (*enter_event) (XCrossingEvent *xevent, GdkWindow *window); + gint (*other_event) (GdkEvent *event, XEvent *xevent, GdkWindow *window); + /* Handle an unidentified event. Returns TRUE if handled, FALSE + otherwise */ + gint (*window_none_event) (GdkEvent *event, XEvent *xevent); + gint (*enable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev); + gint (*disable_window) (GdkWindow *window, GdkDevicePrivate *gdkdev); +}; + +/* information about a device axis */ +struct _GdkAxisInfo +{ + /* reported x resolution */ + gint xresolution; + + /* reported x minimum/maximum values */ + gint xmin_value, xmax_value; + + /* calibrated resolution (for aspect ration) - only relative values + between axes used */ + gint resolution; + + /* calibrated minimum/maximum values */ + gint min_value, max_value; +}; + +#define GDK_INPUT_NUM_EVENTC 6 + +struct _GdkDevicePrivate { + GdkDeviceInfo info; + +#ifndef XINPUT_NONE + /* information about the axes */ + GdkAxisInfo *axes; + + /* reverse lookup on axis use type */ + gint axis_for_use[GDK_AXIS_LAST]; + + /* Information about XInput device */ + XDevice *xdevice; + + /* minimum key code for device */ + gint min_keycode; + + int buttonpress_type, buttonrelease_type, keypress_type, + keyrelease_type, motionnotify_type, proximityin_type, + proximityout_type, changenotify_type; + + /* true if we need to select a different set of events, but + can't because this is the core pointer */ + gint needs_update; + + /* Mask of buttons (used for button grabs) */ + gint button_state; + + /* true if we've claimed the device as active. (used only for XINPUT_GXI) */ + gint claimed; +#endif /* !XINPUT_NONE */ +}; + +struct _GdkInputWindow +{ + /* gdk window */ + GdkWindow *window; + + /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */ + GdkExtensionMode mode; + + /* position relative to root window */ + gint16 root_x; + gint16 root_y; + + /* rectangles relative to window of windows obscuring this one */ + GdkRectangle *obscuring; + gint num_obscuring; + + /* Is there a pointer grab for this window ? */ + gint grabbed; +}; + +/* Global data */ + +extern const GdkDeviceInfo gdk_input_core_info; +extern GList *gdk_input_devices; +extern GList *gdk_input_windows; + +extern GdkInputVTable gdk_input_vtable; +/* information about network port and host for gxid daemon */ +extern gchar *gdk_input_gxid_host; +extern gint gdk_input_gxid_port; +extern gint gdk_input_ignore_core; + +/* Function declarations */ + +GdkDevicePrivate * gdk_input_find_device (guint32 id); +GdkInputWindow * gdk_input_window_find (GdkWindow *window); +void gdk_input_window_destroy (GdkWindow *window); +void gdk_input_init (void); +void gdk_input_exit (void); +gint gdk_input_enable_window (GdkWindow *window, + GdkDevicePrivate *gdkdev); +gint gdk_input_disable_window (GdkWindow *window, + GdkDevicePrivate *gdkdev); + +#ifndef XINPUT_NONE + +#define GDK_MAX_DEVICE_CLASSES 13 + +gint gdk_input_common_init (gint include_core); +void gdk_input_get_root_relative_geometry (Display *dpy, + Window w, + int *x_ret, + int *y_ret, + int *width_ret, + int *height_ret); +void gdk_input_common_find_events (GdkWindow *window, + GdkDevicePrivate *gdkdev, + gint mask, + XEventClass *classes, + int *num_classes); +void gdk_input_common_select_events (GdkWindow *window, + GdkDevicePrivate *gdkdev); +gint gdk_input_common_other_event (GdkEvent *event, + XEvent *xevent, + GdkInputWindow *input_window, + GdkDevicePrivate *gdkdev); +void gdk_input_common_get_pointer (GdkWindow *window, + guint32 deviceid, + gdouble *x, + gdouble *y, + gdouble *pressure, + gdouble *xtilt, + gdouble *ytilt, + GdkModifierType *mask); +void gdk_input_common_set_key (guint32 deviceid, + guint index, + guint keyval, + GdkModifierType modifiers); +void gdk_input_common_set_axes (guint32 deviceid, + GdkAxisUse *axes); +GdkTimeCoord * gdk_input_common_motion_events (GdkWindow *window, + guint32 deviceid, + guint32 start, + guint32 stop, + gint *nevents_return); + +#endif /* !XINPUT_NONE */ + +GdkDevicePrivate *gdk_input_find_device (guint32 id); +GdkInputWindow *gdk_input_window_find (GdkWindow *window); +void gdk_input_window_destroy (GdkWindow *window); +void gdk_input_exit (void); + +#endif /* __GDK_INPUTPRIVATE_H__ */ diff --git a/gdk/nanox/gdkpoly-generic.h b/gdk/nanox/gdkpoly-generic.h new file mode 100644 index 000000000..660c689ad --- /dev/null +++ b/gdk/nanox/gdkpoly-generic.h @@ -0,0 +1,291 @@ +/* $TOG: poly.h /main/5 1998/02/06 17:47:27 kaleb $ */ +/************************************************************************ + +Copyright 1987, 1998 The Open Group + +All Rights Reserved. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +************************************************************************/ + +/* + * This file contains a few macros to help track + * the edge of a filled object. The object is assumed + * to be filled in scanline order, and thus the + * algorithm used is an extension of Bresenham's line + * drawing algorithm which assumes that y is always the + * major axis. + * Since these pieces of code are the same for any filled shape, + * it is more convenient to gather the library in one + * place, but since these pieces of code are also in + * the inner loops of output primitives, procedure call + * overhead is out of the question. + * See the author for a derivation if needed. + */ + + +/* + * In scan converting polygons, we want to choose those pixels + * which are inside the polygon. Thus, we add .5 to the starting + * x coordinate for both left and right edges. Now we choose the + * first pixel which is inside the pgon for the left edge and the + * first pixel which is outside the pgon for the right edge. + * Draw the left pixel, but not the right. + * + * How to add .5 to the starting x coordinate: + * If the edge is moving to the right, then subtract dy from the + * error term from the general form of the algorithm. + * If the edge is moving to the left, then add dy to the error term. + * + * The reason for the difference between edges moving to the left + * and edges moving to the right is simple: If an edge is moving + * to the right, then we want the algorithm to flip immediately. + * If it is moving to the left, then we don't want it to flip until + * we traverse an entire pixel. + */ +#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2) { \ + int dx; /* local storage */ \ +\ + /* \ + * if the edge is horizontal, then it is ignored \ + * and assumed not to be processed. Otherwise, do this stuff. \ + */ \ + if ((dy) != 0) { \ + xStart = (x1); \ + dx = (x2) - xStart; \ + if (dx < 0) { \ + m = dx / (dy); \ + m1 = m - 1; \ + incr1 = -2 * dx + 2 * (dy) * m1; \ + incr2 = -2 * dx + 2 * (dy) * m; \ + d = 2 * m * (dy) - 2 * dx - 2 * (dy); \ + } else { \ + m = dx / (dy); \ + m1 = m + 1; \ + incr1 = 2 * dx - 2 * (dy) * m1; \ + incr2 = 2 * dx - 2 * (dy) * m; \ + d = -2 * m * (dy) + 2 * dx; \ + } \ + } \ +} + +#define BRESINCRPGON(d, minval, m, m1, incr1, incr2) { \ + if (m1 > 0) { \ + if (d > 0) { \ + minval += m1; \ + d += incr1; \ + } \ + else { \ + minval += m; \ + d += incr2; \ + } \ + } else {\ + if (d >= 0) { \ + minval += m1; \ + d += incr1; \ + } \ + else { \ + minval += m; \ + d += incr2; \ + } \ + } \ +} + + +/* + * This structure contains all of the information needed + * to run the bresenham algorithm. + * The variables may be hardcoded into the declarations + * instead of using this structure to make use of + * register declarations. + */ +typedef struct { + int minor_axis; /* minor axis */ + int d; /* decision variable */ + int m, m1; /* slope and slope+1 */ + int incr1, incr2; /* error increments */ +} BRESINFO; + + +#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres) \ + BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \ + bres.m, bres.m1, bres.incr1, bres.incr2) + +#define BRESINCRPGONSTRUCT(bres) \ + BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2) + + + +/* + * These are the data structures needed to scan + * convert regions. Two different scan conversion + * methods are available -- the even-odd method, and + * the winding number method. + * The even-odd rule states that a point is inside + * the polygon if a ray drawn from that point in any + * direction will pass through an odd number of + * path segments. + * By the winding number rule, a point is decided + * to be inside the polygon if a ray drawn from that + * point in any direction passes through a different + * number of clockwise and counter-clockwise path + * segments. + * + * These data structures are adapted somewhat from + * the algorithm in (Foley/Van Dam) for scan converting + * polygons. + * The basic algorithm is to start at the top (smallest y) + * of the polygon, stepping down to the bottom of + * the polygon by incrementing the y coordinate. We + * keep a list of edges which the current scanline crosses, + * sorted by x. This list is called the Active Edge Table (AET) + * As we change the y-coordinate, we update each entry in + * in the active edge table to reflect the edges new xcoord. + * This list must be sorted at each scanline in case + * two edges intersect. + * We also keep a data structure known as the Edge Table (ET), + * which keeps track of all the edges which the current + * scanline has not yet reached. The ET is basically a + * list of ScanLineList structures containing a list of + * edges which are entered at a given scanline. There is one + * ScanLineList per scanline at which an edge is entered. + * When we enter a new edge, we move it from the ET to the AET. + * + * From the AET, we can implement the even-odd rule as in + * (Foley/Van Dam). + * The winding number rule is a little trickier. We also + * keep the EdgeTableEntries in the AET linked by the + * nextWETE (winding EdgeTableEntry) link. This allows + * the edges to be linked just as before for updating + * purposes, but only uses the edges linked by the nextWETE + * link as edges representing spans of the polygon to + * drawn (as with the even-odd rule). + */ + +/* + * for the winding number rule + */ +#define CLOCKWISE 1 +#define COUNTERCLOCKWISE -1 + +typedef struct _EdgeTableEntry { + int ymax; /* ycoord at which we exit this edge. */ + BRESINFO bres; /* Bresenham info to run the edge */ + struct _EdgeTableEntry *next; /* next in the list */ + struct _EdgeTableEntry *back; /* for insertion sort */ + struct _EdgeTableEntry *nextWETE; /* for winding num rule */ + int ClockWise; /* flag for winding number rule */ +} EdgeTableEntry; + + +typedef struct _ScanLineList{ + int scanline; /* the scanline represented */ + EdgeTableEntry *edgelist; /* header node */ + struct _ScanLineList *next; /* next in the list */ +} ScanLineList; + + +typedef struct { + int ymax; /* ymax for the polygon */ + int ymin; /* ymin for the polygon */ + ScanLineList scanlines; /* header node */ +} EdgeTable; + + +/* + * Here is a struct to help with storage allocation + * so we can allocate a big chunk at a time, and then take + * pieces from this heap when we need to. + */ +#define SLLSPERBLOCK 25 + +typedef struct _ScanLineListBlock { + ScanLineList SLLs[SLLSPERBLOCK]; + struct _ScanLineListBlock *next; +} ScanLineListBlock; + + + +/* + * + * a few macros for the inner loops of the fill code where + * performance considerations don't allow a procedure call. + * + * Evaluate the given edge at the given scanline. + * If the edge has expired, then we leave it and fix up + * the active edge table; otherwise, we increment the + * x value to be ready for the next scanline. + * The winding number rule is in effect, so we must notify + * the caller when the edge has been removed so he + * can reorder the Winding Active Edge Table. + */ +#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET) { \ + if (pAET->ymax == y) { /* leaving this edge */ \ + pPrevAET->next = pAET->next; \ + pAET = pPrevAET->next; \ + fixWAET = 1; \ + if (pAET) \ + pAET->back = pPrevAET; \ + } \ + else { \ + BRESINCRPGONSTRUCT(pAET->bres); \ + pPrevAET = pAET; \ + pAET = pAET->next; \ + } \ +} + + +/* + * Evaluate the given edge at the given scanline. + * If the edge has expired, then we leave it and fix up + * the active edge table; otherwise, we increment the + * x value to be ready for the next scanline. + * The even-odd rule is in effect. + */ +#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y) { \ + if (pAET->ymax == y) { /* leaving this edge */ \ + pPrevAET->next = pAET->next; \ + pAET = pPrevAET->next; \ + if (pAET) \ + pAET->back = pPrevAET; \ + } \ + else { \ + BRESINCRPGONSTRUCT(pAET->bres); \ + pPrevAET = pAET; \ + pAET = pAET->next; \ + } \ +} diff --git a/gdk/nanox/gdkprivate-nanox.h b/gdk/nanox/gdkprivate-nanox.h new file mode 100644 index 000000000..ffcd1edba --- /dev/null +++ b/gdk/nanox/gdkprivate-nanox.h @@ -0,0 +1,178 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GDK_NANOX_H__ +#define __GDK_NANOX_H__ + +#include <microwin/nano-X.h> + +#include <gdk/gdkfont.h> +#include <gdk/gdkprivate.h> +#include <gdk/gdkcursor.h> + +typedef struct _GdkGCXData GdkGCXData; +typedef struct _GdkDrawableXData GdkDrawableXData; +typedef struct _GdkColormapPrivateX GdkColormapPrivateX; +typedef struct _GdkCursorPrivate GdkCursorPrivate; +typedef struct _GdkFontPrivateX GdkFontPrivateX; +typedef struct _GdkImagePrivateX GdkImagePrivateX; +typedef struct _GdkVisualPrivate GdkVisualPrivate; +typedef struct _GdkRegionPrivate GdkRegionPrivate; + +#define GDK_DRAWABLE_XDATA(win) ((GdkDrawableXData *)(((GdkDrawablePrivate*)(win))->klass_data)) +#define GDK_GC_XDATA(gc) ((GdkGCXData *)(((GdkGCPrivate*)(gc))->klass_data)) + +struct _GdkGCXData +{ + GR_GC_ID xgc; +}; + +struct _GdkDrawableXData +{ + GR_WINDOW_ID xid; +}; + +struct _GdkCursorPrivate +{ + GdkCursor cursor; + int width, height; + int hotx, hoty; + GR_COLOR fg, bg; + GR_BITMAP *fgb; + GR_BITMAP *bgb; +}; + +struct _GdkFontPrivateX +{ + GdkFontPrivate base; + GR_FONTID xfont; +}; + +struct _GdkVisualPrivate +{ + GdkVisual visual; +}; + +struct _GdkColormapPrivateX +{ + GdkColormapPrivate base; + +}; + +struct _GdkImagePrivateX +{ + GdkImagePrivate base; + + gpointer x_shm_info; +}; + +struct _GdkRegionPrivate +{ + /*GdkRegion region;*/ + MWCLIPREGION* xregion; +}; + +GdkGC * _gdk_nanox_gc_new (GdkDrawable *drawable, + GdkGCValues *values, + GdkGCValuesMask values_mask); +void gdk_xid_table_insert (guint *xid, + gpointer data); +void gdk_xid_table_remove (guint xid); +gpointer gdk_xid_table_lookup (guint xid); +/* +gint gdk_send_xevent (Window window, + gboolean propagate, + glong event_mask, + XEvent *event_send); +GdkColormap * gdk_colormap_lookup (Colormap xcolormap); +GdkVisual * gdk_visual_lookup (Visual *xvisual); +*/ +/* Please see gdkwindow.c for comments on how to use */ +/*Window gdk_window_xid_at (Window base, + gint bx, + gint by, + gint x, + gint y, + GList *excludes, + gboolean excl_child); +Window gdk_window_xid_at_coords (gint x, + gint y, + GList *excludes, + gboolean excl_child); +*/ + +extern GdkDrawableClass _gdk_nanox_drawable_class; +extern gboolean gdk_use_xshm; +extern gchar *gdk_display_name; +extern GR_WINDOW_ID gdk_root_window; +extern GR_WINDOW_ID gdk_leader_window; +/*extern Atom gdk_wm_delete_window; +extern Atom gdk_wm_take_focus; +extern Atom gdk_wm_protocols; +extern Atom gdk_wm_window_protocols[];*/ +extern guint gdk_selection_property; +extern GdkWindow *selection_owner[]; +extern gchar *gdk_progclass; +extern gboolean gdk_null_window_warnings; +extern const int gdk_nevent_masks; +extern const int gdk_event_mask_table[]; + +extern GdkWindowPrivate *gdk_xgrab_window; /* Window that currently holds the + * x pointer grab + */ + +#define GDK_ROOT_WINDOW() gdk_root_window +#define GDK_ROOT_PARENT() ((GdkWindow *)&gdk_parent_root) +#define GDK_DISPLAY() NULL +#define GDK_DRAWABLE_XDISPLAY(win) NULL +#define GDK_DRAWABLE_XID(win) (GDK_DRAWABLE_XDATA(win)->xid) +#define GDK_IMAGE_XDISPLAY(image) NULL +#define GDK_IMAGE_XIMAGE(image) (((GdkImagePrivate*) image)->ximage) +#define GDK_GC_XDISPLAY(gc) NULL +#define GDK_GC_XGC(gc) (GDK_GC_XDATA(gc)->xgc) +#define GDK_COLORMAP_XDISPLAY(cmap) NULL +#define GDK_COLORMAP_XCOLORMAP(cmap) (((GdkColormapPrivateX *)cmap)->xcolormap) +#define GDK_VISUAL_XVISUAL(vis) (((GdkVisualPrivate*) vis)->xvisual) +#define GDK_FONT_XDISPLAY(font) NULL +#define GDK_FONT_XFONT(font) (((GdkFontPrivateX *)font)->xfont) + +#define GDK_WINDOW_XWINDOW GDK_DRAWABLE_XID +#define GDK_WINDOW_XDISPLAY GDK_DRAWABLE_XDISPLAY + +/*GdkVisual* gdkx_visual_get (VisualID xvisualid);*/ +/* XXX: Do not use this function until it is fixed. An X Colormap + * is useless unless we also have the visual. */ +/*GdkColormap* gdkx_colormap_get (Colormap xcolormap);*/ +/* Utility function in gdk.c - not sure where it belongs, but it's + needed in more than one place, so make it public */ +/*Window gdk_get_client_window (Display *dpy, + Window win);*/ + +/* Functions to create pixmaps and windows from their X equivalents */ +/*GdkPixmap *gdk_pixmap_foreign_new (guint32 anid); +GdkWindow *gdk_window_foreign_new (guint32 anid);*/ + +#endif /* __GDK_NANOX_H__ */ diff --git a/gdk/nanox/gdkregion-generic.h b/gdk/nanox/gdkregion-generic.h new file mode 100644 index 000000000..659d44eb4 --- /dev/null +++ b/gdk/nanox/gdkregion-generic.h @@ -0,0 +1,167 @@ +/* $TOG: region.h /main/9 1998/02/06 17:50:30 kaleb $ */ +/************************************************************************ + +Copyright 1987, 1998 The Open Group + +All Rights Reserved. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +************************************************************************/ + +#ifndef __GDK_REGION_GENERIC_H__ +#define __GDK_REGION_GENERIC_H__ + +typedef struct _GdkRegionBox GdkRegionBox; + +struct _GdkRegionBox +{ + int x1, x2, y1, y2; +}; + +/* + * clip region + */ + +struct _GdkRegion +{ + long size; + long numRects; + GdkRegionBox *rects; + GdkRegionBox extents; +}; + +/* 1 if two BOXs overlap. + * 0 if two BOXs do not overlap. + * Remember, x2 and y2 are not in the region + */ +#define EXTENTCHECK(r1, r2) \ + ((r1)->x2 > (r2)->x1 && \ + (r1)->x1 < (r2)->x2 && \ + (r1)->y2 > (r2)->y1 && \ + (r1)->y1 < (r2)->y2) + +/* + * update region extents + */ +#define EXTENTS(r,idRect){\ + if((r)->x1 < (idRect)->extents.x1)\ + (idRect)->extents.x1 = (r)->x1;\ + if((r)->y1 < (idRect)->extents.y1)\ + (idRect)->extents.y1 = (r)->y1;\ + if((r)->x2 > (idRect)->extents.x2)\ + (idRect)->extents.x2 = (r)->x2;\ + if((r)->y2 > (idRect)->extents.y2)\ + (idRect)->extents.y2 = (r)->y2;\ + } + +/* + * Check to see if there is enough memory in the present region. + */ +#define MEMCHECK(reg, rect, firstrect){ \ + if ((reg)->numRects >= ((reg)->size - 1)) { \ + (firstrect) = g_renew (GdkRegionBox, (firstrect), 2 * (reg)->size); \ + (reg)->size *= 2; \ + (rect) = &(firstrect)[(reg)->numRects]; \ + } \ + } + +/* this routine checks to see if the previous rectangle is the same + * or subsumes the new rectangle to add. + */ + +#define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\ + (!(((Reg)->numRects > 0)&&\ + ((R-1)->y1 == (Ry1)) &&\ + ((R-1)->y2 == (Ry2)) &&\ + ((R-1)->x1 <= (Rx1)) &&\ + ((R-1)->x2 >= (Rx2)))) + +/* add a rectangle to the given Region */ +#define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\ + if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\ + CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ + (r)->x1 = (rx1);\ + (r)->y1 = (ry1);\ + (r)->x2 = (rx2);\ + (r)->y2 = (ry2);\ + EXTENTS((r), (reg));\ + (reg)->numRects++;\ + (r)++;\ + }\ + } + + + +/* add a rectangle to the given Region */ +#define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\ + if ((rx1 < rx2) && (ry1 < ry2) &&\ + CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ + (r)->x1 = (rx1);\ + (r)->y1 = (ry1);\ + (r)->x2 = (rx2);\ + (r)->y2 = (ry2);\ + (reg)->numRects++;\ + (r)++;\ + }\ + } + +#define EMPTY_REGION(pReg) pReg->numRects = 0 + +#define REGION_NOT_EMPTY(pReg) pReg->numRects + +#define INBOX(r, x, y) \ + ( ( ((r).x2 > x)) && \ + ( ((r).x1 <= x)) && \ + ( ((r).y2 > y)) && \ + ( ((r).y1 <= y)) ) + +/* + * number of points to buffer before sending them off + * to scanlines() : Must be an even number + */ +#define NUMPTSTOBUFFER 200 + +/* + * used to allocate buffers for points and link + * the buffers together + */ +typedef struct _POINTBLOCK { + GdkPoint pts[NUMPTSTOBUFFER]; + struct _POINTBLOCK *next; +} POINTBLOCK; + +#endif /* __GDK_REGION_GENERIC_H__ */ |