]> www.fi.muni.cz Git - evince.git/blob - libview/ev-view-cursor.c
[dualscreen] fix crash on ctrl+w and fix control window closing
[evince.git] / libview / ev-view-cursor.c
1 /* this file is part of evince, a gnome document viewer
2  *
3  *  Copyright (C) 2004 Red Hat, Inc
4  *
5  * Evince is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * Evince is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #include "ev-view-cursor.h"
21
22 GdkCursor *
23 ev_view_cursor_new (GdkDisplay  *display,
24                     EvViewCursor new_cursor)
25 {
26         GdkCursor *cursor = NULL;
27
28         switch (new_cursor) {
29         case EV_VIEW_CURSOR_NORMAL:
30                 break;
31         case EV_VIEW_CURSOR_IBEAM:
32                 cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
33                 break;
34         case EV_VIEW_CURSOR_LINK:
35                 cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
36                 break;
37         case EV_VIEW_CURSOR_WAIT:
38                 cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
39                 break;
40         case EV_VIEW_CURSOR_HIDDEN:
41                 cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
42                 break;
43         case EV_VIEW_CURSOR_DRAG:
44                 cursor = gdk_cursor_new_for_display (display, GDK_FLEUR);
45                 break;
46         case EV_VIEW_CURSOR_AUTOSCROLL:
47                 cursor = gdk_cursor_new_for_display (display, GDK_DOUBLE_ARROW);
48                 break;
49         case EV_VIEW_CURSOR_ADD:
50                 cursor = gdk_cursor_new_for_display (display, GDK_PLUS);
51                 break;
52         }
53
54         return cursor;
55 }