summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-05-16 09:37:22 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-05-16 09:37:22 +0000
commitb15a6af3d29ad844bdd44eb6181d069958afab5b (patch)
tree7c59b84724c59a3f8df76902841f19c36837f5d6
parentbaca6796eb96fac3cf79400f9cdb588b49f78930 (diff)
downloadnetsurf-b15a6af3d29ad844bdd44eb6181d069958afab5b.tar.gz
netsurf-b15a6af3d29ad844bdd44eb6181d069958afab5b.tar.bz2
s/wchar_t/uint32_t/g
We always assumed that the keycode type was 32bits wide, anyway. wchar_t isn't guaranteed to be that big, so isn't remotely portable. svn path=/trunk/netsurf/; revision=4165
-rw-r--r--desktop/browser.h6
-rw-r--r--desktop/textinput.c10
-rw-r--r--gtk/gtk_window.c7
-rw-r--r--riscos/textarea.c3
-rw-r--r--riscos/url_complete.c3
-rw-r--r--riscos/url_complete.h4
-rw-r--r--riscos/wimp_event.c5
-rw-r--r--riscos/window.c5
8 files changed, 23 insertions, 20 deletions
diff --git a/desktop/browser.h b/desktop/browser.h
index ed002b2c5..bdada0c73 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -24,8 +24,8 @@
#ifndef _NETSURF_DESKTOP_BROWSER_H_
#define _NETSURF_DESKTOP_BROWSER_H_
+#include <inttypes.h>
#include <stdbool.h>
-#include <stddef.h>
#include <time.h>
#include "render/html.h"
@@ -43,7 +43,7 @@ struct bitmap;
typedef bool (*browser_caret_callback)(struct browser_window *bw,
- wchar_t key, void *p);
+ uint32_t key, void *p);
typedef bool (*browser_paste_callback)(struct browser_window *bw,
const char *utf8, unsigned utf8_len, bool last, void *p);
typedef void (*browser_move_callback)(struct browser_window *bw,
@@ -216,7 +216,7 @@ void browser_window_mouse_track(struct browser_window *bw,
void browser_window_mouse_drag_end(struct browser_window *bw,
browser_mouse_state mouse, int x, int y);
-bool browser_window_key_press(struct browser_window *bw, wchar_t key);
+bool browser_window_key_press(struct browser_window *bw, uint32_t key);
bool browser_window_paste_text(struct browser_window *bw, const char *utf8,
unsigned utf8_len, bool last);
void browser_window_form_select(struct browser_window *bw,
diff --git a/desktop/textinput.c b/desktop/textinput.c
index 0aa7b29f7..c2678d021 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -49,9 +49,9 @@ struct caret ghost_caret;
static bool browser_window_textarea_callback(struct browser_window *bw,
- wchar_t key, void *p);
+ uint32_t key, void *p);
static bool browser_window_input_callback(struct browser_window *bw,
- wchar_t key, void *p);
+ uint32_t key, void *p);
static void browser_window_place_caret(struct browser_window *bw,
int x, int y, int height,
browser_caret_callback caret_cb,
@@ -302,7 +302,7 @@ void browser_window_textarea_click(struct browser_window *bw,
* it would have claimed it if it could.
*/
bool browser_window_textarea_callback(struct browser_window *bw,
- wchar_t key, void *p)
+ uint32_t key, void *p)
{
struct box *textarea = p;
struct box *inline_container =
@@ -809,7 +809,7 @@ void browser_window_input_click(struct browser_window* bw,
* it would have claimed it if it could.
*/
bool browser_window_input_callback(struct browser_window *bw,
- wchar_t key, void *p)
+ uint32_t key, void *p)
{
struct box *input = (struct box *)p;
struct box *text_box = input->children->children;
@@ -1147,7 +1147,7 @@ void browser_window_remove_caret(struct browser_window *bw)
* \param key The UCS4 character codepoint
* \return true if key handled, false otherwise
*/
-bool browser_window_key_press(struct browser_window *bw, wchar_t key)
+bool browser_window_key_press(struct browser_window *bw, uint32_t key)
{
/* keys that take effect wherever the caret is positioned */
switch (key) {
diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c
index 4e47e8f50..307b92fa5 100644
--- a/gtk/gtk_window.c
+++ b/gtk/gtk_window.c
@@ -17,6 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <inttypes.h>
#include "gtk/gtk_window.h"
#include "desktop/browser.h"
#include "desktop/options.h"
@@ -61,7 +62,7 @@ struct gui_window {
static struct gui_window *window_list = 0; /**< first entry in win list*/
-static wchar_t gdkkey_to_nskey(GdkEventKey *);
+static uint32_t gdkkey_to_nskey(GdkEventKey *);
static void nsgtk_gui_window_attach_child(struct gui_window *parent,
struct gui_window *child);
/* Methods which apply only to a gui_window */
@@ -371,7 +372,7 @@ gboolean nsgtk_window_button_press_event(GtkWidget *widget,
return TRUE;
}
-wchar_t gdkkey_to_nskey(GdkEventKey *key)
+uint32_t gdkkey_to_nskey(GdkEventKey *key)
{
/* this function will need to become much more complex to support
* everything that the RISC OS version does. But this will do for
@@ -414,7 +415,7 @@ gboolean nsgtk_window_keypress_event(GtkWidget *widget, GdkEventKey *event,
gpointer data)
{
struct gui_window *g = data;
- wchar_t nskey = gdkkey_to_nskey(event);
+ uint32_t nskey = gdkkey_to_nskey(event);
if (browser_window_key_press(g->bw, nskey))
return TRUE;
diff --git a/riscos/textarea.c b/riscos/textarea.c
index 63a2356c0..49b31b704 100644
--- a/riscos/textarea.c
+++ b/riscos/textarea.c
@@ -20,6 +20,7 @@
* Single/Multi-line UTF-8 text area (implementation)
*/
+#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
@@ -907,7 +908,7 @@ bool textarea_mouse_click(wimp_pointer *pointer)
*/
bool textarea_key_press(wimp_key *key)
{
- wchar_t c = (wchar_t)key->c;
+ uint32_t c = (uint32_t) key->c;
wimp_key keypress;
struct text_area *ta;
char utf8[7];
diff --git a/riscos/url_complete.c b/riscos/url_complete.c
index 9085ba85c..144ceba3c 100644
--- a/riscos/url_complete.c
+++ b/riscos/url_complete.c
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <wchar.h>
#include "oslib/wimp.h"
#include "content/urldb.h"
#include "utils/log.h"
@@ -92,7 +91,7 @@ void ro_gui_url_complete_start(struct gui_window *g)
* \param key the key pressed (as UTF32 code or wimp key + bit31 set)
* \return true to indicate keypress handled, false otherwise
*/
-bool ro_gui_url_complete_keypress(struct gui_window *g, wchar_t key)
+bool ro_gui_url_complete_keypress(struct gui_window *g, uint32_t key)
{
wimp_window_state state;
char *match_url;
diff --git a/riscos/url_complete.h b/riscos/url_complete.h
index 1c0849efa..299135791 100644
--- a/riscos/url_complete.h
+++ b/riscos/url_complete.h
@@ -23,14 +23,14 @@
#ifndef _NETSURF_RISCOS_URLCOMPLETE_H_
#define _NETSURF_RISCOS_URLCOMPLETE_H_
+#include <inttypes.h>
#include <stdbool.h>
-#include <wchar.h>
#include "oslib/wimp.h"
struct gui_window;
void ro_gui_url_complete_start(struct gui_window *g);
-bool ro_gui_url_complete_keypress(struct gui_window *g, wchar_t key);
+bool ro_gui_url_complete_keypress(struct gui_window *g, uint32_t key);
void ro_gui_url_complete_resize(struct gui_window *g, wimp_open *open);
bool ro_gui_url_complete_close(struct gui_window *g, wimp_i i);
void ro_gui_url_complete_redraw(wimp_draw *redraw);
diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c
index 243df6829..951c8e96b 100644
--- a/riscos/wimp_event.c
+++ b/riscos/wimp_event.c
@@ -21,6 +21,7 @@
*/
#include <assert.h>
+#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -653,13 +654,13 @@ void ro_gui_wimp_event_ok_click(struct event_window *window, wimp_mouse_state st
bool ro_gui_wimp_event_keypress(wimp_key *key) {
static int *ucstable = NULL;
static int alphabet = 0;
- static wchar_t wc = 0; /* buffer for UTF8 alphabet */
+ static uint32_t wc = 0; /* buffer for UTF8 alphabet */
static int shift = 0;
struct event_window *window;
struct icon_event *event;
wimp_pointer pointer;
wimp_key k;
- wchar_t c = (wchar_t)key->c;
+ uint32_t c = (uint32_t) key->c;
int t_alphabet;
os_error *error;
diff --git a/riscos/window.c b/riscos/window.c
index a50e7b4c4..0ae8aa077 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -27,6 +27,7 @@
#include <assert.h>
#include <ctype.h>
+#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <stdbool.h>
@@ -2288,7 +2289,7 @@ bool ro_gui_window_keypress(wimp_key *key)
os_error *error;
wimp_pointer pointer;
float scale;
- wchar_t c = (wchar_t)key->c;
+ uint32_t c = (uint32_t) key->c;
/* Find gui window */
if ((g = ro_gui_window_lookup(key->w)) != NULL) {
@@ -2367,7 +2368,7 @@ bool ro_gui_window_keypress(wimp_key *key)
/* Reset c to incoming character / key code
* as we may have corrupted it above */
- c = (wchar_t)key->c;
+ c = (uint32_t) key->c;
}
switch (c) {