1 /* AbiWord
2  * Copyright (C) 1998 AbiSource, Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301 USA.
18  */
19 
20 
21 // ********************************************************************************
22 // ********************************************************************************
23 // *** THIS FILE DEFINES THE BINDINGS TO HANG OFF THE DeadCaron PREFIX KEY IN   ***
24 // *** THE DEFAULT BINDINGS TABLE.                                              ***
25 // ********************************************************************************
26 // ********************************************************************************
27 
28 #include "ut_assert.h"
29 #include "ut_types.h"
30 #include "ev_EditBits.h"
31 #include "ev_EditBinding.h"
32 #include "ev_EditMethod.h"
33 #include "ev_NamedVirtualKey.h"
34 #include "ap_LoadBindings.h"
35 #include "ap_LB_DeadCaron.h"
36 
37 #define _S		| EV_EMS_SHIFT
38 #define _C		| EV_EMS_CONTROL
39 #define _A		| EV_EMS_ALT
40 
41 /*****************************************************************
42 ******************************************************************
43 ** load bindings for the non-nvk
44 ** (character keys).  note that SHIFT-state is implicit in the
45 ** character value and is not included in the table.  note that
46 ** we do not include the ASCII control characters (\x00 -- \x1f
47 ** and others) since we don't map keystrokes into them.
48 ******************************************************************
49 *****************************************************************/
50 
51 static struct ap_bs_Char s_CharTable[] =
52 {
53 //	{char, /* desc   */ { none,						_C,		_A,		_A_C	}},
54 
55 	// Latin-2 characters
56 	{0x4c, /* L      */ { "insertCaronData",		"",		"",		""		}},
57 	{0x53, /* S      */ { "insertCaronData",		"",		"",		""		}},
58 	{0x54, /* T      */ { "insertCaronData",		"",		"",		""		}},
59 	{0x5a, /* Z      */ { "insertCaronData",		"",		"",		""		}},
60 	{0x43, /* C      */ { "insertCaronData",		"",		"",		""		}},
61 	{0x45, /* E      */ { "insertCaronData",		"",		"",		""		}},
62 	{0x44, /* D      */ { "insertCaronData",		"",		"",		""		}},
63 	{0x4e, /* N      */ { "insertCaronData",		"",		"",		""		}},
64 	{0x52, /* R      */ { "insertCaronData",		"",		"",		""		}},
65 
66 	{0x6c, /* l      */ { "insertCaronData",		"",		"",		""		}},
67 	{0x73, /* s      */ { "insertCaronData",		"",		"",		""		}},
68 	{0x74, /* t      */ { "insertCaronData",		"",		"",		""		}},
69 	{0x7a, /* z      */ { "insertCaronData",		"",		"",		""		}},
70 	{0x63, /* c      */ { "insertCaronData",		"",		"",		""		}},
71 	{0x65, /* e      */ { "insertCaronData",		"",		"",		""		}},
72 	{0x64, /* d      */ { "insertCaronData",		"",		"",		""		}},
73 	{0x6e, /* n      */ { "insertCaronData",		"",		"",		""		}},
74 	{0x72, /* r      */ { "insertCaronData",		"",		"",		""		}},
75 };
76 
77 
78 /*****************************************************************
79 ******************************************************************
80 ** put it all together and load the default bindings.
81 ******************************************************************
82 *****************************************************************/
83 
ap_LoadBindings_DeadCaron(AP_BindingSet * pThis,EV_EditBindingMap * pebm)84 bool ap_LoadBindings_DeadCaron(AP_BindingSet * pThis,
85 								  EV_EditBindingMap * pebm)
86 {
87 	pThis->_loadChar(pebm,s_CharTable,G_N_ELEMENTS(s_CharTable),NULL,0);
88 
89 	return true;
90 }
91