~ubuntu-branches/ubuntu/trusty/fcitx/trusty-proposed

« back to all changes in this revision

Viewing changes to src/lib/fcitx-utils/gen-hotkey.sh

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2013-02-10 17:03:56 UTC
  • mfrom: (1.3.18) (33.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130210170356-2yuv6xy3ed378kn0
Tags: 1:4.2.7-1
* New upstream release.
* New binary packages:
  - fcitx-libs-gclient: D-Bus client library for Glib
  - fcitx-libs-qt: D-Bus client library for Qt
  - fcitx-module-quickphrase-editor: Quick Phrase editor module

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
function download_file()
 
4
{
 
5
    if [ "x$3" != "xf" ]; then
 
6
        if [ -f $1 ]; then
 
7
            return
 
8
        fi
 
9
    fi
 
10
    rm -f $1
 
11
    wget $2
 
12
}
 
13
 
 
14
XKEYSYM=http://cgit.freedesktop.org/xorg/proto/xproto/plain/keysymdef.h
 
15
KEYSYMGEN_HEADER=keysymgen.h
 
16
 
 
17
download_file keysymdef.h $XKEYSYM
 
18
 
 
19
cat > $KEYSYMGEN_HEADER <<EOF
 
20
/***************************************************************************
 
21
 *   Copyright (C) 2012~2012 by CSSlayer                                   *
 
22
 *   wengxt@gmail.com                                                      *
 
23
 *                                                                         *
 
24
 *   This program is free software; you can redistribute it and/or modify  *
 
25
 *   it under the terms of the GNU General Public License as published by  *
 
26
 *   the Free Software Foundation; either version 2 of the License, or     *
 
27
 *   (at your option) any later version.                                   *
 
28
 *                                                                         *
 
29
 *   This program is distributed in the hope that it will be useful,       *
 
30
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
31
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
32
 *   GNU General Public License for more details.                          *
 
33
 *                                                                         *
 
34
 *   You should have received a copy of the GNU General Public License     *
 
35
 *   along with this program; if not, write to the                         *
 
36
 *   Free Software Foundation, Inc.,                                       *
 
37
 *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.              *
 
38
 ***************************************************************************/
 
39
 
 
40
#ifndef FCITX_UTILS_KEYSYMGEN_H
 
41
#define FCITX_UTILS_KEYSYMGEN_H
 
42
#ifdef __cplusplus
 
43
extern "C" {
 
44
#endif
 
45
 
 
46
typedef enum _FcitxKeySym
 
47
{
 
48
FcitxKey_None = 0x0,
 
49
EOF
 
50
 
 
51
grep '^#define' keysymdef.h | sed 's|^#define XK_\([a-zA-Z_0-9]\+\) \+0x\([0-9A-Fa-f]\+\)\(.*\)$|FcitxKey_\1 = 0x\2,\3|g' >> $KEYSYMGEN_HEADER
 
52
cat >> $KEYSYMGEN_HEADER <<EOF
 
53
} FcitxKeySym;
 
54
 
 
55
#ifdef __cplusplus
 
56
}
 
57
#endif
 
58
 
 
59
#endif
 
60
EOF