NetSurf
pointers.c
Go to the documentation of this file.
1/*
2 * Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU 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, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <stdbool.h>
20#include <sys/types.h>
21#include <sys/stat.h>
22#include <unistd.h>
23#include <windows.h>
24
25#include "utils/errors.h"
26#include "utils/nsurl.h"
27#include "utils/log.h"
28#include "utils/corestrings.h"
29#include "utils/url.h"
30#include "utils/file.h"
32#include "netsurf/clipboard.h"
33
34#include "windows/schedule.h"
35#include "windows/window.h"
36#include "windows/pointers.h"
37
39 HCURSOR hand;
40 HCURSOR ibeam;
41 HCURSOR cross;
42 HCURSOR sizeall;
43 HCURSOR sizewe;
44 HCURSOR sizens;
45 HCURSOR sizenesw;
46 HCURSOR sizenwse;
47 HCURSOR wait;
48 HCURSOR appstarting;
49 HCURSOR no;
50 HCURSOR help;
51 HCURSOR arrow;
52};
53
54/** pre loaded pointer cursors */
56
57/* exported interface documented in windows/pointers.h */
58void nsws_window_init_pointers(HINSTANCE hinstance)
59{
60 nsws_pointer.hand = LoadCursor(NULL, IDC_HAND);
61 nsws_pointer.ibeam = LoadCursor(NULL, IDC_IBEAM);
62 nsws_pointer.cross = LoadCursor(NULL, IDC_CROSS);
63 nsws_pointer.sizeall = LoadCursor(NULL, IDC_SIZEALL);
64 nsws_pointer.sizewe = LoadCursor(NULL, IDC_SIZEWE);
65 nsws_pointer.sizens = LoadCursor(NULL, IDC_SIZENS);
66 nsws_pointer.sizenesw = LoadCursor(NULL, IDC_SIZENESW);
67 nsws_pointer.sizenwse = LoadCursor(NULL, IDC_SIZENWSE);
68 nsws_pointer.wait = LoadCursor(NULL, IDC_WAIT);
69 nsws_pointer.appstarting = LoadCursor(NULL, IDC_APPSTARTING);
70 nsws_pointer.no = LoadCursor(NULL, IDC_NO);
71 nsws_pointer.help = LoadCursor(NULL, IDC_HELP);
72 nsws_pointer.arrow = LoadCursor(NULL, IDC_ARROW);
73}
74
75/* exported interface documented in windows/pointers.h */
77{
78 switch (shape) {
79 case GUI_POINTER_POINT: /* link */
81 return nsws_pointer.hand;
82
83 case GUI_POINTER_CARET: /* input */
84 return nsws_pointer.ibeam;
85
87 return nsws_pointer.cross;
88
90 return nsws_pointer.sizeall;
91
94 return nsws_pointer.sizewe;
95
96 case GUI_POINTER_UP:
98 return nsws_pointer.sizens;
99
100 case GUI_POINTER_RU:
101 case GUI_POINTER_LD:
102 return nsws_pointer.sizenesw;
103
104 case GUI_POINTER_RD:
105 case GUI_POINTER_LU:
106 return nsws_pointer.sizenwse;
107
108 case GUI_POINTER_WAIT:
109 return nsws_pointer.wait;
110
113
116 return nsws_pointer.no;
117
118 case GUI_POINTER_HELP:
119 return nsws_pointer.help;
120
121 default:
122 break;
123 }
124
125 return nsws_pointer.arrow;
126}
Browser window creation and manipulation interface.
Useful interned string pointers (interface).
Error codes.
Interface to platform-specific clipboard operations.
gui_pointer_shape
Definition: mouse.h:89
@ GUI_POINTER_WAIT
Definition: mouse.h:104
@ GUI_POINTER_RIGHT
Definition: mouse.h:97
@ GUI_POINTER_MOVE
Definition: mouse.h:103
@ GUI_POINTER_CARET
Definition: mouse.h:92
@ GUI_POINTER_PROGRESS
Definition: mouse.h:108
@ GUI_POINTER_RD
Definition: mouse.h:101
@ GUI_POINTER_LD
Definition: mouse.h:99
@ GUI_POINTER_NO_DROP
Definition: mouse.h:106
@ GUI_POINTER_DOWN
Definition: mouse.h:95
@ GUI_POINTER_UP
Definition: mouse.h:94
@ GUI_POINTER_RU
Definition: mouse.h:98
@ GUI_POINTER_HELP
Definition: mouse.h:105
@ GUI_POINTER_MENU
Definition: mouse.h:93
@ GUI_POINTER_POINT
Definition: mouse.h:91
@ GUI_POINTER_LEFT
Definition: mouse.h:96
@ GUI_POINTER_NOT_ALLOWED
Definition: mouse.h:107
@ GUI_POINTER_LU
Definition: mouse.h:100
@ GUI_POINTER_CROSS
Definition: mouse.h:102
NetSurf URL handling (interface).
void nsws_window_init_pointers(HINSTANCE hinstance)
initialise the list of mouse cursors
Definition: pointers.c:58
HCURSOR nsws_get_pointer(gui_pointer_shape shape)
get a win32 cursor handle for a pointer shape
Definition: pointers.c:76
static struct nsws_pointers nsws_pointer
pre loaded pointer cursors
Definition: pointers.c:55
Windows mouse cursor interface.
HCURSOR sizens
Definition: pointers.c:44
HCURSOR no
Definition: pointers.c:49
HCURSOR ibeam
Definition: pointers.c:40
HCURSOR sizenesw
Definition: pointers.c:45
HCURSOR cross
Definition: pointers.c:41
HCURSOR arrow
Definition: pointers.c:51
HCURSOR hand
Definition: pointers.c:39
HCURSOR sizeall
Definition: pointers.c:42
HCURSOR wait
Definition: pointers.c:47
HCURSOR sizenwse
Definition: pointers.c:46
HCURSOR sizewe
Definition: pointers.c:43
HCURSOR help
Definition: pointers.c:50
HCURSOR appstarting
Definition: pointers.c:48
Interface to URL parsing and joining operations.
Default operations table for files.