Commit f6a5a938 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

app/Makefile.am app/app_procs.c app/brushes.c app/commands.[ch]

Fri Jun  5 22:37:40 1998  Owen Taylor  <otaylor@gtk.org>

	* app/Makefile.am app/app_procs.c app/brushes.c app/commands.[ch]
	  app/disp_callbacks.c app/gdisplay.[ch] app/gimprc.c
	  app/interface.[ch] app/menus.c app/paint_core.[ch]
	  app/paintbrush.c app/palette.c app/scroll.c
	  app/tools.[ch] app/undo.c

	- Added two new dialogs - input devices; (GtkInputDialog)
	  and DeviceStatus - which shows the tool/color for
	  each device.

	- Added device_status_update() call that gets called
	  whenever the tool/color etc. are changed.

	- Added ~/.gimp/devicerc file to store settings

	- Code to draw cursor on canvas for non XFree86 XInput
	  where device can't control cursor and extended input
	  device simultaneously.

	- Changed input handling so that we always use the pointer
	  position from the device, not from gdk_input_window_get_cursor,
	  so that motion and cursor position sync.

	- Various changes so things work with non-integer coordinates

	- Pay attention to pressure and tilt in basic tool support.

        - New paint mode PRESSURE that changes the brush based on
	  the brush pressure

	- Left in a few XInput hacks that should be removed, but I no longer
	  remember what they are.
parent 664f6c87
Fri Jun 5 22:37:40 1998 Owen Taylor <otaylor@gtk.org>
* app/Makefile.am app/app_procs.c app/brushes.c app/commands.[ch]
app/disp_callbacks.c app/gdisplay.[ch] app/gimprc.c
app/interface.[ch] app/menus.c app/paint_core.[ch]
app/paintbrush.c app/palette.c app/scroll.c
app/tools.[ch] app/undo.c
- Added two new dialogs - input devices; (GtkInputDialog)
and DeviceStatus - which shows the tool/color for
each device.
- Added device_status_update() call that gets called
whenever the tool/color etc. are changed.
- Added ~/.gimp/devicerc file to store settings
- Code to draw cursor on canvas for non XFree86 XInput
where device can't control cursor and extended input
device simultaneously.
- Changed input handling so that we always use the pointer
position from the device, not from gdk_input_window_get_cursor,
so that motion and cursor position sync.
- Various changes so things work with non-integer coordinates
- Pay attention to pressure and tilt in basic tool support.
- New paint mode PRESSURE that changes the brush based on
the brush pressure
- Left in a few XInput hacks that should be removed, but I no longer
remember what they are.
Fri Jun 5 18:08:32 PDT 1998 Manish Singh <yosh@gimp.org>
* configure.in: bumped to 1.1
......
......@@ -79,6 +79,8 @@ gimp_SOURCES = \
datafiles.h \
desaturate.c \
desaturate.h \
devices.c \
devices.h \
dialog_types.h \
disp_callbacks.c \
disp_callbacks.h \
......
......@@ -32,6 +32,7 @@
#include "convert.h"
#include "curves.h"
#include "desaturate.h"
#include "devices.h"
#include "channel_ops.h"
#include "drawable.h"
#include "equalize.h"
......@@ -2436,6 +2437,20 @@ dialogs_tools_options_cmd_callback (GtkWidget *widget,
tools_options_dialog_show ();
}
void
dialogs_input_devices_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
create_input_dialog ();
}
void
dialogs_device_status_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
create_device_status ();
}
void
about_dialog_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -89,6 +89,8 @@ void dialogs_gradient_editor_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
......
......@@ -30,6 +30,7 @@
#include "brushes.h"
#include "color_transfer.h"
#include "curves.h"
#include "devices.h"
#include "gdisplay.h"
#include "colormaps.h"
#include "fileops.h"
......@@ -511,6 +512,7 @@ app_init (void)
if (no_interface == FALSE)
{
get_standard_colormaps ();
devices_init ();
create_toolbox ();
gximage_init ();
render_setup (transparency_type, transparency_size);
......
......@@ -29,6 +29,7 @@
#include "buildmenu.h"
#include "colormaps.h"
#include "datafiles.h"
#include "devices.h"
#include "errors.h"
#include "general.h"
#include "gimprc.h"
......@@ -351,6 +352,8 @@ select_brush (GBrushP brush)
/* Keep up appearances in the brush dialog */
if (brush_select_dialog)
brush_select_select (brush_select_dialog, brush->index);
device_status_update (current_device);
}
......
......@@ -32,6 +32,7 @@
#include "convert.h"
#include "curves.h"
#include "desaturate.h"
#include "devices.h"
#include "channel_ops.h"
#include "drawable.h"
#include "equalize.h"
......@@ -2436,6 +2437,20 @@ dialogs_tools_options_cmd_callback (GtkWidget *widget,
tools_options_dialog_show ();
}
void
dialogs_input_devices_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
create_input_dialog ();
}
void
dialogs_device_status_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
create_device_status ();
}
void
about_dialog_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -89,6 +89,8 @@ void dialogs_gradient_editor_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
......
......@@ -1018,6 +1018,18 @@ undo_pop_paint (GImage *gimage,
pc->lasty = pu->lasty;
pu->lasty = tmp;
tmp = pc->lastpressure;
pc->lastpressure = pu->lastpressure;
pu->lastpressure = tmp;
tmp = pc->lastxtilt;
pc->lastxtilt = pu->lastxtilt;
pu->lastxtilt = tmp;
tmp = pc->lastytilt;
pc->lastytilt = pu->lastytilt;
pu->lastytilt = tmp;
return TRUE;
}
......
......@@ -75,6 +75,7 @@ static GSList * gdisplay_process_area_list(GSList *, GArea *);
static void gdisplay_add_update_area (GDisplay *, int, int, int, int);
static void gdisplay_add_display_area (GDisplay *, int, int, int, int);
static void gdisplay_paint_area (GDisplay *, int, int, int, int);
static void gdisplay_draw_cursor (GDisplay *);
static void gdisplay_display_area (GDisplay *, int, int, int, int);
static guint gdisplay_hash (GDisplay *);
......@@ -121,6 +122,10 @@ gdisplay_new (GImage *gimage,
gdisp->draw_guides = TRUE;
gdisp->snap_to_guides = TRUE;
gdisp->draw_cursor = FALSE;
gdisp->proximity = FALSE;
gdisp->have_cursor = FALSE;
/* add the new display to the list so that it isn't lost */
display_list = g_slist_append (display_list, (void *) gdisp);
......@@ -340,6 +345,10 @@ gdisplay_flush (GDisplay *gdisp)
/* draw the guides */
gdisplay_draw_guides (gdisp);
/* and the cursor (if we have a software cursor */
if (gdisp->have_cursor)
gdisplay_draw_cursor (gdisp);
/* restart (and recalculate) the selection boundaries */
selection_start (gdisp->select, TRUE);
......@@ -520,10 +529,10 @@ gdisplay_find_guide (GDisplay *gdisp,
void
gdisplay_snap_point (GDisplay *gdisp,
int x ,
int y,
int *tx,
int *ty)
gdouble x ,
gdouble y,
gdouble *tx,
gdouble *ty)
{
GList *tmp_list;
Guide *guide;
......@@ -598,8 +607,8 @@ gdisplay_snap_rectangle (GDisplay *gdisp,
int *tx1,
int *ty1)
{
int nx1, ny1;
int nx2, ny2;
double nx1, ny1;
double nx2, ny2;
*tx1 = x1;
*ty1 = y1;
......@@ -611,18 +620,73 @@ gdisplay_snap_rectangle (GDisplay *gdisp,
gdisplay_snap_point (gdisp, x1, y1, &nx1, &ny1);
gdisplay_snap_point (gdisp, x2, y2, &nx2, &ny2);
if (x1 != nx1)
if (x1 != (int)nx1)
*tx1 = nx1;
else if (x2 != nx2)
else if (x2 != (int)nx2)
*tx1 = x1 + (nx2 - x2);
if (y1 != ny1)
if (y1 != (int)ny1)
*ty1 = ny1;
else if (y2 != ny2)
else if (y2 != (int)ny2)
*ty1 = y1 + (ny2 - y2);
}
}
void
gdisplay_draw_cursor (GDisplay *gdisp)
{
int x = gdisp->cursor_x;
int y = gdisp->cursor_y;
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x - 7, y-1, x + 7, y-1);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->black_gc,
x - 7, y, x + 7, y);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x - 7, y+1, x + 7, y+1);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x-1, y - 7, x-1, y + 7);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->black_gc,
x, y - 7, x, y + 7);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x+1, y - 7, x+1, y + 7);
}
void
gdisplay_update_cursor (GDisplay *gdisp, int x, int y)
{
int new_cursor;
new_cursor = gdisp->draw_cursor && gdisp->proximity;
/* Erase old cursor, if necessary */
if (gdisp->have_cursor && (!new_cursor || x != gdisp->cursor_x ||
y != gdisp->cursor_y))
{
gdisplay_expose_area (gdisp, gdisp->cursor_x - 7,
gdisp->cursor_y - 7,
15, 15);
if (!new_cursor)
{
gdisp->have_cursor = FALSE;
gdisplay_flush (gdisp);
}
}
gdisp->have_cursor = new_cursor;
gdisp->cursor_x = x;
gdisp->cursor_y = y;
if (new_cursor)
gdisplay_flush (gdisp);
}
void
gdisplay_remove_and_delete (GDisplay *gdisp)
......
......@@ -89,6 +89,12 @@ struct _GDisplay
GSList *display_areas; /* Display areas list */
GdkCursorType current_cursor; /* Currently installed cursor */
short draw_cursor; /* should we draw software cursor ? */
int cursor_x; /* software cursor X value */
int cursor_y; /* software cursor Y value */
short proximity; /* is a device in proximity of gdisplay ? */
short have_cursor; /* is cursor currently drawn ? */
};
......@@ -116,8 +122,9 @@ void gdisplay_flush (GDisplay *);
void gdisplay_draw_guides (GDisplay *);
void gdisplay_draw_guide (GDisplay *, Guide *, int);
Guide* gdisplay_find_guide (GDisplay *, int, int);
void gdisplay_snap_point (GDisplay *, int , int, int *, int *);
void gdisplay_snap_point (GDisplay *, double , double, double *, double *);
void gdisplay_snap_rectangle (GDisplay *, int, int, int, int, int *, int *);
void gdisplay_update_cursor (GDisplay *, int, int);
/* function declarations */
......
......@@ -20,6 +20,7 @@
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "devices.h"
#include "disp_callbacks.h"
#include "gdisplay.h"
#include "general.h"
......@@ -36,6 +37,10 @@
#define HORIZONTAL 1
#define VERTICAL 2
/* Function declarations */
static void gdisplay_check_device_cursor (GDisplay *gdisp);
static void
redraw (GDisplay *gdisp,
int x,
......@@ -62,6 +67,29 @@ redraw (GDisplay *gdisp,
}
}
static void
gdisplay_check_device_cursor (GDisplay *gdisp)
{
GList *tmp_list;
/* gdk_input_list_devices returns an internal list, so we shouldn't
free it afterwards */
tmp_list = gdk_input_list_devices();
while (tmp_list)
{
GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data;
if (info->deviceid == current_device)
{
gdisp->draw_cursor = !info->has_cursor;
break;
}
tmp_list = tmp_list->next;
}
}
gint
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event)
......@@ -71,8 +99,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
GdkEventMotion *mevent;
GdkEventButton *bevent;
GdkEventKey *kevent;
gint tx, ty;
GdkModifierType tmask;
gdouble tx, ty;
guint state = 0;
gint return_val = FALSE;
static gboolean scrolled = FALSE;
......@@ -111,9 +138,11 @@ gdisplay_canvas_events (GtkWidget *canvas,
setup_scale (gdisp);
}
/* get the pointer position */
gdk_window_get_pointer (canvas->window, &tx, &ty, &tmask);
/* Find out what device the event occurred upon */
if (devices_check_change (event))
gdisplay_check_device_cursor (gdisp);
switch (event->type)
{
case GDK_EXPOSE:
......@@ -132,6 +161,16 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
break;
case GDK_LEAVE_NOTIFY:
gdisp->proximity = FALSE;
gdisplay_update_cursor (gdisp, 0, 0);
break;
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
gdisplay_update_cursor (gdisp, 0, 0);
break;
case GDK_BUTTON_PRESS:
bevent = (GdkEventButton *) event;
state = bevent->state;
......@@ -254,13 +293,24 @@ gdisplay_canvas_events (GtkWidget *canvas,
mevent = (GdkEventMotion *) event;
state = mevent->state;
/* Ask for the pointer position, but ignore it except for cursor
* handling, so motion events sync with the button press/release events */
if (mevent->is_hint)
gdk_input_window_get_pointer (canvas->window, current_device, &tx, &ty,
NULL, NULL, NULL, NULL);
else
{
mevent->x = tx;
mevent->y = ty;
mevent->state = tmask;
tx = mevent->x;
ty = mevent->y;
}
if (!gdisp->proximity)
{
gdisp->proximity = TRUE;
gdisplay_check_device_cursor (gdisp);
}
if (active_tool && ((active_tool->type == MOVE) ||
!gimage_is_empty (gdisp->gimage)) &&
(mevent->state & GDK_BUTTON1_MASK))
......@@ -369,6 +419,8 @@ gdisplay_canvas_events (GtkWidget *canvas,
gdisplay_install_tool_cursor (gdisp, GDK_TOP_LEFT_ARROW);
}
gdisplay_update_cursor (gdisp, tx, ty);
return return_val;
}
......
......@@ -21,7 +21,9 @@
#define CANVAS_EVENT_MASK GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK | \
GDK_ENTER_NOTIFY_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | \
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | \
GDK_PROXIMITY_OUT_MASK
gint gdisplay_canvas_events (GtkWidget *, GdkEvent *);
gint gdisplay_hruler_button_press (GtkWidget *, GdkEventButton *, gpointer);
......
......@@ -20,6 +20,7 @@
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "devices.h"
#include "disp_callbacks.h"
#include "gdisplay.h"
#include "general.h"
......@@ -36,6 +37,10 @@
#define HORIZONTAL 1
#define VERTICAL 2
/* Function declarations */
static void gdisplay_check_device_cursor (GDisplay *gdisp);
static void
redraw (GDisplay *gdisp,
int x,
......@@ -62,6 +67,29 @@ redraw (GDisplay *gdisp,
}
}
static void
gdisplay_check_device_cursor (GDisplay *gdisp)
{
GList *tmp_list;
/* gdk_input_list_devices returns an internal list, so we shouldn't
free it afterwards */
tmp_list = gdk_input_list_devices();
while (tmp_list)
{
GdkDeviceInfo *info = (GdkDeviceInfo *)tmp_list->data;
if (info->deviceid == current_device)
{
gdisp->draw_cursor = !info->has_cursor;
break;
}
tmp_list = tmp_list->next;
}
}
gint
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event)
......@@ -71,8 +99,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
GdkEventMotion *mevent;
GdkEventButton *bevent;
GdkEventKey *kevent;
gint tx, ty;
GdkModifierType tmask;
gdouble tx, ty;
guint state = 0;
gint return_val = FALSE;
static gboolean scrolled = FALSE;
......@@ -111,9 +138,11 @@ gdisplay_canvas_events (GtkWidget *canvas,
setup_scale (gdisp);
}
/* get the pointer position */
gdk_window_get_pointer (canvas->window, &tx, &ty, &tmask);
/* Find out what device the event occurred upon */
if (devices_check_change (event))
gdisplay_check_device_cursor (gdisp);
switch (event->type)
{
case GDK_EXPOSE:
......@@ -132,6 +161,16 @@ gdisplay_canvas_events (GtkWidget *canvas,
}
break;
case GDK_LEAVE_NOTIFY:
gdisp->proximity = FALSE;
gdisplay_update_cursor (gdisp, 0, 0);
break;
case GDK_PROXIMITY_OUT:
gdisp->proximity = FALSE;
gdisplay_update_cursor (gdisp, 0, 0);
break;
case GDK_BUTTON_PRESS:
bevent = (GdkEventButton *) event;
state = bevent->state;
......@@ -254,13 +293,24 @@ gdisplay_canvas_events (GtkWidget *canvas,
mevent = (GdkEventMotion *) event;
state = mevent->state;
/* Ask for the pointer position, but ignore it except for cursor
* handling, so motion events sync with the button press/release events */
if (mevent->is_hint)
gdk_input_window_get_pointer (canvas->window, current_device, &tx, &ty,
NULL, NULL, NULL, NULL);
else
{
mevent->x = tx;
mevent->y = ty;
mevent->state = tmask;
tx = mevent->x;
ty = mevent->y;
}
if (!gdisp->proximity)
{
gdisp->proximity = TRUE;
gdisplay_check_device_cursor (gdisp);
}
if (active_tool && ((active_tool->type == MOVE) ||
!gimage_is_empty (gdisp->gimage)) &&
(mevent->state & GDK_BUTTON1_MASK))
......@@ -369,6 +419,8 @@ gdisplay_canvas_events (GtkWidget *canvas,
gdisplay_install_tool_cursor (gdisp, GDK_TOP_LEFT_ARROW);
}
gdisplay_update_cursor (gdisp, tx, ty);
return return_val;
}
......
......@@ -21,7 +21,9 @@
#define CANVAS_EVENT_MASK GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | \
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | \
GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK | \
GDK_ENTER_NOTIFY_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | \
GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | \
GDK_PROXIMITY_OUT_MASK
gint gdisplay_canvas_events (GtkWidget *, GdkEvent *);
gint gdisplay_hruler_button_press (GtkWidget *, GdkEventButton *, gpointer);
......
......@@ -102,7 +102,7 @@ void
scroll_to_pointer_position (GDisplay *gdisp,
GdkEventMotion *mevent)
{
int child_x, child_y;
double child_x, child_y;
int off_x, off_y;
off_x = off_y = 0;
......@@ -119,7 +119,9 @@ scroll_to_pointer_position (GDisplay *gdisp,
if (scroll_display (gdisp, off_x, off_y))
{
gdk_window_get_pointer (gdisp->canvas->window, &child_x, &child_y, NULL);
gdk_input_window_get_pointer (gdisp->canvas->window, mevent->deviceid,
&child_x, &child_y,
NULL, NULL, NULL, NULL);
if (child_x == mevent->x && child_y == mevent->y)
/* Put this event back on the queue -- so it keeps scrolling */
......
......@@ -75,6 +75,7 @@ static GSList * gdisplay_process_area_list(GSList *, GArea *);
static void gdisplay_add_update_area (GDisplay *, int, int, int, int);
static void gdisplay_add_display_area (GDisplay *, int, int, int, int);
static void gdisplay_paint_area (GDisplay *, int, int, int, int);
static void gdisplay_draw_cursor (GDisplay *);
static void gdisplay_display_area (GDisplay *, int, int, int, int);
static guint gdisplay_hash (GDisplay *);
......@@ -121,6 +122,10 @@ gdisplay_new (GImage *gimage,
gdisp->draw_guides = TRUE;
gdisp->snap_to_guides = TRUE;
gdisp->draw_cursor = FALSE;
gdisp->proximity = FALSE;
gdisp->have_cursor = FALSE;
/* add the new display to the list so that it isn't lost */
display_list = g_slist_append (display_list, (void *) gdisp);
......@@ -340,6 +345,10 @@ gdisplay_flush (GDisplay *gdisp)
/* draw the guides */
gdisplay_draw_guides (gdisp);
/* and the cursor (if we have a software cursor */
if (gdisp->have_cursor)
gdisplay_draw_cursor (gdisp);
/* restart (and recalculate) the selection boundaries */
selection_start (gdisp->select, TRUE);
......@@ -520,10 +529,10 @@ gdisplay_find_guide (GDisplay *gdisp,
void
gdisplay_snap_point (GDisplay *gdisp,
int x ,
int y,
int *tx,
int *ty)
gdouble x ,
gdouble y,
gdouble *tx,
gdouble *ty)
{
GList *tmp_list;
Guide *guide;
......@@ -598,8 +607,8 @@ gdisplay_snap_rectangle (GDisplay *gdisp,
int *tx1,
int *ty1)
{
int nx1, ny1;
int nx2, ny2;
double nx1, ny1;
double nx2, ny2;
*tx1 = x1;
*ty1 = y1;
......@@ -611,18 +620,73 @@ gdisplay_snap_rectangle (GDisplay *gdisp,
gdisplay_snap_point (gdisp, x1, y1, &nx1, &ny1);
gdisplay_snap_point (gdisp, x2, y2, &nx2, &ny2);
if (x1 != nx1)
if (x1 != (int)nx1)
*tx1 = nx1;
else if (x2 != nx2)
else if (x2 != (int)nx2)
*tx1 = x1 + (nx2 - x2);
if (y1 != ny1)
if (y1 != (int)ny1)
*ty1 = ny1;
else if (y2 != ny2)
else if (y2 != (int)ny2)
*ty1 = y1 + (ny2 - y2);
}
}
void
gdisplay_draw_cursor (GDisplay *gdisp)
{
int x = gdisp->cursor_x;
int y = gdisp->cursor_y;
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x - 7, y-1, x + 7, y-1);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->black_gc,
x - 7, y, x + 7, y);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x - 7, y+1, x + 7, y+1);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x-1, y - 7, x-1, y + 7);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->black_gc,
x, y - 7, x, y + 7);
gdk_draw_line (gdisp->canvas->window,
gdisp->canvas->style->white_gc,
x+1, y - 7, x+1, y + 7);
}