Changeset 442

Show
Ignore:
Timestamp:
11/26/06 04:59:31 (2 years ago)
Author:
radekk
Message:

Hand tool - implementing cursor hand.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sweep/trunk/src/cursors.c

    r438 r442  
    4141#include "../pixmaps/zoom_out.xbm" 
    4242#include "../pixmaps/zoom_out_mask.xbm" 
     43#include "../pixmaps/cursor-openhand.xbm" 
     44#include "../pixmaps/cursor-openhand_mask.xbm" 
     45#include "../pixmaps/cursor-closedhand.xbm" 
     46#include "../pixmaps/cursor-closedhand_mask.xbm" 
    4347 
    4448GdkCursor * sweep_cursors[SWEEP_CURSOR_MAX]; 
     
    100104  sweep_cursors[SWEEP_CURSOR_PENCIL] = gdk_cursor_new (GDK_PENCIL); 
    101105  sweep_cursors[SWEEP_CURSOR_NOISE] = gdk_cursor_new (GDK_SPRAYCAN); 
    102   sweep_cursors[SWEEP_CURSOR_HAND] = gdk_cursor_new (GDK_HAND1); 
     106 
    103107 
    104108  create_bitmap_and_mask_from_xpm (&bitmap, &mask, horiz_xpm); 
     
    107111    gdk_cursor_new_from_pixmap (bitmap, mask, &white, &black, 8, 8); 
    108112 
     113 
    109114  create_bitmap_and_mask_from_xpm (&bitmap, &mask, horiz_plus_xpm); 
    110115   
     
    112117    gdk_cursor_new_from_pixmap (bitmap, mask, &white, &black, 8, 8); 
    113118 
     119 
    114120  create_bitmap_and_mask_from_xpm (&bitmap, &mask, horiz_minus_xpm); 
    115121   
    116122  sweep_cursors[SWEEP_CURSOR_HORIZ_MINUS] = 
    117123    gdk_cursor_new_from_pixmap (bitmap, mask, &white, &black, 8, 8); 
     124 
    118125 
    119126  bitmap = 
     
    163170 
    164171 
     172  bitmap = 
     173    gdk_bitmap_create_from_data (NULL, (const gchar *) cursor_openhand_bits, 
     174                                 cursor_openhand_width, cursor_openhand_height); 
     175  mask = 
     176    gdk_bitmap_create_from_data (NULL, (const gchar *) cursor_openhand_mask_bits, 
     177                                 cursor_openhand_mask_width, cursor_openhand_mask_height); 
     178 
     179  sweep_cursors[SWEEP_CURSOR_HAND_OPEN] = 
     180    gdk_cursor_new_from_pixmap (bitmap, mask, &black, &white, 
     181                                cursor_openhand_x_hot, cursor_openhand_y_hot); 
     182 
     183 
     184  bitmap = 
     185    gdk_bitmap_create_from_data (NULL, cursor_closedhand_bits, 
     186                                 cursor_closedhand_width, cursor_closedhand_height); 
     187  mask = 
     188    gdk_bitmap_create_from_data (NULL, cursor_closedhand_mask_bits, 
     189                                 cursor_closedhand_mask_width, cursor_closedhand_mask_height); 
     190 
     191  sweep_cursors[SWEEP_CURSOR_HAND_CLOSE] = 
     192    gdk_cursor_new_from_pixmap (bitmap, mask, &black, &white, 
     193                                cursor_closedhand_x_hot, cursor_closedhand_y_hot); 
     194 
     195 
    165196} 
  • sweep/trunk/src/cursors.h

    r438 r442  
    3333  SWEEP_CURSOR_PENCIL, 
    3434  SWEEP_CURSOR_NOISE, 
    35   SWEEP_CURSOR_HAND, 
     35  SWEEP_CURSOR_HAND_OPEN, 
     36  SWEEP_CURSOR_HAND_CLOSE, 
    3637  SWEEP_CURSOR_MAX 
    3738}; 
  • sweep/trunk/src/sample-display.c

    r441 r442  
    487487  case TOOL_NOISE: 
    488488    cursor = sweep_cursors[SWEEP_CURSOR_NOISE]; 
     489    break; 
     490  case TOOL_HAND: 
     491    cursor = sweep_cursors[SWEEP_CURSOR_HAND_OPEN]; 
    489492    break; 
    490493  default: 
     
    22092212        s->selecting = SELECTING_HAND; 
    22102213        s->view->hand_offset = x; 
    2211         SET_CURSOR(widget, HAND); 
     2214        SET_CURSOR(widget, HAND_CLOSE); 
    22122215        sample_display_handle_hand_motion (s, x, y); 
    22132216        break;