diff options
Diffstat (limited to 'gdk/nanox')
-rw-r--r-- | gdk/nanox/Makefile.am | 41 | ||||
-rw-r--r-- | gdk/nanox/gdkcc-nanox.c | 119 | ||||
-rw-r--r-- | gdk/nanox/gdkcolor-nanox.c | 238 | ||||
-rw-r--r-- | gdk/nanox/gdkcursor-nanox.c | 26 | ||||
-rw-r--r-- | gdk/nanox/gdkdnd-nanox.c | 121 | ||||
-rw-r--r-- | gdk/nanox/gdkdrawable-nanox.c | 271 | ||||
-rw-r--r-- | gdk/nanox/gdkevents-nanox.c | 441 | ||||
-rw-r--r-- | gdk/nanox/gdkfont-nanox.c | 146 | ||||
-rw-r--r-- | gdk/nanox/gdkgc-nanox.c | 103 | ||||
-rw-r--r-- | gdk/nanox/gdkglobals-nanox.c | 0 | ||||
-rw-r--r-- | gdk/nanox/gdkim-nanox.c | 0 | ||||
-rw-r--r-- | gdk/nanox/gdkimage-nanox.c | 118 | ||||
-rw-r--r-- | gdk/nanox/gdkinput-none.c | 79 | ||||
-rw-r--r-- | gdk/nanox/gdkinput.c | 282 | ||||
-rw-r--r-- | gdk/nanox/gdkinputprivate.h | 230 | ||||
-rw-r--r-- | gdk/nanox/gdkmain-nanox.c | 250 | ||||
-rw-r--r-- | gdk/nanox/gdkpixmap-nanox.c | 149 | ||||
-rw-r--r-- | gdk/nanox/gdkprivate-nanox.h | 178 | ||||
-rw-r--r-- | gdk/nanox/gdkproperty-nanox.c | 55 | ||||
-rw-r--r-- | gdk/nanox/gdkregion-nanox.c | 107 | ||||
-rw-r--r-- | gdk/nanox/gdkselection-nanox.c | 89 | ||||
-rw-r--r-- | gdk/nanox/gdkvisual-nanox.c | 95 | ||||
-rw-r--r-- | gdk/nanox/gdkwindow-nanox.c | 600 |
23 files changed, 0 insertions, 3738 deletions
diff --git a/gdk/nanox/Makefile.am b/gdk/nanox/Makefile.am deleted file mode 100644 index d906549139..0000000000 --- a/gdk/nanox/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## Process this file with automake to produce Makefile.in - -INCLUDES = @STRIP_BEGIN@ \ - -DG_LOG_DOMAIN=\"Gdk\" \ - -I$(top_srcdir) \ - -I$(top_srcdir)/gdk \ - @GTK_DEBUG_FLAGS@ \ - @GDK_DEP_CFLAGS@ \ -@STRIP_END@ - -LDADDS = @STRIP_BEGIN@ \ - @GDK_DEP_LIBS@ \ -@STRIP_END@ - -noinst_LTLIBRARIES = libgdk-nanox.la - -xinput_sources = \ - gdkinput-none.c - -libgdk_nanox_la_SOURCES = \ - gdkcc-nanox.c \ - gdkcolor-nanox.c \ - gdkcursor-nanox.c \ - gdkdnd-nanox.c \ - gdkdrawable-nanox.c \ - gdkevents-nanox.c \ - gdkfont-nanox.c \ - gdkgc-nanox.c \ - gdkglobals-nanox.c \ - gdkim-nanox.c \ - gdkimage-nanox.c \ - gdkinput.c \ - gdkinputprivate.h \ - gdkmain-nanox.c \ - gdkpixmap-nanox.c \ - gdkproperty-nanox.c \ - gdkselection-nanox.c \ - gdkvisual-nanox.c \ - gdkwindow-nanox.c \ - gdkprivate-nanox.h \ - gdkinput-none.c diff --git a/gdk/nanox/gdkcc-nanox.c b/gdk/nanox/gdkcc-nanox.c deleted file mode 100644 index 3589924346..0000000000 --- a/gdk/nanox/gdkcc-nanox.c +++ /dev/null @@ -1,119 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkColorContext * -gdk_color_context_new (GdkVisual *visual, - GdkColormap *colormap) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkColorContext * -gdk_color_context_new_mono (GdkVisual *visual, - GdkColormap *colormap) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_color_context_free (GdkColorContext *cc) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gulong -gdk_color_context_get_pixel (GdkColorContext *cc, - gushort red, - gushort green, - gushort blue, - gint *failed) -{ - return RGB2PIXEL(red, green, blue); -} - -void -gdk_color_context_get_pixels (GdkColorContext *cc, - gushort *reds, - gushort *greens, - gushort *blues, - gint ncolors, - gulong *colors, - gint *nallocated) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_color_context_get_pixels_incremental (GdkColorContext *cc, - gushort *reds, - gushort *greens, - gushort *blues, - gint ncolors, - gint *used, - gulong *colors, - gint *nallocated) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gint -gdk_color_context_query_color (GdkColorContext *cc, - GdkColor *color) -{ - return gdk_color_context_query_colors (cc, color, 1); -} - -gint -gdk_color_context_query_colors (GdkColorContext *cc, - GdkColor *colors, - gint num_colors) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -gint -gdk_color_context_add_palette (GdkColorContext *cc, - GdkColor *palette, - gint num_palette) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_color_context_init_dither (GdkColorContext *cc) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_color_context_free_dither (GdkColorContext *cc) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gulong -gdk_color_context_get_pixel_from_palette (GdkColorContext *cc, - gushort *red, - gushort *green, - gushort *blue, - gint *failed) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -guchar -gdk_color_context_get_index_from_palette (GdkColorContext *cc, - gint *red, - gint *green, - gint *blue, - gint *failed) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} diff --git a/gdk/nanox/gdkcolor-nanox.c b/gdk/nanox/gdkcolor-nanox.c deleted file mode 100644 index e0fb65be85..0000000000 --- a/gdk/nanox/gdkcolor-nanox.c +++ /dev/null @@ -1,238 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" -#include <stdlib.h> -#include <string.h> - -GdkColormap* -gdk_colormap_new (GdkVisual *visual, - gboolean private_cmap) -{ - GdkColormap *colormap; - GdkColormapPrivateX *private; - int size; - int i; - - g_return_val_if_fail (visual != NULL, NULL); - - private = g_new (GdkColormapPrivateX, 1); - colormap = (GdkColormap*) private; - - private->base.visual = visual; - private->base.ref_count = 1; - - colormap->size = visual->colormap_size; - colormap->colors = NULL; - - return colormap; -} - -void -_gdk_colormap_real_destroy (GdkColormap *colormap) -{ -} - - -void -gdk_colormap_sync (GdkColormap *colormap, - gboolean force) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -GdkColormap* -gdk_colormap_get_system (void) -{ - return gdk_colormap_new(gdk_visual_get_system(), 0); -} - - -gint -gdk_colormap_get_system_size (void) -{ - GR_PALETTE palette; - - GrGetSystemPalette(&palette); - return palette.count; -} - -void -gdk_colormap_change (GdkColormap *colormap, - gint ncolors) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gboolean -gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels) -{ - g_message("unimplemented %s", __FUNCTION__); - return 1; -} - -static struct cspec { - char *name; - int red, green, blue; -} cnames [] = { - {"white", 0xffff, 0xffff, 0xffff}, - {"black", 0, 0, 0}, - {"red", 0xffff, 0, 0}, - {"green", 0, 0xffff, 0}, - {"blue", 0, 0, 0xffff}, - {NULL} -}; - -gboolean -gdk_color_parse (const gchar *spec, - GdkColor *color) -{ - int size, csize, i, j, shift; - double dval; - gchar *end; - int scale[] = {0, 4096, 256, 16, 1}; - int add[] = {0, 4095, 255, 15, 1}; - - g_return_val_if_fail(spec != NULL, 0); - g_return_val_if_fail(color != NULL, 0); - - g_message("color parsing %s", spec); - - if (*spec == '#') { - spec++; - size = strlen(spec); - csize = size/3; - shift = 16-csize*4; - if (size > 12 || size % 3) - return 0; - j = spec[csize]; - spec[csize] = 0; - color->red = strtol(spec, &end, 16) << shift; - if (end == spec || *end != '\0') - return 0; - spec[csize] = j; - spec += csize; - /* green */ - j = spec[csize]; - spec[csize] = 0; - color->green = strtol(spec, &end, 16) << shift; - if (end == spec || *end != '\0') - return 0; - spec[csize] = j; - spec += csize; - /* blue */ - color->blue = strtol(spec, &end, 16) << shift; - if (end == spec || *end != '\0') - return 0; - return 1; - } else if (!strncmp(spec, "rgb:", 4)) { - spec += 4; - color->red = strtol(spec, &end, 16); - if (end == spec || *end != '/') - return 0; - csize = end-spec; - color->red *= scale[csize]; - color->red += add[csize]; - spec += csize + 1; - /* green */ - color->green = strtol(spec, &end, 16); - if (end == spec || *end != '/') - return 0; - csize = end-spec; - color->green *= scale[csize]; - color->green += add[csize]; - spec += csize + 1; - /* blue */ - color->blue = strtol(spec, &end, 16); - if (end == spec || *end != '\0') - return 0; - csize = end-spec; - color->blue *= scale[csize]; - color->blue += add[csize]; - return 1; - } else if (!strncmp(spec, "rgbi:", 5)) { - spec += 5; - dval = strtod(spec, &end); - if (end == spec || *end != '/' || dval > 1.0 || dval < 0) - return 0; - color->red = dval*0xffff; - spec += end-spec + 1; - /* green */ - dval = strtod(spec, &end); - if (end == spec || *end != '/' || dval > 1.0 || dval < 0) - return 0; - color->green = dval*0xffff; - spec += end-spec + 1; - /* blue */ - dval = strtod(spec, &end); - if (end == spec || *end != '0' || dval > 1.0 || dval < 0) - return 0; - color->blue = dval*0xffff; - return 1; - } else { - /* use a cdb database, instead, later */ - for (i=0; cnames[i].name; ++i) { - if (strcmp(cnames[i].name, spec)) - continue; - color->red = cnames[i].red; - color->green = cnames[i].green; - color->blue = cnames[i].blue; - return 1; - } - if (spec[0] == 'g' && spec[1] == 'r' && (spec[2] == 'a' || spec[2] == 'e') && spec[3] == 'y') { - dval = strtol(spec+4, NULL, 10)/100; - color->red = color->green = color->blue = 255 * dval; - return 1; - } - } - - return 0; -} - -void -gdk_colors_free (GdkColormap *colormap, - gulong *in_pixels, - gint in_npixels, - gulong planes) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_colormap_free_colors (GdkColormap *colormap, - GdkColor *colors, - gint ncolors) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gint -gdk_colormap_alloc_colors (GdkColormap *colormap, - GdkColor *colors, - gint ncolors, - gboolean writeable, - gboolean best_match, - gboolean *success) -{ - int i; - - for (i=0; i < ncolors;++i) - colors[i].pixel = RGB2PIXEL(colors[i].red>>8, colors[i].green>>8, colors[i].blue>>8); - success = 1; - return 1; -} - - -gboolean -gdk_color_change (GdkColormap *colormap, - GdkColor *color) -{ - g_message("unimplemented %s", __FUNCTION__); - return 1; -} - - diff --git a/gdk/nanox/gdkcursor-nanox.c b/gdk/nanox/gdkcursor-nanox.c deleted file mode 100644 index a3b7fb0ca1..0000000000 --- a/gdk/nanox/gdkcursor-nanox.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkCursor* -gdk_cursor_new (GdkCursorType cursor_type) { - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkCursor* -gdk_cursor_new_from_pixmap (GdkPixmap *source, - GdkPixmap *mask, - GdkColor *fg, - GdkColor *bg, - gint x, - gint y) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -_gdk_cursor_destroy (GdkCursor *cursor) -{ -} - diff --git a/gdk/nanox/gdkdnd-nanox.c b/gdk/nanox/gdkdnd-nanox.c deleted file mode 100644 index d9fc05537b..0000000000 --- a/gdk/nanox/gdkdnd-nanox.c +++ /dev/null @@ -1,121 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - - -GdkDragContext * -gdk_drag_context_new (void) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_drag_context_ref (GdkDragContext *context) -{ -} - -void -gdk_drag_context_unref (GdkDragContext *context) -{ -} - -void -gdk_dnd_init (void) -{ -} - -GdkDragContext * -gdk_drag_begin (GdkWindow *window, - GList *targets) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -guint32 -gdk_drag_get_protocol (guint32 xid, - GdkDragProtocol *protocol) -{ - *protocol = GDK_DRAG_PROTO_NONE; - return 0; -} - -void -gdk_drag_find_window (GdkDragContext *context, - GdkWindow *drag_window, - gint x_root, - gint y_root, - GdkWindow **dest_window, - GdkDragProtocol *protocol) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gboolean -gdk_drag_motion (GdkDragContext *context, - GdkWindow *dest_window, - GdkDragProtocol protocol, - gint x_root, - gint y_root, - GdkDragAction suggested_action, - GdkDragAction possible_actions, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_drag_drop (GdkDragContext *context, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_drag_abort (GdkDragContext *context, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_drag_status (GdkDragContext *context, - GdkDragAction action, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_drop_reply (GdkDragContext *context, - gboolean ok, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_drop_finish (GdkDragContext *context, - gboolean success, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_register_dnd (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -GdkAtom -gdk_drag_get_selection (GdkDragContext *context) -{ - return GDK_NONE; -} - - diff --git a/gdk/nanox/gdkdrawable-nanox.c b/gdk/nanox/gdkdrawable-nanox.c deleted file mode 100644 index 10c67049b3..0000000000 --- a/gdk/nanox/gdkdrawable-nanox.c +++ /dev/null @@ -1,271 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -static void gdk_nanox_drawable_destroy (GdkDrawable *drawable); - -static void gdk_nanox_draw_rectangle (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height); -static void gdk_nanox_draw_arc (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height, - gint angle1, - gint angle2); -static void gdk_nanox_draw_polygon (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - GdkPoint *points, - gint npoints); -static void gdk_nanox_draw_text (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *text, - gint text_length); -static void gdk_nanox_draw_text_wc (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const GdkWChar *text, - gint text_length); -static void gdk_nanox_draw_drawable (GdkDrawable *drawable, - GdkGC *gc, - GdkPixmap *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); -static void gdk_nanox_draw_points (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); -static void gdk_nanox_draw_segments (GdkDrawable *drawable, - GdkGC *gc, - GdkSegment *segs, - gint nsegs); -static void gdk_nanox_draw_lines (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints); - -GdkDrawableClass _gdk_nanox_drawable_class = { - gdk_nanox_drawable_destroy, - _gdk_nanox_gc_new, - gdk_nanox_draw_rectangle, - gdk_nanox_draw_arc, - gdk_nanox_draw_polygon, - gdk_nanox_draw_text, - gdk_nanox_draw_text_wc, - gdk_nanox_draw_drawable, - gdk_nanox_draw_points, - gdk_nanox_draw_segments, - gdk_nanox_draw_lines -}; - -GdkColormap* -gdk_drawable_get_colormap (GdkDrawable *drawable) -{ - GdkDrawablePrivate *drawable_private; - - g_return_val_if_fail (drawable != NULL, NULL); - drawable_private = (GdkDrawablePrivate*) drawable; - - if (!GDK_DRAWABLE_DESTROYED (drawable)) - { - if (drawable_private->colormap == NULL && - GDK_IS_WINDOW (drawable)) - { - /*XGetWindowAttributes (GDK_DRAWABLE_XDISPLAY (drawable), - GDK_DRAWABLE_XID (drawable), - &window_attributes); - drawable_private->colormap = gdk_colormap_lookup (window_attributes.colormap);*/ - } - - return drawable_private->colormap; - } - - return NULL; -} - -void -gdk_drawable_set_colormap (GdkDrawable *drawable, - GdkColormap *colormap) -{ - GdkDrawablePrivate *drawable_private; - GdkColormapPrivateX *colormap_private; - - g_return_if_fail (drawable != NULL); - g_return_if_fail (colormap != NULL); - - drawable_private = (GdkDrawablePrivate *)drawable; - colormap_private = (GdkColormapPrivateX *)colormap; - - if (!GDK_DRAWABLE_DESTROYED (drawable)) - { - if (GDK_IS_WINDOW (drawable)) - { - g_return_if_fail (colormap_private->base.visual != - ((GdkColormapPrivate *)(drawable_private->colormap))->visual); - - } - - if (drawable_private->colormap) - gdk_colormap_unref (drawable_private->colormap); - drawable_private->colormap = colormap; - gdk_colormap_ref (drawable_private->colormap); - - if (GDK_IS_WINDOW (drawable) && - drawable_private->window_type != GDK_WINDOW_TOPLEVEL) - /*gdk_window_add_colormap_windows (drawable);*/; - } -} - -static void -gdk_nanox_drawable_destroy (GdkDrawable *drawable) -{ - -} - -static void -gdk_nanox_draw_rectangle (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height) -{ - if (filled) - GrFillRect (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width, height); - else - GrRect (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width, height); -} - -static void -gdk_nanox_draw_arc (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - gint x, - gint y, - gint width, - gint height, - gint angle1, - gint angle2) -{ - /* this is not an arc, obviously */ - if (filled) - GrFillEllipse (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width/2, height/2); - else - GrEllipse (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, width/2, height/2); -} - -static void -gdk_nanox_draw_polygon (GdkDrawable *drawable, - GdkGC *gc, - gint filled, - GdkPoint *points, - gint npoints) -{ - GR_POINT *new_points = g_new(GR_POINT, npoints); - int i; - for (i=0; i < npoints;++i) { - new_points[i].x = points[i].x; - new_points[i].y = points[i].y; - } - if (filled) - { - GrFillPoly (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), npoints, new_points); - } - else - { - GrPoly (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), npoints, new_points); - } - g_free(new_points); -} - -static void -gdk_nanox_draw_text (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const gchar *text, - gint text_length) -{ - GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(font)); - GrText (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, text, text_length, TF_UTF8|TF_BASELINE); -} - -static void -gdk_nanox_draw_text_wc (GdkDrawable *drawable, - GdkFont *font, - GdkGC *gc, - gint x, - gint y, - const GdkWChar *text, - gint text_length) -{ - GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(font)); - GrText (GDK_DRAWABLE_XID (drawable), GDK_GC_XGC (gc), x, y, text, text_length, TF_UC32|TF_BASELINE); -} - -static void -gdk_nanox_draw_drawable (GdkDrawable *drawable, - GdkGC *gc, - GdkPixmap *src, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height) -{ - GrCopyArea(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), xdest, ydest, - width, height, GDK_DRAWABLE_XID(src), xsrc, ysrc, 0); -} - -static void -gdk_nanox_draw_points (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints) -{ - int i; - for (i=0; i < npoints; ++i) - GrPoint(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), points[i].x, points[i].y); -} - -static void -gdk_nanox_draw_segments (GdkDrawable *drawable, - GdkGC *gc, - GdkSegment *segs, - gint nsegs) -{ - int i; - for (i=0; i < nsegs; ++i) - GrLine(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), segs[i].x1, segs[i].y1, segs[i].x2, segs[i].y2); -} - -static void -gdk_nanox_draw_lines (GdkDrawable *drawable, - GdkGC *gc, - GdkPoint *points, - gint npoints) -{ - int i; - for (i=0; i < npoints-1; ++i) - GrLine(GDK_DRAWABLE_XID(drawable), GDK_GC_XGC(gc), points[i].x, points[i].y, points[i+1].x, points[i+1].y); -} - diff --git a/gdk/nanox/gdkevents-nanox.c b/gdk/nanox/gdkevents-nanox.c deleted file mode 100644 index 81d9cb4bc7..0000000000 --- a/gdk/nanox/gdkevents-nanox.c +++ /dev/null @@ -1,441 +0,0 @@ -#include "gdk.h" -#include "gdkinternals.h" -#include "gdkprivate-nanox.h" - -typedef struct _GdkEventPrivate GdkEventPrivate; - -#define DOUBLE_CLICK_TIME 250 -#define TRIPLE_CLICK_TIME 500 -#define DOUBLE_CLICK_DIST 5 -#define TRIPLE_CLICK_DIST 5 - -#define GR_BUTTON_TO_GDK(b) b&LBUTTON? 1: (b&MBUTTON? 2: (b&RBUTTON? 3: 0)) - -static guint gr_mod_to_gdk(guint mods, guint buttons) { - guint res=0; - if (mods & GR_MODIFIER_SHIFT) - res |= GDK_SHIFT_MASK; - if (mods & GR_MODIFIER_CTRL) - res |= GDK_CONTROL_MASK; - if (mods & GR_MODIFIER_META) - res |= GDK_MOD1_MASK; - if (buttons & LBUTTON) - res |= GDK_BUTTON1_MASK; - if (buttons & MBUTTON) - res |= GDK_BUTTON2_MASK; - if (buttons & RBUTTON) - res |= GDK_BUTTON3_MASK; - return res; -} - -static gboolean gdk_event_prepare (gpointer source_data, - GTimeVal *current_time, - gint *timeout, - gpointer user_data); -static gboolean gdk_event_check (gpointer source_data, - GTimeVal *current_time, - gpointer user_data); -static gboolean gdk_event_dispatch (gpointer source_data, - GTimeVal *current_time, - gpointer user_data); - -typedef enum -{ - /* Following flag is set for events on the event queue during - * translation and cleared afterwards. - */ - GDK_EVENT_PENDING = 1 << 0 -} GdkEventFlags; - -struct _GdkEventPrivate -{ - GdkEvent event; - guint flags; -}; - - -static GSourceFuncs event_funcs = { - gdk_event_prepare, - gdk_event_check, - gdk_event_dispatch, - (GDestroyNotify)g_free -}; - -GPollFD event_poll_fd; -extern int sock; -static guint serial_value = 1; - -static int -events_idle () { - gdk_events_queue(); - return TRUE; -} - -void -gdk_events_init (void) -{ - g_source_add (GDK_PRIORITY_EVENTS, TRUE, &event_funcs, NULL, NULL, NULL); - - event_poll_fd.fd = sock; - event_poll_fd.events = G_IO_IN; - - g_main_add_poll (&event_poll_fd, GDK_PRIORITY_EVENTS); - - g_idle_add(events_idle, NULL); - -} - -static gboolean -gdk_event_prepare (gpointer source_data, - GTimeVal *current_time, - gint *timeout, - gpointer user_data) -{ - gboolean retval; - - GDK_THREADS_ENTER (); - - *timeout = -1; - - retval = (gdk_event_queue_find_first () != NULL); - - GDK_THREADS_LEAVE (); - - return retval; -} - -static gboolean -gdk_event_check (gpointer source_data, - GTimeVal *current_time, - gpointer user_data) -{ - gboolean retval; - - GDK_THREADS_ENTER (); - - if (event_poll_fd.revents & G_IO_IN) - //retval = (gdk_event_queue_find_first () != NULL); - retval = 1; - else - retval = FALSE; - - GDK_THREADS_LEAVE (); - - return retval; -} - -static gboolean -gdk_event_dispatch (gpointer source_data, - GTimeVal *current_time, - gpointer user_data) -{ - GdkEvent *event; - - GDK_THREADS_ENTER (); - - gdk_events_queue(); - event = gdk_event_unqueue(); - - if (event) - { - if (gdk_event_func) - (*gdk_event_func) (event, gdk_event_data); - - gdk_event_free (event); - } - - GDK_THREADS_LEAVE (); - - return TRUE; -} - - -gboolean -gdk_events_pending (void) -{ - return gdk_event_queue_find_first(); -} - -GdkEvent* -gdk_event_get_graphics_expose (GdkWindow *window) -{ - return NULL; -} - -static gint gdk_event_translate (GdkEvent *event, GR_EVENT *xevent) { - GdkWindow *window=NULL; - GdkWindowPrivate *window_private=NULL; - gint return_val = FALSE; - static int lastx=0, lasty=0, lastrootx=0, lastrooty=0; - - if (xevent->type == GR_EVENT_TYPE_FDINPUT) - return 0; - window = gdk_window_lookup (xevent->general.wid); - /* FIXME: window might be a GdkPixmap!!! */ - - window_private = (GdkWindowPrivate *) window; - - if (window != NULL) - gdk_window_ref (window); - - event->any.window = window; - event->any.send_event = FALSE; - - if (window_private && GDK_DRAWABLE_DESTROYED (window)) - { - return FALSE; - } - else - { - /* Check for filters for this window - */ - GdkFilterReturn result = GDK_FILTER_CONTINUE; - /*result = gdk_event_apply_filters (xevent, event, - window_private - ?window_private->filters - :gdk_default_filters); - */ - if (result != GDK_FILTER_CONTINUE) - { - return (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE; - } - } - - return_val = TRUE; - - //g_message("got event (%p) %d", window, xevent->type); - switch (xevent->type) - { - case GR_EVENT_TYPE_KEY_DOWN: - event->key.keyval = xevent->keystroke.ch; - event->key.type = GDK_KEY_PRESS; - event->key.window = window; - event->key.time = serial_value++; - event->key.state = gr_mod_to_gdk(xevent->keystroke.modifiers, xevent->keystroke.buttons); - event->key.string = g_strdup_printf ("%c", xevent->keystroke.ch); - event->key.length = 1; - - break; - case GR_EVENT_TYPE_KEY_UP: - event->key.keyval = xevent->keystroke.ch; - event->key.type = GDK_KEY_RELEASE; - event->key.window = window; - event->key.time = serial_value++; - event->key.state = gr_mod_to_gdk(xevent->keystroke.modifiers, xevent->keystroke.buttons)|GDK_RELEASE_MASK; - event->key.string = NULL; - event->key.length = 0; - - break; - case GR_EVENT_TYPE_BUTTON_DOWN: - event->button.type = GDK_BUTTON_PRESS; - event->button.window = window; - event->button.time = serial_value++; - event->button.x = xevent->button.x; - event->button.y = xevent->button.y; - event->button.x_root = (gfloat)xevent->button.rootx; - event->button.y_root = (gfloat)xevent->button.rooty; - event->button.pressure = 0.5; - event->button.xtilt = 0; - event->button.ytilt = 0; - event->button.state = gr_mod_to_gdk(xevent->button.modifiers, xevent->button.buttons); - event->button.button = GR_BUTTON_TO_GDK(xevent->button.changebuttons); - event->button.source = GDK_SOURCE_MOUSE; - event->button.deviceid = GDK_CORE_POINTER; - g_message("button down: %d", event->button.button); - gdk_event_button_generate (event); - break; - case GR_EVENT_TYPE_BUTTON_UP: - event->button.type = GDK_BUTTON_RELEASE; - event->button.window = window; - event->button.time = serial_value++; - event->button.x = xevent->button.x; - event->button.y = xevent->button.y; - event->button.x_root = (gfloat)xevent->button.rootx; - event->button.y_root = (gfloat)xevent->button.rooty; - event->button.pressure = 0.5; - event->button.xtilt = 0; - event->button.ytilt = 0; - event->button.state = gr_mod_to_gdk(xevent->button.modifiers, xevent->button.buttons)|GDK_RELEASE_MASK; - event->button.button = GR_BUTTON_TO_GDK(xevent->button.changebuttons); - event->button.source = GDK_SOURCE_MOUSE; - event->button.deviceid = GDK_CORE_POINTER; - g_message("button up: %d", event->button.button); - gdk_event_button_generate (event); - break; - case GR_EVENT_TYPE_MOUSE_MOTION: - event->motion.type = GDK_MOTION_NOTIFY; - event->motion.window = window; - event->motion.time = serial_value++; - event->motion.x = xevent->mouse.x; - event->motion.y = xevent->mouse.y; - event->motion.x_root = (gfloat)xevent->mouse.rootx; - event->motion.y_root = (gfloat)xevent->mouse.rooty; - event->motion.pressure = 0.5; - event->motion.xtilt = 0; - event->motion.ytilt = 0; - event->motion.state = gr_mod_to_gdk(xevent->mouse.modifiers, xevent->mouse.buttons); - event->motion.is_hint = 0; - event->motion.source = GDK_SOURCE_MOUSE; - event->motion.deviceid = GDK_CORE_POINTER; - - break; - case GR_EVENT_TYPE_MOUSE_POSITION: - return_val = FALSE; - break; - case GR_EVENT_TYPE_MOUSE_ENTER: - event->crossing.type = GDK_ENTER_NOTIFY; - event->crossing.window = window; - event->crossing.subwindow = NULL; - event->crossing.time = serial_value++; - event->crossing.detail = GDK_NOTIFY_UNKNOWN; - //g_message("subwindow 1: %p", event->crossing.subwindow); - /* other stuff here , x, y, x_root, y_root */ - break; - case GR_EVENT_TYPE_MOUSE_EXIT: - event->crossing.type = GDK_LEAVE_NOTIFY; - event->crossing.window = window; - event->crossing.subwindow = NULL; - event->crossing.time = serial_value++; - event->crossing.mode = GDK_CROSSING_NORMAL; - event->crossing.detail = GDK_NOTIFY_UNKNOWN; - //g_message("subwindow 2: %p", event->crossing.subwindow); - /* other stuff here , x, y, x_root, y_root */ - break; - case GR_EVENT_TYPE_FOCUS_IN: - case GR_EVENT_TYPE_FOCUS_OUT: - event->focus_change.type = GDK_FOCUS_CHANGE; - event->focus_change.window = window; - event->focus_change.in = (xevent->general.type == GR_EVENT_TYPE_FOCUS_IN); - - break; - case GR_EVENT_TYPE_UPDATE: - case GR_EVENT_TYPE_CHLD_UPDATE: - if (xevent->update.utype == GR_UPDATE_MAP) { - event->any.type = GDK_MAP; - event->any.window = window; - - } else if (xevent->update.utype == GR_UPDATE_UNMAP) { - event->any.type = GDK_UNMAP; - event->any.window = window; - - if (gdk_xgrab_window == window_private) - gdk_xgrab_window = NULL; - } else { - if (!window || GDK_DRAWABLE_TYPE (window) == GDK_WINDOW_CHILD) - return_val = FALSE; - else - { - event->configure.type = GDK_CONFIGURE; - event->configure.window = window; - event->configure.width = xevent->update.width; - event->configure.height = xevent->update.height; - event->configure.x = xevent->update.x; - event->configure.y = xevent->update.y; - window_private->x = event->configure.x; - window_private->y = event->configure.y; - window_private->drawable.width = event->configure.width; - window_private->drawable.height = event->configure.height; - if (window_private->resize_count > 1) - window_private->resize_count -= 1; - } - } - break; - case GR_EVENT_TYPE_EXPOSURE: - - event->expose.type = GDK_EXPOSE; - event->expose.window = window; - event->expose.area.x = xevent->exposure.x; - event->expose.area.y = xevent->exposure.y; - event->expose.area.width = xevent->exposure.width; - event->expose.area.height = xevent->exposure.height; - event->expose.count = 0; - - break; - case GR_EVENT_TYPE_FDINPUT: - case GR_EVENT_TYPE_NONE: - return_val = FALSE; - break; - default: - return_val = FALSE; - g_message("event %d not handled\n", xevent->type); - } - if (return_val) - { - if (event->any.window) - gdk_window_ref (event->any.window); - if (((event->any.type == GDK_ENTER_NOTIFY) || - (event->any.type == GDK_LEAVE_NOTIFY)) && - (event->crossing.subwindow != NULL)) - gdk_window_ref (event->crossing.subwindow); - } - else - { - /* Mark this event as having no resources to be freed */ - event->any.window = NULL; - event->any.type = GDK_NOTHING; - } - - if (window) - gdk_window_unref (window); - - return return_val; -} - -void -gdk_events_queue (void) -{ - GList *node; - GdkEvent *event; - GR_EVENT xevent; - - while (!gdk_event_queue_find_first()) - { - GrCheckNextEvent (&xevent); - if (!xevent.type) - return; - - event = gdk_event_new (); - - event->any.type = GDK_NOTHING; - event->any.window = NULL; - event->any.send_event = FALSE; - - ((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING; - - gdk_event_queue_append (event); - node = gdk_queued_tail; - - if (gdk_event_translate (event, &xevent)) - { - ((GdkEventPrivate *)event)->flags &= ~GDK_EVENT_PENDING; - //g_message("got event: %d", event->type); - } - else - { - gdk_event_queue_remove_link (node); - g_list_free_1 (node); - gdk_event_free (event); - } - } -} - -gboolean -gdk_event_send_client_message (GdkEvent *event, guint32 xid) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_event_send_clientmessage_toall (GdkEvent *event) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_flush (void) -{ - GrFlush(); -} - - diff --git a/gdk/nanox/gdkfont-nanox.c b/gdk/nanox/gdkfont-nanox.c deleted file mode 100644 index 19818b5ebf..0000000000 --- a/gdk/nanox/gdkfont-nanox.c +++ /dev/null @@ -1,146 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -static GR_GC_ID gc_for_width = 0; - -#define ENSURE_GC if (!gc_for_width) gc_for_width = GrNewGC(); - -GdkFont* -gdk_font_load (const gchar *font_name) -{ - GdkFont *font; - GdkFontPrivateX *private; - GR_FONTID xfont; - - g_return_val_if_fail (font_name != NULL, NULL); - - xfont = GrCreateFont("System", 0, 0); - if (xfont == 0) - return NULL; - - { - private = g_new (GdkFontPrivateX, 1); - private->xfont = xfont; - private->base.ref_count = 1; - - font = (GdkFont*) private; - font->type = GDK_FONT_FONT; - font->ascent = 8; - font->descent = 4; - - } - - return font; -} - -GdkFont* -gdk_fontset_load (const gchar *fontset_name) -{ - return gdk_font_load(fontset_name); -} - -void -_gdk_font_destroy (GdkFont *font) -{ - GrUnloadFont(GDK_FONT_XFONT(font)); -} - -gint -_gdk_font_strlen (GdkFont *font, - const gchar *str) -{ - return strlen(str); -} - -gint -gdk_font_id (const GdkFont *font) -{ - return GDK_FONT_XFONT(font); -} - -gboolean -gdk_font_equal (const GdkFont *fonta, - const GdkFont *fontb) -{ - return GDK_FONT_XFONT(fonta) == GDK_FONT_XFONT(fontb); -} - -gint -gdk_text_width (GdkFont *font, - const gchar *text, - gint text_length) -{ - gint width, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UTF8, &width, &height, &base); - return width; -} - -gint -gdk_text_width_wc (GdkFont *font, - const GdkWChar *text, - gint text_length) -{ - gint width, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UC32, &width, &height, &base); - return width; -} - - -void -gdk_text_extents (GdkFont *font, - const gchar *text, - gint text_length, - gint *lbearing, - gint *rbearing, - gint *width, - gint *ascent, - gint *descent) -{ - gint mwidth, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UTF8, &mwidth, &height, &base); - if (width) - *width = mwidth; - if (lbearing) - *lbearing = 0; - if (rbearing) - *rbearing = 0; - if (ascent) - *ascent = base; - if (descent) - *descent = height - base; - -} - -void -gdk_text_extents_wc (GdkFont *font, - const GdkWChar *text, - gint text_length, - gint *lbearing, - gint *rbearing, - gint *width, - gint *ascent, - gint *descent) -{ - gint mwidth, height, base; - ENSURE_GC; - GrSetGCFont(gc_for_width, GDK_FONT_XFONT(font)); - GrGetGCTextSize(gc_for_width, text, text_length, TF_UC32, &mwidth, &height, &base); - if (width) - *width = mwidth; - if (lbearing) - *lbearing = 0; - if (rbearing) - *rbearing = 0; - if (ascent) - *ascent = base; - if (descent) - *descent = height - base; -} - - diff --git a/gdk/nanox/gdkgc-nanox.c b/gdk/nanox/gdkgc-nanox.c deleted file mode 100644 index 78246a3dc0..0000000000 --- a/gdk/nanox/gdkgc-nanox.c +++ /dev/null @@ -1,103 +0,0 @@ -#include "gdkprivate-nanox.h" - -static void gdk_nanox_gc_destroy (GdkGC *gc); -static void gdk_nanox_gc_get_values (GdkGC *gc, - GdkGCValues *values); -static void gdk_nanox_gc_set_values (GdkGC *gc, - GdkGCValues *values, - GdkGCValuesMask values_mask); -static void gdk_nanox_gc_set_dashes (GdkGC *gc, - gint dash_offset, - gchar dash_list[], - gint n); - -static GdkGCClass gdk_nanox_gc_class = { - gdk_nanox_gc_destroy, - gdk_nanox_gc_get_values, - gdk_nanox_gc_set_values, - gdk_nanox_gc_set_dashes -}; - -GdkGC * -_gdk_nanox_gc_new (GdkDrawable *drawable, - GdkGCValues *values, - GdkGCValuesMask values_mask) -{ - - GdkGC *gc; - GdkGCPrivate *private; - - gc = gdk_gc_alloc (); - private = (GdkGCPrivate *)gc; - - private->klass = &gdk_nanox_gc_class; - private->klass_data = g_new (GdkGCXData, 1); - - GDK_GC_XDATA(gc)->xgc = GrNewGC(); - GrSetGCUseBackground(GDK_GC_XDATA(gc)->xgc, 0); - GrSetGCForeground(GDK_GC_XDATA(gc)->xgc, RGB2PIXEL(0,0,0)); - GrSetGCBackground(GDK_GC_XDATA(gc)->xgc, RGB2PIXEL(0,0,0)); - g_message("created GC: %d", GDK_GC_XDATA(gc)->xgc); - return gc; -} - - -static void -gdk_nanox_gc_destroy (GdkGC *gc) -{ - GrDestroyGC (GDK_GC_XGC (gc)); - g_free (GDK_GC_XDATA (gc)); -} - -static void -gdk_nanox_gc_get_values (GdkGC *gc, - GdkGCValues *values) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -static void -gdk_nanox_gc_set_values (GdkGC *gc, - GdkGCValues *values, - GdkGCValuesMask values_mask) -{ - if (values_mask & GDK_GC_FOREGROUND) - GrSetGCForeground(GDK_GC_XGC(gc), values->foreground.pixel); - else if (values_mask & GDK_GC_BACKGROUND) - GrSetGCBackground(GDK_GC_XGC(gc), values->background.pixel); - else if (values_mask & GDK_GC_FONT) - GrSetGCFont(GDK_GC_XGC(gc), GDK_FONT_XFONT(values->font)); -} - -static void -gdk_nanox_gc_set_dashes (GdkGC *gc, - gint dash_offset, - gchar dash_list[], - gint n) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_gc_set_clip_rectangle (GdkGC *gc, - GdkRectangle *rectangle) -{ - //g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_gc_set_clip_region (GdkGC *gc, - GdkRegion *region) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc) -{ - GDK_GC_XDATA(dst_gc)->xgc = GrCopyGC(GDK_GC_XGC(src_gc)); -} - - diff --git a/gdk/nanox/gdkglobals-nanox.c b/gdk/nanox/gdkglobals-nanox.c deleted file mode 100644 index e69de29bb2..0000000000 --- a/gdk/nanox/gdkglobals-nanox.c +++ /dev/null diff --git a/gdk/nanox/gdkim-nanox.c b/gdk/nanox/gdkim-nanox.c deleted file mode 100644 index e69de29bb2..0000000000 --- a/gdk/nanox/gdkim-nanox.c +++ /dev/null diff --git a/gdk/nanox/gdkimage-nanox.c b/gdk/nanox/gdkimage-nanox.c deleted file mode 100644 index e0b580ac42..0000000000 --- a/gdk/nanox/gdkimage-nanox.c +++ /dev/null @@ -1,118 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -static void -gdk_nanox_image_destroy (GdkImage *image); - -static void -gdk_image_put_normal (GdkImage *image, - GdkDrawable *drawable, - GdkGC *gc, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height); - -static GdkImageClass image_class_normal = { - gdk_nanox_image_destroy, - gdk_image_put_normal -}; - -void -gdk_image_exit (void) -{ -} - - -GdkImage * -gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint w, gint h) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_image_init (void) -{ -} - - -GdkImage* -gdk_image_new (GdkImageType type, - GdkVisual *visual, - gint width, - gint height) -{ - GdkImage *image; - GdkImagePrivateX *private; - - private = g_new (GdkImagePrivateX, 1); - image = (GdkImage*) private; - - private->base.ref_count = 1; - image->type = type; - image->visual = visual; - image->width = width; - image->height = height; - image->depth = visual->depth; - - private->base.klass = &image_class_normal; - //private->ximage = NULL; - /* more: implement as a pixmap? */ - return image; -} - - -GdkImage* -gdk_image_get (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -guint32 -gdk_image_get_pixel (GdkImage *image, - gint x, - gint y) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_image_put_pixel (GdkImage *image, - gint x, - gint y, - guint32 pixel) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -static void -gdk_nanox_image_destroy (GdkImage *image) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -static void -gdk_image_put_normal (GdkImage *image, - GdkDrawable *drawable, - GdkGC *gc, - gint xsrc, - gint ysrc, - gint xdest, - gint ydest, - gint width, - gint height) -{ - g_message("unimplemented %s", __FUNCTION__); -} - diff --git a/gdk/nanox/gdkinput-none.c b/gdk/nanox/gdkinput-none.c deleted file mode 100644 index 4c0575bc4f..0000000000 --- a/gdk/nanox/gdkinput-none.c +++ /dev/null @@ -1,79 +0,0 @@ -/* 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 Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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. - */ - -#include "gdkinputprivate.h" - -/* - * Modified by the GTK+ Team and others 1997-2000. 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/. - */ - -static void gdk_input_none_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask); - -void -gdk_input_init (void) -{ - gdk_input_vtable.set_mode = NULL; - gdk_input_vtable.set_axes = NULL; - gdk_input_vtable.set_key = NULL; - gdk_input_vtable.motion_events = NULL; - gdk_input_vtable.get_pointer = gdk_input_none_get_pointer; - gdk_input_vtable.grab_pointer = NULL; - gdk_input_vtable.ungrab_pointer = NULL; - gdk_input_vtable.configure_event = NULL; - gdk_input_vtable.enter_event = NULL; - gdk_input_vtable.other_event = NULL; - gdk_input_vtable.window_none_event = NULL; - gdk_input_vtable.enable_window = NULL; - gdk_input_vtable.disable_window = NULL; - - gdk_input_devices = g_list_append (NULL, (GdkDeviceInfo *) &gdk_input_core_info); - - gdk_input_ignore_core = FALSE; -} - -static void -gdk_input_none_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask) -{ - gint x_int, y_int; - - gdk_window_get_pointer (window, &x_int, &y_int, mask); - - if (x) *x = x_int; - if (y) *y = y_int; - if (pressure) *pressure = 0.5; - if (xtilt) *xtilt = 0; - if (ytilt) *ytilt = 0; -} diff --git a/gdk/nanox/gdkinput.c b/gdk/nanox/gdkinput.c deleted file mode 100644 index 6dd0195746..0000000000 --- a/gdk/nanox/gdkinput.c +++ /dev/null @@ -1,282 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" -#include "gdkinputprivate.h" - -static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y }; - -const GdkDeviceInfo gdk_input_core_info = -{ - GDK_CORE_POINTER, - "Core Pointer", - GDK_SOURCE_MOUSE, - GDK_MODE_SCREEN, - TRUE, - 2, - gdk_input_core_axes -}; - -/* Global variables */ - -GdkInputVTable gdk_input_vtable; -/* information about network port and host for gxid daemon */ -gchar *gdk_input_gxid_host; -gint gdk_input_gxid_port; -gint gdk_input_ignore_core; - -GList *gdk_input_devices; -GList *gdk_input_windows; - -GList * -gdk_input_list_devices (void) -{ - return gdk_input_devices; -} - -void -gdk_input_set_source (guint32 deviceid, GdkInputSource source) -{ - GdkDevicePrivate *gdkdev = gdk_input_find_device(deviceid); - g_return_if_fail (gdkdev != NULL); - - gdkdev->info.source = source; -} - -gboolean -gdk_input_set_mode (guint32 deviceid, GdkInputMode mode) -{ - if (deviceid == GDK_CORE_POINTER) - return FALSE; - - if (gdk_input_vtable.set_mode) - return gdk_input_vtable.set_mode(deviceid,mode); - else - return FALSE; -} - -void -gdk_input_set_axes (guint32 deviceid, GdkAxisUse *axes) -{ - if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_axes) - gdk_input_vtable.set_axes (deviceid, axes); -} - -void gdk_input_set_key (guint32 deviceid, - guint index, - guint keyval, - GdkModifierType modifiers) -{ - if (deviceid != GDK_CORE_POINTER && gdk_input_vtable.set_key) - gdk_input_vtable.set_key (deviceid, index, keyval, modifiers); -} - -GdkTimeCoord * -gdk_input_motion_events (GdkWindow *window, - guint32 deviceid, - guint32 start, - guint32 stop, - gint *nevents_return) -{ - GdkTimeCoord *coords; - int i; - - g_return_val_if_fail (window != NULL, NULL); - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); - - if (GDK_DRAWABLE_DESTROYED (window)) - return NULL; - - if (deviceid == GDK_CORE_POINTER) - { - return NULL; - } - else - { - if (gdk_input_vtable.motion_events) - { - return gdk_input_vtable.motion_events(window, - deviceid, start, stop, - nevents_return); - } - else - { - *nevents_return = 0; - return NULL; - } - } -} - -gint -gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev) -{ - if (gdk_input_vtable.enable_window) - return gdk_input_vtable.enable_window (window, gdkdev); - else - return TRUE; -} - -gint -gdk_input_disable_window (GdkWindow *window, GdkDevicePrivate *gdkdev) -{ - if (gdk_input_vtable.disable_window) - return gdk_input_vtable.disable_window(window,gdkdev); - else - return TRUE; -} - - -GdkInputWindow * -gdk_input_window_find(GdkWindow *window) -{ - GList *tmp_list; - - for (tmp_list=gdk_input_windows; tmp_list; tmp_list=tmp_list->next) - if (((GdkInputWindow *)(tmp_list->data))->window == window) - return (GdkInputWindow *)(tmp_list->data); - - return NULL; /* Not found */ -} - -/* FIXME: this routine currently needs to be called between creation - and the corresponding configure event (because it doesn't get the - root_relative_geometry). This should work with - gtk_window_set_extension_events, but will likely fail in other - cases */ - -void -gdk_input_set_extension_events (GdkWindow *window, gint mask, - GdkExtensionMode mode) -{ - GdkWindowPrivate *window_private; - GList *tmp_list; - GdkInputWindow *iw; - - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - window_private = (GdkWindowPrivate*) window; - if (GDK_DRAWABLE_DESTROYED (window)) - return; - - if (mode == GDK_EXTENSION_EVENTS_NONE) - mask = 0; - - if (mask != 0) - { - iw = g_new(GdkInputWindow,1); - - iw->window = window; - iw->mode = mode; - - iw->obscuring = NULL; - iw->num_obscuring = 0; - iw->grabbed = FALSE; - - gdk_input_windows = g_list_append(gdk_input_windows,iw); - window_private->extension_events = mask; - - /* Add enter window events to the event mask */ - /* FIXME, this is not needed for XINPUT_NONE */ - gdk_window_set_events (window, - gdk_window_get_events (window) | - GDK_ENTER_NOTIFY_MASK); - } - else - { - iw = gdk_input_window_find (window); - if (iw) - { - gdk_input_windows = g_list_remove(gdk_input_windows,iw); - g_free(iw); - } - - window_private->extension_events = 0; - } - - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) - { - GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)(tmp_list->data); - - if (gdkdev->info.deviceid != GDK_CORE_POINTER) - { - if (mask != 0 && gdkdev->info.mode != GDK_MODE_DISABLED - && (gdkdev->info.has_cursor || mode == GDK_EXTENSION_EVENTS_ALL)) - gdk_input_enable_window(window,gdkdev); - else - gdk_input_disable_window(window,gdkdev); - } - } -} - -void -gdk_input_window_destroy (GdkWindow *window) -{ - GdkInputWindow *input_window; - - input_window = gdk_input_window_find (window); - g_return_if_fail (input_window != NULL); - - gdk_input_windows = g_list_remove (gdk_input_windows,input_window); - g_free(input_window); -} - -void -gdk_input_exit (void) -{ - GList *tmp_list; - GdkDevicePrivate *gdkdev; - - for (tmp_list = gdk_input_devices; tmp_list; tmp_list = tmp_list->next) - { - gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (gdkdev->info.deviceid != GDK_CORE_POINTER) - { - gdk_input_set_mode(gdkdev->info.deviceid,GDK_MODE_DISABLED); - - g_free(gdkdev->info.name); -#ifndef XINPUT_NONE - g_free(gdkdev->axes); -#endif - g_free(gdkdev->info.axes); - g_free(gdkdev->info.keys); - g_free(gdkdev); - } - } - - g_list_free(gdk_input_devices); - - for (tmp_list = gdk_input_windows; tmp_list; tmp_list = tmp_list->next) - { - g_free(tmp_list->data); - } - g_list_free(gdk_input_windows); -} - -GdkDevicePrivate * -gdk_input_find_device(guint32 id) -{ - GList *tmp_list = gdk_input_devices; - GdkDevicePrivate *gdkdev; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (gdkdev->info.deviceid == id) - return gdkdev; - tmp_list = tmp_list->next; - } - return NULL; -} - -void -gdk_input_window_get_pointer (GdkWindow *window, - guint32 deviceid, - gdouble *x, - gdouble *y, - gdouble *pressure, - gdouble *xtilt, - gdouble *ytilt, - GdkModifierType *mask) -{ - if (gdk_input_vtable.get_pointer) - gdk_input_vtable.get_pointer (window, deviceid, x, y, pressure, - xtilt, ytilt, mask); -} diff --git a/gdk/nanox/gdkinputprivate.h b/gdk/nanox/gdkinputprivate.h deleted file mode 100644 index 03df0dfd54..0000000000 --- a/gdk/nanox/gdkinputprivate.h +++ /dev/null @@ -1,230 +0,0 @@ -/* 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 Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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-2000. 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/gdkmain-nanox.c b/gdk/nanox/gdkmain-nanox.c deleted file mode 100644 index 38983228b8..0000000000 --- a/gdk/nanox/gdkmain-nanox.c +++ /dev/null @@ -1,250 +0,0 @@ -#include "gdk.h" -#include "gdkinternals.h" -#include "gdkprivate-nanox.h" - -static GR_SCREEN_INFO screen_info; -static int gdk_use_xshm = 0; /* shm not supported */ -guint gdk_selection_property = 0; -gchar* gdk_progclass = NULL; -GdkWindowPrivate* gdk_xgrab_window = NULL; - -GdkArgDesc _gdk_windowing_args[] = { - {NULL} -}; - -gboolean -_gdk_windowing_init_check (int argc, char **argv) -{ - int result = GrOpen(); - if (result < 0) - return 0; - GrGetScreenInfo(&screen_info); - - return 1; -} - - -gchar* -gdk_set_locale (void) -{ - return ""; -} - -void -gdk_set_use_xshm (gboolean use_xshm) -{ - gdk_use_xshm = 0; /* shm not supported */ -} - -gboolean -gdk_get_use_xshm (void) -{ - return gdk_use_xshm; -} - -GdkGrabStatus -gdk_pointer_grab (GdkWindow * window, - gboolean owner_events, - GdkEventMask event_mask, - GdkWindow * confine_to, - GdkCursor * cursor, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_pointer_ungrab (guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gboolean -gdk_pointer_is_grabbed (void) -{ - return gdk_xgrab_window != NULL; -} - -GdkGrabStatus -gdk_keyboard_grab (GdkWindow * window, - gboolean owner_events, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_keyboard_ungrab (guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gint -gdk_screen_width (void) -{ - return screen_info.cols; -} - -gint -gdk_screen_height (void) -{ - return screen_info.rows; -} - -gint -gdk_screen_width_mm (void) -{ - return screen_info.cols*10/screen_info.xdpcm; -} - -gint -gdk_screen_height_mm (void) -{ - return screen_info.rows*10/screen_info.ydpcm; -} - -void -gdk_set_sm_client_id (const gchar* sm_client_id) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_key_repeat_disable (void) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_key_repeat_restore (void) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_beep (void) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_windowing_exit (void) -{ - GrClose(); -} - -gchar * -gdk_get_display (void) -{ - return "nano-X"; -} - -gchar* -gdk_keyval_name (guint keyval) -{ - static gchar buf[64]; - g_snprintf(buf, 64, "%c", keyval); - return buf; -} - -guint -gdk_keyval_from_name (const gchar *keyval_name) -{ - return *keyval_name; -} - -/* -void -gdk_keyval_convert_case (guint symbol, - guint *lower, - guint *upper) -{ -} -*/ - -static guint gdk_xid_hash (guint *xid); -static gboolean gdk_xid_equal (guint *a, - guint *b); - - -static GHashTable *xid_ht = NULL; - - -void -gdk_xid_table_insert (guint *xid, - gpointer data) -{ - g_return_if_fail (xid != NULL); - - if (!xid_ht) - xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash, - (GEqualFunc) gdk_xid_equal); - - g_hash_table_insert (xid_ht, xid, data); -} - -void -gdk_xid_table_remove (guint xid) -{ - if (!xid_ht) - xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash, - (GEqualFunc) gdk_xid_equal); - - g_hash_table_remove (xid_ht, &xid); -} - -gpointer -gdk_xid_table_lookup (guint xid) -{ - gpointer data = NULL; - - if (xid_ht) - data = g_hash_table_lookup (xid_ht, &xid); - - return data; -} - - -static guint -gdk_xid_hash (guint *xid) -{ - return *xid; -} - -static gboolean -gdk_xid_equal (guint *a, - guint *b) -{ - return (*a == *b); -} - -gchar * -gdk_wcstombs (const GdkWChar *src) -{ - gchar *mbstr; - gint i, length = 0; - - while (src[length] != 0) - length++; - mbstr = g_new (gchar, length + 1); - for (i=0; i <length+1;++i) - mbstr[i] = src[i]; - return mbstr; -} - -gint -gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max) -{ - gint i; - - for (i=0; i < dest_max && src[i]; i++) - dest[i] = src[i]; - return i; -} - diff --git a/gdk/nanox/gdkpixmap-nanox.c b/gdk/nanox/gdkpixmap-nanox.c deleted file mode 100644 index 3235acf233..0000000000 --- a/gdk/nanox/gdkpixmap-nanox.c +++ /dev/null @@ -1,149 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkDrawableClass _gdk_nanox_pixmap_class; - -static void -gdk_nanox_pixmap_destroy (GdkPixmap *pixmap) -{ - GrDestroyWindow (GDK_DRAWABLE_XID (pixmap)); - gdk_xid_table_remove (GDK_DRAWABLE_XID (pixmap)); - - g_free (GDK_DRAWABLE_XDATA (pixmap)); -} - -static GdkDrawable * -gdk_nanox_pixmap_alloc (void) -{ - GdkDrawable *drawable; - GdkDrawablePrivate *private; - - static GdkDrawableClass klass; - static gboolean initialized = FALSE; - - if (!initialized) - { - initialized = TRUE; - - klass = _gdk_nanox_drawable_class; - klass.destroy = gdk_nanox_pixmap_destroy; - } - - drawable = gdk_drawable_alloc (); - private = (GdkDrawablePrivate *)drawable; - - private->klass = &klass; - private->klass_data = g_new (GdkDrawableXData, 1); - private->window_type = GDK_DRAWABLE_PIXMAP; - - return drawable; -} - -GdkPixmap* -gdk_pixmap_new (GdkWindow *window, - gint width, - gint height, - gint depth) -{ - GdkPixmap *pixmap; - GdkDrawablePrivate *private; - - g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); - g_return_val_if_fail ((window != NULL) || (depth != -1), NULL); - g_return_val_if_fail ((width != 0) && (height != 0), NULL); - - if (!window) - window = gdk_parent_root; - - if (GDK_DRAWABLE_DESTROYED (window)) - return NULL; - - if (depth == -1) - depth = gdk_drawable_get_visual (window)->depth; - - pixmap = gdk_nanox_pixmap_alloc (); - private = (GdkDrawablePrivate *)pixmap; - - GDK_DRAWABLE_XDATA (private)->xid = GrNewPixmap (width, height, NULL); - private->width = width; - private->height = height; - - gdk_xid_table_insert (&GDK_DRAWABLE_XID (pixmap), pixmap); - - return pixmap; -} - -GdkPixmap * -gdk_bitmap_create_from_data (GdkWindow *window, - const gchar *data, - gint width, - gint height) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_create_from_data (GdkWindow *window, - const gchar *data, - gint width, - gint height, - gint depth, - GdkColor *fg, - GdkColor *bg) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -GdkPixmap* -gdk_pixmap_colormap_create_from_xpm (GdkWindow *window, - GdkColormap *colormap, - GdkBitmap **mask, - GdkColor *transparent_color, - const gchar *filename) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -GdkPixmap* -gdk_pixmap_create_from_xpm (GdkWindow *window, - GdkBitmap **mask, - GdkColor *transparent_color, - const gchar *filename) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_colormap_create_from_xpm_d (GdkWindow *window, - GdkColormap *colormap, - GdkBitmap **mask, - GdkColor *transparent_color, - gchar **data) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_create_from_xpm_d (GdkWindow *window, - GdkBitmap **mask, - GdkColor *transparent_color, - gchar **data) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkPixmap* -gdk_pixmap_foreign_new (guint32 anid) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - diff --git a/gdk/nanox/gdkprivate-nanox.h b/gdk/nanox/gdkprivate-nanox.h deleted file mode 100644 index aed8c3de55..0000000000 --- a/gdk/nanox/gdkprivate-nanox.h +++ /dev/null @@ -1,178 +0,0 @@ -/* 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 Lesser 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser 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-2000. 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/gdkproperty-nanox.c b/gdk/nanox/gdkproperty-nanox.c deleted file mode 100644 index 2c88c70485..0000000000 --- a/gdk/nanox/gdkproperty-nanox.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -GdkAtom -gdk_atom_intern (const gchar *atom_name, - gboolean only_if_exists) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -gchar* -gdk_atom_name (GdkAtom atom) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -gboolean -gdk_property_get (GdkWindow *window, - GdkAtom property, - GdkAtom type, - gulong offset, - gulong length, - gint pdelete, - GdkAtom *actual_property_type, - gint *actual_format_type, - gint *actual_length, - guchar **data) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -gdk_property_change (GdkWindow *window, - GdkAtom property, - GdkAtom type, - gint format, - GdkPropMode mode, - const guchar *data, - gint nelements) -{ - g_message("unimplemented %s", __FUNCTION__); - return; -} - -void -gdk_property_delete (GdkWindow *window, - GdkAtom property) -{ - g_message("unimplemented %s", __FUNCTION__); - return; -} - diff --git a/gdk/nanox/gdkregion-nanox.c b/gdk/nanox/gdkregion-nanox.c deleted file mode 100644 index b0bcc33d81..0000000000 --- a/gdk/nanox/gdkregion-nanox.c +++ /dev/null @@ -1,107 +0,0 @@ -#include "gdkprivate-nanox.h" - -GdkRegion* -gdk_region_new (void) -{ - return NULL; -} - - -void -gdk_region_destroy (GdkRegion *region) -{ -} - - -gboolean -gdk_region_empty (GdkRegion *region) -{ - return 1; -} - -gboolean -gdk_region_equal (GdkRegion *region1, - GdkRegion *region2) -{ - return 1; -} - - -void -gdk_region_get_clipbox(GdkRegion *region, - GdkRectangle *rectangle) -{ -} - -gboolean -gdk_region_point_in (GdkRegion *region, - gint x, - gint y) -{ - return 0; -} - -GdkOverlapType -gdk_region_rect_in (GdkRegion *region, - GdkRectangle *rect) -{ - return 0; -} - -GdkRegion * -gdk_region_polygon (GdkPoint *points, - gint npoints, - GdkFillRule fill_rule) -{ - return NULL; -} - -void -gdk_region_offset (GdkRegion *region, - gint dx, - gint dy) -{ -} - -void -gdk_region_shrink (GdkRegion *region, - gint dx, - gint dy) -{ -} - -GdkRegion* -gdk_region_union_with_rect (GdkRegion *region, - GdkRectangle *rect) -{ - return NULL; -} - -GdkRegion* -gdk_regions_intersect (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - -GdkRegion* -gdk_regions_union (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - -GdkRegion* -gdk_regions_subtract (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - -GdkRegion* -gdk_regions_xor (GdkRegion *source1, - GdkRegion *source2) -{ - return NULL; -} - diff --git a/gdk/nanox/gdkselection-nanox.c b/gdk/nanox/gdkselection-nanox.c deleted file mode 100644 index 60d7fcaa2c..0000000000 --- a/gdk/nanox/gdkselection-nanox.c +++ /dev/null @@ -1,89 +0,0 @@ -#include "gdk.h" -#include "gdkprivate-nanox.h" - -gboolean -gdk_selection_owner_set (GdkWindow *owner, - GdkAtom selection, - guint32 time, - gboolean send_event) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -GdkWindow* -gdk_selection_owner_get (GdkAtom selection) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -void -gdk_selection_convert (GdkWindow *requestor, - GdkAtom selection, - GdkAtom target, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -gint -gdk_selection_property_get (GdkWindow *requestor, - guchar **data, - GdkAtom *ret_type, - gint *ret_format) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_selection_send_notify (guint32 requestor, - GdkAtom selection, - GdkAtom target, - GdkAtom property, - guint32 time) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -gint -gdk_text_property_to_text_list (GdkAtom encoding, - gint format, - const guchar *text, - gint length, - gchar ***list) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_free_text_list (gchar **list) -{ - g_return_if_fail (list != NULL); - -} - -gint -gdk_string_to_compound_text (const gchar *str, - GdkAtom *encoding, - gint *format, - guchar **ctext, - gint *length) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void gdk_free_compound_text (guchar *ctext) -{ -/* if (ctext) - g_free (ctext);*/ -} - diff --git a/gdk/nanox/gdkvisual-nanox.c b/gdk/nanox/gdkvisual-nanox.c deleted file mode 100644 index 616410d03b..0000000000 --- a/gdk/nanox/gdkvisual-nanox.c +++ /dev/null @@ -1,95 +0,0 @@ - -#include "gdkvisual.h" -#include "gdkprivate-nanox.h" -#include <glib.h> - -static GdkVisual system_visual; - -void -gdk_visual_init (void) -{ - system_visual.type = GDK_VISUAL_TRUE_COLOR; - system_visual.depth = 24; - system_visual.bits_per_rgb = 8; -} - -GdkVisual* -gdk_visual_ref (GdkVisual *visual) -{ - return visual; -} - -void -gdk_visual_unref (GdkVisual *visual) -{ - return; -} - -gint -gdk_visual_get_best_depth (void) -{ - return 24; -} - -GdkVisualType -gdk_visual_get_best_type (void) -{ - return GDK_VISUAL_TRUE_COLOR; -} - -GdkVisual* -gdk_visual_get_system (void) -{ - return ((GdkVisual*) &system_visual); -} - -GdkVisual* -gdk_visual_get_best (void) -{ - return ((GdkVisual*) &system_visual); -} - -GdkVisual* -gdk_visual_get_best_with_type (GdkVisualType visual_type) -{ - if (visual_type == GDK_VISUAL_TRUE_COLOR) - return &system_visual; - return NULL; -} - -GdkVisual* -gdk_visual_get_best_with_both (gint depth, - GdkVisualType visual_type) -{ - if (visual_type == GDK_VISUAL_TRUE_COLOR && depth == 24) - return &system_visual; - return NULL; -} - -void -gdk_query_depths (gint **depths, - gint *count) -{ - if (count) - *count = 1; - if (depths) - *depths[0] = 24; -} - -void -gdk_query_visual_types (GdkVisualType **visual_types, - gint *count) -{ - if (count) - *count = 1; - if (visual_types) - *visual_types[0] = GDK_VISUAL_TRUE_COLOR; -} - -GList* -gdk_list_visuals (void) -{ - return g_list_append(NULL, &system_visual); -} - - diff --git a/gdk/nanox/gdkwindow-nanox.c b/gdk/nanox/gdkwindow-nanox.c deleted file mode 100644 index c537c8fe95..0000000000 --- a/gdk/nanox/gdkwindow-nanox.c +++ /dev/null @@ -1,600 +0,0 @@ - -#include "gdk.h" -#include "config.h" - -#include "gdkwindow.h" -#include "gdkprivate-nanox.h" -#include "gdkprivate.h" - -static void create_toplevel (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height); -static int manage_event (GR_EVENT *event); -static void set_title (GR_WINDOW_ID win, char* title); - -typedef struct { - char * name; - void (*create_toplevel) (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height); - int (*manage_event) (GR_EVENT *event); - void (*set_title) (GR_WINDOW_ID win, char* title); -} GdkWindowManager; - -typedef struct { - GR_WINDOW_ID pwin; - GR_WINDOW_ID win; - char *title; - GdkWMFunction functions; - GdkWMDecoration decors; -} WMInfo; - -static GdkWindowManager test_wm = { - "test", - create_toplevel, - manage_event, - set_title -}; - -static GdkWindowManager *default_wm = &test_wm; -static GHashTable * wm_hash = NULL; -GdkDrawableClass _gdk_windowing_window_class; - -static void create_toplevel (GR_WINDOW_ID parent, GR_WINDOW_ID win, int x, int y, int width, int height) -{ - WMInfo *winfo; - - winfo = g_new0(WMInfo, 1); - winfo->pwin = GrNewWindow(parent, x, y-20, width, height+20, 0, RGB(150, 50,150), WHITE); - winfo->win = win; - GrReparentWindow(winfo->pwin, win, 20, 0); - if (!wm_hash) - wm_hash = g_hash_table_new(g_int_hash, g_int_equal); - g_hash_table_insert(wm_hash, winfo->pwin, winfo); -} - -static int manage_event (GR_EVENT *event) { - return 0; -} - -static void set_title (GR_WINDOW_ID win, char* title) { -} - - -static void -gdk_nanox_window_destroy (GdkDrawable *drawable) -{ - if (!GDK_DRAWABLE_DESTROYED (drawable)) - { - if (GDK_DRAWABLE_TYPE (drawable) == GDK_WINDOW_FOREIGN) - gdk_xid_table_remove (GDK_DRAWABLE_XID (drawable)); - else - g_warning ("losing last reference to undestroyed window\n"); - } - - g_free (GDK_DRAWABLE_XDATA (drawable)); -} - -static GdkWindowPrivate* -gdk_window_nanox_alloc() { - GdkWindow *window; - GdkWindowPrivate *private; - - static GdkDrawableClass klass; - static gboolean initialized = FALSE; - - if (!initialized) - { - initialized = TRUE; - - klass = _gdk_nanox_drawable_class; - klass.destroy = gdk_nanox_window_destroy; - } - - window = _gdk_window_alloc (); - private = (GdkWindowPrivate *)window; - - private->drawable.klass = &klass; - private->drawable.klass_data = g_new (GdkDrawableXData, 1); - - return window; -} - -static void -gdk_window_internal_destroy (GdkWindow *window, - gboolean xdestroy, - gboolean our_destroy) -{ -} - -GR_WINDOW_ID gdk_root_window = GR_ROOT_WINDOW_ID; - -void -gdk_window_init (void) -{ - GdkWindowPrivate *private; - - gdk_parent_root = gdk_window_nanox_alloc (); - private = (GdkWindowPrivate *)gdk_parent_root; - - GDK_DRAWABLE_XDATA (gdk_parent_root)->xid = gdk_root_window; - - private->drawable.window_type = GDK_WINDOW_ROOT; - private->drawable.width = gdk_screen_width(); - private->drawable.height = gdk_screen_height(); - - gdk_window_set_events(private, -1); - gdk_xid_table_insert (&gdk_root_window, gdk_parent_root); -} - - -GdkWindow* -gdk_window_new (GdkWindow *parent, - GdkWindowAttr *attributes, - gint attributes_mask) -{ - GR_WINDOW_ID new_win; - GdkWindowPrivate *private, *parent_private; - int x, y, width, height; - int border = 1; - - if (!parent) - parent = gdk_parent_root; - - if (GDK_DRAWABLE_DESTROYED (parent)) - return NULL; - - private->parent = parent; - - parent_private = (GdkWindowPrivate*)parent; - - if (attributes_mask & GDK_WA_X) - x = attributes->x; - else - x = 0; - - if (attributes_mask & GDK_WA_Y) - y = attributes->y; - else - y = 0; - - width = attributes->width; - height = attributes->height; - - private = gdk_window_nanox_alloc(); - private->x = x; - private->y = y; - private->drawable.width = (attributes->width > 1) ? (attributes->width) : (1); - private->drawable.height = (attributes->height > 1) ? (attributes->height) : (1); - private->drawable.window_type = attributes->window_type; - - if (attributes->window_type == GDK_WINDOW_TOPLEVEL || attributes->window_type == GDK_WINDOW_DIALOG) - border = 2; - /* if toplevel reparent to our own window managed window... (check override_redirect) */ - if (attributes->wclass == GDK_INPUT_OUTPUT) - new_win = GrNewWindow(GDK_WINDOW_XWINDOW(parent), x, y, width, height, border, RGB(150,150,150), WHITE); - else - new_win = GrNewInputWindow(GDK_WINDOW_XWINDOW(parent), x, y, width, height); - - GDK_DRAWABLE_XDATA(private)->xid = new_win; - gdk_drawable_ref(private); - - private->drawable.colormap = gdk_colormap_get_system (); - - gdk_xid_table_insert (&GDK_DRAWABLE_XID(private), private); - g_message("created window %d %d %d %d %d", new_win, x, y, width, height); - GrSelectEvents(GDK_DRAWABLE_XID(private), -1); - return (GdkWindow*)private;; -} - - -GdkWindow * -gdk_window_foreign_new (guint32 anid) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -void -gdk_window_destroy (GdkWindow *window) -{ - gdk_window_internal_destroy (window, TRUE, TRUE); - gdk_drawable_unref (window); -} - -void -gdk_window_destroy_notify (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_show (GdkWindow *window) -{ - GdkWindowPrivate *private; - - g_return_if_fail (window != NULL); - - private = (GdkWindowPrivate*) window; - if (!private->drawable.destroyed) - { - private->mapped = TRUE; - GrRaiseWindow (GDK_DRAWABLE_XID (window)); - GrMapWindow (GDK_DRAWABLE_XID (window)); - } -} - -void -gdk_window_hide (GdkWindow *window) -{ - GdkWindowPrivate *private; - - g_return_if_fail (window != NULL); - - private = (GdkWindowPrivate*) window; - if (!private->drawable.destroyed) - { - private->mapped = FALSE; - GrUnmapWindow (GDK_DRAWABLE_XID (window)); - } -} - -void -gdk_window_raise (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrRaiseWindow (GDK_DRAWABLE_XID (window)); -} - -void -gdk_window_lower (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrLowerWindow (GDK_DRAWABLE_XID (window)); -} - -void -gdk_window_withdraw (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_move (GdkWindow *window, - gint x, - gint y) -{ - GrMoveWindow(GDK_DRAWABLE_XID(window), x, y); -} - -void -gdk_window_resize (GdkWindow *window, - gint width, - gint height) -{ - GrResizeWindow(GDK_DRAWABLE_XID(window), width, height); -} - -void -gdk_window_move_resize (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - GrMoveWindow(GDK_DRAWABLE_XID(window), x, y); - GrResizeWindow(GDK_DRAWABLE_XID(window), width, height); -} - -void -gdk_window_reparent (GdkWindow *window, - GdkWindow *new_parent, - gint x, - gint y) -{ - GrReparentWindow(GDK_DRAWABLE_XID(window), GDK_DRAWABLE_XID(new_parent), x, y); -} - -void -gdk_window_clear (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrClearWindow (GDK_DRAWABLE_XID (window), 0); -} - -void -_gdk_windowing_window_clear_area (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrClearWindow (GDK_DRAWABLE_XID (window), 0); -} - -void -_gdk_windowing_window_clear_area_e (GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (!GDK_DRAWABLE_DESTROYED (window)) - GrClearWindow (GDK_DRAWABLE_XID (window), 1); -} - -void -gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_geometry_hints (GdkWindow *window, - GdkGeometry *geometry, - GdkWindowHints geom_mask) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_title (GdkWindow *window, - const gchar *title) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_role (GdkWindow *window, - const gchar *role) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_background (GdkWindow *window, - GdkColor *color) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - g_message("unimplemented %s", __FUNCTION__); - if (GDK_DRAWABLE_DESTROYED (window)) - return; -} - - -void -gdk_window_set_back_pixmap (GdkWindow *window, - GdkPixmap *pixmap, - gboolean parent_relative) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_cursor (GdkWindow *window, - GdkCursor *cursor) -{ -} - -void -gdk_window_get_geometry (GdkWindow *window, - gint *x, - gint *y, - gint *width, - gint *height, - gint *depth) -{ - GR_WINDOW_INFO winfo; - g_return_if_fail (window == NULL || GDK_IS_WINDOW (window)); - - if (!window) - window = gdk_parent_root; - - if (!GDK_DRAWABLE_DESTROYED (window)) - { - GrGetWindowInfo(GDK_DRAWABLE_XID(window), &winfo); - if (x) - *x = winfo.x; - if (y) - *y = winfo.y; - if (width) - *width = winfo.width; - if (height) - *height = winfo.height; - if (depth) - *depth = 24; - } -} - - -gint -gdk_window_get_origin (GdkWindow *window, - gint *x, - gint *y) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -gboolean -gdk_window_get_deskrelative_origin (GdkWindow *window, - gint *x, - gint *y) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - - -void -gdk_window_get_root_origin (GdkWindow *window, - gint *x, - gint *y) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -GdkWindow* -gdk_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkWindow* -gdk_window_at_pointer (gint *win_x, - gint *win_y) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - - -GList* -gdk_window_get_children (GdkWindow *window) -{ - g_message("unimplemented %s", __FUNCTION__); - return NULL; -} - -GdkEventMask -gdk_window_get_events (GdkWindow *window) -{ - return -1; -} - - -void -gdk_window_set_events (GdkWindow *window, - GdkEventMask event_mask) -{ - GrSelectEvents(GDK_DRAWABLE_XID(window), -1); -} - - -void -gdk_window_shape_combine_mask (GdkWindow *window, - GdkBitmap *mask, - gint x, gint y) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_override_redirect (GdkWindow *window, - gboolean override_redirect) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_icon (GdkWindow *window, - GdkWindow *icon_window, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_icon_name (GdkWindow *window, - const gchar *name) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_group (GdkWindow *window, - GdkWindow *leader) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_decorations (GdkWindow *window, - GdkWMDecoration decorations) -{ - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_set_functions (GdkWindow *window, - GdkWMFunction functions) -{ - g_message("unimplemented %s", __FUNCTION__); -} - -void -gdk_window_set_child_shapes (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - g_message("unimplemented %s", __FUNCTION__); -} - - -void -gdk_window_merge_child_shapes (GdkWindow *window) -{ - g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - g_message("unimplemented %s", __FUNCTION__); -} - - -gboolean -gdk_window_set_static_gravities (GdkWindow *window, - gboolean use_static) -{ - g_message("unimplemented %s", __FUNCTION__); - return 0; -} - -void -_gdk_windowing_window_get_offsets (GdkWindow *window, gint *x_offset, gint *y_offset) { - *x_offset = *y_offset = 0; -} - -gboolean -_gdk_windowing_window_queue_antiexpose (GdkWindow *window, GdkRegion *area) { - return FALSE; -} |