[project @ 2006-03-19 17:49:32 by dsilvers]

Add support for a few more CSS cursors and tidy the GUI_POINTER_* stuff to support what we already had

svn path=/import/netsurf/; revision=2135
This commit is contained in:
Daniel Silverstone 2006-03-19 17:49:32 +00:00
parent 63c65c6808
commit 35bb5f96d5
5 changed files with 71 additions and 14 deletions

View File

@ -5,7 +5,7 @@ css_border_collapse inherit collapse separate
css_border_style inherit none hidden dotted dashed solid double groove ridge inset outset
css_caption_side inherit top bottom
css_clear inherit none both left right
css_cursor inherit auto crosshair default pointer move e-resize ne-resize nw-resize n-resize se-resize sw-resize s-resize w-resize text wait help
css_cursor inherit auto crosshair default pointer move e-resize ne-resize nw-resize n-resize se-resize sw-resize s-resize w-resize text wait help no-drop not-allowed progress
css_direction inherit ltr rtl
css_display inherit inline block list-item run-in inline-block table inline-table table-row-group table-header-group table-footer-group table-row table-column-group table-column table-cell table-caption none
css_empty_cells inherit show hide

View File

@ -1803,24 +1803,43 @@ gui_pointer_shape get_pointer_shape(css_cursor cursor)
pointer = GUI_POINTER_MOVE;
break;
case CSS_CURSOR_E_RESIZE:
pointer = GUI_POINTER_RIGHT;
break;
case CSS_CURSOR_W_RESIZE:
pointer = GUI_POINTER_LR;
pointer = GUI_POINTER_LEFT;
break;
case CSS_CURSOR_N_RESIZE:
pointer = GUI_POINTER_UP;
break;
case CSS_CURSOR_S_RESIZE:
pointer = GUI_POINTER_UD;
pointer = GUI_POINTER_DOWN;
break;
case CSS_CURSOR_NE_RESIZE:
pointer = GUI_POINTER_RU;
break;
case CSS_CURSOR_SW_RESIZE:
pointer = GUI_POINTER_LD;
break;
case CSS_CURSOR_SE_RESIZE:
case CSS_CURSOR_NW_RESIZE:
pointer = GUI_POINTER_RD;
break;
case CSS_CURSOR_NW_RESIZE:
pointer = GUI_POINTER_LU;
break;
case CSS_CURSOR_TEXT:
pointer = GUI_POINTER_CARET;
break;
case CSS_CURSOR_WAIT:
pointer = GUI_POINTER_WAIT;
break;
case CSS_CURSOR_PROGRESS:
pointer = GUI_POINTER_PROGRESS;
case CSS_CURSOR_NO_DROP:
pointer = GUI_POINTER_NO_DROP;
case CSS_CURSOR_NOT_ALLOWED:
pointer = GUI_POINTER_NOT_ALLOWED;
case CSS_CURSOR_HELP:
pointer = GUI_POINTER_HELP;
default:
pointer = GUI_POINTER_DEFAULT;
break;

View File

@ -33,9 +33,12 @@ struct gui_window;
struct gui_download_window;
typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET,
GUI_POINTER_MENU, GUI_POINTER_UD, GUI_POINTER_LR,
GUI_POINTER_LD, GUI_POINTER_RD, GUI_POINTER_CROSS,
GUI_POINTER_MOVE } gui_pointer_shape;
GUI_POINTER_MENU, GUI_POINTER_UP, GUI_POINTER_DOWN,
GUI_POINTER_LEFT, GUI_POINTER_RIGHT, GUI_POINTER_RU,
GUI_POINTER_LD, GUI_POINTER_LU, GUI_POINTER_RD,
GUI_POINTER_CROSS, GUI_POINTER_MOVE, GUI_POINTER_WAIT,
GUI_POINTER_HELP, GUI_POINTER_NO_DROP, GUI_POINTER_NOT_ALLOWED,
GUI_POINTER_PROGRESS } gui_pointer_shape;
#include <stdbool.h>
#include "netsurf/utils/config.h"

View File

@ -374,17 +374,29 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
case GUI_POINTER_CARET:
cursortype = GDK_XTERM;
break;
case GUI_POINTER_UD:
cursortype = GDK_SB_V_DOUBLE_ARROW;
case GUI_POINTER_UP:
cursortype = GDK_TOP_SIDE;
break;
case GUI_POINTER_LR:
cursortype = GDK_SB_H_DOUBLE_ARROW;
case GUI_POINTER_DOWN:
cursortype = GDK_BOTTOM_SIDE;
break;
case GUI_POINTER_LEFT:
cursortype = GDK_LEFT_SIDE;
break;
case GUI_POINTER_RIGHT:
cursortype = GDK_RIGHT_SIDE;
break;
case GUI_POINTER_LD:
cursortype = GDK_SIZING; /* XXX */
cursortype = GDK_BOTTOM_LEFT_CORNER;
break;
case GUI_POINTER_RD:
cursortype = GDK_SIZING; /* XXX */
cursortype = GDK_BOTTOM_RIGHT_CORNER;
break;
case GUI_POINTER_LU:
cursortype = GDK_TOP_LEFT_CORNER;
break;
case GUI_POINTER_RU:
cursortype = GDK_TOP_RIGHT_CORNER;
break;
case GUI_POINTER_CROSS:
cursortype = GDK_CROSS;
@ -392,8 +404,22 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
case GUI_POINTER_MOVE:
cursortype = GDK_FLEUR;
break;
case GUI_POINTER_WAIT:
cursortype = GDK_WATCH;
break;
case GUI_POINTER_HELP:
cursortype = GDK_QUESTION_ARROW;
break;
case GUI_POINTER_MENU:
/* Cannot think of a good cursor for 'menu' yet */
cursortype = GDK_RIGHTBUTTON;
break;
case GUI_POINTER_PROGRESS:
/* In reality, this needs to be the funky left_ptr_watch which we can't do easily yet */
cursortype = GDK_WATCH;
break;
/* The following we're not sure about */
case GUI_POINTER_NO_DROP:
case GUI_POINTER_NOT_ALLOWED:
case GUI_POINTER_DEFAULT:
default:
nullcursor = true;

View File

@ -2506,11 +2506,20 @@ struct ro_gui_pointer_entry ro_gui_pointer_table[] = {
{ false, "ptr_caret", 4, 9 },
{ false, "ptr_menu", 6, 4 },
{ false, "ptr_ud", 6, 7 },
{ false, "ptr_ud", 6, 7 },
{ false, "ptr_lr", 7, 6 },
{ false, "ptr_lr", 7, 6 },
{ false, "ptr_ld", 7, 7 },
{ false, "ptr_ld", 7, 7 },
{ false, "ptr_rd", 7, 7 },
{ false, "ptr_rd", 6, 7 },
{ false, "ptr_cross", 7, 7 },
{ false, "ptr_move", 8, 0 },
{ true, "ptr_default", 0, 0 }, /* WAIT */
{ true, "ptr_default", 0, 0 }, /* HELP */
{ true, "ptr_default", 0, 0 }, /* NO DROP */
{ true, "ptr_default", 0, 0 }, /* NOT ALLOWED */
{ true, "ptr_default", 0, 0 }, /* PROGRESS */
};
/**