libxputty 0.1
Loading...
Searching...
No Matches
xputty-mswin.h
Go to the documentation of this file.
1/* vim:ts=4:sw=4:et:
2 * 0BSD
3 *
4 * BSD Zero Clause License
5 *
6 * Copyright (c) 2019 Hermann Meyer
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted.
10
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
29#ifdef _WIN32 //XCompatibility
30
31#pragma once
32
33#ifndef XPUTTY_MSWIN_H_
34#define XPUTTY_MSWIN_H_
35
36#include <windows.h>
37#include <cairo-win32.h>
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43// forward definitions for codepage tools in xwidget-mswin.cpp
44
45char *convert_cp(DWORD cp_from, DWORD cp_to, char *s_from);
46
47// typedefs for mimicking Xlib structs & definitions
48
49typedef unsigned long int XID;
50typedef unsigned long int Atom;
51typedef XID Display;
52typedef HWND Window;
53typedef XID Pixmap;
54typedef XID KeySym;
55typedef void *XIC;
56typedef void *XIM;
57
58typedef struct {
60 int x;
61 int y;
62 int button;
64 unsigned int state; /* key or button mask */
65 bool vk_is_final_char; // (from WM_CHAR) readily composed character (after processing dead keys and other input methods)
66 WORD vk;
67} XEvent;
71
72#define True 1
73#define False 0
74
75#define Button1 1
76#define Button2 2
77#define Button3 3
78#define Button4 4
79#define Button5 5
80
81#define ShiftMask (1<<0)
82#define Button1Mask (1<<8)
83
84// xmidi_keyboard.cpp
85#define XK_0 '0'
86#define XK_2 '2'
87#define XK_3 '3'
88#define XK_5 '5'
89#define XK_6 '6'
90#define XK_7 '7'
91#define XK_9 '9'
92#define XK_a 'a'
93#define XK_b 'b'
94#define XK_c 'c'
95#define XK_d 'd'
96#define XK_e 'e'
97#define XK_g 'g'
98#define XK_h 'h'
99#define XK_i 'i'
100#define XK_j 'j'
101#define XK_k 'k'
102#define XK_l 'l'
103#define XK_m 'm'
104#define XK_n 'n'
105#define XK_o 'o'
106#define XK_p 'p'
107#define XK_q 'q'
108#define XK_r 'r'
109#define XK_s 's'
110#define XK_t 't'
111#define XK_u 'u'
112#define XK_v 'v'
113#define XK_w 'w'
114#define XK_x 'x'
115#define XK_y 'y'
116#define XK_z 'z'
117#define XK_space VK_SPACE // 0x20
118#define XK_quotedbl '"' //0x22
119#define XK_parenleft '(' //0x28
120#define XK_plus '+' //0x2b
121#define XK_comma ',' //0x2c
122#define XK_minus '-' //0x2d
123#define XK_section 0x00a7
124#define XK_mu 0x00b5
125#define XK_dollar 0x0024
126#define XK_parenright 0x0029
127#define XK_asterisk 0x002a
128#define XK_Ugrave 0x00d9
129#define XK_exclam 0x0021
130#define XK_colon 0x003a
131#define XK_semicolon 0x003b
132#define XK_less 0x003c
133#define XK_equal 0x003d
134#define XK_agrave 0xe0 //'à'
135#define XK_ugrave 0x00f9
136#define XK_Ugrave 0x00d9
137#define XK_ccedilla 0xe7 //'ç'
138#define XK_eacute 0xe9 //'é'
139#define XK_egrave 0xe8 //'è'
140#define XK_udiaeresis 0xfc //'ü'
141#define XK_dead_circumflex 0xfe52 //0x5e '^'
142#define XK_dead_diaeresis 0xfe57 //0xfc 'ü' - unsure: pass uppercase 'Ü' 0xdc
143#define XK_BackSpace 0xff08
144#define XK_Tab 0xff09
145#define XK_Return 0xff0d
146#define XK_Home 0xff50
147#define XK_Left 0xff51
148#define XK_Up 0xff52
149#define XK_Right 0xff53
150#define XK_Down 0xff54
151#define XK_End 0xff57
152#define XK_Insert 0xff63
153#define XK_Delete 0xffff
154#define XK_KP_Enter 0xff8d
155#define XK_KP_Home 0xff95
156#define XK_KP_Left 0xff96
157#define XK_KP_Up 0xff97
158#define XK_KP_Right 0xff98
159#define XK_KP_Down 0xff99
160#define XK_KP_End 0xff9c
161#define XK_KP_Insert 0xff9e
162#define XK_KP_Add 0xffab
163#define XK_KP_Subtract 0xffad
164#define XK_KP_Decimal 0xffae
165#define XK_KP_Delete 0xff9f
166
167#define XKeysymToKeycode(A,B) B
168
169#ifdef __cplusplus
170}
171#endif
172
173#endif //XPUTTY_MSWIN_H_
174
175#endif //_WIN32 //XCompatibility
bool vk_is_final_char
unsigned int state
int button
int keycode
WORD vk
Window window
XID Pixmap
void * XIM
XEvent XKeyEvent
void * XIC
XID KeySym
XEvent XButtonEvent
XEvent XMotionEvent
char * convert_cp(DWORD cp_from, DWORD cp_to, char *s_from)
XID Display
unsigned long int Atom
unsigned long int XID
HWND Window