mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
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
This commit is contained in:
parent
baca6796eb
commit
b15a6af3d2
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user