Remove the keymap stuff too, it is not needed in sade.
This commit is contained in:
parent
c49d3a7d07
commit
d876403d1e
@ -8,10 +8,10 @@ PROG= sade
|
||||
MAN= sade.8
|
||||
SRCS= command.c config.c devices.c \
|
||||
disks.c dispatch.c dmenu.c \
|
||||
globals.c install.c keymap.c \
|
||||
globals.c install.c \
|
||||
label.c main.c menus.c misc.c \
|
||||
msg.c system.c termcap.c \
|
||||
variable.c ${_wizard} keymap.h
|
||||
variable.c ${_wizard}
|
||||
WARNS?= 3
|
||||
|
||||
# command.c
|
||||
@ -24,35 +24,4 @@ CFLAGS+= -I${.CURDIR}/../../gnu/lib/libdialog -I.
|
||||
DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO}
|
||||
LDADD= -ldialog -lncurses -lutil -ldisk -lftpio
|
||||
|
||||
CLEANFILES= keymap.tmp keymap.h
|
||||
|
||||
.if ${MACHINE} == "pc98"
|
||||
KEYMAPS= jp.pc98 jp.pc98.iso
|
||||
.else
|
||||
KEYMAPS= be.iso bg.bds.ctrlcaps bg.phonetic.ctrlcaps br275.iso \
|
||||
ce.iso2 cs.latin2.qwertz danish.iso el.iso07 \
|
||||
estonian.cp850 estonian.iso estonian.iso15 finnish.iso fr.iso \
|
||||
german.iso gr.elot.acc gr.us101.acc hr.iso hu.iso2.101keys \
|
||||
it.iso icelandic.iso jp.106 norwegian.iso pl_PL.ISO8859-2 \
|
||||
pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso swedish.iso \
|
||||
swissfrench.iso \
|
||||
swissgerman.iso ua.koi8-u ua.koi8-u.shift.alt uk.iso us.dvorak \
|
||||
us.iso us.pc-ctrl us.unix
|
||||
.endif
|
||||
|
||||
keymap.h:
|
||||
rm -f keymap.tmp
|
||||
for map in ${KEYMAPS} ; do \
|
||||
KEYMAP_PATH=${.CURDIR}/../../share/syscons/keymaps \
|
||||
kbdcontrol -L $$map | \
|
||||
sed -e '/^static accentmap_t/,$$d' >> keymap.tmp ; \
|
||||
done
|
||||
echo "static struct keymapInfo keymapInfos[] = {" >> keymap.tmp
|
||||
for map in ${KEYMAPS} ; do \
|
||||
echo -n ' { "'$$map'", ' >> keymap.tmp ; \
|
||||
echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \
|
||||
done
|
||||
( echo " { NULL, NULL }"; echo "};" ; echo "" ) >> keymap.tmp
|
||||
mv keymap.tmp keymap.h
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -105,25 +105,6 @@ dmenuSetVariables(dialogMenuItem *tmp)
|
||||
return DITEM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
dmenuSetKmapVariable(dialogMenuItem *tmp)
|
||||
{
|
||||
char *lang;
|
||||
int err;
|
||||
|
||||
variable_set((char *)tmp->data, TRUE);
|
||||
lang = variable_get(VAR_KEYMAP);
|
||||
if (lang != NULL)
|
||||
{
|
||||
err = loadKeymap(lang);
|
||||
if (err == -1)
|
||||
msgConfirm("No appropriate keyboard map found, sorry.");
|
||||
else if (err == -2)
|
||||
msgConfirm("Error installing keyboard map, errno = %d.", errno);
|
||||
}
|
||||
return DITEM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
dmenuToggleVariable(dialogMenuItem *tmp)
|
||||
{
|
||||
|
@ -1,95 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1996 Joerg Wunsch
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sade.h"
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/kbio.h>
|
||||
|
||||
struct keymapInfo {
|
||||
const char *name;
|
||||
const struct keymap *map;
|
||||
};
|
||||
|
||||
#include "keymap.h"
|
||||
|
||||
/*
|
||||
* keymap.h is being automatically generated by the Makefile. It
|
||||
* contains definitions for all desired keymaps. Note that since we
|
||||
* don't support font loading nor screen mapping during installation,
|
||||
* we simply don't care for any other keys than the ASCII subset.
|
||||
*
|
||||
* Therefore, if no keymap with the exact name has been found in the
|
||||
* first pass, we make a second pass over the table looking just for
|
||||
* the language name only.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Return values:
|
||||
*
|
||||
* 0: OK
|
||||
* -1: no appropriate keymap found
|
||||
* -2: error installing map (other than ENXIO which means we're not on syscons)
|
||||
*/
|
||||
|
||||
int
|
||||
loadKeymap(const char *lang)
|
||||
{
|
||||
int passno, err;
|
||||
char *llang;
|
||||
size_t l;
|
||||
struct keymapInfo *kip;
|
||||
|
||||
llang = strdup(lang);
|
||||
if (llang == NULL)
|
||||
abort();
|
||||
|
||||
for (passno = 0; passno < 2; passno++)
|
||||
{
|
||||
if (passno > 0)
|
||||
{
|
||||
/* make the match more fuzzy */
|
||||
l = strspn(llang, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
||||
llang[l] = '\0';
|
||||
}
|
||||
|
||||
l = strlen(llang);
|
||||
|
||||
for (kip = keymapInfos; kip->name; kip++)
|
||||
if (strncmp(kip->name, llang, l) == 0)
|
||||
{
|
||||
/* Yep, got it! */
|
||||
err = ioctl(0, PIO_KEYMAP, kip->map);
|
||||
free(llang);
|
||||
return (err == -1 && errno != ENOTTY)? -2: 0;
|
||||
}
|
||||
}
|
||||
free(llang);
|
||||
return -1;
|
||||
}
|
@ -93,7 +93,6 @@
|
||||
#define VAR_GEOMETRY "geometry"
|
||||
#define VAR_INSTALL_CFG "installConfig"
|
||||
#define VAR_INSTALL_ROOT "installRoot"
|
||||
#define VAR_KEYMAP "keymap"
|
||||
#define VAR_LABEL "label"
|
||||
#define VAR_LABEL_COUNT "labelCount"
|
||||
#define VAR_NEWFS_ARGS "newfsArgs"
|
||||
@ -352,7 +351,6 @@ extern int dmenuSystemCommandBox(dialogMenuItem *tmp);
|
||||
extern int dmenuExit(dialogMenuItem *tmp);
|
||||
extern int dmenuISetVariable(dialogMenuItem *tmp);
|
||||
extern int dmenuSetVariable(dialogMenuItem *tmp);
|
||||
extern int dmenuSetKmapVariable(dialogMenuItem *tmp);
|
||||
extern int dmenuSetVariables(dialogMenuItem *tmp);
|
||||
extern int dmenuToggleVariable(dialogMenuItem *tmp);
|
||||
extern int dmenuSetFlag(dialogMenuItem *tmp);
|
||||
@ -385,9 +383,6 @@ extern Boolean copySelf(void);
|
||||
/* kget.c */
|
||||
extern int kget(char *out);
|
||||
|
||||
/* keymap.c */
|
||||
extern int loadKeymap(const char *lang);
|
||||
|
||||
/* label.c */
|
||||
extern int diskLabelEditor(dialogMenuItem *self);
|
||||
extern int diskLabelCommit(dialogMenuItem *self);
|
||||
|
Loading…
x
Reference in New Issue
Block a user