/* AbiHello * Copyright (C) 1999 AbiSource, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ // ******************************************************************************** // ******************************************************************************** // *** This file contains the table of binding sets (compatibility modes) that *** // *** this application provides. *** // ******************************************************************************** // ******************************************************************************** #include "ut_assert.h" #include "ut_types.h" #include "ut_string.h" #include "ev_EditBinding.h" #include "ap_LoadBindings.h" #include "ap_LB_Default.h" /****************************************************************/ /****************************************************************/ typedef bool (*ap_LoadBindings_pFn)(AP_BindingSet * pThis, EV_EditBindingMap * pebm); struct _lb { const char * m_name; ap_LoadBindings_pFn m_fn; EV_EditBindingMap * m_pebm; // must be deleted }; static struct _lb s_lbTable[] = { { "default", ap_LoadBindings_Default, NULL }, // stock AbiSuite bindings }; #define NrElements(a) ((sizeof(a)/sizeof(a[0]))) /****************************************************************/ /****************************************************************/ AP_BindingSet::AP_BindingSet(EV_EditMethodContainer * pemc) : XAP_BindingSet(pemc) { } AP_BindingSet::~AP_BindingSet(void) { for (UT_uint32 k=0; ksetBinding(pMouseTable[k].m_eb|emo,pMouseTable[k].m_szMethod[m]); } } void AP_BindingSet::_loadNVK(EV_EditBindingMap * pebm, ap_bs_NVK * pNVK, UT_uint32 cNVK, ap_bs_NVK_Prefix * pNVKPrefix, UT_uint32 cNVKPrefix) { UT_uint32 k, m; // load terminal keys for (k=0; ksetBinding(EV_EKP_PRESS|pNVK[k].m_eb|ems,pNVK[k].m_szMethod[m]); } // load prefix keys for (k=0; ksetBinding(EV_EKP_PRESS|pNVKPrefix[k].m_eb|ems,pebSub); } } } void AP_BindingSet::_loadChar(EV_EditBindingMap * pebm, ap_bs_Char * pCharTable, UT_uint32 cCharTable, ap_bs_Char_Prefix * pCharPrefixTable, UT_uint32 cCharPrefixTable) { UT_uint32 k, m; // load terminal keys for (k=0; ksetBinding(EV_EKP_PRESS|pCharTable[k].m_eb|ems,pCharTable[k].m_szMethod[m]); } // load prefix keys for (k=0; ksetBinding(EV_EKP_PRESS|pCharPrefixTable[k].m_eb|ems,pebSub); } } }