init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
29
Telegram/ThirdParty/nimf/.github/ISSUE_TEMPLATE/------.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: 버그 리포트
|
||||
about: 발견한 버그를 알려주세요
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**버그 설명**
|
||||
어떤 버그인지 내용을 적어주세요
|
||||
|
||||
**버그 재현 과정**
|
||||
어떤 과정으로 버그가 발생하는지 단계별로 과정을 설명해주세요.
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**예상한 결과**
|
||||
이 기능을 동작시킬때 예상한 결과를 적어주세요.
|
||||
|
||||
**Screenshots**
|
||||
가능하다면 화면 캡처를 포함해주세요. (이미지를 드래그앤드롭으로 업로드하세요)
|
||||
|
||||
**자신의 PC 환경**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
10
Telegram/ThirdParty/nimf/.github/ISSUE_TEMPLATE/-----.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: 기능 제안
|
||||
about: 자유롭게 자신의 의견을 적어주세요.
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
자유롭게 자신의 의견을 적어주세요.
|
||||
29
Telegram/ThirdParty/nimf/.github/ISSUE_TEMPLATE/bug-report-eng.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Description of the bug found
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior, please provide code snippets or a repository:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem. (Image drag & drop)
|
||||
|
||||
**Your PC environment**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
54
Telegram/ThirdParty/nimf/.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Build and Release Debian Package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Build Debian Package
|
||||
uses: jtdor/build-deb-action@v1
|
||||
env:
|
||||
DEB_BUILD_OPTIONS: noautodbgsym
|
||||
with:
|
||||
docker-image: ubuntu:24.04
|
||||
buildpackage-opts: -us -uc
|
||||
# When change deb package name as git rev id
|
||||
# before-build-hook: debchange --controlmaint --local="+ci${{ github.run_id }}~git$(git rev-parse --short HEAD)" "CI build"
|
||||
extra-build-deps: build-essential devscripts debhelper autoconf automake debhelper libglib2.0-dev pkgconf intltool libgtk-3-dev libgtk-3-bin libgtk-4-dev libgtk-4-bin libgtk2.0-dev qtbase5-dev qtbase5-private-dev qt6-base-dev qt6-base-private-dev libayatana-appindicator3-dev librsvg2-bin fonts-noto-cjk libhangul-dev libanthy-dev anthy librime-dev libxkbcommon-dev libwayland-dev wayland-protocols libxklavier-dev libm17n-dev m17n-db gtk-doc-tools
|
||||
host-arch: amd64
|
||||
artifacts-dir: debian/artifacts
|
||||
|
||||
- name: Upload Debian Package
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: debian-package
|
||||
path: debian/artifacts/*.deb
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Download build artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: debian-package
|
||||
path: .
|
||||
|
||||
- run: ls -R .
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: ./*.deb
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
71
Telegram/ThirdParty/nimf/.gitignore
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
build-aux/
|
||||
config.*
|
||||
configure
|
||||
.deps/
|
||||
.libs/
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
/bin/nimf/nimf
|
||||
/bin/nimf-settings/nimf-settings
|
||||
libtool
|
||||
m4/
|
||||
stamp-h1
|
||||
*.valid
|
||||
*anjuta*
|
||||
*.gir
|
||||
*.typelib
|
||||
# built sources
|
||||
input-method-unstable-v1-client-protocol.h
|
||||
input-method-unstable-v1-protocol.c
|
||||
nimf-enum-types.c
|
||||
nimf-enum-types-private.h
|
||||
nimf-marshalers.c
|
||||
nimf-marshalers-private.h
|
||||
nimf-message-enum-types.c
|
||||
nimf-message-enum-types-private.h
|
||||
nimf.pc
|
||||
nimf-settings-autostart.desktop
|
||||
nimf-settings.desktop
|
||||
po/nimf.pot
|
||||
POTFILES
|
||||
*.moc
|
||||
.dirstamp
|
||||
Makefile.in.in
|
||||
stamp-it
|
||||
*.gmo
|
||||
data/icons/16x16/
|
||||
data/icons/22x22/
|
||||
data/icons/24x24/
|
||||
data/icons/32x32/
|
||||
data/icons/48x48/
|
||||
data/icons/96x96/
|
||||
data/icons/256x256/
|
||||
modules/engines/nimf-m17n/icons/16x16/
|
||||
modules/engines/nimf-m17n/icons/22x22/
|
||||
modules/engines/nimf-m17n/icons/24x24/
|
||||
modules/engines/nimf-m17n/icons/32x32/
|
||||
modules/engines/nimf-m17n/icons/48x48/
|
||||
modules/engines/nimf-m17n/icons/96x96/
|
||||
modules/engines/nimf-m17n/icons/256x256/
|
||||
po/.intltool-merge-cache
|
||||
# gnome-builder
|
||||
.buildconfig
|
||||
tags
|
||||
# docs
|
||||
gtk-doc.make
|
||||
docs/
|
||||
!docs/nimf.png
|
||||
# tests
|
||||
test-*.log
|
||||
test-*.trs
|
||||
test-suite.log
|
||||
test-nimf-m17n
|
||||
# vscode
|
||||
.vscode/
|
||||
*.stamp
|
||||
1
Telegram/ThirdParty/nimf/AUTHORS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Hodong Kim <hodong@nimfsoft.com>
|
||||
142
Telegram/ThirdParty/nimf/BUILD.md
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
# Building Nimf Packages
|
||||
|
||||
## Debian Package
|
||||
To build a Debian package for Nimf, follow these steps:
|
||||
|
||||
### Install Dependencies:
|
||||
|
||||
```sudo apt-get update
|
||||
sudo apt-get install build-essential devscripts debhelper autoconf automake libglib2.0-dev intltool gtk-doc-tools libgtk-3-dev libgtk2.0-dev libqt5core5a libqt5gui5 libqt5widgets5 qtbase5-dev libayatana-appindicator3-dev librsvg2-bin libhangul-dev anthy libxkbcommon-dev libxklavier-dev libm17n-dev m17n-db librime-dev
|
||||
|
||||
```
|
||||
|
||||
### Clone the Repository:
|
||||
|
||||
```
|
||||
git clone https://github.com/hamonikr/nimf.git
|
||||
cd nimf
|
||||
```
|
||||
|
||||
Build the Package:
|
||||
```
|
||||
debuild -us -uc
|
||||
```
|
||||
Install the Package:
|
||||
```
|
||||
sudo dpkg -i ../nimf_*.deb
|
||||
```
|
||||
|
||||
## RPM Package
|
||||
To build an RPM package for Nimf, follow these steps:
|
||||
|
||||
### Install Dependencies:
|
||||
|
||||
```
|
||||
sudo dnf install gcc-c++ libtool glib2-devel pkgconfig intltool gtk3-devel gtk2-devel qt5-qtbase-devel qt5-qtbase-private-devel qt6-qtbase-devel qt6-qtbase-private-devel libappindicator-gtk3-devel librsvg2-tools google-noto-cjk-fonts libhangul-devel anthy-devel anthy libxkbcommon-devel wayland-devel libxklavier-devel gtk-doc librime-devel m17n-lib-devel m17n-db-devel
|
||||
```
|
||||
|
||||
### Clone the Repository:
|
||||
|
||||
```
|
||||
git clone https://github.com/hamonikr/nimf.git
|
||||
cd nimf
|
||||
```
|
||||
|
||||
### Prepare the Source Tarball:
|
||||
|
||||
```
|
||||
git archive --format=tar.gz --prefix=nimf/ HEAD > nimf-1.3.5.tar.gz
|
||||
```
|
||||
|
||||
### Build the Package:
|
||||
|
||||
```
|
||||
rpmbuild -ta nimf-1.3.5.tar.gz
|
||||
```
|
||||
|
||||
### Install the Package:
|
||||
|
||||
```
|
||||
sudo rpm -i ~/rpmbuild/RPMS/x86_64/nimf-1.3.5-1.x86_64.rpm
|
||||
```
|
||||
|
||||
## Arch Linux Package
|
||||
To build an Arch Linux package for Nimf, follow these steps:
|
||||
|
||||
### Install Dependencies:
|
||||
|
||||
```
|
||||
sudo pacman -S --needed base-devel git glib2 gtk3 gtk2 qt5-base qt6-base libappindicator-gtk3 librsvg noto-fonts-cjk libhangul anthy librime libxkbcommon wayland libxklavier m17n-lib m17n-db gtk-doc
|
||||
```
|
||||
|
||||
### Clone the Repository:
|
||||
|
||||
```
|
||||
git clone https://github.com/hamonikr/nimf.git
|
||||
cd nimf
|
||||
```
|
||||
|
||||
### Build and Install the Package:
|
||||
|
||||
```
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
By following these steps, you can build and install Nimf on Debian, RPM-based, and Arch Linux systems.
|
||||
|
||||
|
||||
## Build from Source
|
||||
Open the terminal and run the following commands step by step.
|
||||
```
|
||||
git clone https://github.com/hamonikr/nimf.git
|
||||
cd nimf
|
||||
|
||||
autoreconf --force --install --verbose
|
||||
./configure
|
||||
make -j $(nproc)
|
||||
sudo make install
|
||||
```
|
||||
|
||||
There are configuration options. Use it for your situation.
|
||||
```
|
||||
--disable-hardening Disable hardening
|
||||
--disable-nimf-anthy Disable nimf-anthy
|
||||
--disable-nimf-m17n Disable nimf-m17n
|
||||
--disable-nimf-rime Disable nimf-rime
|
||||
--with-im-config-data Install im-config data
|
||||
--with-imsettings-data Install imsettings data
|
||||
|
||||
ex)
|
||||
./configure --disable-nimf-m17n
|
||||
```
|
||||
If you are using im-config
|
||||
```
|
||||
./autogen.sh --with-im-config-data
|
||||
```
|
||||
If you are using im-chooser
|
||||
```
|
||||
./autogen.sh --with-imsettings-data
|
||||
```
|
||||
To uninstall nimf, run the following command.
|
||||
```
|
||||
sudo make uninstall
|
||||
```
|
||||
|
||||
## Debugging
|
||||
```
|
||||
nimf --debug
|
||||
|
||||
# for nimf-indicator
|
||||
nimf-settings --gapplication-service &
|
||||
|
||||
tail -f /var/log/syslog
|
||||
|
||||
export GTK_IM_MODULE="nimf"
|
||||
export QT4_IM_MODULE="xim"
|
||||
export QT_IM_MODULE="nimf"
|
||||
export XMODIFIERS="@im=nimf"
|
||||
export G_MESSAGES_DEBUG=nimf
|
||||
|
||||
# run application
|
||||
gedit or kate # for Qt
|
||||
```
|
||||
166
Telegram/ThirdParty/nimf/COPYING
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
||||
31
Telegram/ThirdParty/nimf/Makefile.am
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
SUBDIRS = libnimf modules bin po data docs
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
DISTCLEANFILES = \
|
||||
Makefile.in \
|
||||
po/Makefile.in.in \
|
||||
INSTALL \
|
||||
aclocal.m4 \
|
||||
config.h.in \
|
||||
config.h.in~ \
|
||||
configure \
|
||||
gtk-doc.make
|
||||
|
||||
clean-local:
|
||||
@debian/rules clean || true
|
||||
rm -rf $(STAMP_DIR) $(SOURCE_DIR) debian/tmp config.log config.status
|
||||
|
||||
distclean-local:
|
||||
rm -rf autom4te.cache build-aux m4 .anjuta .anjuta_sym_db.db
|
||||
|
||||
update-gtk-im-cache:
|
||||
$(GTK_QUERY_IMMODULES2) --update-cache
|
||||
$(GTK_QUERY_IMMODULES3) --update-cache
|
||||
|
||||
update-gtk-icon-cache:
|
||||
(cd data/icons; make update-gtk-icon-cache)
|
||||
|
||||
ChangeLog:
|
||||
|
||||
.PHONY: ChangeLog
|
||||
1
Telegram/ThirdParty/nimf/NEWS
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
debian/changelog
|
||||
51
Telegram/ThirdParty/nimf/PKGBUILD
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# Maintainer: Kevin Kim <root@hamonikr.org>
|
||||
|
||||
pkgname=nimf
|
||||
pkgver=v1.3.5.r8.7e55f06
|
||||
pkgrel=1
|
||||
pkgdesc="Nimf is an input method framework."
|
||||
arch=('any')
|
||||
url="https://github.com/hamonikr/nimf"
|
||||
license=('LGPL3')
|
||||
makedepends=('binutils' 'autoconf' 'automake' 'gcc' 'make' 'glib2' 'intltool'
|
||||
'gtk3' 'gtk2' 'qt5-base' 'qt6-base' 'libappindicator-gtk3' 'libayatana-appindicator' 'librsvg'
|
||||
'noto-fonts-cjk' 'libhangul-git' 'anthy' 'librime' 'libxkbcommon'
|
||||
'wayland' 'wayland-protocols' 'libxklavier' 'm17n-lib' 'm17n-db' 'gtk-doc')
|
||||
depends=('glib2' 'gtk3' 'gtk2' 'qt5-base' 'qt6-base' 'libappindicator-gtk3' 'libhangul-git'
|
||||
'anthy' 'librime' 'libxkbcommon' 'wayland' 'libxklavier' 'm17n-lib'
|
||||
'm17n-db')
|
||||
provides=('nimf-git')
|
||||
conflicts=('nimf-git')
|
||||
optdepends=('brise: Rime schema repository'
|
||||
'noto-fonts-cjk: Google Noto CJK fonts')
|
||||
source=("git+https://github.com/hamonikr/nimf.git")
|
||||
md5sums=('SKIP')
|
||||
|
||||
pkgver() {
|
||||
cd nimf
|
||||
printf "%s" "$(git describe --long | sed 's/nimf-//' | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd nimf
|
||||
./autogen.sh --prefix=/usr --enable-gtk-doc
|
||||
make -j $(nproc)
|
||||
}
|
||||
|
||||
package() {
|
||||
cd nimf
|
||||
make DESTDIR="${pkgdir}/" install
|
||||
}
|
||||
|
||||
post_install() {
|
||||
cat <<EOF
|
||||
To use Nimf as your input method framework, add the following lines to your ~/.xprofile:
|
||||
|
||||
export GTK_IM_MODULE=nimf
|
||||
export QT4_IM_MODULE="nimf"
|
||||
export QT_IM_MODULE=nimf
|
||||
export QT6_IM_MODULE=nimf
|
||||
export XMODIFIERS="@im=nimf"
|
||||
|
||||
EOF
|
||||
}
|
||||
279
Telegram/ThirdParty/nimf/README
vendored
Normal file
@@ -0,0 +1,279 @@
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
|
||||
Because this document contains upstream content, there may be errors in the build.
|
||||
If you have any questions, please visit the address below.
|
||||
https://github.com/hamonikr/nimf/wiki
|
||||
https://github.com/hamonikr/nimf/issues
|
||||
|
||||
Nimf provides:
|
||||
* Input Method Server:
|
||||
* nimf
|
||||
* Language Engines:
|
||||
* System keyboard
|
||||
* Chinese (based on librime)
|
||||
* Japanese (based on anthy)
|
||||
* Korean (based on libhangul)
|
||||
* Various languages (based on m17n)
|
||||
* Service Modules:
|
||||
* Indicator (based on appindicator)
|
||||
* Wayland
|
||||
* NIM (Nimf Input Method)
|
||||
* XIM (based on IMdkit)
|
||||
* Preedit window
|
||||
* Candidate
|
||||
* Client Modules:
|
||||
* GTK+2, GTK+3, Qt5
|
||||
* Settings tool to configure the Nimf:
|
||||
* nimf-settings
|
||||
* Development files:
|
||||
* C library, headers and documents
|
||||
|
||||
Project Homepage:
|
||||
* https://github.com/hamonikr/nimf
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Nimf is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Nimf 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
Downloads
|
||||
---------
|
||||
|
||||
Download latest snapshot of the current master branch
|
||||
|
||||
* Clone with HTTPS
|
||||
|
||||
git clone https://github.com/hamonikr/nimf/nimf.git
|
||||
|
||||
* Download tar.gz
|
||||
|
||||
https://github.com/hamonikr/nimf/archive/master/nimf-master.tar.gz
|
||||
|
||||
|
||||
|
||||
Compiling and installing
|
||||
------------------------
|
||||
|
||||
* Debian, Ubuntu, Kubuntu
|
||||
|
||||
First of all, install devscripts, build-essential, debhelper.
|
||||
|
||||
username:~$ sudo apt install devscripts build-essential debhelper
|
||||
|
||||
After installing devscripts, build-essential perform the following commands.
|
||||
|
||||
username:~$ cd
|
||||
username:~$ mkdir tmp-build
|
||||
username:~$ cd tmp-build
|
||||
username:~/tmp-build$ wget https://github.com/hamonikr/nimf/archive/master/nimf-master.tar.gz
|
||||
username:~/tmp-build$ tar zxf nimf-master.tar.gz
|
||||
username:~/tmp-build$ cd nimf-master
|
||||
username:~/tmp-build/nimf-master$ dpkg-checkbuilddeps
|
||||
|
||||
You may see something like:
|
||||
|
||||
dpkg-checkbuilddeps: Unmet build dependencies: some-package1 some-package2 ...
|
||||
|
||||
Install all dependent packages and perform the following commands.
|
||||
|
||||
username:~/tmp-build/nimf-master$ debuild -b -uc -us
|
||||
username:~/tmp-build/nimf-master$ cd ..
|
||||
username:~/tmp-build$ ls
|
||||
libnimf1_YYYY.mm.dd_amd64.deb
|
||||
libnimf1-dbgsym_YYYY.mm.dd_amd64.deb
|
||||
nimf_YYYY.mm.dd_amd64.build
|
||||
nimf_YYYY.mm.dd_amd64.buildinfo
|
||||
nimf_YYYY.mm.dd_amd64.changes
|
||||
nimf_YYYY.mm.dd_amd64.deb
|
||||
nimf_YYYY.mm.dd.dsc
|
||||
nimf_YYYY.mm.dd.tar.xz
|
||||
nimf-anthy_YYYY.mm.dd_amd64.deb
|
||||
nimf-anthy-dbgsym_YYYY.mm.dd_amd64.deb
|
||||
nimf-dbgsym_YYYY.mm.dd_amd64.deb
|
||||
nimf-dev_YYYY.mm.dd_amd64.deb
|
||||
nimf-libhangul_YYYY.mm.dd_amd64.deb
|
||||
nimf-libhangul-dbgsym_YYYY.mm.dd_amd64.deb
|
||||
nimf-m17n_YYYY.mm.dd_amd64.deb
|
||||
nimf-m17n-dbgsym_YYYY.mm.dd_amd64.deb
|
||||
nimf-master
|
||||
nimf-rime_YYYY.mm.dd_amd64.deb
|
||||
nimf-rime-dbgsym_YYYY.mm.dd_amd64.deb
|
||||
|
||||
Install deb packages.
|
||||
|
||||
username:~/tmp-build$ sudo dpkg -i nimf_YYYY.mm.dd_amd64.deb \
|
||||
libnimf1_YYYY.mm.dd_amd64.deb nimf-anthy_YYYY.mm.dd_amd64.deb \
|
||||
nimf-libhangul_YYYY.mm.dd_amd64.deb nimf-m17n_YYYY.mm.dd_amd64.deb \
|
||||
nimf-rime_YYYY.mm.dd_amd64.deb
|
||||
|
||||
* CentOS
|
||||
|
||||
Open the terminal and run the following commands step by step.
|
||||
|
||||
wget https://gitlab.com/nimf-i18n/nimf/-/archive/master/nimf-master.tar.bz2
|
||||
tar -jxvf nimf-master.tar.bz2
|
||||
|
||||
NIMF_VERSION=`grep AC_INIT nimf-master/configure.ac | \
|
||||
grep -Po '\d{4}.\d{2}.\d{2}'`
|
||||
|
||||
cp -r nimf-master nimf-$NIMF_VERSION
|
||||
tar -jcvf nimf-master.tar.bz2 nimf-$NIMF_VERSION
|
||||
mkdir -p rpmbuild/SOURCES
|
||||
cp -f nimf-master.tar.bz2 rpmbuild/SOURCES
|
||||
sudo yum install epel-release
|
||||
|
||||
sudo yum install gcc-c++ libtool glib2-devel pkgconfig intltool \
|
||||
gtk3-devel gtk2-devel qt5-qtbase-devel qt5-qtbase-private-devel \
|
||||
libappindicator-gtk3-devel librsvg2-tools google-noto-cjk-fonts \
|
||||
libhangul-devel anthy-devel anthy libxkbcommon-devel wayland-devel \
|
||||
libxklavier-devel gtk-doc
|
||||
|
||||
rpmbuild -bb nimf-master/nimf.spec
|
||||
ls -R rpmbuild/RPMS/
|
||||
|
||||
sudo yum install \
|
||||
rpmbuild/RPMS/`uname -m`/nimf-YYYY.mm.dd-1.el7.`uname-m`.rpm
|
||||
|
||||
* Other Linux distributions
|
||||
|
||||
There are configuration options. Use it for your situation.
|
||||
|
||||
--disable-hardening Disable hardening
|
||||
--disable-nimf-anthy Disable nimf-anthy
|
||||
--disable-nimf-m17n Disable nimf-m17n
|
||||
--disable-nimf-rime Disable nimf-rime
|
||||
--with-im-config-data Install im-config data
|
||||
--with-imsettings-data Install imsettings data
|
||||
|
||||
Open the terminal and run the following commands step by step.
|
||||
|
||||
username:~$ cd
|
||||
username:~$ mkdir tmp-build
|
||||
username:~$ cd tmp-build
|
||||
username:~/tmp-build$ wget https://gitlab.com/nimf-i18n/nimf/-/archive/master/nimf-master.tar.gz
|
||||
username:~/tmp-build$ tar zxf nimf-master.tar.gz
|
||||
username:~/tmp-build$ cd nimf-master
|
||||
|
||||
If you are using im-config
|
||||
|
||||
./autogen.sh --with-im-config-data
|
||||
|
||||
If you are using im-chooser
|
||||
|
||||
./autogen.sh --with-imsettings-data
|
||||
|
||||
Otherwise
|
||||
|
||||
./autogen.sh
|
||||
|
||||
make
|
||||
sudo make install
|
||||
sudo ldconfig
|
||||
sudo make update-gtk-im-cache
|
||||
sudo make update-gtk-icon-cache
|
||||
|
||||
To uninstall nimf, run the following command.
|
||||
|
||||
sudo make uninstall
|
||||
|
||||
|
||||
Configure
|
||||
---------
|
||||
|
||||
* For GNOME Shell, use 3rd party gnome-shell-extension-appindicator
|
||||
|
||||
https://github.com/ubuntu/gnome-shell-extension-appindicator
|
||||
https://extensions.gnome.org/extension/615/appindicator-support/
|
||||
|
||||
* How to enable Nimf on systems using im-config
|
||||
|
||||
im-config -n nimf
|
||||
|
||||
* How to enable Nimf on systems using im-chooser
|
||||
|
||||
imsettings-switch nimf
|
||||
|
||||
* How to enable Nimf on systems using systemd v233 or later
|
||||
|
||||
Run nimf-settings.
|
||||
Turn on the "Setup environment variables" option in the Nimf menu.
|
||||
|
||||
|
||||
Debugging
|
||||
---------
|
||||
|
||||
nimf --debug
|
||||
nimf-settings --gapplication-service & # for nimf-indicator
|
||||
tail -f /var/log/daemon.log # or /var/log/syslog
|
||||
|
||||
export GTK_IM_MODULE="nimf"
|
||||
export QT4_IM_MODULE="xim"
|
||||
export QT_IM_MODULE="nimf"
|
||||
export XMODIFIERS="@im=nimf"
|
||||
export G_MESSAGES_DEBUG=nimf
|
||||
gedit # or kate for Qt
|
||||
|
||||
|
||||
Participate
|
||||
-----------
|
||||
|
||||
* Development
|
||||
|
||||
You may send pull requests.
|
||||
https://github.com/hamonikr/nimf/pulls
|
||||
|
||||
* Translation
|
||||
|
||||
You can make nimf.pot using the following commands.
|
||||
|
||||
git clone https://github.com/hamonikr/nimf/nimf.git
|
||||
cd nimf
|
||||
./autogen.sh
|
||||
cd po
|
||||
make nimf.pot
|
||||
|
||||
Then, you may translate nimf.pot into your native language.
|
||||
|
||||
|
||||
References
|
||||
----------
|
||||
|
||||
* APIs
|
||||
|
||||
http://www.x.org/releases/X11R7.6/doc/libX11/specs/XIM/xim.html
|
||||
http://www.w3.org/TR/ime-api/
|
||||
https://developer.chrome.com/extensions/input_ime
|
||||
https://docs.enlightenment.org/stable/efl/group__Ecore__IMF__Lib__Group.html
|
||||
http://doc.qt.io/qt-4.8/qinputcontext.html
|
||||
http://doc.qt.io/qt-5/qinputmethod.html
|
||||
https://git.gnome.org/browse/gtk+/tree/gtk/gtkimcontext.c
|
||||
|
||||
* Language Engines (alphabetically listed)
|
||||
|
||||
http://anonscm.debian.org/cgit/collab-maint/anthy.git
|
||||
https://github.com/libhangul/libhangul
|
||||
https://github.com/rime/librime
|
||||
https://www.nongnu.org/m17n/
|
||||
|
||||
* Implementations
|
||||
|
||||
https://github.com/libhangul/nabi
|
||||
https://github.com/libhangul/imhangul
|
||||
https://github.com/libhangul/ibus-hangul
|
||||
https://github.com/ibus/ibus
|
||||
https://github.com/fcitx/fcitx
|
||||
https://github.com/fcitx/fcitx-qt5
|
||||
https://github.com/uim/uim
|
||||
211
Telegram/ThirdParty/nimf/README.md
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
[English](#nimf) | [한국어](#가볍고-빠른-입력기-프레임워크-nimf)
|
||||
|
||||
# nimf
|
||||
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
|
||||

|
||||
|
||||
Nimf provides:
|
||||
* Input Method Server:
|
||||
* nimf
|
||||
|
||||
* Language Engines:
|
||||
* System keyboard
|
||||
* Chinese (based on librime)
|
||||
* Japanese (based on anthy)
|
||||
* Korean (based on libhangul)
|
||||
* Various languages (based on m17n)
|
||||
|
||||
* Service Modules:
|
||||
* Indicator (based on appindicator)
|
||||
* Wayland
|
||||
* NIM (Nimf Input Method)
|
||||
* XIM (based on IMdkit)
|
||||
* Preedit window
|
||||
* Candidate
|
||||
|
||||
* Client Modules:
|
||||
* GTK+2, GTK+3, Qt5, Qt6
|
||||
|
||||
* Settings tool to configure the Nimf:
|
||||
* nimf-settings
|
||||
|
||||
# Install
|
||||
|
||||
## Ubuntu, Debian, LinuxMint...
|
||||
On Ubuntu 21.10 or later distributions, the ibus-daemon starts automatically, causing conflicts with the input method nimf.
|
||||
|
||||
Method 1: Remove ibus
|
||||
```
|
||||
sudo apt purge ibus
|
||||
```
|
||||
Method 2: Disable ibus-daemon
|
||||
```
|
||||
sudo mv /usr/bin/ibus-daemon /usr/bin/ibus-daemon.bak
|
||||
```
|
||||
|
||||
Install nimf
|
||||
```
|
||||
wget -qO- https://pkg.hamonikr.org/add-hamonikr.apt | sudo -E bash -
|
||||
|
||||
sudo apt install nimf nimf-libhangul
|
||||
|
||||
im-config -n nimf
|
||||
```
|
||||
|
||||
If you want to use other languages (Japanese, Chinese, etc.)
|
||||
```
|
||||
sudo apt install libnimf1 nimf nimf-anthy nimf-dev nimf-libhangul nimf-m17n nimf-rime
|
||||
```
|
||||
|
||||
## Arch Linux, Manjaro
|
||||
|
||||
1) Download and Install
|
||||
```
|
||||
# Install latest libhangul-git
|
||||
git clone https://aur.archlinux.org/libhangul-git.git
|
||||
|
||||
cd libhangul-git
|
||||
|
||||
makepkg -si
|
||||
|
||||
# Install nimf
|
||||
git clone https://github.com/hamonikr/nimf.git
|
||||
|
||||
cd nimf
|
||||
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
2) im setting
|
||||
```
|
||||
vi ~/.xprofile
|
||||
|
||||
export GTK_IM_MODULE=nimf
|
||||
export QT4_IM_MODULE="nimf"
|
||||
export QT_IM_MODULE=nimf
|
||||
export XMODIFIERS="@im=nimf"
|
||||
```
|
||||
|
||||
## Build Instructions
|
||||
|
||||
For detailed build instructions, see the following sections in the [BUILD.md](BUILD.md) file:
|
||||
|
||||
- [Building Debian Package](BUILD.md#debian-package)
|
||||
- [Building RPM Package](BUILD.md#rpm-package)
|
||||
- [Building Arch Linux Package](BUILD.md#arch-linux-package)
|
||||
- [Building from source](BUILD.md#Build-from-Source)
|
||||
- [Debugging](BUILD.md#Debugging)
|
||||
|
||||
### Others
|
||||
|
||||
* Manjaro : https://github.com/hamonikr/nimf/wiki/Manjaro-build
|
||||
* CentOS 8 : https://blog.naver.com/dfnk5516/222074913406
|
||||
* Raspberry pi 4 arm64 : https://github.com/hamonikr/nimf/wiki/Install-nimf-on-raspberry-pi-4---arm64
|
||||
* Armbian : https://github.com/hamonikr/nimf/wiki/Armbian-build
|
||||
* Manjaro ARM : https://github.com/hamonikr/nimf/wiki/Manjaro-build
|
||||
* Arch AUR : https://aur.archlinux.org/packages/nimf-git/
|
||||
* Others : https://github.com/hamonikr/nimf/wiki/How-to-Build-and-Install-with-Others-Distro
|
||||
|
||||
<hr>
|
||||
|
||||
# 가볍고 빠른 입력기 프레임워크 nimf
|
||||
|
||||
[Go to English](#nimf)
|
||||
|
||||
이 프로젝트는 한글입력기 nimf 가 더이상 [지속되기 힘든 상황](https://launchpad.net/~hodong/+archive/ubuntu/nimf) 이 되었기 때문에
|
||||
|
||||
프로젝트의 지속적인 사용을 위해서는 관리가 필요하다고 생각되어 [nimf Project](https://gitlab.com/nimf-i18n/nimf) 를 포크한 프로젝트 입니다.
|
||||
|
||||
다년간 한글 사용자를 위한 환경 개선에 많은 기여를 하신 Hodong Kim 님께 감사를 드립니다.
|
||||
|
||||
하모니카 개발팀은 개방형OS 배포에 필수적인 한글입력기에 대한 관리가 필요하다고 생각하고 있으며
|
||||
|
||||
앞으로 하모니카 팀에서 직접 nimf 프로젝트를 계속 관리하기로 결정하였습니다.
|
||||
|
||||
향후 하모니카 팀에서 이 프로젝트에 필요한 기능을 계속 추가하여 좋은 소프트웨어를 사용할 수 있도록 노력하겠습니다.
|
||||
|
||||
# nimf 설치
|
||||
|
||||
## Ubuntu, Debian, LinuxMint...
|
||||
```
|
||||
# 우분투 21.10 이상을 기반으로 하는 배포판에서는 ibus-daemon이 자동으로 시작되어 입력기가 nimf 와 충돌됩니다.
|
||||
# 부팅 시 ibus가 동작하지 않도록 아래의 방법으로 ibus를 제거하거나 ibus-daemon을 비활성화할 수 있습니다.
|
||||
# 방법1 : sudo apt purge ibus
|
||||
# 방법2 : sudo mv /usr/bin/ibus-daemon /usr/bin/ibus-daemon.bak
|
||||
|
||||
wget -qO- https://pkg.hamonikr.org/add-hamonikr.apt | sudo -E bash -
|
||||
|
||||
sudo apt install nimf nimf-libhangul
|
||||
|
||||
im-config -n nimf
|
||||
|
||||
# 만약 일본어, 중국어 등 다른 언어를 사용하고 싶은 경우에는 다음과 같이 추가 패키지를 설치해줍니다.
|
||||
sudo apt install libnimf1 nimf nimf-anthy nimf-dev nimf-libhangul nimf-m17n nimf-rime
|
||||
```
|
||||
## Arch Linux, Manjaro
|
||||
1) 패키지 다운로드 및 설치
|
||||
```
|
||||
# 최신 libhangul-git 패키지 설치
|
||||
git clone https://aur.archlinux.org/libhangul-git.git
|
||||
|
||||
cd libhangul-git
|
||||
|
||||
makepkg -si
|
||||
|
||||
# nimf 설치
|
||||
git clone https://github.com/hamonikr/nimf.git
|
||||
|
||||
cd nimf
|
||||
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
2) 입력기 설정
|
||||
```
|
||||
vi ~/.xprofile
|
||||
|
||||
export GTK_IM_MODULE=nimf
|
||||
export QT4_IM_MODULE="nimf"
|
||||
export QT_IM_MODULE=nimf
|
||||
export XMODIFIERS="@im=nimf"
|
||||
```
|
||||
# LICENSE
|
||||
* GNU Lesser General Public License v3.0 ([한글 해석](https://olis.or.kr/license/Detailselect.do?lId=1073))
|
||||
|
||||
Nimf is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Nimf 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 Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
## ISSUE
|
||||
사용 중 이슈는 깃허브 이슈를 이용하시거나 [하모니카 커뮤니티](https://hamonikr.org)를 방문해서 알려주시면 함께 고민하도록 하겠습니다.
|
||||
|
||||
For any issues you encounter while using this software, please use GitHub Issues or visit the [Hamonikr Community](https://hamonikr.org) to let us know so we can work together to address them.
|
||||
|
||||
## Contribution
|
||||
깃허브 저장소를 포크하신 후 수정하실 내용을 수정하고 PR을 요청하시면 하모니카 팀에서 리뷰 후 반영됩니다.
|
||||
|
||||
To contribute, please fork the GitHub repository, make your changes, and submit a PR. The Hamonikr team will review and integrate your contributions.
|
||||
|
||||
|
||||
35
Telegram/ThirdParty/nimf/THANKS
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
mxa reported:
|
||||
* nimf-settings segmentation fault
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/282
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/280
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/277
|
||||
* Compose key not supported in nimf
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/33
|
||||
|
||||
5HARK <blgf6190 at gmail com> reported:
|
||||
A problem occurs when statically linking libnimf and then dynamically loading
|
||||
client modules.
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/16#note_90967748
|
||||
|
||||
Determining NIMF_RUNTIME_DIR, NIMF_MODULE_DIR at compile time causes problems
|
||||
when distributing static libnimf.a.
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/16#note_89891251
|
||||
|
||||
Hansol Shin (hshin23) reported segfault.
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/57
|
||||
|
||||
yueunseon reported: Support multi-user environment
|
||||
https://gitlab.com/nimf-i18n/nimf/issues/37
|
||||
|
||||
JH (nemonein) reported issues.
|
||||
nimf-daemon freezes https://gitlab.com/nimf-i18n/nimf/issues/22
|
||||
Side effect about singleton mode https://gitlab.com/nimf-i18n/nimf/issues/7
|
||||
Caps Lock doesn't work correctly https://gitlab.com/nimf-i18n/nimf/issues/2
|
||||
|
||||
madhwang reported an issue about the open files limit.
|
||||
https://github.com/dasom-im/dasom/issues/64
|
||||
|
||||
Youngbin Han <sukso96100 at gmail com> reported a race condition.
|
||||
https://github.com/dasom-im/dasom/issues/18
|
||||
|
||||
Suhyeok Gwon <gshyuk at gmail com> named Dasom.
|
||||
61
Telegram/ThirdParty/nimf/autogen.sh
vendored
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
test -n "$srcdir" || srcdir=`dirname "$0"`
|
||||
test -n "$srcdir" || srcdir=.
|
||||
|
||||
olddir=`pwd`
|
||||
cd "$srcdir"
|
||||
|
||||
# Clean up previous build files
|
||||
echo "Cleaning up previous build files..."
|
||||
make clean > /dev/null 2>&1
|
||||
rm -rf autom4te.cache
|
||||
rm -f aclocal.m4 ltmain.sh
|
||||
|
||||
mkdir -p m4
|
||||
|
||||
PKGCONFIG=`which pkg-config`
|
||||
if test -z "$PKGCONFIG"; then
|
||||
echo "pkg-config not found, please install pkg-config"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pkg-config --print-errors glib-2.0
|
||||
if [ $? != 0 ]; then
|
||||
echo "You probably need to install libglib2.0-dev or glib2-devel"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LIBTOOLIZE=`which libtoolize`
|
||||
if test -z $LIBTOOLIZE; then
|
||||
echo "libtoolize not found, please install libtool package"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GTKDOCIZE=`which gtkdocize`
|
||||
if test -z $GTKDOCIZE; then
|
||||
echo "gtkdocize not found, please install gtk-doc-tools or gtk-doc package"
|
||||
exit 1
|
||||
else
|
||||
gtkdocize || exit $?
|
||||
fi
|
||||
|
||||
INTLTOOLIZE=`which intltoolize`
|
||||
if test -z $INTLTOOLIZE; then
|
||||
echo "intltoolize not found, please install intltool package"
|
||||
exit 1
|
||||
else
|
||||
intltoolize --force --copy --automake || exit $?
|
||||
fi
|
||||
|
||||
AUTORECONF=`which autoreconf`
|
||||
if test -z $AUTORECONF; then
|
||||
echo "autoreconf not found, please install autoconf package"
|
||||
exit 1
|
||||
else
|
||||
autoreconf --force --install --verbose || exit $?
|
||||
fi
|
||||
|
||||
cd "$olddir"
|
||||
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" --libdir=/usr/lib/x86_64-linux-gnu
|
||||
3
Telegram/ThirdParty/nimf/bin/Makefile.am
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
SUBDIRS = nimf nimf-settings
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
34
Telegram/ThirdParty/nimf/bin/nimf-settings/Makefile.am
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
bin_PROGRAMS = nimf-settings
|
||||
|
||||
man_MANS = nimf-settings.1
|
||||
|
||||
applicationsdir = $(datadir)/applications
|
||||
applications_DATA = nimf-settings.desktop
|
||||
|
||||
autostartdir = /etc/xdg/autostart
|
||||
autostart_DATA = nimf-settings-autostart.desktop
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
gsettings_SCHEMAS = org.nimf.settings.gschema.xml
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
AM_CFLAGS = \
|
||||
$(EXTRA_CFLAGS) \
|
||||
-I$(top_srcdir)/libnimf \
|
||||
-DNIMF_COMPILATION \
|
||||
-DNIMF_MODULE_DIR=\"$(libdir)/nimf/modules\" \
|
||||
-DG_LOG_DOMAIN=\"nimf\"
|
||||
|
||||
nimf_settings_SOURCES = nimf-settings.c
|
||||
nimf_settings_CFLAGS = \
|
||||
$(NIMF_SETTINGS_DEPS_CFLAGS) \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
nimf_settings_LDFLAGS = $(NIMF_SETTINGS_DEPS_LIBS)
|
||||
nimf_settings_LDADD = $(top_builddir)/libnimf/libnimf.la
|
||||
|
||||
DISTCLEANFILES = \
|
||||
Makefile.in \
|
||||
nimf-settings.desktop \
|
||||
nimf-settings-autostart.desktop
|
||||
13
Telegram/ThirdParty/nimf/bin/nimf-settings/nimf-settings-autostart.desktop.in
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
_Name=Nimf Settings
|
||||
Exec=nimf-settings --gapplication-service
|
||||
Icon=nimf-logo
|
||||
Terminal=false
|
||||
Categories=System;Utility;
|
||||
X-GNOME-AutoRestart=false
|
||||
X-GNOME-Autostart-Notify=false
|
||||
X-GNOME-Autostart-Phase=Application
|
||||
X-KDE-autostart-after=panel
|
||||
X-KDE-StartupNotify=false
|
||||
26
Telegram/ThirdParty/nimf/bin/nimf-settings/nimf-settings.1
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
.TH nimf-settings 1 "7 Jun 2019"
|
||||
.SH NAME
|
||||
nimf-settings \- Tool for setting up Nimf
|
||||
.SH SYNOPSIS
|
||||
.B nimf-settings
|
||||
[OPTIONS]
|
||||
.SH DESCRIPTION
|
||||
nimf-settings is a GUI tool for configuring nimf.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
Show help messages
|
||||
.TP
|
||||
.B \-\-help\-all
|
||||
Show all options
|
||||
.TP
|
||||
.B \-\-help\-gapplication
|
||||
Show GApplication options
|
||||
.TP
|
||||
.B \-\-gapplication\-service
|
||||
Enter GApplication service mode. Currently this option is used to trigger the
|
||||
nimf indicator.
|
||||
.SH "EXIT STATUS"
|
||||
It returns 0 on success, non-zero on failure.
|
||||
.SH "SEE ALSO"
|
||||
.BR nimf (1)
|
||||
1474
Telegram/ThirdParty/nimf/bin/nimf-settings/nimf-settings.c
vendored
Normal file
8
Telegram/ThirdParty/nimf/bin/nimf-settings/nimf-settings.desktop.in
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
_Name=Nimf Settings
|
||||
Exec=nimf-settings
|
||||
Icon=nimf-logo
|
||||
Terminal=false
|
||||
Categories=Settings;
|
||||
11
Telegram/ThirdParty/nimf/bin/nimf-settings/org.nimf.settings.gschema.xml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schemalist>
|
||||
<schema id="org.nimf.settings"
|
||||
path="/org/nimf/settings/" gettext-domain="nimf">
|
||||
<key type="as" name="xkb-options">
|
||||
<default>['']</default>
|
||||
<summary>xkb options</summary>
|
||||
<description>xkb options</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
20
Telegram/ThirdParty/nimf/bin/nimf/Makefile.am
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
bin_PROGRAMS = nimf
|
||||
|
||||
man_MANS = nimf.1
|
||||
|
||||
AM_CFLAGS = \
|
||||
$(EXTRA_CFLAGS) \
|
||||
-I$(top_srcdir)/libnimf \
|
||||
-DNIMF_COMPILATION \
|
||||
-DG_LOG_DOMAIN=\"nimf\"
|
||||
|
||||
nimf_SOURCES = nimf.c
|
||||
nimf_CFLAGS = \
|
||||
$(LIBNIMF_DEPS_CFLAGS) \
|
||||
$(NIMF_DEPS_CFLAGS) \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
nimf_LDFLAGS = $(NIMF_DEPS_LIBS)
|
||||
nimf_LDADD = $(top_builddir)/libnimf/libnimf.la
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
22
Telegram/ThirdParty/nimf/bin/nimf/nimf.1
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
.TH nimf 1 "7 Jun 2019"
|
||||
.SH NAME
|
||||
nimf \- Nimf input method daemon
|
||||
.SH SYNOPSIS
|
||||
.B nimf
|
||||
[OPTIONS]
|
||||
.SH DESCRIPTION
|
||||
nimf is an input method daemon.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-h, \-\-help
|
||||
Show help messages
|
||||
.TP
|
||||
.B \-\-debug
|
||||
Log debugging messages
|
||||
.TP
|
||||
.B \-\-version
|
||||
Show version
|
||||
.SH "EXIT STATUS"
|
||||
It returns 0 on success, non-zero on failure.
|
||||
.SH "SEE ALSO"
|
||||
.BR nimf-settings (1)
|
||||
339
Telegram/ThirdParty/nimf/bin/nimf/nimf.c
vendored
Normal file
@@ -0,0 +1,339 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include "nimf-utils.h"
|
||||
#include <glib/gstdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "nimf-server.h"
|
||||
#include "nimf-server-private.h"
|
||||
#include "nimf-service.h"
|
||||
#include <glib/gi18n.h>
|
||||
#include "config.h"
|
||||
#include <syslog.h>
|
||||
#include <errno.h>
|
||||
#include <glib-unix.h>
|
||||
|
||||
static gchar *
|
||||
nimf_get_nimf_path ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_strconcat (g_get_user_runtime_dir (), "/nimf", NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
create_nimf_runtime_dir ()
|
||||
{
|
||||
gchar *nimf_path;
|
||||
gboolean retval = TRUE;
|
||||
|
||||
nimf_path = nimf_get_nimf_path ();
|
||||
|
||||
if (g_mkdir_with_parents (nimf_path, 0700))
|
||||
{
|
||||
g_critical (G_STRLOC": Can't create directory: %s", nimf_path);
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
g_free (nimf_path);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
nimf_get_lock_path ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_strconcat (g_get_user_runtime_dir (), "/nimf/lock.pid", NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
open_lock_file ()
|
||||
{
|
||||
gchar *path;
|
||||
int fd;
|
||||
|
||||
path = nimf_get_lock_path ();
|
||||
fd = g_open (path, O_RDWR | O_CREAT, 0600);
|
||||
|
||||
if (fd == -1)
|
||||
g_critical ("Failed to open lock file: %s", path);
|
||||
|
||||
g_free (path);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
static int
|
||||
set_lock (int fd, int type)
|
||||
{
|
||||
struct flock lock;
|
||||
lock.l_type = type;
|
||||
lock.l_start = 0;
|
||||
lock.l_whence = SEEK_SET;
|
||||
lock.l_len = 0;
|
||||
|
||||
return fcntl (fd, F_SETLK, &lock);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
write_pid (int fd)
|
||||
{
|
||||
gchar *pid;
|
||||
ssize_t len;
|
||||
ssize_t written;
|
||||
|
||||
if (ftruncate (fd, 0))
|
||||
return FALSE;
|
||||
|
||||
pid = g_strdup_printf ("%ld", (long int) getpid ());
|
||||
|
||||
len = strlen (pid) + 1;
|
||||
written = write (fd, pid, len);
|
||||
|
||||
g_free (pid);
|
||||
|
||||
if (written != len)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void unlink_socket_file ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
gchar *path;
|
||||
path = nimf_get_socket_path ();
|
||||
g_unlink (path);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_log_default_handler (const gchar *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const gchar *message,
|
||||
gboolean *debug)
|
||||
{
|
||||
int priority;
|
||||
const gchar *prefix;
|
||||
|
||||
switch (log_level & G_LOG_LEVEL_MASK)
|
||||
{
|
||||
case G_LOG_LEVEL_ERROR:
|
||||
priority = LOG_ERR;
|
||||
prefix = "ERROR **";
|
||||
break;
|
||||
case G_LOG_LEVEL_CRITICAL:
|
||||
priority = LOG_CRIT;
|
||||
prefix = "CRITICAL **";
|
||||
break;
|
||||
case G_LOG_LEVEL_WARNING:
|
||||
priority = LOG_WARNING;
|
||||
prefix = "WARNING **";
|
||||
break;
|
||||
case G_LOG_LEVEL_MESSAGE:
|
||||
priority = LOG_NOTICE;
|
||||
prefix = "Message";
|
||||
break;
|
||||
case G_LOG_LEVEL_INFO:
|
||||
priority = LOG_INFO;
|
||||
prefix = "INFO";
|
||||
break;
|
||||
case G_LOG_LEVEL_DEBUG:
|
||||
priority = LOG_DEBUG;
|
||||
prefix = "DEBUG";
|
||||
break;
|
||||
default:
|
||||
priority = LOG_NOTICE;
|
||||
prefix = "LOG";
|
||||
break;
|
||||
}
|
||||
|
||||
if (priority == LOG_DEBUG && (debug == NULL || *debug == FALSE))
|
||||
return;
|
||||
|
||||
syslog (priority, "%s-%s: %s", log_domain, prefix, message ? message : "(NULL) message");
|
||||
}
|
||||
|
||||
/**
|
||||
* SECTION:nimf
|
||||
* @title: nimf
|
||||
* @section_id: nimf
|
||||
*/
|
||||
|
||||
/**
|
||||
* PROGRAM:nimf
|
||||
* @short_description: Nimf input method daemon
|
||||
* @synopsis: nimf [*OPTIONS*...]
|
||||
* @see_also: nimf-settings(1)
|
||||
* @-h, --help: Show help messages
|
||||
* @--debug: Log debugging messages
|
||||
* @--version: Show version
|
||||
*
|
||||
* nimf is an input method daemon.
|
||||
*
|
||||
* Returns: 0 on success, non-zero on failure
|
||||
*/
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServer *server = NULL;
|
||||
GMainLoop *loop;
|
||||
int fd;
|
||||
GError *error = NULL;
|
||||
gboolean retval = FALSE;
|
||||
|
||||
gboolean is_debug = FALSE;
|
||||
gboolean is_version = FALSE;
|
||||
|
||||
GOptionContext *context;
|
||||
GOptionEntry entries[] = {
|
||||
{"debug", 0, 0, G_OPTION_ARG_NONE, &is_debug, N_("Log debugging message"), NULL},
|
||||
{"version", 0, 0, G_OPTION_ARG_NONE, &is_version, N_("Version"), NULL},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
context = g_option_context_new ("- Nimf Input Method Server");
|
||||
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
||||
g_option_context_parse (context, &argc, &argv, &error);
|
||||
g_option_context_free (context);
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
g_warning ("%s", error->message);
|
||||
g_error_free (error);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
g_setenv ("GTK_IM_MODULE", "gtk-im-context-simple", TRUE);
|
||||
g_setenv ("GDK_BACKEND", "x11", TRUE);
|
||||
|
||||
#if ENABLE_NLS
|
||||
bindtextdomain (GETTEXT_PACKAGE, NIMF_LOCALE_DIR);
|
||||
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
||||
textdomain (GETTEXT_PACKAGE);
|
||||
#endif
|
||||
|
||||
if (is_debug)
|
||||
g_setenv ("G_MESSAGES_DEBUG", "nimf", TRUE);
|
||||
|
||||
if (is_version)
|
||||
{
|
||||
g_print ("%s %s\n", argv[0], VERSION);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
openlog (g_get_prgname (), LOG_PID | LOG_PERROR, LOG_DAEMON);
|
||||
g_log_set_default_handler ((GLogFunc) nimf_log_default_handler, &is_debug);
|
||||
|
||||
if (daemon (0, 0) != 0)
|
||||
{
|
||||
g_critical ("Couldn't daemonize.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (!create_nimf_runtime_dir ())
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if ((fd = open_lock_file ()) == -1)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
if (set_lock (fd, F_WRLCK))
|
||||
{
|
||||
if (errno == EACCES || errno == EAGAIN)
|
||||
{
|
||||
close(fd);
|
||||
g_message (G_STRLOC ": %s: Another instance appears to be running: %s",
|
||||
G_STRFUNC, strerror (errno));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning (G_STRLOC ": %s: %s", G_STRFUNC, strerror (errno));
|
||||
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!write_pid (fd))
|
||||
{
|
||||
g_critical ("Can't write pid");
|
||||
goto finally;
|
||||
}
|
||||
|
||||
unlink_socket_file ();
|
||||
|
||||
server = g_object_new (NIMF_TYPE_SERVER, NULL);
|
||||
|
||||
if (!nimf_server_start (server))
|
||||
{
|
||||
retval = EXIT_FAILURE;
|
||||
goto finally;
|
||||
}
|
||||
|
||||
loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
g_unix_signal_add (SIGINT, (GSourceFunc) g_main_loop_quit, loop);
|
||||
g_unix_signal_add (SIGTERM, (GSourceFunc) g_main_loop_quit, loop);
|
||||
signal (SIGTSTP, SIG_IGN);
|
||||
|
||||
g_main_loop_run (loop);
|
||||
|
||||
g_main_loop_unref (loop);
|
||||
|
||||
retval = EXIT_SUCCESS;
|
||||
|
||||
finally:
|
||||
|
||||
if (server)
|
||||
g_object_unref (server);
|
||||
|
||||
closelog ();
|
||||
|
||||
if (set_lock (fd, F_UNLCK))
|
||||
{
|
||||
g_critical ("Failed to unlock file: %s", nimf_get_lock_path ());
|
||||
retval = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
close (fd);
|
||||
|
||||
gchar *lock_path, *nimf_path;
|
||||
|
||||
lock_path = nimf_get_lock_path ();
|
||||
nimf_path = nimf_get_nimf_path ();
|
||||
|
||||
unlink_socket_file ();
|
||||
g_unlink (lock_path);
|
||||
g_rmdir (nimf_path);
|
||||
|
||||
g_free (lock_path);
|
||||
g_free (nimf_path);
|
||||
|
||||
return retval;
|
||||
}
|
||||
386
Telegram/ThirdParty/nimf/configure.ac
vendored
Normal file
@@ -0,0 +1,386 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
# 추가된 경로 설정
|
||||
libdir='/usr/lib/x86_64-linux-gnu'
|
||||
|
||||
AC_SUBST(libdir)
|
||||
|
||||
AC_INIT(nimf, 1.3.5)
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror])
|
||||
AM_MAINTAINER_MODE([disable])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AM_PROG_AR
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
|
||||
AS_IF([test "$CXX" = "g++"],
|
||||
[AS_IF([test "$GXX" != "yes"],
|
||||
AC_MSG_ERROR([C++ compiler is not found.]))])
|
||||
|
||||
AC_ARG_ENABLE([hardening],
|
||||
AS_HELP_STRING([--disable-hardening], [Disable hardening]))
|
||||
|
||||
# EXTRA_CFLAGS="-Wall -Werror"
|
||||
EXTRA_CFLAGS="-Wall"
|
||||
AS_IF([test "x$enable_hardening" != "xno"],
|
||||
[AS_IF([echo "$EXTRA_CFLAGS" | grep -vq '\-D_FORTIFY_SOURCE'],
|
||||
[EXTRA_CFLAGS+=" -D_FORTIFY_SOURCE=2"])])
|
||||
|
||||
AC_SUBST(EXTRA_CFLAGS)
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl Internationalization
|
||||
dnl ***************************************************************************
|
||||
|
||||
IT_PROG_INTLTOOL(0.50.1)
|
||||
GETTEXT_PACKAGE=nimf
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [gettext package name])
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
AM_GLIB_DEFINE_LOCALEDIR(NIMF_LOCALE_DIR)
|
||||
|
||||
LT_INIT([disable-static])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl libnimf
|
||||
dnl ***************************************************************************
|
||||
# Before making a release, the LT_VERSION string should be modified.
|
||||
# The string is of the form C:R:A.
|
||||
# - If interfaces have been changed or added, but binary compatibility has
|
||||
# been preserved, change to C+1:0:A+1
|
||||
# - If binary compatibility has been broken (eg removed or changed interfaces)
|
||||
# change to C+1:0:0
|
||||
# - If the interface is the same as the previous version, change to C:R+1:A
|
||||
|
||||
LIBNIMF_LT_VERSION=1:0:0
|
||||
AC_SUBST(LIBNIMF_LT_VERSION)
|
||||
|
||||
LIBNIMF_REQUIRES="glib-2.0 gio-2.0 gio-unix-2.0 gmodule-2.0"
|
||||
AC_SUBST(LIBNIMF_REQUIRES)
|
||||
PKG_CHECK_MODULES(LIBNIMF_DEPS, [$LIBNIMF_REQUIRES])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-libhangul nimf-system-keyboard
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_LIBHANGUL_DEPS, [libhangul >= 0.0.12 $LIBNIMF_REQUIRES])
|
||||
PKG_CHECK_MODULES(NIMF_SYSTEM_KEYBOARD_DEPS,
|
||||
[xkbcommon >= 0.5.0 $LIBNIMF_REQUIRES])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-m17n
|
||||
dnl ***************************************************************************
|
||||
|
||||
AC_ARG_ENABLE([nimf-m17n],
|
||||
AS_HELP_STRING([--disable-nimf-m17n], [Disable nimf-m17n]))
|
||||
|
||||
AS_IF([test "x$enable_nimf_m17n" != "xno"],
|
||||
[PKG_CHECK_MODULES(NIMF_M17N_DEPS, [m17n-shell >= 1.7.0 m17n-db >= 1.7.0
|
||||
$LIBNIMF_REQUIRES])])
|
||||
|
||||
AM_CONDITIONAL([ENABLE_NIMF_M17N], [test "x$enable_nimf_m17n" != "xno"])
|
||||
|
||||
PKG_CHECK_EXISTS([m17n-db >= 1.8.0], [m17n_1_8_0_available="yes"])
|
||||
AM_CONDITIONAL([M17N_1_8_0_AVAILABLE], [test "x$m17n_1_8_0_available" = "xyes"])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-rime
|
||||
dnl ***************************************************************************
|
||||
|
||||
AC_ARG_ENABLE([nimf-rime],
|
||||
AS_HELP_STRING([--disable-nimf-rime], [Disable nimf-rime]))
|
||||
|
||||
AS_IF([test "x$enable_nimf_rime" != "xno"],
|
||||
[PKG_CHECK_MODULES(NIMF_RIME_DEPS, [rime >= 1.2.9 $LIBNIMF_REQUIRES])])
|
||||
|
||||
AM_CONDITIONAL([ENABLE_NIMF_RIME], [test "x$enable_nimf_rime" != "xno"])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-anthy
|
||||
dnl ***************************************************************************
|
||||
|
||||
AC_ARG_ENABLE([nimf-anthy],
|
||||
AS_HELP_STRING([--disable-nimf-anthy], [Disable nimf-anthy]))
|
||||
|
||||
AS_IF([test "x$enable_nimf_anthy" != "xno"],
|
||||
[PKG_CHECK_MODULES(NIMF_ANTHY_DEPS, [anthy $LIBNIMF_REQUIRES])])
|
||||
AS_IF([test "x$enable_nimf_anthy" != "xno"],
|
||||
[AC_CHECK_FILE([/var/lib/anthy/anthy.dic], [HAVE_ANTHY_DIC="yes"])])
|
||||
AS_IF([test "x$enable_nimf_anthy" != "xno"],
|
||||
[AC_CHECK_FILE([/usr/share/anthy/anthy.dic], [HAVE_ANTHY_DIC="yes"])])
|
||||
AS_IF([test "x$enable_nimf_anthy" != "xno" -a "x$HAVE_ANTHY_DIC" != "xyes"],
|
||||
[AC_MSG_ERROR([anthy.dic is not found.])])
|
||||
|
||||
AM_CONDITIONAL([ENABLE_NIMF_ANTHY], [test "x$enable_nimf_anthy" != "xno"])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl im-nimf-qt5
|
||||
dnl ***************************************************************************
|
||||
|
||||
# Check for Qt5
|
||||
PKG_CHECK_MODULES(IM_NIMF_QT5_DEPS, [Qt5Core Qt5Gui Qt5Widgets], [has_qt5=yes], [has_qt5=no])
|
||||
AS_IF([test "x$has_qt5" = "xyes"], [
|
||||
QT5_VERSION=`pkg-config --modversion Qt5Core`
|
||||
QT5_INCLUDE_DIR=`pkg-config --variable=includedir Qt5Core`
|
||||
QT5_CORE_PRIVATE_INCLUDE_PATH=$QT5_INCLUDE_DIR/QtCore/$QT5_VERSION
|
||||
QT5_GUI_PRIVATE_INCLUDE_PATH=$QT5_INCLUDE_DIR/QtGui/$QT5_VERSION
|
||||
|
||||
AC_CHECK_FILES(
|
||||
[$QT5_GUI_PRIVATE_INCLUDE_PATH/QtGui/qpa/qplatforminputcontext.h
|
||||
$QT5_GUI_PRIVATE_INCLUDE_PATH/QtGui/qpa/qplatforminputcontextplugin_p.h], [],
|
||||
AC_MSG_ERROR([Qt 5 base private development files are not found.]))
|
||||
|
||||
AC_SUBST(QT5_CORE_PRIVATE_INCLUDE_PATH)
|
||||
AC_SUBST(QT5_GUI_PRIVATE_INCLUDE_PATH)
|
||||
|
||||
AC_PATH_PROGS([QT5_MOC], [moc-qt5 moc], [no],
|
||||
[`pkg-config --variable=host_bins Qt5Core`])
|
||||
if test "x$QT5_MOC" = "xno"; then
|
||||
AC_MSG_ERROR([moc for qt5 not found])
|
||||
fi
|
||||
|
||||
QT5_LIB_DIR=`pkg-config --variable=libdir Qt5Core`
|
||||
|
||||
case `pkg-config --variable=includedir Qt5Core` in
|
||||
*/qt5)
|
||||
QT5_IM_MODULE_DIR=$QT5_LIB_DIR/qt5/plugins/platforminputcontexts
|
||||
;;
|
||||
*/qt)
|
||||
QT5_IM_MODULE_DIR=$QT5_LIB_DIR/qt/plugins/platforminputcontexts
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(Can not determine Qt5 plugins/platforminputcontexts directory)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(QT5_IM_MODULE_DIR)
|
||||
])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl im-nimf-qt6
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(IM_NIMF_QT6_DEPS, [Qt6Core Qt6Gui Qt6Widgets], [has_qt6=yes], [has_qt6=no])
|
||||
AS_IF([test "x$has_qt6" = "xyes"], [
|
||||
QT6_VERSION=`pkg-config --modversion Qt6Core`
|
||||
QT6_INCLUDE_DIR=`pkg-config --variable=includedir Qt6Core`
|
||||
QT6_CORE_PRIVATE_INCLUDE_PATH=$QT6_INCLUDE_DIR/QtCore/$QT6_VERSION
|
||||
QT6_GUI_PRIVATE_INCLUDE_PATH=$QT6_INCLUDE_DIR/QtGui/$QT6_VERSION
|
||||
|
||||
# Add Qt6 checks
|
||||
AC_CHECK_HEADERS([QtCore/QtCore,
|
||||
QtGui/QtGui,
|
||||
QtWidgets/QtWidgets,
|
||||
QtGui/6.4.2/QtGui/qpa/qplatforminputcontext.h])
|
||||
|
||||
AC_CHECK_FILES(
|
||||
[$QT6_GUI_PRIVATE_INCLUDE_PATH/QtGui/qpa/qplatforminputcontext.h
|
||||
$QT6_GUI_PRIVATE_INCLUDE_PATH/QtGui/qpa/qplatforminputcontextplugin_p.h], [],
|
||||
AC_MSG_ERROR([Qt 6 base private development files are not found.]))
|
||||
|
||||
AC_SUBST(QT6_CORE_PRIVATE_INCLUDE_PATH)
|
||||
AC_SUBST(QT6_GUI_PRIVATE_INCLUDE_PATH)
|
||||
|
||||
AC_PATH_PROGS([QT6_MOC], [moc-qt6 moc], [no],
|
||||
[`pkg-config --variable=host_bins Qt6Core`])
|
||||
if test "x$QT6_MOC" = "xno"; then
|
||||
QT6_MOC=`find /usr/lib/ -name moc -type f | grep qt6`
|
||||
if test "x$QT6_MOC" = "x"; then
|
||||
AC_MSG_ERROR([moc for qt6 not found])
|
||||
fi
|
||||
fi
|
||||
|
||||
QT6_LIB_DIR=`pkg-config --variable=libdir Qt6Core`
|
||||
|
||||
case `pkg-config --variable=includedir Qt6Core` in
|
||||
*/qt6)
|
||||
QT6_IM_MODULE_DIR=$QT6_LIB_DIR/qt6/plugins/platforminputcontexts
|
||||
;;
|
||||
*/qt)
|
||||
QT6_IM_MODULE_DIR=$QT6_LIB_DIR/qt/plugins/platforminputcontexts
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(Can not determine Qt6 plugins/platforminputcontexts directory)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(QT6_IM_MODULE_DIR)
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([HAVE_QT5], [test "x$has_qt5" = "xyes"])
|
||||
AM_CONDITIONAL([HAVE_QT6], [test "x$has_qt6" = "xyes"])
|
||||
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl Check for im-nimf-gtk
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(IM_NIMF_GTK3_DEPS, [gtk+-3.0 gdk-x11-3.0])
|
||||
PKG_CHECK_MODULES(IM_NIMF_GTK2_DEPS, [gtk+-2.0])
|
||||
|
||||
case `uname -m` in
|
||||
x86_64)
|
||||
BITS=64
|
||||
;;
|
||||
*)
|
||||
BITS=32
|
||||
;;
|
||||
esac
|
||||
|
||||
GTK3_LIBDIR=`pkg-config --variable=libdir gtk+-3.0`
|
||||
GTK3_BINARY_VERSION=`pkg-config --variable=gtk_binary_version gtk+-3.0`
|
||||
AC_SUBST(GTK3_LIBDIR)
|
||||
AC_SUBST(GTK3_BINARY_VERSION)
|
||||
AC_PATH_PROGS([GTK_QUERY_IMMODULES3],
|
||||
[gtk-query-immodules-3.0 gtk-query-immodules-3.0-64], [no],
|
||||
[/usr/bin:/snap/gnome-42-2204/176/usr/lib/x86_64-linux-gnu/libgtk-3-0:/usr/lib/x86_64-linux-gnu/libgtk-3-0t64:/usr/lib/x86_64-linux-gnu/libgtk-3-0])
|
||||
if test "x$GTK_QUERY_IMMODULES3" = "xno"; then
|
||||
AC_MSG_ERROR([gtk-query-immodules-3.0 or gtk-query-immodules-3.0-64 not found])
|
||||
fi
|
||||
|
||||
AC_PATH_PROGS([GTK_QUERY_IMMODULES2],
|
||||
[gtk-query-immodules-2.0 gtk-query-immodules-2.0-64], [no],
|
||||
[/usr/bin:/snap/gnome-42-2204/176/usr/lib/x86_64-linux-gnu/libgtk2.0-0:/usr/lib/x86_64-linux-gnu/libgtk2.0-0t64:/usr/lib/x86_64-linux-gnu/libgtk2.0-0])
|
||||
if test "x$GTK_QUERY_IMMODULES2" = "xno"; then
|
||||
AC_MSG_ERROR([gtk-query-immodules-2.0 or gtk-query-immodules-2.0-64 not found])
|
||||
fi
|
||||
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl icon cache
|
||||
dnl ***************************************************************************
|
||||
|
||||
AC_PATH_PROGS([GTK_UPDATE_ICON_CACHE],
|
||||
[gtk-update-icon-cache-3.0 gtk-update-icon-cache], [no],
|
||||
[/usr/bin:$GTK3_LIBDIR/libgtk-3-0:$GTK2_LIBDIR/libgtk2.0-0])
|
||||
if test "x$GTK_UPDATE_ICON_CACHE" = "xno"; then
|
||||
AC_MSG_ERROR([gtk-update-icon-cache-3.0 or gtk-update-icon-cache not found])
|
||||
fi
|
||||
|
||||
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg], [no])
|
||||
if test "x$RSVG_CONVERT" = "xno"; then
|
||||
AC_MSG_ERROR([rsvg-convert or rsvg is not found, please install librsvg2-bin])
|
||||
fi
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-wayland
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_WAYLAND_DEPS, [$LIBNIMF_REQUIRES]
|
||||
wayland-client wayland-server
|
||||
wayland-protocols xkbcommon)
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-xim
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_XIM_DEPS, [$LIBNIMF_REQUIRES] x11)
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-nim
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_NIM_DEPS, [$LIBNIMF_REQUIRES] glib-2.0 gio-2.0)
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf server
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_DEPS, [glib-2.0 gio-2.0 gobject-2.0 gmodule-2.0])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-indicator
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_INDICATOR_DEPS,
|
||||
[glib-2.0 x11 gtk+-3.0 ayatana-appindicator3-0.1 libxklavier gdk-3.0
|
||||
gdk-x11-3.0 gmodule-2.0])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-preedit-window nimf-candidate
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_PREEDIT_WINDOW_DEPS, [glib-2.0 gtk+-3.0])
|
||||
PKG_CHECK_MODULES(NIMF_CANDIDATE_DEPS, [glib-2.0 gtk+-3.0])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl nimf-settings
|
||||
dnl ***************************************************************************
|
||||
|
||||
PKG_CHECK_MODULES(NIMF_SETTINGS_DEPS,
|
||||
[gtk+-3.0 glib-2.0 >= 2.54 gio-2.0 gmodule-2.0 libxklavier
|
||||
gdk-3.0 gdk-x11-3.0])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl im-config data
|
||||
dnl ***************************************************************************
|
||||
|
||||
AC_ARG_WITH([im-config-data],
|
||||
AS_HELP_STRING([--with-im-config-data], [Install im-config data]),
|
||||
[with_im_config_data=yes])
|
||||
|
||||
AM_CONDITIONAL([WITH_IM_CONFIG_DATA],
|
||||
[test "$with_im_config_data" = "yes"])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl imsettings data
|
||||
dnl ***************************************************************************
|
||||
|
||||
AC_ARG_WITH([imsettings-data],
|
||||
AS_HELP_STRING([--with-imsettings-data], [Install imsettings data]),
|
||||
[with_imsettings_data=yes])
|
||||
|
||||
AM_CONDITIONAL([WITH_IMSETTINGS_DATA],
|
||||
[test "$with_imsettings_data" = "yes"])
|
||||
|
||||
dnl ***************************************************************************
|
||||
dnl Check for gtk-doc
|
||||
dnl ***************************************************************************
|
||||
|
||||
GTK_DOC_CHECK([1.26],[--flavour no-tmpl])
|
||||
|
||||
dnl ***************************************************************************
|
||||
|
||||
GLIB_GSETTINGS
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
bin/Makefile
|
||||
bin/nimf/Makefile
|
||||
bin/nimf-settings/Makefile
|
||||
data/Makefile
|
||||
data/apparmor-abstractions/Makefile
|
||||
data/icons/Makefile
|
||||
data/im-config/Makefile
|
||||
data/imsettings/Makefile
|
||||
docs/Makefile
|
||||
libnimf/Makefile
|
||||
libnimf/nimf.pc
|
||||
modules/Makefile
|
||||
modules/clients/Makefile
|
||||
modules/clients/gtk/Makefile
|
||||
modules/clients/qt5/Makefile
|
||||
modules/clients/qt6/Makefile
|
||||
modules/engines/Makefile
|
||||
modules/engines/nimf-anthy/Makefile
|
||||
modules/engines/nimf-libhangul/Makefile
|
||||
modules/engines/nimf-m17n/Makefile
|
||||
modules/engines/nimf-m17n/icons/Makefile
|
||||
modules/engines/nimf-rime/Makefile
|
||||
modules/engines/nimf-system-keyboard/Makefile
|
||||
modules/services/Makefile
|
||||
modules/services/candidate/Makefile
|
||||
modules/services/indicator/Makefile
|
||||
modules/services/nim/Makefile
|
||||
modules/services/preedit-window/Makefile
|
||||
modules/services/wayland/Makefile
|
||||
modules/services/xim/Makefile
|
||||
po/Makefile.in
|
||||
])
|
||||
15
Telegram/ThirdParty/nimf/data/Makefile.am
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
SUBDIRS = icons apparmor-abstractions
|
||||
|
||||
if WITH_IM_CONFIG_DATA
|
||||
SUBDIRS += im-config
|
||||
endif
|
||||
|
||||
if WITH_IMSETTINGS_DATA
|
||||
SUBDIRS += imsettings
|
||||
endif
|
||||
|
||||
configdir = /etc/input.d
|
||||
|
||||
config_DATA = nimf.conf
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
5
Telegram/ThirdParty/nimf/data/apparmor-abstractions/Makefile.am
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
abstractionsdir = /etc/apparmor.d/abstractions
|
||||
|
||||
abstractions_DATA = nimf
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
6
Telegram/ThirdParty/nimf/data/apparmor-abstractions/nimf
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
# vim:syntax=apparmor
|
||||
|
||||
# Allow connecting to the nimf socket
|
||||
unix (send, receive, connect)
|
||||
type=stream
|
||||
peer=(addr="/{,var/}run/user/[0-9]*/nimf/socket"),
|
||||
114
Telegram/ThirdParty/nimf/data/icons/Makefile.am
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
icon_themedir = $(datadir)/icons/hicolor
|
||||
|
||||
status_scalable_icondir = $(icon_themedir)/scalable/status/
|
||||
status_scalable_icon_DATA = \
|
||||
scalable/nimf-logo.svg \
|
||||
scalable/nimf-focus-out.svg \
|
||||
scalable/nimf-system-keyboard.svg \
|
||||
scalable/nimf-libhangul.svg \
|
||||
scalable/nimf-anthy.svg \
|
||||
scalable/nimf-rime-simplified.svg \
|
||||
scalable/nimf-rime-traditional.svg
|
||||
|
||||
# 16x16 icons
|
||||
|
||||
status_16_icondir = $(icon_themedir)/16x16/status/
|
||||
status_16_icon_tmp = $(status_scalable_icon_DATA:scalable/%=16x16/%)
|
||||
status_16_icon_DATA = $(status_16_icon_tmp:.svg=.png)
|
||||
|
||||
$(status_16_icon_DATA): $(status_scalable_icon_DATA)
|
||||
$(AM_V_GEN) $(MKDIR_P) 16x16; \
|
||||
$(RSVG_CONVERT) -w 16 -h 16 scalable/`basename "$@" .png`.svg -o $@
|
||||
|
||||
# 22x22 icons
|
||||
|
||||
status_22_icondir = $(icon_themedir)/22x22/status/
|
||||
status_22_icon_tmp = $(status_scalable_icon_DATA:scalable/%=22x22/%)
|
||||
status_22_icon_DATA = $(status_22_icon_tmp:.svg=.png)
|
||||
|
||||
$(status_22_icon_DATA): $(status_scalable_icon_DATA)
|
||||
$(AM_V_GEN) $(MKDIR_P) 22x22; \
|
||||
$(RSVG_CONVERT) -w 22 -h 22 scalable/`basename "$@" .png`.svg -o $@
|
||||
|
||||
# 24x24 icons
|
||||
|
||||
status_24_icondir = $(icon_themedir)/24x24/status/
|
||||
status_24_icon_tmp = $(status_scalable_icon_DATA:scalable/%=24x24/%)
|
||||
status_24_icon_DATA = $(status_24_icon_tmp:.svg=.png)
|
||||
|
||||
$(status_24_icon_DATA): $(status_scalable_icon_DATA)
|
||||
$(AM_V_GEN) $(MKDIR_P) 24x24; \
|
||||
$(RSVG_CONVERT) -w 24 -h 24 scalable/`basename "$@" .png`.svg -o $@
|
||||
|
||||
# 32x32 icons
|
||||
|
||||
status_32_icondir = $(icon_themedir)/32x32/status/
|
||||
status_32_icon_tmp = $(status_scalable_icon_DATA:scalable/%=32x32/%)
|
||||
status_32_icon_DATA = $(status_32_icon_tmp:.svg=.png)
|
||||
|
||||
$(status_32_icon_DATA): $(status_scalable_icon_DATA)
|
||||
$(AM_V_GEN) $(MKDIR_P) 32x32; \
|
||||
$(RSVG_CONVERT) -w 32 -h 32 scalable/`basename "$@" .png`.svg -o $@
|
||||
|
||||
update-gtk-icon-cache:
|
||||
@if [ -d "$(icon_themedir)" ]; then \
|
||||
$(GTK_UPDATE_ICON_CACHE) -f -t $(icon_themedir); \
|
||||
else \
|
||||
echo "GTK icon cache is not updated. Try after make; sudo make install"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# 48x48 icons
|
||||
|
||||
status_48_icondir = $(icon_themedir)/48x48/status/
|
||||
status_48_icon_tmp = $(status_scalable_icon_DATA:scalable/%=48x48/%)
|
||||
status_48_icon_DATA = $(status_48_icon_tmp:.svg=.png)
|
||||
|
||||
$(status_48_icon_DATA): $(status_scalable_icon_DATA)
|
||||
$(AM_V_GEN) $(MKDIR_P) 48x48; \
|
||||
$(RSVG_CONVERT) -w 48 -h 48 scalable/`basename "$@" .png`.svg -o $@
|
||||
|
||||
# 96x96 icons
|
||||
|
||||
status_96_icondir = $(icon_themedir)/96x96/status/
|
||||
status_96_icon_tmp = $(status_scalable_icon_DATA:scalable/%=96x96/%)
|
||||
status_96_icon_DATA = $(status_96_icon_tmp:.svg=.png)
|
||||
|
||||
$(status_96_icon_DATA): $(status_scalable_icon_DATA)
|
||||
$(AM_V_GEN) $(MKDIR_P) 96x96; \
|
||||
$(RSVG_CONVERT) -w 96 -h 96 scalable/`basename "$@" .png`.svg -o $@
|
||||
|
||||
# 256x256 icons
|
||||
|
||||
status_256_icondir = $(icon_themedir)/256x256/status/
|
||||
status_256_icon_tmp = $(status_scalable_icon_DATA:scalable/%=256x256/%)
|
||||
status_256_icon_DATA = $(status_256_icon_tmp:.svg=.png)
|
||||
|
||||
$(status_256_icon_DATA): $(status_scalable_icon_DATA)
|
||||
$(AM_V_GEN) $(MKDIR_P) 256x256; \
|
||||
$(RSVG_CONVERT) -w 256 -h 256 scalable/`basename "$@" .png`.svg -o $@
|
||||
|
||||
clean-local:
|
||||
-rmdir 16x16 22x22 24x24 32x32 48x48 96x96 256x256
|
||||
|
||||
uninstall-hook:
|
||||
rm -f $(DESTDIR)$(icon_themedir)/icon-theme.cache
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/16x16/status
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/22x22/status
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/24x24/status
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/32x32/status
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/48x48/status
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/96x96/status
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/256x256/status
|
||||
-rmdir -p $(DESTDIR)$(icon_themedir)/scalable/status
|
||||
-$(GTK_UPDATE_ICON_CACHE) -f -t $(icon_themedir)
|
||||
|
||||
CLEANFILES = $(status_16_icon_DATA) \
|
||||
$(status_22_icon_DATA) \
|
||||
$(status_24_icon_DATA) \
|
||||
$(status_32_icon_DATA) \
|
||||
$(status_48_icon_DATA) \
|
||||
$(status_96_icon_DATA) \
|
||||
$(status_256_icon_DATA)
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
56
Telegram/ThirdParty/nimf/data/icons/scalable/nimf-anthy.svg
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="레이어_1"
|
||||
data-name="레이어 1"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
sodipodi:docname="nimf-anthy.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview13"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.046875"
|
||||
inkscape:cx="31.954738"
|
||||
inkscape:cy="32"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1019"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="레이어_1" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<style
|
||||
id="style2">.cls-1{fill:#fff;}.cls-2{fill:#262933;}</style>
|
||||
</defs>
|
||||
<title
|
||||
id="title6">nimf-anthy</title>
|
||||
<g
|
||||
id="g35"
|
||||
transform="matrix(0.86608093,0,0,0.86379001,3.9530199,4.1113949)">
|
||||
<rect
|
||||
class="cls-1"
|
||||
width="64"
|
||||
height="64"
|
||||
rx="12.22"
|
||||
ry="12.22"
|
||||
id="rect8"
|
||||
style="fill:#f9f9f9"
|
||||
x="0"
|
||||
y="0" />
|
||||
<path
|
||||
class="cls-2"
|
||||
d="m 35.77,47.37 a 22.65,22.65 0 0 0 7.79,-2.49 7.75,7.75 0 0 0 2.85,-2.88 8.08,8.08 0 0 0 0.93,-3.92 7.34,7.34 0 0 0 -2.16,-5.24 9.47,9.47 0 0 0 -2.06,-1.64 10.2,10.2 0 0 0 -2.69,-1.05 32.55,32.55 0 0 1 -4,8 38.54,38.54 0 0 1 -5.43,6.33 23.57,23.57 0 0 1 -5.51,3.87 11.84,11.84 0 0 1 -5.22,1.33 5,5 0 0 1 -0.56,0 4.08,4.08 0 0 1 -0.52,-0.07 7,7 0 0 1 -4.31,-2 8.69,8.69 0 0 1 -2.25,-6.42 12.06,12.06 0 0 1 3.52,-8.09 19.08,19.08 0 0 1 7.42,-5.1 c 0,-0.91 0,-2 0.05,-3.16 0.05,-1.16 0.05,-2.36 0.05,-3.5 H 15.54 V 17.58 H 24 q 0.11,-1.86 0.3,-3.6 c 0.13,-1.16 0.29,-2.26 0.49,-3.31 h 3.87 q -0.24,1.58 -0.42,3.24 c -0.11,1.11 -0.23,2.27 -0.37,3.48 q 3.63,-0.06 7.55,-0.22 3.92,-0.16 7.89,-0.52 v 3.68 c -2.65,0.22 -5.27,0.4 -7.86,0.51 -2.59,0.11 -5.22,0.2 -7.87,0.27 0,0.39 0,0.85 0,1.37 0,0.52 0,1.05 -0.05,1.57 -0.05,0.52 0,1 0,1.52 v 1.32 a 29.29,29.29 0 0 1 3.9,-0.73 29.83,29.83 0 0 1 3.7,-0.25 23.88,23.88 0 0 1 6.69,0.84 16.63,16.63 0 0 1 5.17,2.49 10.34,10.34 0 0 1 4.46,8.82 11.19,11.19 0 0 1 -4.56,9.46 14.58,14.58 0 0 1 -4,2.25 28.41,28.41 0 0 1 -5.17,1.38 z M 23.67,31.94 a 12.61,12.61 0 0 0 -2.84,1.71 15.09,15.09 0 0 0 -2.26,2.26 8.27,8.27 0 0 0 -2.15,5.29 6.25,6.25 0 0 0 0.27,1.89 3.76,3.76 0 0 0 3.89,2.67 6.74,6.74 0 0 0 2.53,-0.52 8,8 0 0 0 2.47,-1.59 24.71,24.71 0 0 1 -1.37,-5.56 60.91,60.91 0 0 1 -0.54,-6.15 z m 5.15,9.55 a 27.12,27.12 0 0 0 4.41,-5.43 43.22,43.22 0 0 0 3.28,-6.52 h -0.93 a 33.2,33.2 0 0 0 -4.46,0.29 23.24,23.24 0 0 0 -3.68,0.79 c 0,1.86 0.16,3.73 0.37,5.61 a 32.7,32.7 0 0 0 1.01,5.26 z"
|
||||
id="path10" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
101
Telegram/ThirdParty/nimf/data/icons/scalable/nimf-focus-out.svg
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="레이어_1"
|
||||
data-name="레이어 1"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
sodipodi:docname="nimf-focus-out.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview33"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.046875"
|
||||
inkscape:cx="10.319661"
|
||||
inkscape:cy="32"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1019"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="레이어_1" />
|
||||
<defs
|
||||
id="defs18">
|
||||
<style
|
||||
id="style2">.cls-1{fill:#fff;}.cls-2{fill:#4bced6;}.cls-3{fill:url(#무제_그라디언트_43);}.cls-4{fill:url(#무제_그라디언트_43-2);}</style>
|
||||
<linearGradient
|
||||
id="무제_그라디언트_43"
|
||||
x1="18.87"
|
||||
y1="12.57"
|
||||
x2="18.87"
|
||||
y2="45.02"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
offset="0"
|
||||
stop-color="#50d7d7"
|
||||
id="stop4" />
|
||||
<stop
|
||||
offset="0.2"
|
||||
stop-color="#41bdd4"
|
||||
id="stop6" />
|
||||
<stop
|
||||
offset="0.84"
|
||||
stop-color="#8253d6"
|
||||
id="stop8" />
|
||||
<stop
|
||||
offset="0.89"
|
||||
stop-color="#8457d6"
|
||||
id="stop10" />
|
||||
<stop
|
||||
offset="0.95"
|
||||
stop-color="#8963d6"
|
||||
id="stop12" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-color="#9174d6"
|
||||
id="stop14" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="무제_그라디언트_43-2"
|
||||
x1="-612.83"
|
||||
y1="12.57"
|
||||
x2="-612.83"
|
||||
y2="45.02"
|
||||
gradientTransform="matrix(-1, 0, 0, 1, -567.69, 0)"
|
||||
xlink:href="#무제_그라디언트_43" />
|
||||
</defs>
|
||||
<title
|
||||
id="title20">님프1</title>
|
||||
<path
|
||||
class="cls-1"
|
||||
d="M 48.87823,4.601826 15.191127,4.9813332 A 10.415058,10.35585 0 0 0 4.903152,15.445281 L 5.284829,48.940876 A 10.415058,10.35585 0 0 0 15.808602,59.170365 L 49.495705,58.790859 A 10.415058,10.35585 0 0 0 59.783679,48.326912 L 59.402003,14.831316 A 10.415058,10.35585 0 0 0 48.87823,4.601826 Z"
|
||||
id="path22"
|
||||
style="fill:#f9f9f9;stroke-width:0.849175" />
|
||||
<path
|
||||
class="cls-2"
|
||||
d="M19.49,38.76h10.2a1.52,1.52,0,0,1,1.52,1.52V48.1A5.88,5.88,0,0,1,25.33,54H13.89a0,0,0,0,1,0,0V44.36a5.6,5.6,0,0,1,5.6-5.6Z"
|
||||
transform="translate(45.09 92.73) rotate(-180)"
|
||||
id="path24" />
|
||||
<path
|
||||
class="cls-3"
|
||||
d="M10.05,16.63H21.87A9.34,9.34,0,0,1,31.21,26h0V48.16l-5.55-6.94a6.38,6.38,0,0,0-5-2.39H13.82a7.29,7.29,0,0,1-7.29-7.3V20.16A3.52,3.52,0,0,1,10.05,16.63Z"
|
||||
id="path26" />
|
||||
<path
|
||||
class="cls-2"
|
||||
d="M32.79,33.13H44.24A5.88,5.88,0,0,1,50.11,39v7.81a1.52,1.52,0,0,1-1.52,1.52H38.4a5.6,5.6,0,0,1-5.6-5.6V33.13A0,0,0,0,1,32.79,33.13Z"
|
||||
id="path28" />
|
||||
<path
|
||||
class="cls-4"
|
||||
d="M54,11H42.13a9.34,9.34,0,0,0-9.34,9.34h0v22.2l5.55-6.95a6.38,6.38,0,0,1,5-2.39h6.86a7.29,7.29,0,0,0,7.29-7.3V14.53A3.52,3.52,0,0,0,54,11Z"
|
||||
id="path30" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
56
Telegram/ThirdParty/nimf/data/icons/scalable/nimf-libhangul.svg
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="레이어_1"
|
||||
data-name="레이어 1"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
sodipodi:docname="nimf-libhangul.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview13"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.5234375"
|
||||
inkscape:cx="2.8967468"
|
||||
inkscape:cy="43.722772"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1019"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="레이어_1" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<style
|
||||
id="style2">.cls-1{fill:#fff;}</style>
|
||||
</defs>
|
||||
<title
|
||||
id="title6">한1</title>
|
||||
<g
|
||||
id="g13"
|
||||
transform="matrix(1.0554712,0,0,1.0541183,-2.2393976,-1.723443)">
|
||||
<g
|
||||
id="g161"
|
||||
transform="matrix(1.094379,0,0,1.0518054,6.6715218,5.9769757)">
|
||||
<path
|
||||
class="cls-1"
|
||||
d="M 38.258658,0 H 9.0289842 A 9.0363729,9.4160941 0 0 0 0,9.4083949 V 39.866341 a 9.0363729,9.4160941 0 0 0 9.0289842,9.408395 H 38.258658 a 9.0363729,9.4160941 0 0 0 9.028985,-9.408395 V 9.4083949 A 9.0363729,9.4160941 0 0 0 38.258658,0 Z M 9.2728112,12.318684 H 16.595007 V 8.3767051 h 3.354467 v 3.9419789 h 7.292641 v 2.964183 H 9.2728112 Z m 2.1501098,13.473561 a 5.2164181,5.4356193 0 0 1 -0.458099,-2.209664 v -1.085584 a 5.3272485,5.551107 0 0 1 0.458099,-2.240461 5.2755276,5.4972127 0 0 1 1.374297,-1.901697 7.2335316,7.5374948 0 0 1 2.268329,-1.347356 9.4723059,9.8703455 0 0 1 3.191916,-0.508146 9.4279737,9.8241505 0 0 1 3.184527,0.508146 6.908429,7.1987309 0 0 1 2.26833,1.362754 5.2976937,5.5203103 0 0 1 1.41124,1.924795 5.2090294,5.4279201 0 0 1 0.458099,2.201965 v 1.062486 a 5.2164181,5.4356193 0 0 1 -0.458099,2.209664 5.3715806,5.597302 0 0 1 -1.41124,1.947892 6.8936516,7.1833326 0 0 1 -2.283107,1.331958 9.2432564,9.631671 0 0 1 -3.184527,0.515845 9.2875885,9.6778661 0 0 1 -3.191916,-0.515845 6.9749273,7.2680235 0 0 1 -2.253552,-1.331958 5.5636867,5.7974806 0 0 1 -1.374297,-1.947892 z M 34.423926,40.898031 H 14.474452 v -9.000339 h 3.361856 v 5.966863 H 34.423926 Z M 38.014831,21.403713 H 33.581615 V 32.336545 H 30.256703 V 8.6923714 h 3.324912 v 9.6778656 h 4.433216 z"
|
||||
id="path8"
|
||||
style="fill:#f9f9f9;stroke-width:0.754234" />
|
||||
<path
|
||||
class="cls-1"
|
||||
d="m 16.359606,26.52953 a 5.9103749,5.7340289 0 0 0 1.920082,0.283635 5.9735875,5.7953554 0 0 0 1.920081,-0.283635 3.9902932,3.8712361 0 0 0 1.374874,-0.766581 3.1606283,3.0663256 0 0 0 0.790157,-1.088546 3.2317424,3.1353179 0 0 0 0.276555,-1.249527 v -0.705255 a 3.3107582,3.2119761 0 0 0 -1.090417,-2.338073 3.9507854,3.832907 0 0 0 -1.35907,-0.766582 5.7049341,5.5347177 0 0 0 -1.935885,-0.283635 5.7207372,5.5500494 0 0 0 -1.943786,0.283635 3.9507854,3.832907 0 0 0 -1.359071,0.766582 3.2238409,3.1276521 0 0 0 -0.790157,1.096211 3.1606283,3.0663256 0 0 0 -0.268653,1.241862 v 0.705255 a 3.2159393,3.1199863 0 0 0 0.268653,1.257193 3.1606283,3.0663256 0 0 0 0.790157,1.088546 3.9507854,3.832907 0 0 0 1.40648,0.758915 z"
|
||||
id="path10"
|
||||
style="fill:#f9f9f9;stroke-width:0.77828" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
1
Telegram/ThirdParty/nimf/data/icons/scalable/nimf-logo.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="레이어_1" data-name="레이어 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 64 64"><defs><style>.cls-1{fill:#dfedf2;}.cls-2{fill:#4bced6;}.cls-3{fill:url(#무제_그라디언트_43);}.cls-4{fill:url(#무제_그라디언트_43-2);}</style><linearGradient id="무제_그라디언트_43" x1="18.1" y1="11.37" x2="18.1" y2="45.96" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#50d7d7"/><stop offset="0.2" stop-color="#41bdd4"/><stop offset="0.84" stop-color="#8253d6"/><stop offset="0.89" stop-color="#8457d6"/><stop offset="0.95" stop-color="#8963d6"/><stop offset="1" stop-color="#9174d6"/></linearGradient><linearGradient id="무제_그라디언트_43-2" x1="-385.8" y1="11.37" x2="-385.8" y2="45.96" gradientTransform="matrix(-1, 0, 0, 1, -339.69, 0)" xlink:href="#무제_그라디언트_43"/></defs><title>nimf-logo</title><path class="cls-1" d="M49.6,64H14.4A14.4,14.4,0,0,1,0,49.6V14.4A14.4,14.4,0,0,1,14.4,0H49.6A14.4,14.4,0,0,1,64,14.4V49.6A14.4,14.4,0,0,1,49.6,64Z"/><path class="cls-2" d="M18.77,39.28H29.63a1.62,1.62,0,0,1,1.62,1.62v8.33A6.27,6.27,0,0,1,25,55.5H12.8a0,0,0,0,1,0,0V45.25A6,6,0,0,1,18.77,39.28Z" transform="translate(44.05 94.78) rotate(-180)"/><path class="cls-3" d="M8.71,15.69H21.3a10,10,0,0,1,10,10h0V49.31l-5.92-7.4A6.77,6.77,0,0,0,20,39.35H12.73A7.77,7.77,0,0,1,5,31.58V19.45A3.76,3.76,0,0,1,8.71,15.69Z"/><path class="cls-2" d="M32.95,33.28h12.2a6.27,6.27,0,0,1,6.27,6.27v8.33a1.62,1.62,0,0,1-1.62,1.62H38.92a6,6,0,0,1-6-6V33.28a0,0,0,0,1,0,0Z"/><path class="cls-4" d="M55.5,9.69H42.9a10,10,0,0,0-9.95,10h0V43.31l5.91-7.4a6.78,6.78,0,0,1,5.31-2.56h7.31a7.78,7.78,0,0,0,7.78-7.77V13.45A3.77,3.77,0,0,0,55.5,9.69Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
56
Telegram/ThirdParty/nimf/data/icons/scalable/nimf-rime-simplified.svg
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="레이어_1"
|
||||
data-name="레이어 1"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
sodipodi:docname="nimf-rime-simplified.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview13"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.046875"
|
||||
inkscape:cx="31.954738"
|
||||
inkscape:cy="32"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1019"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="레이어_1" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<style
|
||||
id="style2">.cls-1{fill:#fff;}.cls-2{fill:#262933;}</style>
|
||||
</defs>
|
||||
<title
|
||||
id="title6">nimf-rime-simplified</title>
|
||||
<g
|
||||
id="g35"
|
||||
transform="matrix(0.85405272,0,0,0.8649272,4.5217796,4.5271006)">
|
||||
<rect
|
||||
class="cls-1"
|
||||
width="64"
|
||||
height="64"
|
||||
rx="12.22"
|
||||
ry="12.22"
|
||||
id="rect8"
|
||||
style="fill:#f9f9f9"
|
||||
x="0"
|
||||
y="0" />
|
||||
<path
|
||||
class="cls-2"
|
||||
d="M 25.51,36.58 A 39.87,39.87 0 0 1 14.8,52.07 l -1.72,-3.53 a 36.31,36.31 0 0 0 5.33,-6 40.48,40.48 0 0 0 4,-7.48 z M 14.8,24 a 47.31,47.31 0 0 1 8.2,4.76 l -1.85,3 a 44.5,44.5 0 0 0 -8,-4.64 z M 17,13.06 a 47.05,47.05 0 0 1 8.09,5 L 23.14,21 A 42.14,42.14 0 0 0 15.27,16.18 Z M 49.76,52.19 A 33.41,33.41 0 0 1 39.18,43.9 46.62,46.62 0 0 1 25.89,52.28 l -2.23,-3.7 A 45,45 0 0 0 37,40.93 C 35.36,38.31 31.84,32.54 29.47,18.48 H 27.83 V 15 h 20.68 l 1.76,1.68 c -0.9,9.2 -3.09,16.55 -6.62,22 -0.6,0.91 -1.33,1.81 -2,2.67 a 28.34,28.34 0 0 0 11,7.74 z M 32.9,18.48 c 1.42,8.47 3.7,15.7 6.54,20 a 17,17 0 0 0 1.33,-1.72 c 2.93,-4.42 4.9,-10.53 5.85,-18.23 z"
|
||||
id="path10" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
51
Telegram/ThirdParty/nimf/data/icons/scalable/nimf-rime-traditional.svg
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="레이어_1"
|
||||
data-name="레이어 1"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
sodipodi:docname="nimf-rime-traditional.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview13"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="11.046875"
|
||||
inkscape:cx="31.954738"
|
||||
inkscape:cy="32"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1019"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="레이어_1" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<style
|
||||
id="style2">.cls-1{fill:#fff;}.cls-2{fill:#262933;}</style>
|
||||
</defs>
|
||||
<title
|
||||
id="title6">nimf-rime-traditional</title>
|
||||
<g
|
||||
id="g107"
|
||||
transform="matrix(0.85696631,0,0,0.8536344,4.4143495,4.8358935)">
|
||||
<path
|
||||
class="cls-1"
|
||||
d="M 51.78,0 H 12.22 A 12.23,12.23 0 0 0 0,12.22 V 51.78 A 12.23,12.23 0 0 0 12.22,64 H 51.78 A 12.23,12.23 0 0 0 64,51.78 V 12.22 A 12.23,12.23 0 0 0 51.78,0 Z"
|
||||
id="path8"
|
||||
style="fill:#f9f9f9" />
|
||||
<path
|
||||
class="cls-2"
|
||||
d="m 12.63,50.13 a 33.54,33.54 0 0 0 6.11,-14.62 l 3.44,0.6 c -1.29,6.62 -3.36,11.83 -6.11,15.52 z M 19.29,31.68 A 37.17,37.17 0 0 0 12.76,27 l 2.11,-3.05 a 41,41 0 0 1 6.66,4.86 z m 0.56,-9.8 a 42.65,42.65 0 0 0 -6.49,-5.12 l 2.24,-2.92 a 35.81,35.81 0 0 1 6.62,5.24 z m 30,10.84 a 0.43,0.43 0 0 1 -0.48,0.47 H 38.69 V 35 h 11.69 v 3.14 H 38.69 l -0.13,1.81 h 13.16 v 3.35 h -12 c 2.71,3.27 7,5.21 12.82,5.59 l -1.04,3.52 c -6.45,-0.47 -11.31,-2.92 -14.49,-7.22 -2.24,4.25 -6.79,6.23 -14.49,7.35 l -1.29,-3.61 c 6.88,-0.43 11.22,-2.37 13,-5.64 H 23.12 v -3.35 h 12 l 0.13,-1.81 H 24.28 V 35 H 35.2 V 33.2 H 24.45 c -0.3,0 -0.43,-0.17 -0.43,-0.47 v -7.32 c 0,-0.26 0.13,-0.39 0.43,-0.39 H 35.2 v -1.89 h -5.63 a 1.29,1.29 0 0 1 -1.42,-1.47 v -3.91 h -6 v -3.31 h 6 v -1.89 h 3.48 v 1.89 h 10.63 v -1.89 h 3.48 v 1.89 h 6.32 v 3.31 h -6.32 v 3.91 a 1.3,1.3 0 0 1 -1.46,1.47 H 38.69 V 25 h 10.7 c 0.3,0 0.48,0.13 0.48,0.39 z M 35.2,28 h -7.69 c -0.13,0 -0.18,0 -0.13,0.12 v 1.94 l 0.13,0.17 h 7.69 z m 6.54,-7.87 c 0.34,0 0.52,-0.13 0.52,-0.52 V 17.75 H 31.63 v 1.85 c 0,0.39 0.18,0.52 0.52,0.52 z M 46.38,28 h -7.69 v 2.23 h 7.69 l 0.18,-0.17 v -1.95 z"
|
||||
id="path10" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
191
Telegram/ThirdParty/nimf/data/icons/scalable/nimf-system-keyboard.svg
vendored
Normal file
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="레이어_1"
|
||||
data-name="레이어 1"
|
||||
viewBox="0 0 64 64"
|
||||
version="1.1"
|
||||
sodipodi:docname="nimf-system-keyboard.svg"
|
||||
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview41"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="5.5234375"
|
||||
inkscape:cx="0.7241867"
|
||||
inkscape:cy="26.885431"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1019"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="33"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="레이어_1" />
|
||||
<defs
|
||||
id="defs4">
|
||||
<style
|
||||
id="style2">.cls-1{fill:#fff;}.cls-2{fill:#262933;}</style>
|
||||
</defs>
|
||||
<title
|
||||
id="title6">nimf-system-keyboard</title>
|
||||
<g
|
||||
id="g41"
|
||||
transform="matrix(1.0490311,0,0,1.0546842,-1.7636977,-1.2042515)">
|
||||
<rect
|
||||
class="cls-1"
|
||||
width="52.121643"
|
||||
height="51.836411"
|
||||
rx="9.9519768"
|
||||
ry="9.8975153"
|
||||
id="rect8"
|
||||
style="fill:#f9f9f9;stroke-width:0.81217"
|
||||
x="5.9576001"
|
||||
y="5.5064812" />
|
||||
<g
|
||||
id="g202"
|
||||
transform="matrix(0.64159423,0,0,0.59512851,11.689247,13.161949)">
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="28.99"
|
||||
y="37.740002"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect10" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="32.360001"
|
||||
y="28.48"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect12" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="24.780001"
|
||||
y="28.48"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect14" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="39.939999"
|
||||
y="28.48"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect16" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="47.290001"
|
||||
y="28.48"
|
||||
width="9.4899998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect18" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="36.57"
|
||||
y="37.740002"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect20" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="17.200001"
|
||||
y="28.48"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect22" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="21.41"
|
||||
y="37.740002"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect24" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="51.73"
|
||||
y="47.009998"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect26" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="44.150002"
|
||||
y="37.740002"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect28" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="51.73"
|
||||
y="37.740002"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect30" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="7.0900002"
|
||||
y="47.009998"
|
||||
width="5.4099998"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect32" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="14.66"
|
||||
y="47.009998"
|
||||
width="34.549999"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect34" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="6.8600001"
|
||||
y="28.48"
|
||||
width="7.8099999"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect36" />
|
||||
<rect
|
||||
class="cls-2"
|
||||
x="7.0900002"
|
||||
y="37.740002"
|
||||
width="12.64"
|
||||
height="6.4899998"
|
||||
rx="2"
|
||||
ry="2"
|
||||
id="rect38" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
11
Telegram/ThirdParty/nimf/data/im-config/23_nimf.conf
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
IM_CONFIG_SHORT="$(gettext "activate Nimf")"
|
||||
|
||||
IM_CONFIG_LONG="$(gettext "Nimf Input Method Framework")"
|
||||
|
||||
package_auto () {
|
||||
:
|
||||
}
|
||||
|
||||
package_menu () {
|
||||
:
|
||||
}
|
||||
11
Telegram/ThirdParty/nimf/data/im-config/23_nimf.rc
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
if [ "$IM_CONFIG_PHASE" = 2 ]; then
|
||||
nimf
|
||||
fi
|
||||
|
||||
if [ "$IM_CONFIG_PHASE" = 1 ]; then
|
||||
XMODIFIERS="@im=nimf"
|
||||
GTK_IM_MODULE=nimf
|
||||
QT4_IM_MODULE=xim
|
||||
QT_IM_MODULE=nimf
|
||||
CLUTTER_IM_MODULE=xim
|
||||
fi
|
||||
7
Telegram/ThirdParty/nimf/data/im-config/Makefile.am
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
imconfigdir = /usr/share/im-config/data
|
||||
|
||||
imconfig_DATA = \
|
||||
23_nimf.conf \
|
||||
23_nimf.rc
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
4
Telegram/ThirdParty/nimf/data/imsettings/Makefile.am
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
imsettingsdir = /etc/X11/xinit/xinput.d
|
||||
imsettings_DATA = nimf.conf
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
7
Telegram/ThirdParty/nimf/data/imsettings/nimf.conf
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
XIM=nimf
|
||||
XIM_PROGRAM=/usr/bin/nimf
|
||||
PREFERENCE_PROGRAM=/usr/bin/nimf-settings
|
||||
ICON=nimf
|
||||
SHORT_DESC=Nimf
|
||||
GTK_IM_MODULE=nimf
|
||||
QT_IM_MODULE=nimf
|
||||
4
Telegram/ThirdParty/nimf/data/nimf.conf
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
GTK_IM_MODULE=nimf
|
||||
QT4_IM_MODULE=xim
|
||||
QT_IM_MODULE=nimf
|
||||
XMODIFIERS=@im=nimf
|
||||
568
Telegram/ThirdParty/nimf/debian/autoreconf.after
vendored
Normal file
@@ -0,0 +1,568 @@
|
||||
symlink ./NEWS
|
||||
8a2abc364b21c3f7ebb67c4ed583e202 ./config.h
|
||||
33d49e4fd7057cb9a7513eec5c9308bc ./configure~
|
||||
94a79667c2a0e5f3f3152ebec68fca4b ./po/POTFILES
|
||||
d41d8cd98f00b204e9800998ecf8427e ./po/stamp-it
|
||||
8a009250d4750ed232217d17d15470f3 ./po/ko.gmo
|
||||
d41d8cd98f00b204e9800998ecf8427e ./po/.intltool-merge-cache.lock
|
||||
1a2e929113f392eab9cb24a0b0238ad6 ./po/Makefile.in
|
||||
a7b3d4e230c47ec28658a010d3b13810 ./po/Makefile.in.in
|
||||
91c0c674c4bb205caa5ccb8ec71dad4d ./po/de.po
|
||||
f2b780a5e09c9bfe8f871ad1ceb514be ./po/Makefile
|
||||
914ab9d59cd0f93d03c6bb3ae367c8ba ./po/de.gmo
|
||||
42bdcee67f573847fc06d3cf89bb9701 ./po/POTFILES.in
|
||||
4e329809f560d11c2f56a1d96d3fb999 ./po/LINGUAS
|
||||
913cc182fe191a4dab6a6a3bbecf9fd5 ./po/ko.po
|
||||
44f0f9ddef62cb307d899d88b5e74d10 ./README.md
|
||||
5730681549837589f8f9175e3a1cf5cf ./.vscode/settings.json
|
||||
ab411652c7449bbcd366feb17fd2b084 ./THANKS
|
||||
8c95d04c489ee13eccd91c614ee9b629 ./configure.ac
|
||||
ef1758df3fb7f88a1ef015c110fdf9e1 ./bin/nimf/nimf.1
|
||||
f197e7f47863a6bccb4d6c6dc8b76e90 ./bin/nimf/nimf.c
|
||||
691ad63aeb993eebcb4b3cb8509e3807 ./bin/nimf/Makefile.in
|
||||
62d934abaafc54222339381e7be34ff1 ./bin/nimf/Makefile.am
|
||||
d5f1f45f7d6ddd82ec9d433220d6d363 ./bin/nimf/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./bin/nimf/.deps/nimf-nimf.Po
|
||||
fc63b14ea6c097a17f77c7f1f1865b9f ./bin/nimf-settings/nimf-settings.1
|
||||
a8cd3f55ecb0feec62bf9e424a2216c0 ./bin/nimf-settings/org.nimf.settings.gschema.xml
|
||||
01097c714c69141e75d8c9ce7fec82f3 ./bin/nimf-settings/nimf-settings-autostart.desktop
|
||||
f14a1df1ab6ad0cee0abfc1b000fd7ad ./bin/nimf-settings/nimf-settings.c
|
||||
d9ac6bd07e3c40bb6d50d42851012fb9 ./bin/nimf-settings/nimf-settings-autostart.desktop.in
|
||||
91f3992ab8a7c1f62404f0ec5268f137 ./bin/nimf-settings/Makefile.in
|
||||
424741c22867b084fe9956d247e5bd44 ./bin/nimf-settings/Makefile.am
|
||||
e35e12580456a12c0b03995ec192d13a ./bin/nimf-settings/nimf-settings.desktop
|
||||
eda543de4154f4100257189b04d47fef ./bin/nimf-settings/Makefile
|
||||
8402109c0c3d753b04ef3be0a66c8594 ./bin/nimf-settings/nimf-settings.desktop.in
|
||||
dad0227408777290e6c56afc03cf6e12 ./bin/nimf-settings/.deps/nimf_settings-nimf-settings.Po
|
||||
cddca1bd499495fedca5b5f12d9fc5cc ./bin/Makefile.in
|
||||
380a978df8a925bb0d0a19d3f18fd17d ./bin/Makefile.am
|
||||
cbb8f4c8887fa3b1bb0d0357bd581468 ./bin/Makefile
|
||||
233e667406e9fdd02f91302c8277ed73 ./libnimf/nimf-candidatable.h
|
||||
5fdab93e0575a3d8d4f2f57b2f53b58a ./libnimf/nimf-im.c
|
||||
bc3b17b1c34c0f4bdd9387bb5c7c91ca ./libnimf/nimf-types.c
|
||||
6dc3dae8cd482d955184ebb6e5227e6a ./libnimf/nimf.pc
|
||||
40573b09d978c9712369de1bd3e03701 ./libnimf/nimf-enum-types.c.template
|
||||
a2ecf579e90c65766c599593c6f204e0 ./libnimf/nimf-service-ic.h
|
||||
e31957914c153d82513ac7d19083aec0 ./libnimf/nimf-server.h
|
||||
b9c744f784022ddbcf454543f907a4b0 ./libnimf/nimf-message-enum-types.c.template
|
||||
3adbed3e7c6c74e3b300a3b161b86628 ./libnimf/nimf-im.h
|
||||
326a657b5b1fe4b4cccd18c1fa4ae8e7 ./libnimf/nimf-service-ic.c
|
||||
d776aed1971982772968e47df4405643 ./libnimf/nimf-service.h
|
||||
66bb1829761e2498fd0c4cf988a578d0 ./libnimf/nimf-utils-private.h
|
||||
1438913fa64c6f573bdab3c3fc5704a9 ./libnimf/nimf-events.h
|
||||
df6727b75b11d9afde0b851bd72c6e92 ./libnimf/nimf-utils.h
|
||||
e033b26055da0be0173753701785d3bc ./libnimf/nimf-module-private.h
|
||||
5817eb8eedf570c13fbff94fe490c762 ./libnimf/nimf-message.c
|
||||
ca6111937b76394bc6110dc42ad95eac ./libnimf/nimf-message-enum-types-private.h.template
|
||||
7b38eb040cf6d3ca2dd4d9eed0ff2291 ./libnimf/Makefile.in
|
||||
81f4e762c0f0fba4d0a49bd63acd8714 ./libnimf/nimf-engine.c
|
||||
7846d48dce55e26bb3707a4a5fb022d8 ./libnimf/Makefile.am
|
||||
388d74da664955b12f34f10400377c44 ./libnimf/nimf-server.c
|
||||
04b5c452bc67db9a69752728d74c62d9 ./libnimf/nimf-service.c
|
||||
7e6daf73f671d1ecf6d86be1ea6e7503 ./libnimf/nimf-marshalers.list
|
||||
0830713ebcccc1de1710d360f1cbc2a4 ./libnimf/nimf-service-ic-private.h
|
||||
3bfa7416257f9a1263e4244e8fce9257 ./libnimf/nimf-utils.c
|
||||
7792bb85216fb994cbf6bd2058122960 ./libnimf/nimf-preeditable.h
|
||||
0cb4e84cdb7dee3f7ea0acf061396ed5 ./libnimf/nimf.h
|
||||
93067e042da5acd5ae95d116dd2220b1 ./libnimf/nimf-events.c
|
||||
551fc4e6014fb909fddeb3ae7ef8b9a8 ./libnimf/nimf-message-private.h
|
||||
1b3501353fc53a6d3da93a804646313d ./libnimf/nimf-engine.h
|
||||
0fc63d291e92b2d697278187e25128a1 ./libnimf/nimf.pc.in
|
||||
5de5800659615e12ee2c8245629247a8 ./libnimf/nimf-module.c
|
||||
f29cae285d45be59634ebb1dc1cffc2e ./libnimf/nimf-types.h
|
||||
f12f6bc539f30c01a92deae8ef8452b4 ./libnimf/nimf-candidatable.c
|
||||
dfad84746b82272bdaa99309b7bf97dc ./libnimf/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-im.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-events.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-message.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-types.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-service-ic.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-server.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-utils.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-message-enum-types.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-preeditable.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-engine.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-service.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-enum-types.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-module.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-candidatable.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./libnimf/.deps/libnimf_la-nimf-marshalers.Plo
|
||||
a0a352679b18c0e14b53e1972032a862 ./libnimf/nimf-key-syms.h
|
||||
8f450f38cc09ebf43fd6eb8e6ebf2a01 ./libnimf/nimf-server-private.h
|
||||
09bd966a8ba99da7ced098ef13a76c63 ./libnimf/org.nimf.gschema.xml
|
||||
5d5b318f5c31cd3e84b7c55fbb312d62 ./libnimf/nimf-enum-types-private.h.template
|
||||
f26387da6275d27dcf568b10520e4ef1 ./libnimf/nimf-preeditable.c
|
||||
910a5ea3ee8c72346795e8c01b3fb739 ./.gitignore
|
||||
d8b38d140e47f97a72426ba72b2cb5b1 ./config.log
|
||||
dd63184811cb2ff705c3e466364d3773 ./INSTALL
|
||||
91023a1d58d69b4916a8609882d782a8 ./stamp-h1
|
||||
db0b6a0e2bc2a787fde5546e9aea127c ./config.h.in~
|
||||
b83bd96f124de0211de4194bd62b425f ./config.status
|
||||
92e87889fbbbd75c5ba3190900d7f56e ./aclocal.m4
|
||||
51aeb1dc9e06a30677e9baa50d52bb7e ./Makefile.in
|
||||
98312682443b415dc42558ee6c7f25a9 ./m4/ltoptions.m4
|
||||
42fc54566fd6a8055fad65f78f32960c ./m4/lt~obsolete.m4
|
||||
5643b2b54db1fef0503669bc5be3378e ./m4/gtk-doc.m4
|
||||
057a003c14ef81b6c16d1dc54d491105 ./m4/ltsugar.m4
|
||||
977b5a5821f9013ef0cd54824d232a20 ./m4/libtool.m4
|
||||
665ef728f05b03734804931333632de4 ./m4/ltversion.m4
|
||||
f6ec0f12e5813e4154c7ede9cdc80ad8 ./m4/intltool.m4
|
||||
05fb8fab19946df226cb8082e802b251 ./Makefile.am
|
||||
33d49e4fd7057cb9a7513eec5c9308bc ./configure
|
||||
aa80031f29b554bf1e8943be2b2d1899 ./autom4te.cache/output.2
|
||||
1765f52dffe5c36364371b083693b49e ./autom4te.cache/output.3
|
||||
0f44e35caf80137a4cb2528967894f62 ./autom4te.cache/output.0
|
||||
f8ef86c8581cefc587aa7ae1c32936ba ./autom4te.cache/traces.3
|
||||
aa8710781881975db942f295f3e7c44b ./autom4te.cache/traces.0
|
||||
be46efe42e3076873deb99edc781c8dc ./autom4te.cache/traces.1
|
||||
e04f8516458d8c21adab563e4b2006d7 ./autom4te.cache/requests
|
||||
c747732e828f21919b21dff1d4ff6199 ./autom4te.cache/traces.2
|
||||
aa80031f29b554bf1e8943be2b2d1899 ./autom4te.cache/output.1
|
||||
c493ea95f5499080afbf695a05db1b5f ./BUILD.md
|
||||
db0b6a0e2bc2a787fde5546e9aea127c ./config.h.in
|
||||
b706ac2ba26475072c6dc72a68bd5ea0 ./build-aux/config.sub
|
||||
02e7b1aebd8cd0e27ab4b858173ad8ec ./build-aux/ltmain.sh
|
||||
761b9d083bd4741484292ce03510f40a ./build-aux/test-driver
|
||||
b816f92498a6ec8138d9ec53a14bcaa4 ./build-aux/compile
|
||||
b090c5891571c820e91d345a9551af44 ./build-aux/install-sh
|
||||
32828e0f15b831b50dbb2c7503b8d89b ./build-aux/config.guess
|
||||
e0f25a7f68c6fbf5101c01343f49e8ee ./build-aux/ar-lib
|
||||
6ecafe15a6088eb7a2f4f2aadbb240ce ./build-aux/depcomp
|
||||
086b8da5a251be943f06d3a927bbe60e ./build-aux/missing
|
||||
3d76b29db80e9570a80e73dc651f6cda ./PKGBUILD
|
||||
fb52f12eaa808b3100d00ae4bfcaae3b ./.github/ISSUE_TEMPLATE/-----.md
|
||||
b3a2e5b625179cbe8a232fd409b74008 ./.github/ISSUE_TEMPLATE/------.md
|
||||
570bd03a02861155a42d1c5d018ac83f ./.github/ISSUE_TEMPLATE/bug-report-eng.md
|
||||
9abc3ceb6ee274fdacb266a0e19185bb ./AUTHORS
|
||||
959bffe2993816eb32ec4bc1ec1d5875 ./COPYING
|
||||
0ddf23f5ff424085c7c52573c53d9fc1 ./autogen.sh
|
||||
c4dd00f710f44bf2eccf3db6e5b7f4f0 ./modules/clients/qt5/im-nimf-qt5.moc
|
||||
e64a0e74ef877012d5db0ff11c3a62bf ./modules/clients/qt5/org.nimf.clients.qt5.gschema.xml
|
||||
1465638a868173c278607a044439ddc9 ./modules/clients/qt5/im-nimf-qt5.cpp
|
||||
c236ab880d0beaa40b46a14342ae2598 ./modules/clients/qt5/Makefile.in
|
||||
0dc22f1d2b0d0b947525008ead553c7c ./modules/clients/qt5/Makefile.am
|
||||
ee28882e1f7f37ea110702a1fa9727a6 ./modules/clients/qt5/nimf.json
|
||||
6ae2e5cd895a9e8cb16830f5db8bc6bc ./modules/clients/qt5/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/clients/qt5/.deps/libqt5im_nimf_la-im-nimf-qt5.Plo
|
||||
53b4cda0ca58b19d948400581d813073 ./modules/clients/qt6/im-nimf-qt6.cpp
|
||||
6718e3c35c8052382019bddb9b837696 ./modules/clients/qt6/Makefile.in
|
||||
a2cd59269f5dccc61e2fd61675b9bf2c ./modules/clients/qt6/Makefile.am
|
||||
5f6e41e737bfa7c8e9a5fd95c17b4516 ./modules/clients/qt6/org.nimf.clients.qt6.gschema.xml
|
||||
842c13e026503ef042a56ef25c9e6a8e ./modules/clients/qt6/im-nimf-qt6.moc
|
||||
ee28882e1f7f37ea110702a1fa9727a6 ./modules/clients/qt6/nimf.json
|
||||
2029135724fafab28a723cb9361b6490 ./modules/clients/qt6/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/clients/qt6/.deps/libqt6im_nimf_la-im-nimf-qt6.Plo
|
||||
d62c7c8468e2ed0b36f937df17601d7f ./modules/clients/Makefile.in
|
||||
ad328c4d318dcd2b615ac62870690c9d ./modules/clients/Makefile.am
|
||||
a37234d5c36242eb16e4922d3dfc4148 ./modules/clients/gtk/im-nimf.c
|
||||
86081fa503674077231236bb902d8adb ./modules/clients/gtk/org.nimf.clients.gtk.gschema.xml
|
||||
060826bfcc58d8408e3514557707f63d ./modules/clients/gtk/Makefile.in
|
||||
de45d5e9580262251252f3445f96312e ./modules/clients/gtk/Makefile.am
|
||||
7912ed74b35cf46c36a9fef50077ad1b ./modules/clients/gtk/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/clients/gtk/.deps/im_nimf_gtk3_la-im-nimf.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/clients/gtk/.deps/im_nimf_gtk2_la-im-nimf.Plo
|
||||
44c83d70ab4f20cd699b19b86083f912 ./modules/clients/Makefile
|
||||
5d712ede67f97cf366e9e4f3b9bcb6c6 ./modules/engines/nimf-m17n/nimf-m17n-be.c
|
||||
bf932e425b5647851474a5d8be678f3e ./modules/engines/nimf-m17n/nimf-m17n-mr.c
|
||||
b50bb9b1f81dd1092372b4ec1e1a6cb3 ./modules/engines/nimf-m17n/nimf-m17n-ath.c
|
||||
09d527058afedad961f352e9cf37080b ./modules/engines/nimf-m17n/nimf-m17n-ug.c
|
||||
7d0d2c5500480b33bbe6a05de3ae4566 ./modules/engines/nimf-m17n/nimf-m17n-ar.c
|
||||
d37a87324646817f53b4fde4e7b216dd ./modules/engines/nimf-m17n/nimf-m17n-nsk.c
|
||||
bab2d754e1fdaf62a6be9fcc73aa364b ./modules/engines/nimf-m17n/nimf-m17n-iu.c
|
||||
89038828d8c9a1797953fc1b479761c5 ./modules/engines/nimf-m17n/nimf-m17n-ml.c
|
||||
7f6b9cd3da35afe42d9730d1868bae0d ./modules/engines/nimf-m17n/nimf-m17n-kk.c
|
||||
2a2eb14272ecd174bd4beb5c0402201e ./modules/engines/nimf-m17n/nimf-m17n-sk.c
|
||||
cb284532a13251910efc474a606a6b44 ./modules/engines/nimf-m17n/nimf-m17n-th.c
|
||||
fdd17f2aaa98a91e5043f211eb4d92c0 ./modules/engines/nimf-m17n/nimf-m17n-kn.c
|
||||
07d20dac6b9e8d12b0fa4e7af8fcae0c ./modules/engines/nimf-m17n/icons/Makefile.in
|
||||
75dc591a08c9e095691cc3624024e6c7 ./modules/engines/nimf-m17n/icons/Makefile.am
|
||||
8df2969b63984d30e0c047c6340e1591 ./modules/engines/nimf-m17n/icons/Makefile
|
||||
39ff2a2f0abde2db906336c07b1be85e ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-cr.svg
|
||||
d6fb46fcd166e1933dd21f58c781f606 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-he.svg
|
||||
10904215d2d8f3448330c25158251893 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-pa.svg
|
||||
0cbd9059eb915f5b460d0ba7422c56cd ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-my.svg
|
||||
8001803b8afa2075c6c5a34a127547b4 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-sr.svg
|
||||
ddc90ac583397af06bb35fb7d47bad10 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-hr.svg
|
||||
265fb5fcc0d7db8d6adb94dd058585f5 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-fa.svg
|
||||
bbda570abc6bcdd566e35679682de949 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-oj.svg
|
||||
3be5d269302ed53ffd5d13fd8039064b ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-si.svg
|
||||
2f4dae5c197ff93e7ae71fe58a647074 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ug.svg
|
||||
2498c3e45ebf9c1397a9e8bebd460953 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ru.svg
|
||||
a5778d7e9596e87f6012ba53fc050e53 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-tai.svg
|
||||
4a07fe513cb0330bcd6b93f1015b0202 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-uk.svg
|
||||
a8d6830818afaebab09819f647a07b17 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-cmc.svg
|
||||
b3f6f44c0ddc3c9a5a28240e81deb54b ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ps.svg
|
||||
a85a522ea9d76bc9fa881965db49ea3b ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-th.svg
|
||||
df508d8a63a8364cbe70849be098ddd0 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-yi.svg
|
||||
0dbc557579b324eb2efa4884f9ad9f5a ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-lo.svg
|
||||
0e10f329dc518eb3f6d136779508013a ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-el.svg
|
||||
7705d0e50a3ad6b15d85683b95c34532 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ml.svg
|
||||
205c556faf006350c5b5cb4767a60c06 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-hu.svg
|
||||
6c021adad5e1d52054c7efdbd137d89b ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-mai.svg
|
||||
d3e605e93d922e467767fcb2c4835a79 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-hy.svg
|
||||
9a29c5138004d79b3da5b6535016bc4e ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-kk.svg
|
||||
8b7fefcdce504d430fb1ac82d071eb89 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-iu.svg
|
||||
f3c4cdaf09ba0eeec974923d9fcb83cd ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-kn.svg
|
||||
fbd8e81cc261fcaeb16d5ec9e5594bfe ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-bn.svg
|
||||
e04a210ceb46765b665364bd9d152d3a ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-km.svg
|
||||
091dd92f672bf187e419bd897b23078b ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ne.svg
|
||||
2c1fd4c8f40218805537d036c23318c5 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-dv.svg
|
||||
81f1b42a889658e25472add8583b9032 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-sa.svg
|
||||
bd643c75c1a784e2db069a11ff034937 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ta.svg
|
||||
8df6fc0d18d3d201b5df185c283d7e48 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-vi.svg
|
||||
0abbfd1f89ba5c17e9d278675fc2b241 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-gu.svg
|
||||
bbd09463a56e79a51c1a783d6ffa89f6 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-or.svg
|
||||
9b4f59a655dabbd51f6f6167f02cd997 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-bo.svg
|
||||
620892889cbc64e14afc0367647e05a1 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ks.svg
|
||||
c3a792ed3eaa1d4aa3026dcecec15866 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ur.svg
|
||||
87626176374a6c864fc6989286966af8 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-am.svg
|
||||
b764929e3b99ea64cf06af6b426d9b38 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ar.svg
|
||||
c76067dc3e9b47c9f2858740657ce131 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-be.svg
|
||||
44b04f9958655f955c80a3d930e5defb ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-eo.svg
|
||||
c0caf98c2da5e596e22e862b5285775c ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ath.svg
|
||||
81c0391f7ebc3715a06b993f828d5954 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-sv.svg
|
||||
a81c9d8de3c5a2df64388db27cfb7f1b ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-nsk.svg
|
||||
e50f5a72534362ac6880503a361518c7 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-fr.svg
|
||||
afb70b995c0347097e996d6450cffb85 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-mr.svg
|
||||
56661ca5ca9d6d54ae2b89e38bdb6091 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-t.svg
|
||||
ecd231275555b1fb9b64f108134c3040 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-te.svg
|
||||
ff5d4e65a2c44fcb36ff9a4f80705ae4 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-bla.svg
|
||||
1933a61061dc18390e20bcc80d43e93d ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-grc.svg
|
||||
52ee446fc69817128760e28dcf84fbfb ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-as.svg
|
||||
8be901ad113dc0347c953f5ff11d7d65 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-sd.svg
|
||||
0ee38209c4869aea8bc3c33857465b80 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ii.svg
|
||||
c25db4d3b0fefeb98ab173dc9e95a2e9 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ka.svg
|
||||
b05fc0b092dc169cd284f93841d15af8 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-cs.svg
|
||||
3f8ee86237937a1307406c484edc508f ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-uz.svg
|
||||
e669e010474fab69302125d315133cb4 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-hi.svg
|
||||
633f715f7a29ea3811610bbf792cc4d2 ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-da.svg
|
||||
3e646ce1ea2c64f8d6d6fda684a0cc9a ./modules/engines/nimf-m17n/icons/scalable/nimf-m17n-sk.svg
|
||||
2c501d79e848300639ce388c071336ce ./modules/engines/nimf-m17n/nimf-m17n-as.c
|
||||
8d97cc8904a2710ecb12bf0cadc273af ./modules/engines/nimf-m17n/nimf-m17n-ps.c
|
||||
e2f366421695061d5f8953ec5c5ea1d3 ./modules/engines/nimf-m17n/nimf-m17n-gu.c
|
||||
fd828d7e142fee38fc9b583d416bcbff ./modules/engines/nimf-m17n/nimf-m17n-si.c
|
||||
3c2dd402350e43d5f580716b3ac88d53 ./modules/engines/nimf-m17n/nimf-m17n-el.c
|
||||
2bffe4fe8cbfd4caa8dd71fa17d50dd8 ./modules/engines/nimf-m17n/nimf-m17n.c
|
||||
4dd99b9adcbd293bac5c903705eb937d ./modules/engines/nimf-m17n/nimf-m17n-bo.c
|
||||
49f94d7059ea8f618bb94c2ccda30945 ./modules/engines/nimf-m17n/nimf-m17n-am.c
|
||||
fb612f105f35864a6cd4d62f09794da6 ./modules/engines/nimf-m17n/nimf-m17n-he.c
|
||||
27b200ed268d50ad37adbd394abefba8 ./modules/engines/nimf-m17n/nimf-m17n-fr.c
|
||||
15f8da082fab5ede1370e8378a475a80 ./modules/engines/nimf-m17n/Makefile.in
|
||||
af4a69478fb99e84bfe287d13d218b1e ./modules/engines/nimf-m17n/nimf-m17n-grc.c
|
||||
138207af4f27bd8e98b4cb48b57d9bf4 ./modules/engines/nimf-m17n/nimf-m17n-hr.c
|
||||
efc8af922554187cd3fb0c4a6ad29fa9 ./modules/engines/nimf-m17n/nimf-m17n-dv.c
|
||||
afd4196d30e9509833b42c099da79c2b ./modules/engines/nimf-m17n/org.nimf.engines.nimf-m17n-mr.gschema.xml
|
||||
542998c0005af5de86058b0668008057 ./modules/engines/nimf-m17n/nimf-m17n-ks.c
|
||||
b84f98b28bc0649cdcdea389a409f6e3 ./modules/engines/nimf-m17n/Makefile.am
|
||||
7a9866e421d05a9f931d70a129dd000d ./modules/engines/nimf-m17n/nimf-m17n-hy.c
|
||||
0655b27a16d5a87b1638acad1bd1de4c ./modules/engines/nimf-m17n/nimf-m17n-t.c
|
||||
d9ef84a73bcd8d36b76822f978001a9f ./modules/engines/nimf-m17n/nimf-m17n-cmc.c
|
||||
1295c14459012d5b0b6e700d9492dc64 ./modules/engines/nimf-m17n/nimf-m17n-ta.c
|
||||
729ce293e6801a05ab3f5dece176992c ./modules/engines/nimf-m17n/org.nimf.engines.nimf-m17n-ne.gschema.xml
|
||||
b906a897995a258d74450f25a7235ef1 ./modules/engines/nimf-m17n/nimf-m17n-tai.c
|
||||
4b52fb35af6a036c039c55170ce62e1b ./modules/engines/nimf-m17n/nimf-m17n-uz.c
|
||||
91cd89bdad338e8f3f1acfe8f4a349c6 ./modules/engines/nimf-m17n/org.nimf.engines.nimf-m17n.gschema.xml
|
||||
9e8bd27d86b128c9c510f5706d1fee66 ./modules/engines/nimf-m17n/org.nimf.engines.nimf-m17n-kn.gschema.xml
|
||||
f725bc0369c1ff2e0fd2f8ec01e78b7d ./modules/engines/nimf-m17n/nimf-m17n-ne.c
|
||||
8197ba73d39d362965f2a78414d15cb8 ./modules/engines/nimf-m17n/org.nimf.engines.nimf-m17n-hu.gschema.xml
|
||||
5bd4f0132c7e1bf1e685851b194b014a ./modules/engines/nimf-m17n/nimf-m17n-cs.c
|
||||
1fbbe219926c3639bf764a0d9d2a42c5 ./modules/engines/nimf-m17n/nimf-m17n-vi.c
|
||||
dbeb3934d4cb96cfc9bb425278859c53 ./modules/engines/nimf-m17n/nimf-m17n-uk.c
|
||||
72be27ddf1a8e26724b02fc1fe0dc3e3 ./modules/engines/nimf-m17n/nimf-m17n-sv.c
|
||||
48d327c07532f517e9aedd3f5cf2cb00 ./modules/engines/nimf-m17n/nimf-m17n-pa.c
|
||||
353628a825199a0d5d81e77cd6c27e0f ./modules/engines/nimf-m17n/nimf-m17n-oj.c
|
||||
c89ad118edcd45d0c97935e2f684e9f3 ./modules/engines/nimf-m17n/nimf-m17n-ii.c
|
||||
79b5a97b9c81f7f17cffba133de2d90d ./modules/engines/nimf-m17n/org.nimf.engines.nimf-m17n-hi.gschema.xml
|
||||
ca44bb2b27c0c715098b0f30e9fc9d1c ./modules/engines/nimf-m17n/nimf-m17n-sr.c
|
||||
89b5b13e2235abebbfc783013b8f783a ./modules/engines/nimf-m17n/nimf-m17n-da.c
|
||||
e9e1894c5903c25b024b997dcc43e264 ./modules/engines/nimf-m17n/nimf-m17n-hi.c
|
||||
0e848641e50d040d46f8fc92d8db11ff ./modules/engines/nimf-m17n/nimf-m17n-ru.c
|
||||
dfcee4d3e6d37cae39d29fb235ee3faf ./modules/engines/nimf-m17n/nimf-m17n-ur.c
|
||||
590bc1aa6550cd365356e72da8a23534 ./modules/engines/nimf-m17n/nimf-m17n-hu.c
|
||||
1397192d9f6cc203c9a35a3c21b5e418 ./modules/engines/nimf-m17n/test-nimf-m17n.c
|
||||
bb17e104e39215e21da3aefa60ccaa26 ./modules/engines/nimf-m17n/nimf-m17n-sa.c
|
||||
85385ca050654ddbdc370f26df0cb6e1 ./modules/engines/nimf-m17n/nimf-m17n-mai.c
|
||||
97d22f654ab93ae2ac6fc877f4a59411 ./modules/engines/nimf-m17n/nimf-m17n-bla.c
|
||||
384cf84599d23f57caf03de7dedbcc55 ./modules/engines/nimf-m17n/Makefile
|
||||
1eb1efb3b9d7956a6caa65edd820d6af ./modules/engines/nimf-m17n/org.nimf.engines.nimf-m17n-ml.gschema.xml
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_vi_la-nimf-m17n-vi.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_gu_la-nimf-m17n-gu.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_oj_la-nimf-m17n-oj.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_kk_la-nimf-m17n-kk.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_eo_la-nimf-m17n-eo.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_hu_la-nimf-m17n-hu.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_bn_la-nimf-m17n-bn.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_hi_la-nimf-m17n-hi.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_cr_la-nimf-m17n-cr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_km_la-nimf-m17n-km.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_cs_la-nimf-m17n-cs.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_pa_la-nimf-m17n-pa.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_mr_la-nimf-m17n-mr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_si_la-nimf-m17n-si.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_sd_la-nimf-m17n-sd.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_fr_la-nimf-m17n-fr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_or_la-nimf-m17n-or.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_te_la-nimf-m17n-te.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ru_la-nimf-m17n-ru.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/test_nimf_m17n-test-nimf-m17n.Po
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_mai_la-nimf-m17n-mai.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ks_la-nimf-m17n-ks.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_dv_la-nimf-m17n-dv.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_hy_la-nimf-m17n-hy.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ps_la-nimf-m17n-ps.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_el_la-nimf-m17n-el.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_nsk_la-nimf-m17n-nsk.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_be_la-nimf-m17n-be.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_uz_la-nimf-m17n-uz.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ur_la-nimf-m17n-ur.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ar_la-nimf-m17n-ar.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_yi_la-nimf-m17n-yi.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_th_la-nimf-m17n-th.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_uk_la-nimf-m17n-uk.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_la-nimf-m17n.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_fa_la-nimf-m17n-fa.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_my_la-nimf-m17n-my.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_cmc_la-nimf-m17n-cmc.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_tai_la-nimf-m17n-tai.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_sa_la-nimf-m17n-sa.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_t_la-nimf-m17n-t.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ne_la-nimf-m17n-ne.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ml_la-nimf-m17n-ml.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_am_la-nimf-m17n-am.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_grc_la-nimf-m17n-grc.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_hr_la-nimf-m17n-hr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_kn_la-nimf-m17n-kn.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_lo_la-nimf-m17n-lo.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_sv_la-nimf-m17n-sv.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_sr_la-nimf-m17n-sr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_as_la-nimf-m17n-as.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_sk_la-nimf-m17n-sk.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ug_la-nimf-m17n-ug.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ii_la-nimf-m17n-ii.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ta_la-nimf-m17n-ta.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_bo_la-nimf-m17n-bo.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ath_la-nimf-m17n-ath.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_he_la-nimf-m17n-he.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_bla_la-nimf-m17n-bla.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_da_la-nimf-m17n-da.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_iu_la-nimf-m17n-iu.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-m17n/.deps/libnimf_m17n_ka_la-nimf-m17n-ka.Plo
|
||||
1ac6cf72d7715ba5ef412d63905653cf ./modules/engines/nimf-m17n/nimf-m17n-sd.c
|
||||
0f8d106087d09418b9c495b872efb702 ./modules/engines/nimf-m17n/nimf-m17n-ka.c
|
||||
cf5a2a900a209b35d5f47e0199462de8 ./modules/engines/nimf-m17n/nimf-m17n-te.c
|
||||
1de53340b6005b1bc12e52a71bbf23b3 ./modules/engines/nimf-m17n/nimf-m17n-my.c
|
||||
7122357e584820dba5dae967afa53ed3 ./modules/engines/nimf-m17n/nimf-m17n-eo.c
|
||||
a4de2950fd31b7eb7c724205eac6b997 ./modules/engines/nimf-m17n/nimf-m17n-km.c
|
||||
b3e74335ef0be2909502656ce24b8962 ./modules/engines/nimf-m17n/nimf-m17n.h
|
||||
8e7f7198238adc34e543d28cfe81671f ./modules/engines/nimf-m17n/nimf-m17n-bn.c
|
||||
b0f24bdcd182cf0d07e39767491e9ad4 ./modules/engines/nimf-m17n/nimf-m17n-lo.c
|
||||
439624c5418105fe71a4f3e351e94694 ./modules/engines/nimf-m17n/nimf-m17n-or.c
|
||||
c9937633c037890c34ad9b871d5fdb8c ./modules/engines/nimf-m17n/nimf-m17n-fa.c
|
||||
27800a0cdd8db46e3d72f84167b0d889 ./modules/engines/nimf-m17n/nimf-m17n-cr.c
|
||||
a285a74c0a14209b8ead2e25efba4bf1 ./modules/engines/nimf-m17n/nimf-m17n-yi.c
|
||||
40c39b9896e9e7e663b09952fc962a53 ./modules/engines/Makefile.in
|
||||
ea9a12f8c1e08bfc8ff7cfec90c5b499 ./modules/engines/Makefile.am
|
||||
7201b11911d37a3628bb7af8c3f7c95c ./modules/engines/nimf-libhangul/nimf-libhangul.c
|
||||
ca6cfccc7827e41977b040a8f40f6965 ./modules/engines/nimf-libhangul/org.nimf.engines.nimf-libhangul.gschema.xml
|
||||
20804a898b0fb8e1e203441540f8aa5f ./modules/engines/nimf-libhangul/Makefile.in
|
||||
f3a60d47d9f8a351ebb376c650b49c91 ./modules/engines/nimf-libhangul/Makefile.am
|
||||
5b4f9f6d5f713b01fea9896b40d57015 ./modules/engines/nimf-libhangul/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-libhangul/.deps/libnimf_libhangul_la-nimf-libhangul.Plo
|
||||
3167b945ccac00db91be67f76c359817 ./modules/engines/nimf-libhangul/mssymbol.txt
|
||||
cd15d9d85e51675ddb9acfa025f7fe2c ./modules/engines/nimf-system-keyboard/nimf-system-keyboard.c
|
||||
b6c91a1edb77fae222d0f6ce9c7522be ./modules/engines/nimf-system-keyboard/org.nimf.engines.nimf-system-keyboard.gschema.xml
|
||||
5dc177244535ca3d91d6a527d0aedcae ./modules/engines/nimf-system-keyboard/Makefile.in
|
||||
36c6bbff96ced269032c9c6703ba603c ./modules/engines/nimf-system-keyboard/Makefile.am
|
||||
03b42fa848da452ea09f4fb3a26f1547 ./modules/engines/nimf-system-keyboard/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-system-keyboard/.deps/libnimf_system_keyboard_la-nimf-system-keyboard.Plo
|
||||
d246077bace0780e36aa8c2a10ecb5d1 ./modules/engines/Makefile
|
||||
d10b93267496af6a81a6207d82b4b926 ./modules/engines/nimf-anthy/org.nimf.engines.nimf-anthy.gschema.xml
|
||||
a31df8ffa5b9010770f64351c99fb3dc ./modules/engines/nimf-anthy/nimf-anthy.c
|
||||
acad16e0a09992ecddc862279bd4961e ./modules/engines/nimf-anthy/Makefile.in
|
||||
52f7810f2f3fe7161db8d5eab2749c69 ./modules/engines/nimf-anthy/Makefile.am
|
||||
9befbf483eff4bd3f8168721cfc2dab0 ./modules/engines/nimf-anthy/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-anthy/.deps/libnimf_anthy_la-nimf-anthy.Plo
|
||||
17c0f13a1b79d94aa5c282e959120603 ./modules/engines/nimf-rime/nimf-rime.c
|
||||
2b9adcbdb3e753a6af909f9cae3dacd2 ./modules/engines/nimf-rime/Makefile.in
|
||||
3541d458bb8ddb181d65325b70db36ec ./modules/engines/nimf-rime/org.nimf.engines.nimf-rime.gschema.xml
|
||||
7f1c3bbafb89c5edcbd34c0d3885895b ./modules/engines/nimf-rime/Makefile.am
|
||||
0eab93ae8a505440de75fdfd7981e77f ./modules/engines/nimf-rime/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/engines/nimf-rime/.deps/libnimf_rime_la-nimf-rime.Plo
|
||||
6712caad0b5a40b1a64cd556d337cfc9 ./modules/Makefile.in
|
||||
5326eaab40930e198e1dec6e17892a5b ./modules/Makefile.am
|
||||
807aad5f7158e6d4e29b87622891e0c5 ./modules/services/xim/nimf-xim-ic.h
|
||||
77cf19ad26ee6fe4f18c8e69f057a847 ./modules/services/xim/nimf-xim.h
|
||||
9e97b1c48dd4c96354eeed86a9e3704d ./modules/services/xim/IMdkit/i18nIMProto.c
|
||||
d41d8cd98f00b204e9800998ecf8427e ./modules/services/xim/IMdkit/.dirstamp
|
||||
0e0d9cb59bd8acaed827d09e589a3f08 ./modules/services/xim/IMdkit/i18nX.c
|
||||
438805757f4d544551c25b68e8847f50 ./modules/services/xim/IMdkit/i18nAttr.c
|
||||
e513a0ab6d1f1f3af0556a1c3740f2e2 ./modules/services/xim/IMdkit/i18nUtil.c
|
||||
ef877d0f4133cae225d6da9e7852248d ./modules/services/xim/IMdkit/XimProto.h
|
||||
1a6069f2c5136f3b4656d3fc9a52a10b ./modules/services/xim/IMdkit/i18nIc.c
|
||||
beffc7e275cb909dddba5d16eb072d2d ./modules/services/xim/IMdkit/FrameMgr.c
|
||||
9d536bb1c04c8bb7049367505c99512e ./modules/services/xim/IMdkit/i18nX.h
|
||||
f0267fd195af6ffd1a9b3b7e18f407e6 ./modules/services/xim/IMdkit/i18nPtHdr.c
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nUtil.Plo
|
||||
d41d8cd98f00b204e9800998ecf8427e ./modules/services/xim/IMdkit/.deps/.dirstamp
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-FrameMgr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nMethod.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nOffsetCache.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nPtHdr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nClbk.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nAttr.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nIc.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nIMProto.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/IMdkit/.deps/libnimf_xim_la-i18nX.Plo
|
||||
ebb32947ca610107b8975a7cbb72f2fc ./modules/services/xim/IMdkit/i18nMethod.h
|
||||
fef87e8e371ecc22c60f747ce3598b5f ./modules/services/xim/IMdkit/Xi18n.h
|
||||
f7cb279a7b1ccb3ba39116d8907a0f88 ./modules/services/xim/IMdkit/i18nMethod.c
|
||||
e648c2bdebcc85a95cf620f519d43463 ./modules/services/xim/IMdkit/XimFunc.h
|
||||
ef0d279f1dba4c4c578835d7d20ce129 ./modules/services/xim/IMdkit/FrameMgr.h
|
||||
48c34dfb6968a14b1d2dd61dffb141f7 ./modules/services/xim/IMdkit/i18nOffsetCache.c
|
||||
61908658ac0c214bdebf9bc5c19d9077 ./modules/services/xim/IMdkit/i18nClbk.c
|
||||
675dfb56448f42047ff49967082b9c13 ./modules/services/xim/Makefile.in
|
||||
64c944deb0a5c4187924586df6b7f6f9 ./modules/services/xim/Makefile.am
|
||||
d78db3f0a43a62b19fcf5774cdd30dd5 ./modules/services/xim/nimf-xim-ic.c
|
||||
4f2ae2137c8bae72c95f4a2d84c4417b ./modules/services/xim/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/.deps/libnimf_xim_la-nimf-xim.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/xim/.deps/libnimf_xim_la-nimf-xim-ic.Plo
|
||||
52929508cc4b04261220263194b5386e ./modules/services/xim/nimf-xim.c
|
||||
d59003061026bc993c44a1b937f78951 ./modules/services/nim/nimf-connection.h
|
||||
89bdd8b0d625190041a726c7a60e82c4 ./modules/services/nim/Makefile.in
|
||||
434215c3f4b93621307398b2def731cb ./modules/services/nim/nimf-nim-ic.c
|
||||
bc367d3b0f42018aebe395e76fe4ed5b ./modules/services/nim/Makefile.am
|
||||
e3b32bdd9cc3011a69f6586398c84f50 ./modules/services/nim/nimf-nim.c
|
||||
bd3c5f4661941aabf0018f2fff839c88 ./modules/services/nim/nimf-connection.c
|
||||
55340b009d8eb3a8c2b5859799727b46 ./modules/services/nim/nimf-nim-ic.h
|
||||
2ce971ed7b07b2641df29f0c6d1e9bc1 ./modules/services/nim/nimf-nim.h
|
||||
e3dcdba1754ca712c9ddd2ab366e6de6 ./modules/services/nim/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/nim/.deps/libnimf_nim_la-nimf-nim-ic.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/nim/.deps/libnimf_nim_la-nimf-connection.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/nim/.deps/libnimf_nim_la-nimf-nim.Plo
|
||||
0e2ea1f4edfaa2b37ad208c465b3cb0e ./modules/services/indicator/nimf-indicator.c
|
||||
2a4b336f3d454a988a5733eb4c00e582 ./modules/services/indicator/Makefile.in
|
||||
8691e81709c13ed98391b063fb179e03 ./modules/services/indicator/Makefile.am
|
||||
527f51cdaf9cb173e962a8f00c674c90 ./modules/services/indicator/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/indicator/.deps/libnimf_indicator_la-nimf-indicator.Plo
|
||||
dbd8d9a5301fbb49c787b339c06ed24a ./modules/services/preedit-window/nimf-preedit-window.c
|
||||
8df482745708a6409bf95185a1a7697d ./modules/services/preedit-window/Makefile.in
|
||||
15d315cdf14ef5083f7ea63c25c28ff0 ./modules/services/preedit-window/Makefile.am
|
||||
0779b486199865a433f306ec6e56ea09 ./modules/services/preedit-window/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/preedit-window/.deps/libnimf_preedit_window_la-nimf-preedit-window.Plo
|
||||
8db585e717eda9d4f0d7cad6c2130c7a ./modules/services/Makefile.in
|
||||
ce6f7a38354ead51e2ad3a88e20af42e ./modules/services/Makefile.am
|
||||
ee5c2411855a6780d5da839c8d60c3de ./modules/services/Makefile
|
||||
7a5204e01052b075791b986856dc3d97 ./modules/services/candidate/Makefile.in
|
||||
3b130a04d6a60dd65a1bc2f8adecaaac ./modules/services/candidate/Makefile.am
|
||||
e9c3b6931fbc16d20b0baa0b126a8edc ./modules/services/candidate/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/candidate/.deps/libnimf_candidate_la-nimf-candidate.Plo
|
||||
c5bb324da3dc385bb73fe5e0890a8c70 ./modules/services/candidate/nimf-candidate.c
|
||||
8f84452bc56c3191375f2e5a5c2fb7f8 ./modules/services/wayland/nimf-wayland.c
|
||||
0bb8c42c501d137f04f39fe6555295be ./modules/services/wayland/nimf-wayland.h
|
||||
05325ca399e79c8f12f2d9b46f7fd336 ./modules/services/wayland/Makefile.in
|
||||
64c33daf87411b34ffe9468564bd32e6 ./modules/services/wayland/Makefile.am
|
||||
2df62347e8931d44e0aa7de2c76826b2 ./modules/services/wayland/nimf-wayland-ic.h
|
||||
b66b9b7a524333802af2323eae6402a4 ./modules/services/wayland/nimf-wayland-ic.c
|
||||
1e1ec288214652812373a220cc42682b ./modules/services/wayland/Makefile
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/wayland/.deps/libnimf_wayland_la-nimf-wayland-ic.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/wayland/.deps/libnimf_wayland_la-nimf-wayland.Plo
|
||||
dad0227408777290e6c56afc03cf6e12 ./modules/services/wayland/.deps/libnimf_wayland_la-input-method-unstable-v1-protocol.Plo
|
||||
6633b09fd5fdf9dabeb98779bbc6dded ./modules/Makefile
|
||||
2590dc835abdd3ce65874f606e85ae75 ./Makefile
|
||||
511fc0102f48c12ca4c83357366d90e7 ./nimf.spec
|
||||
dbb184d2142cbb7b34205baf4d73471c ./gtk-doc.make
|
||||
b6be30057484c1b914ddc5bab8a33285 ./data/icons/Makefile.in
|
||||
bd014ea5180bffe03180aaf13eeb1ef2 ./data/icons/Makefile.am
|
||||
8210386e7191655c4dfd63a9fbfe4ef6 ./data/icons/Makefile
|
||||
9eea63a1a386b66c1d3ef2c57651b6ec ./data/icons/scalable/nimf-logo.svg
|
||||
fe29532d3b3c681207b6b715712ba366 ./data/icons/scalable/nimf-rime-simplified.svg
|
||||
df9a74e7b50e870ccc2ffd25394f3b58 ./data/icons/scalable/nimf-libhangul.svg
|
||||
79cb098266c77a336ffb4d8e322da523 ./data/icons/scalable/nimf-anthy.svg
|
||||
ac5d3d5ac2f5ed3389c17adf2142017c ./data/icons/scalable/nimf-system-keyboard.svg
|
||||
f6bf5aefa79b57a18e5fe9a1170eb4df ./data/icons/scalable/nimf-rime-traditional.svg
|
||||
6391cd8485dda2917b4186f689e1a0e7 ./data/icons/scalable/nimf-focus-out.svg
|
||||
d36c5f85366accdcd33d6f259c6de63d ./data/apparmor-abstractions/nimf
|
||||
b80be61eb22cc84687566cbeb73f3f02 ./data/apparmor-abstractions/Makefile.in
|
||||
32351c5ad224661699aa0eaec804fd78 ./data/apparmor-abstractions/Makefile.am
|
||||
93a80dc993d71cade8c71cb5ae6f789e ./data/apparmor-abstractions/Makefile
|
||||
e00f4feaf2e9322fe5ecca0c6f4bc6a7 ./data/im-config/23_nimf.rc
|
||||
e7852c5c5a13ae0fa315f35d82ac0a68 ./data/im-config/23_nimf.conf
|
||||
b32eb62de7dbdd271dc936eb28b88001 ./data/im-config/Makefile.in
|
||||
e36dbf289fd009bc77773dbacc467d12 ./data/im-config/Makefile.am
|
||||
b384e86429997d69870b821adc51c09a ./data/im-config/Makefile
|
||||
c96196cd783359e9f8a61d85bbec76b3 ./data/Makefile.in
|
||||
a23b82ed80f286119a7fcca70213648e ./data/Makefile.am
|
||||
bf7d5504a18023dffef125a2a54dde01 ./data/Makefile
|
||||
5f895bd86f5a12a234a5156bf4a700d7 ./data/nimf.conf
|
||||
a48f740dd4a4b4216d9e153973072a5f ./data/imsettings/Makefile.in
|
||||
1af3f2133245fe37b45d7ad0a7cda7bf ./data/imsettings/Makefile.am
|
||||
210f4b24f79a80a82922ad144319bb0e ./data/imsettings/Makefile
|
||||
2ba43c3b0586fbfded528731ee682e64 ./data/imsettings/nimf.conf
|
||||
dbb332eb146f8ef1a99fb7188f81076f ./README
|
||||
1e9a51a977537a97f30248375efd655e ./patchs/nimf-2020.11.28-hamonikr.patch
|
||||
cc29f80e7510c7dfce6e50751be779a4 ./patchs/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/README
|
||||
d8a0296d1558025662ea959161198ccb ./patchs/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libqt5im-nimf.so
|
||||
344fb761a094fb857a682efd4366a432 ./patchs/nimf-2020.04.28.patch
|
||||
d98fe4e708c87f9ca64bbfc48cd6f2ff ./patchs/README
|
||||
b8c41e9a36413e62301b36621c18fe19 ./libtool
|
||||
740f065e3f8f2e05b83c28f0a3977ce0 ./docs/xml/nimf-service-ic.xml
|
||||
86831d81d3cf97fbc3b765dc2e6d4252 ./docs/xml/nimf-doc.bottom
|
||||
3a973c8c6dcdf1e1287791edbb7429b9 ./docs/xml/nimf-server.xml
|
||||
151c7387a5f2475d3881eda9fef57bc2 ./docs/xml/nimf-service.xml
|
||||
545f08c5620c8f0e5c86fc2bdcb37841 ./docs/xml/nimf-candidatable.xml
|
||||
483bf7c935f9df94adfd35fc8360e899 ./docs/xml/nimf-engine.xml
|
||||
a82cea309cc71f7331ad3d389ee5ae24 ./docs/xml/nimf.xml
|
||||
acad3108aa8a73ba4a3fbcf7ea3dda85 ./docs/xml/nimf-types.xml
|
||||
aacbe78e19d9ad94df615a0e6fce6e6f ./docs/xml/nimf-preeditable.xml
|
||||
d6f1979a262d861f56688099b1a21fc6 ./docs/xml/object_index.sgml
|
||||
d41d8cd98f00b204e9800998ecf8427e ./docs/xml/nimf-doc.top
|
||||
38b0dba719adeb42ba7cf2df588acbba ./docs/xml/api-index-full.xml
|
||||
e7ce82340c9860f7fcc3007cbd5e6b08 ./docs/xml/nimf-settings.xml
|
||||
d09b587ed00ff9471426396719236cfc ./docs/xml/api-index-deprecated.xml
|
||||
b095e61f602c5ec71326d97107d19b72 ./docs/xml/nimf-events.xml
|
||||
fd5e8a8d56b7566f66684e1a0f9f408b ./docs/xml/gtkdocentities.ent
|
||||
4bf7f723f0fe5a6764284608931ae301 ./docs/xml/nimf-utils.xml
|
||||
c79918084dff93c0330aee6d8489fcd2 ./docs/xml/tree_index.sgml
|
||||
d77e1072506f96adf55ffd2ab8c782b2 ./docs/xml/nimf-im.xml
|
||||
0239a9344d60ca7c5bba793820bfdd99 ./docs/xml/nimf-key-syms.xml
|
||||
fab219c5308a10d729289bedfd999054 ./docs/xml/annotation-glossary.xml
|
||||
0be5f7cdbbf15edba50468c9bf7fe0df ./docs/nimf.png
|
||||
fb6571abcb48c35ba2497758981ca869 ./docs/nimf-decl.txt
|
||||
25c1d10b9d1fe886ee75ef34522dbf6f ./docs/nimf-docs.xml
|
||||
08ce8f185d778a0b365e8e0ce898c623 ./docs/manjaro.png
|
||||
59d59f6937e9684ab455aa4c765e3a34 ./docs/Makefile.in
|
||||
a6d266b0d45bca6b2d69b6333fa1a5d0 ./docs/nimf-decl-list.txt
|
||||
fda1e35ad6deb51f203cfe31b9b731ee ./docs/Makefile.am
|
||||
33c0b24f586b1b4059efed28a0b5fe7a ./docs/nimf-sections.txt
|
||||
f61793450440117e201b0ea97bc6492c ./docs/html/style.css
|
||||
bdbf74aec081c0e1fd929773355a0b7c ./docs/html/NimfService.html
|
||||
604eccc19ec29f2be11c9088aace75d5 ./docs/html/nimf-types.html
|
||||
87f814036fc5519aab94850896a37f16 ./docs/html/up.png
|
||||
58176300a31276fd17b377905ea1af96 ./docs/html/left-insensitive.png
|
||||
50db9c14dd64626182e035ca99e8da26 ./docs/html/index.html
|
||||
28e5f88647a00928f86a8613f5c98e29 ./docs/html/left.png
|
||||
287bdb74416da19dbf7c3ecfaac4f861 ./docs/html/nimf-key-syms.html
|
||||
136460665915d038d394a88058906482 ./docs/html/NimfEngine.html
|
||||
4c5def48f26f45b5a3e6fae0a10d2445 ./docs/html/up-insensitive.png
|
||||
3bbac446f0bc89c263c710fb0c1d8a1f ./docs/html/interfaces.html
|
||||
b640319531cf6ff22a31c7000a4781df ./docs/html/NimfIM.html
|
||||
f7c9d76b2b56196d1890737b85b3284f ./docs/html/right-insensitive.png
|
||||
ced5d55a2467daf809db367af480aa15 ./docs/html/executables.html
|
||||
14bb1fa1308c2aa40d205c4ab47cf412 ./docs/html/nimf.html
|
||||
b7a88b7894b804141f51a619e30c54de ./docs/html/abstract-classes.html
|
||||
0a46d0233021178753c32cc31c33d6d5 ./docs/html/nimf-utils.html
|
||||
807def39f74ea9e4aa36f5a3588e7fec ./docs/html/libnimf-api.html
|
||||
a8c0e2eaa4ca245307e30e6ed27fc53e ./docs/html/right.png
|
||||
8e2b69ad55b84a1a19741771a38fdcfb ./docs/html/nimf-events.html
|
||||
95ce3d04b152402b3b50a37ca57bcfc2 ./docs/html/api-index-full.html
|
||||
57c662a13ac164a444cc8bcff4584bcf ./docs/html/NimfServiceIC.html
|
||||
c8aa83529148681a4ad4573289e59793 ./docs/html/NimfCandidatable.html
|
||||
d854753f7e7a1b73608f5e45c7fa3aa5 ./docs/html/home.png
|
||||
1883a423947b70deb48b825703c49bfa ./docs/html/NimfServer.html
|
||||
999e0a1d99488ae8b34c76a67cce14df ./docs/html/nimf-settings.html
|
||||
c73b5d4aa4c5d4dd88fe1964133f83e7 ./docs/html/nimf.devhelp2
|
||||
390fe5c33f06e0f8cb39830ec7fd8a09 ./docs/html/annotation-glossary.html
|
||||
9a48c14d0a20d6649b691f12a6331c0c ./docs/html/NimfPreeditable.html
|
||||
21065f9567b7e8ab733b1d46d9c4739a ./docs/html/object-tree.html
|
||||
3f71f3636d148e7c29b98fe47acda104 ./docs/Makefile
|
||||
d41d8cd98f00b204e9800998ecf8427e ./docs/nimf-overrides.txt
|
||||
129
Telegram/ThirdParty/nimf/debian/changelog
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
nimf (1.3.5) noble; urgency=medium
|
||||
|
||||
* Release for Ubuntu 24.04
|
||||
* Support QT6
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Wed, 12 Jun 2024 10:01:49 +0900
|
||||
|
||||
nimf (1.3.4) stable; urgency=medium
|
||||
|
||||
* Release for Ubuntu 24.04
|
||||
* Removed gtk 2.0
|
||||
* Override test step in rules
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Sat, 08 Jun 2024 00:18:01 +0900
|
||||
|
||||
nimf (1.3.3) stable; urgency=medium
|
||||
|
||||
* Release for arm64
|
||||
* Tested on raspberry pi 4, 400
|
||||
* Support APT for focal(bullseye) and jammy(bookworm)
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Mon, 04 Dec 2023 00:36:11 +0900
|
||||
|
||||
nimf (1.3.1) stable; urgency=medium
|
||||
|
||||
* Support Arch Linux, Manjaro
|
||||
* Replace indicator icons
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Sat, 03 Dec 2022 16:51:23 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.9) stable; urgency=medium
|
||||
|
||||
* Release for Debian 12 Bookworm
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Thu, 24 Nov 2022 19:57:21 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.8) stable; urgency=medium
|
||||
|
||||
* Release for Ubuntu 22.04 Jammy
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Thu, 31 May 2022 14:25:13 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.7) stable; urgency=medium
|
||||
|
||||
* Synchronizing Release Versions
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Thu, 24 Dec 2021 16:57:08 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.6) stable; urgency=medium
|
||||
|
||||
* Release for Ubuntu 21.10 Impish
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Thu, 23 Dec 2021 16:57:08 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.5) stable; urgency=medium
|
||||
|
||||
* Release for Ubuntu 21.04 Hirsute
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Fri, 19 Mar 2021 16:42:20 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.4) stable; urgency=medium
|
||||
|
||||
* Remove doc/nimf-info.png
|
||||
* Update README.md
|
||||
* Update nimf/po/ko.po
|
||||
* Change distributor name to Hodong Kim
|
||||
* Update nimf/modules/services/indicator/nimf-indicator.c
|
||||
* Change distributor name to Hodong Kim
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Tue, 08 Dec 2020 09:49:50 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.3) stable; urgency=medium
|
||||
|
||||
* Update nimf/configure.ac
|
||||
* Change version string to 1.3.0
|
||||
* Add doc/nimf-info.png and doc/nimf.png
|
||||
* Update README.md
|
||||
* Update nimf/po/ko.po
|
||||
* Change distributor name as HamoniKR
|
||||
* Update nimf/modules/services/indicator/nimf-indicator.c
|
||||
* Change distributor name as HamoniKR
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Tue, 01 Dec 2020 15:23:33 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.2) stable; urgency=medium
|
||||
|
||||
* Rebuild deb package for HamoniKR 4.0
|
||||
* Apply new icons for modules
|
||||
* Remove modules/engines/nimf-m17n/icons/scalable/nimf-m17n-ui.svg
|
||||
* Fix bug for nimf/modules/engines/nimf-m17n/test-nimf-m17n.c
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Tue, 01 Dec 2020 15:23:33 +0900
|
||||
|
||||
nimf (1.3.0hamonikr40.1) stable; urgency=medium
|
||||
|
||||
* Rebuild deb package for HamoniKR 4.0
|
||||
* Build for auto upgrade on HamoniKR 4.0 Jin
|
||||
|
||||
-- HamoniKRTeam <pkg@hamonikr.org> Sun, 29 Nov 2020 18:07:32 +0900
|
||||
|
||||
nimf (2020.04.28-1+hamonikr40.2) focal; urgency=low
|
||||
|
||||
* Apply patch for HamoniKR 4.0
|
||||
* Update icons on data/icons/scalable folder
|
||||
* Apply new icon for HamoniKR 4.0
|
||||
* Update AUTHORS, README
|
||||
* Changed contact into AUTHORS for fix #23
|
||||
* Add BUILD.md and README.md
|
||||
* Add build descriptions for HamoniKR 4.0 (Ubuntu 20.04)
|
||||
* Update modules/services/indicator/nimf-indicator.c
|
||||
* Change display maintainer name
|
||||
|
||||
-- HamoniKR Team <pkg@hamonikr.org> Sun, 29 Nov 2020 17:57:07 +0900
|
||||
|
||||
nimf (2020.04.28-0~20200428~hamonikr40.1) focal; urgency=low
|
||||
|
||||
* Apply new icons for HamoniKR 4.0
|
||||
|
||||
-- HamoniKR Team <pkg@hamonikr.org> Tue, 13 Oct 2020 15:32:00 +0900
|
||||
|
||||
nimf (2020.04.28) stable; urgency=medium
|
||||
|
||||
* Fixed auto-reordering
|
||||
* Fixed errors when typing Hangul with the Dvorak layout.
|
||||
* Fixed wrong path. This prevents nimf from running more than once.
|
||||
Don't use g_get_user_runtime_dir()
|
||||
* Fix an error on compiling im-nimf.c for gtk2
|
||||
|
||||
-- Hodong Kim <nimfsoft@gmail.com> Tue, 28 Apr 2020 22:14:14 +0900
|
||||
1
Telegram/ThirdParty/nimf/debian/compat
vendored
Normal file
@@ -0,0 +1 @@
|
||||
11
|
||||
120
Telegram/ThirdParty/nimf/debian/control
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
Source: nimf
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Kevin Kim <chaeya@gmail.com>
|
||||
Build-Depends: debhelper (>= 11),
|
||||
libglib2.0-dev (>= 2.54),
|
||||
pkgconf | pkg-config,
|
||||
intltool (>= 0.50.1),
|
||||
libgtk-3-dev,
|
||||
libgtk-3-bin,
|
||||
libgtk-4-dev,
|
||||
libgtk-4-bin,
|
||||
libgtk2.0-dev,
|
||||
qtbase5-dev,
|
||||
qtbase5-private-dev,
|
||||
qt6-base-dev,
|
||||
qt6-base-private-dev,
|
||||
libayatana-appindicator3-dev,
|
||||
librsvg2-bin,
|
||||
fonts-noto-cjk,
|
||||
libhangul-dev,
|
||||
libanthy-dev,
|
||||
anthy,
|
||||
librime-dev (>= 1.2.9),
|
||||
libxkbcommon-dev (>= 0.5.0),
|
||||
libwayland-dev,
|
||||
wayland-protocols,
|
||||
libxklavier-dev,
|
||||
libm17n-dev (>= 1.7.0),
|
||||
m17n-db (>= 1.7.0),
|
||||
gtk-doc-tools (>= 1.26)
|
||||
Standards-Version: 3.9.8
|
||||
Homepage: https://github.com/hamonikr/nimf
|
||||
|
||||
Package: nimf
|
||||
Architecture: any
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libnimf1 (= ${binary:Version})
|
||||
Recommends: im-config
|
||||
Suggests: fonts-noto-cjk | nimf-anthy | nimf-libhangul | nimf-m17n | nimf-rime
|
||||
Description: Input Method Framework
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
.
|
||||
This package contains the essentials for Nimf.
|
||||
|
||||
Package: libnimf1
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Pre-Depends: ${misc:Pre-Depends}
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: Input Method Framework (shared library)
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
.
|
||||
This package contains the shared library.
|
||||
|
||||
Package: nimf-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends},
|
||||
libnimf1 (= ${binary:Version}),
|
||||
libglib2.0-dev
|
||||
Description: Input Method Framework (development file)
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
.
|
||||
This package contains development files.
|
||||
|
||||
Package: nimf-anthy
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, nimf (= ${binary:Version}), anthy
|
||||
Suggests: fonts-noto-cjk
|
||||
Description: Japanese input module for Nimf, based on anthy
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
.
|
||||
This package provides a Japanese input module based on anthy.
|
||||
|
||||
Package: nimf-libhangul
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, nimf (= ${binary:Version})
|
||||
Suggests: fonts-noto-cjk
|
||||
Description: Korean input module for Nimf, based on libhangul
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
.
|
||||
This package provides a Korean input module based on libhangul.
|
||||
|
||||
Package: nimf-m17n
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends},
|
||||
libm17n-0 (>= 1.7.0), m17n-db (>= 1.7.0), nimf (= ${binary:Version})
|
||||
Suggests: fonts-noto-cjk
|
||||
Description: Multilingual input module for Nimf, based on m17n
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
.
|
||||
This package provides multilingual input modules based on m17n.
|
||||
|
||||
Package: nimf-rime
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, nimf (= ${binary:Version})
|
||||
Recommends: librime-data
|
||||
Suggests: fonts-noto-cjk
|
||||
Description: Chinese input module for Nimf, based on rime
|
||||
Nimf is a lightweight, fast and extensible input method framework.
|
||||
.
|
||||
This package provides a Chinese input module based on rime.
|
||||
|
||||
Package: qtbase-abi-5-15-3-dummy
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}
|
||||
Description: Dummy package for qtbase-abi-5-15-3
|
||||
This is a dummy package to satisfy dependencies for the qtbase-abi-5-15-3
|
||||
transition. It does not contain any files or functionality and can be safely
|
||||
removed once the transition is complete.
|
||||
|
||||
Package: qtbase-abi-5-12-8-dummy
|
||||
Architecture: any
|
||||
Depends: ${misc:Depends}
|
||||
Description: Dummy package for qtbase-abi-5-12-8
|
||||
This is a dummy package to satisfy dependencies for the qtbase-abi-5-12-8
|
||||
transition. It does not contain any files or functionality and can be safely
|
||||
removed once the transition is complete.
|
||||
|
||||
192
Telegram/ThirdParty/nimf/debian/copyright
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Source: https://gitlab.com/nimf-i18n/nimf
|
||||
|
||||
Files: *
|
||||
Copyright: 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
License: LGPL-3+
|
||||
This library is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This library 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 Lesser General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, the complete text of the GNU Library General
|
||||
Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3".
|
||||
|
||||
Files: modules/services/wayland/nimf-wayland.c
|
||||
modules/services/wayland/nimf-wayland.h
|
||||
Copyright: 2012, 2013 Intel Corporation
|
||||
2017 Hodong Kim <cogniti@gmail.com>
|
||||
License: Expat
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Files: modules/services/xim/IMdkit/FrameMgr.*
|
||||
Copyright: 1993, 1994 Digital Equipment Corporation, Maynard, Massachusetts
|
||||
License: FrameMgr
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the names of Digital or MIT not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
.
|
||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
||||
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
|
||||
Files: modules/services/xim/IMdkit/i18nAttr.c
|
||||
modules/services/xim/IMdkit/i18nClbk.c
|
||||
modules/services/xim/IMdkit/i18nIc.c
|
||||
modules/services/xim/IMdkit/i18nMethod.c
|
||||
modules/services/xim/IMdkit/i18nMethod.h
|
||||
modules/services/xim/IMdkit/i18nPtHdr.c
|
||||
modules/services/xim/IMdkit/XimFunc.h
|
||||
Copyright: 1993, 1994 Hewlett-Packard Company
|
||||
1994, 1995 Sun Microsystems, Inc.
|
||||
License: HP-SUN
|
||||
Permission to use, copy, modify, distribute, and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Sun Microsystems, Inc.
|
||||
and Hewlett-Packard not be used in advertising or publicity pertaining to
|
||||
distribution of the software without specific, written prior permission.
|
||||
Sun Microsystems, Inc. and Hewlett-Packard make no representations about
|
||||
the suitability of this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.
|
||||
.
|
||||
SUN MICROSYSTEMS INC. AND HEWLETT-PACKARD COMPANY DISCLAIMS ALL
|
||||
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
SUN MICROSYSTEMS, INC. AND HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY
|
||||
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
||||
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
||||
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Files: modules/services/xim/IMdkit/i18nIMProto.c
|
||||
Copyright: 1993, 1994 Digital Equipment Corporation, Maynard, Massachusetts
|
||||
1993, 1994 Hewlett-Packard Company
|
||||
1994, 1995 Sun Microsystems, Inc.
|
||||
License: i18nIMProto
|
||||
Permission to use, copy, modify, and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appear in all copies and that
|
||||
both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the names of Digital or MIT not be
|
||||
used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission.
|
||||
.
|
||||
DIGITAL AND HEWLETT-PACKARD COMPANY DISCLAIMS ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL DIGITAL AND HEWLETT-PACKARD COMPANY BE LIABLE
|
||||
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
||||
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
||||
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Files: modules/services/xim/IMdkit/i18nOffsetCache.c
|
||||
Copyright: 2014 Peng Huang <shawn.p.huang@gmail.com>
|
||||
2014 Red Hat, Inc.
|
||||
License: i18nOffsetCache
|
||||
Permission to use, copy, modify, distribute, and sell this
|
||||
software and its documentation for any purpose is hereby granted
|
||||
without fee, provided that the above copyright notice appear in
|
||||
all copies and that both that copyright notice and this permission
|
||||
notice appear in supporting documentation, and that the name of
|
||||
the copyright holders not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific,
|
||||
written prior permission. The copyright holders make no
|
||||
representations about the suitability of this software for any
|
||||
purpose. It is provided "as is" without express or implied
|
||||
warranty.
|
||||
.
|
||||
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
||||
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
|
||||
Files: modules/services/xim/IMdkit/i18nUtil.c
|
||||
modules/services/xim/IMdkit/i18nX.c
|
||||
modules/services/xim/IMdkit/i18nX.h
|
||||
modules/services/xim/IMdkit/Xi18n.h
|
||||
Copyright: 1993, 1994 Hewlett-Packard Company
|
||||
1994, 1995 Sun Microsystems, Inc.
|
||||
2014 Peng Huang <shawn.p.huang@gmail.com>
|
||||
2014 Red Hat, Inc.
|
||||
License: i18nUtil-i18nX-Xi18n
|
||||
Permission to use, copy, modify, distribute, and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Sun Microsystems, Inc.
|
||||
and Hewlett-Packard not be used in advertising or publicity pertaining to
|
||||
distribution of the software without specific, written prior permission.
|
||||
Sun Microsystems, Inc. and Hewlett-Packard make no representations about
|
||||
the suitability of this software for any purpose. It is provided "as is"
|
||||
without express or implied warranty.
|
||||
.
|
||||
SUN MICROSYSTEMS INC. AND HEWLETT-PACKARD COMPANY DISCLAIMS ALL
|
||||
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||
SUN MICROSYSTEMS, INC. AND HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY
|
||||
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
|
||||
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
||||
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
Files: modules/services/xim/IMdkit/XimProto.h
|
||||
Copyright: 1992-1994 FUJITSU LIMITED
|
||||
License: XimProto
|
||||
Permission to use, copy, modify, distribute, and sell this software
|
||||
and its documentation for any purpose is hereby granted without fee,
|
||||
provided that the above copyright notice appear in all copies and
|
||||
that both that copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of FUJITSU LIMITED
|
||||
not be used in advertising or publicity pertaining to distribution
|
||||
of the software without specific, written prior permission.
|
||||
FUJITSU LIMITED makes no representations about the suitability of
|
||||
this software for any purpose.
|
||||
It is provided "as is" without express or implied warranty.
|
||||
.
|
||||
FUJITSU LIMITED DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
EVENT SHALL FUJITSU LIMITED BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
|
||||
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
2
Telegram/ThirdParty/nimf/debian/git-build-recipe.manifest
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# git-build-recipe format 0.4 deb-version {debupstream}-0~201908141206
|
||||
lp:~nimf-i18n/+git/nimf git-commit:dec1a11c3034677a825b0dff319a05a8d019ae08
|
||||
1
Telegram/ThirdParty/nimf/debian/libnimf1.install
vendored
Normal file
@@ -0,0 +1 @@
|
||||
usr/lib/*/libnimf.so.*
|
||||
3
Telegram/ThirdParty/nimf/debian/nimf-anthy.install
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/share/icons/hicolor/*/status/nimf-anthy.*
|
||||
usr/share/glib-2.0/schemas/org.nimf.engines.nimf-anthy.gschema.xml
|
||||
usr/lib/*/nimf/modules/libnimf-anthy.so
|
||||
4
Telegram/ThirdParty/nimf/debian/nimf-dev.install
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
usr/include
|
||||
usr/lib/*/libnimf.so
|
||||
usr/lib/*/pkgconfig
|
||||
usr/share/gtk-doc
|
||||
4
Telegram/ThirdParty/nimf/debian/nimf-libhangul.install
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
usr/share/icons/hicolor/*/status/nimf-libhangul.*
|
||||
usr/share/glib-2.0/schemas/org.nimf.engines.nimf-libhangul.gschema.xml
|
||||
usr/lib/*/nimf/modules/libnimf-libhangul.so
|
||||
usr/lib/*/nimf/mssymbol.txt
|
||||
3
Telegram/ThirdParty/nimf/debian/nimf-m17n.install
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/share/icons/hicolor/*/status/nimf-m17n*
|
||||
usr/share/glib-2.0/schemas/org.nimf.engines.nimf-m17n*.gschema.xml
|
||||
usr/lib/*/nimf/modules/libnimf-m17n*.so
|
||||
3
Telegram/ThirdParty/nimf/debian/nimf-rime.install
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/share/icons/hicolor/*/status/nimf-rime-*
|
||||
usr/share/glib-2.0/schemas/org.nimf.engines.nimf-rime.gschema.xml
|
||||
usr/lib/*/nimf/modules/libnimf-rime.so
|
||||
19
Telegram/ThirdParty/nimf/debian/nimf.install
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
etc/input.d/nimf.conf
|
||||
etc/xdg/autostart
|
||||
usr/bin
|
||||
usr/lib/*/gtk-3.0
|
||||
usr/lib/*/gtk-4.0
|
||||
usr/lib/*/nimf/modules/libnimf-system-keyboard.so
|
||||
usr/lib/*/nimf/modules/services
|
||||
usr/lib/*/qt*
|
||||
usr/share/applications
|
||||
usr/share/glib-2.0/schemas/org.nimf.clients.*
|
||||
usr/share/glib-2.0/schemas/org.nimf.engines.nimf-system-keyboard.gschema.xml
|
||||
usr/share/glib-2.0/schemas/org.nimf.gschema.xml
|
||||
usr/share/glib-2.0/schemas/org.nimf.settings.gschema.xml
|
||||
usr/share/icons/hicolor/*/status/nimf-focus-out.*
|
||||
usr/share/icons/hicolor/*/status/nimf-logo.*
|
||||
usr/share/icons/hicolor/*/status/nimf-system-keyboard.*
|
||||
usr/share/im-config
|
||||
usr/share/locale
|
||||
usr/share/man
|
||||
36
Telegram/ThirdParty/nimf/debian/rules
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
%:
|
||||
dh $@ --with autoreconf
|
||||
|
||||
override_dh_autoreconf:
|
||||
./autogen.sh
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- --with-im-config-data --enable-gtk-doc
|
||||
|
||||
override_dh_auto_clean:
|
||||
rm -rf $(STAMP_DIR) $(SOURCE_DIR)
|
||||
dh_clean
|
||||
|
||||
override_dh_clean:
|
||||
dh_clean
|
||||
rm -rf autom4te.cache
|
||||
rm -f aclocal.m4 config.log config.status
|
||||
rm -rf debian/tmp
|
||||
|
||||
override_dh_auto_install:
|
||||
dh_auto_install
|
||||
# Ensure the correct installation path for GTK 4.0
|
||||
mkdir -p debian/tmp/usr/lib/x86_64-linux-gnu/gtk-4.0
|
||||
|
||||
override_dh_shlibdeps:
|
||||
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info -- -l/usr/lib/nimf
|
||||
|
||||
# Add this override to skip tests
|
||||
override_dh_auto_test:
|
||||
echo "Skipping tests"
|
||||
|
||||
1
Telegram/ThirdParty/nimf/debian/source/format
vendored
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (native)
|
||||
1
Telegram/ThirdParty/nimf/debian/source/lintian-overrides
vendored
Normal file
@@ -0,0 +1 @@
|
||||
nimf: source-is-missing
|
||||
130
Telegram/ThirdParty/nimf/libnimf/Makefile.am
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
lib_LTLIBRARIES = libnimf.la
|
||||
|
||||
BUILT_SOURCES = \
|
||||
nimf-enum-types.c \
|
||||
nimf-enum-types-private.h \
|
||||
nimf-marshalers.c \
|
||||
nimf-marshalers-private.h \
|
||||
nimf-message-enum-types-private.h \
|
||||
nimf-message-enum-types.c \
|
||||
$(NULL)
|
||||
|
||||
libnimf_la_SOURCES = \
|
||||
nimf.h \
|
||||
nimf-candidatable.c \
|
||||
nimf-candidatable.h \
|
||||
nimf-engine.c \
|
||||
nimf-engine.h \
|
||||
nimf-events.c \
|
||||
nimf-events.h \
|
||||
nimf-im.c \
|
||||
nimf-im.h \
|
||||
nimf-key-syms.h \
|
||||
nimf-message.c \
|
||||
nimf-message-private.h \
|
||||
nimf-module.c \
|
||||
nimf-module-private.h \
|
||||
nimf-preeditable.c \
|
||||
nimf-preeditable.h \
|
||||
nimf-server.c \
|
||||
nimf-server.h \
|
||||
nimf-server-private.h \
|
||||
nimf-service.c \
|
||||
nimf-service.h \
|
||||
nimf-service-ic.c \
|
||||
nimf-service-ic.h \
|
||||
nimf-service-ic-private.h \
|
||||
nimf-types.c \
|
||||
nimf-types.h \
|
||||
nimf-utils.c \
|
||||
nimf-utils.h \
|
||||
nimf-utils-private.h \
|
||||
$(BUILT_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
libnimf_la_CFLAGS = \
|
||||
$(EXTRA_CFLAGS) \
|
||||
-I$(top_srcdir)/libnimf \
|
||||
-DNIMF_COMPILATION \
|
||||
-DG_LOG_DOMAIN=\"nimf\" \
|
||||
-DNIMF_MODULE_DIR=\"$(libdir)/nimf/modules\" \
|
||||
-DNIMF_SERVICE_MODULE_DIR=\"$(libdir)/nimf/modules/services\" \
|
||||
$(LIBNIMF_DEPS_CFLAGS)
|
||||
|
||||
libnimf_la_LDFLAGS = -version-info $(LIBNIMF_LT_VERSION) $(LIBNIMF_DEPS_LIBS)
|
||||
|
||||
nimfincludedir = $(includedir)/nimf
|
||||
nimfinclude_HEADERS = \
|
||||
nimf.h \
|
||||
nimf-candidatable.h \
|
||||
nimf-engine.h \
|
||||
nimf-events.h \
|
||||
nimf-im.h \
|
||||
nimf-key-syms.h \
|
||||
nimf-preeditable.h \
|
||||
nimf-server.h \
|
||||
nimf-service.h \
|
||||
nimf-service-ic.h \
|
||||
nimf-types.h \
|
||||
nimf-utils.h \
|
||||
$(NULL)
|
||||
|
||||
nimf-marshalers-private.h: nimf-marshalers.list
|
||||
$(AM_V_GEN) glib-genmarshal --prefix=nimf_cclosure_marshal \
|
||||
--header nimf-marshalers.list \
|
||||
> nimf-marshalers-private.h
|
||||
|
||||
nimf-marshalers.c: nimf-marshalers.list
|
||||
$(AM_V_GEN) glib-genmarshal --prefix=nimf_cclosure_marshal \
|
||||
--body nimf-marshalers.list \
|
||||
> nimf-marshalers.c
|
||||
|
||||
nimf-enum-types-private.h: nimf-key-syms.h \
|
||||
nimf-types.h \
|
||||
nimf-enum-types-private.h.template
|
||||
$(AM_V_GEN) glib-mkenums --identifier-prefix Nimf \
|
||||
--template nimf-enum-types-private.h.template \
|
||||
nimf-key-syms.h nimf-types.h \
|
||||
> nimf-enum-types-private.h
|
||||
|
||||
nimf-enum-types.c: nimf-key-syms.h \
|
||||
nimf-types.h \
|
||||
nimf-enum-types.c.template
|
||||
$(AM_V_GEN) glib-mkenums --identifier-prefix Nimf \
|
||||
--template nimf-enum-types.c.template \
|
||||
nimf-key-syms.h nimf-types.h \
|
||||
> nimf-enum-types.c
|
||||
|
||||
nimf-message-enum-types-private.h: \
|
||||
nimf-message-private.h \
|
||||
nimf-message-enum-types-private.h.template
|
||||
$(AM_V_GEN) glib-mkenums \
|
||||
--identifier-prefix Nimf \
|
||||
--template nimf-message-enum-types-private.h.template \
|
||||
nimf-message-private.h > nimf-message-enum-types-private.h
|
||||
|
||||
nimf-message-enum-types.c: nimf-message.c nimf-enum-types.c.template
|
||||
$(AM_V_GEN) glib-mkenums \
|
||||
--identifier-prefix Nimf \
|
||||
--template nimf-message-enum-types.c.template \
|
||||
nimf-message-private.h > nimf-message-enum-types.c
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = nimf.pc
|
||||
|
||||
gsettings_SCHEMAS = org.nimf.gschema.xml
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
EXTRA_DIST = nimf.pc.in
|
||||
|
||||
install-data-hook:
|
||||
rm -f $(DESTDIR)$(libdir)/libnimf.la
|
||||
|
||||
uninstall-hook:
|
||||
-rm -f $(DESTDIR)$(libdir)/libnimf.so*
|
||||
-rmdir -p $(DESTDIR)$(libdir)/nimf
|
||||
-rmdir -p $(DESTDIR)$(nimfincludedir)
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
357
Telegram/ThirdParty/nimf/libnimf/nimf-candidatable.c
vendored
Normal file
@@ -0,0 +1,357 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-candidatable.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2018,2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-candidatable.h"
|
||||
|
||||
G_DEFINE_INTERFACE (NimfCandidatable, nimf_candidatable, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
nimf_candidatable_default_init (NimfCandidatableInterface *iface)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_show:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
* @target: a #NimfServiceIC
|
||||
* @show_entry: %TRUE if the entry for auxiliary text should be shown
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_show (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target,
|
||||
gboolean show_entry)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->show)
|
||||
iface->show (candidatable, target, show_entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_hide:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Hides the candidatable
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_hide (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->hide)
|
||||
iface->hide (candidatable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_is_visible:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Returns: %TRUE if the @candidatable is visible
|
||||
*/
|
||||
gboolean
|
||||
nimf_candidatable_is_visible (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NIMF_IS_CANDIDATABLE (candidatable), FALSE);
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->is_visible)
|
||||
return iface->is_visible (candidatable);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_clear:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
* @target: a #NimfServiceIC
|
||||
*
|
||||
* Clears the contents of the candidatable
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_clear (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->clear)
|
||||
iface->clear (candidatable, target);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_set_page_values:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
* @target: a #NimfServiceIC
|
||||
* @page_index: page index
|
||||
* @n_pages: the number of pages
|
||||
* @page_size: page size
|
||||
*
|
||||
* Sets page values.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_set_page_values (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target,
|
||||
gint page_index,
|
||||
gint n_pages,
|
||||
gint page_size)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->set_page_values)
|
||||
iface->set_page_values (candidatable,
|
||||
target,
|
||||
page_index,
|
||||
n_pages,
|
||||
page_size);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_append:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
* @text1: text for the first column; @text1 must be non-%NULL.
|
||||
* @text2: (nullable): text for the second column; @text2 allows %NULL.
|
||||
*
|
||||
* After appending a row, adds @text1 to the first column and @text2 to the
|
||||
* second column.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_append (NimfCandidatable *candidatable,
|
||||
const gchar *text1,
|
||||
const gchar *text2)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->append)
|
||||
iface->append (candidatable, text1, text2);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_get_selected_index:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Returns: index of the selected row
|
||||
*/
|
||||
gint
|
||||
nimf_candidatable_get_selected_index (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NIMF_IS_CANDIDATABLE (candidatable), 0);
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->get_selected_index)
|
||||
return iface->get_selected_index (candidatable);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_get_selected_text:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Returns: text of the first column in the selected row
|
||||
*/
|
||||
gchar *
|
||||
nimf_candidatable_get_selected_text (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_val_if_fail (NIMF_IS_CANDIDATABLE (candidatable), NULL);
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->get_selected_text)
|
||||
return iface->get_selected_text (candidatable);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_select_first_item_in_page:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Selects the first item in the page.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_select_first_item_in_page (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->select_first_item_in_page)
|
||||
iface->select_first_item_in_page (candidatable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_select_last_item_in_page:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Selects the last item in the page.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_select_last_item_in_page (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->select_last_item_in_page)
|
||||
iface->select_last_item_in_page (candidatable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_select_item_by_index_in_page:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
* @index: a gint
|
||||
*
|
||||
* Selects an item by the index in the page.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_select_item_by_index_in_page (NimfCandidatable *candidatable,
|
||||
gint index)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->select_item_by_index_in_page)
|
||||
iface->select_item_by_index_in_page (candidatable, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_select_previous_item:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Selects the previous item.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_select_previous_item (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->select_previous_item)
|
||||
iface->select_previous_item (candidatable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_select_next_item:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
*
|
||||
* Selects the next item.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_select_next_item (NimfCandidatable *candidatable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->select_next_item)
|
||||
iface->select_next_item (candidatable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_candidatable_set_auxiliary_text:
|
||||
* @candidatable: a #NimfCandidatable
|
||||
* @text: text
|
||||
* @cursor_pos: cursor position within @text
|
||||
*
|
||||
* Sets auxiliary text.
|
||||
*/
|
||||
void
|
||||
nimf_candidatable_set_auxiliary_text (NimfCandidatable *candidatable,
|
||||
const gchar *text,
|
||||
gint cursor_pos)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfCandidatableInterface *iface;
|
||||
|
||||
g_return_if_fail (NIMF_IS_CANDIDATABLE (candidatable));
|
||||
|
||||
iface = NIMF_CANDIDATABLE_GET_IFACE (candidatable);
|
||||
|
||||
if (iface->set_auxiliary_text)
|
||||
iface->set_auxiliary_text (candidatable, text, cursor_pos);
|
||||
}
|
||||
128
Telegram/ThirdParty/nimf/libnimf/nimf-candidatable.h
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-candidatable.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2018,2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_CANDIDATABLE_H__
|
||||
#define __NIMF_CANDIDATABLE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nimf-service-ic.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_CANDIDATABLE nimf_candidatable_get_type ()
|
||||
|
||||
G_DECLARE_INTERFACE (NimfCandidatable, nimf_candidatable, NIMF, CANDIDATABLE, GObject)
|
||||
|
||||
#ifndef __GTK_DOC_IGNORE__
|
||||
typedef struct _NimfServiceIC NimfServiceIC;
|
||||
#endif
|
||||
typedef struct _NimfCandidatable NimfCandidatable; /* dummy typedef */
|
||||
typedef struct _NimfCandidatableInterface NimfCandidatableInterface;
|
||||
|
||||
/**
|
||||
* NimfCandidatableInterface:
|
||||
* @parent: The parent interface.
|
||||
* @show: Shows the candidatable.
|
||||
* @hide: Hides the candidatable.
|
||||
* @is_visible: Determines whether the candidatable is visible.
|
||||
* @clear: Clears the contents of the candidatable.
|
||||
* @set_page_values: Sets page values.
|
||||
* @append: Appends a new candidate.
|
||||
* @get_selected_index: Gets the index of the selected candidatable.
|
||||
* @get_selected_text: Gets the text of the selected candidatable.
|
||||
* @select_first_item_in_page: Selects first item in page.
|
||||
* @select_last_item_in_page: Selects last item in page.
|
||||
* @select_item_by_index_in_page: Selects item in page with the index given as the argument.
|
||||
* @select_previous_item: Selects previus item.
|
||||
* @select_next_item: Selects a next item.
|
||||
* @set_auxiliary_text: Selects auxiliary text.
|
||||
*
|
||||
* Provides an interface for candidate window.
|
||||
*/
|
||||
struct _NimfCandidatableInterface
|
||||
{
|
||||
GTypeInterface parent;
|
||||
|
||||
void (* show) (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target,
|
||||
gboolean show_entry);
|
||||
void (* hide) (NimfCandidatable *candidatable);
|
||||
gboolean (* is_visible) (NimfCandidatable *candidatable);
|
||||
void (* clear) (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target);
|
||||
void (* set_page_values) (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target,
|
||||
gint page_index,
|
||||
gint n_pages,
|
||||
gint page_size);
|
||||
void (* append) (NimfCandidatable *candidatable,
|
||||
const gchar *item1,
|
||||
const gchar *item2);
|
||||
gint (* get_selected_index) (NimfCandidatable *candidatable);
|
||||
gchar * (* get_selected_text) (NimfCandidatable *candidatable);
|
||||
void (* select_first_item_in_page) (NimfCandidatable *candidatable);
|
||||
void (* select_last_item_in_page) (NimfCandidatable *candidatable);
|
||||
void (* select_item_by_index_in_page) (NimfCandidatable *candidatable,
|
||||
gint index);
|
||||
void (* select_previous_item) (NimfCandidatable *candidatable);
|
||||
void (* select_next_item) (NimfCandidatable *candidatable);
|
||||
void (* set_auxiliary_text) (NimfCandidatable *candidatable,
|
||||
const gchar *text,
|
||||
gint cursor_pos);
|
||||
};
|
||||
|
||||
void nimf_candidatable_show (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target,
|
||||
gboolean show_entry);
|
||||
void nimf_candidatable_hide (NimfCandidatable *candidatable);
|
||||
gboolean nimf_candidatable_is_visible (NimfCandidatable *candidatable);
|
||||
void nimf_candidatable_clear (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target);
|
||||
void nimf_candidatable_set_page_values (NimfCandidatable *candidatable,
|
||||
NimfServiceIC *target,
|
||||
gint page_index,
|
||||
gint n_pages,
|
||||
gint page_size);
|
||||
void nimf_candidatable_append (NimfCandidatable *candidatable,
|
||||
const gchar *text1,
|
||||
const gchar *text2);
|
||||
gint nimf_candidatable_get_selected_index
|
||||
(NimfCandidatable *candidatable);
|
||||
gchar *nimf_candidatable_get_selected_text
|
||||
(NimfCandidatable *candidatable);
|
||||
void nimf_candidatable_select_first_item_in_page
|
||||
(NimfCandidatable *candidatable);
|
||||
void nimf_candidatable_select_last_item_in_page
|
||||
(NimfCandidatable *candidatable);
|
||||
void nimf_candidatable_select_item_by_index_in_page
|
||||
(NimfCandidatable *candidatable,
|
||||
gint index);
|
||||
void nimf_candidatable_select_previous_item
|
||||
(NimfCandidatable *candidatable);
|
||||
void nimf_candidatable_select_next_item
|
||||
(NimfCandidatable *candidatable);
|
||||
void nimf_candidatable_set_auxiliary_text
|
||||
(NimfCandidatable *candidatable,
|
||||
const gchar *text,
|
||||
gint cursor_pos);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_CANDIDATABLE_H__ */
|
||||
430
Telegram/ThirdParty/nimf/libnimf/nimf-engine.c
vendored
Normal file
@@ -0,0 +1,430 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-engine.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-engine.h"
|
||||
#include "nimf-server.h"
|
||||
#include "nimf-server-private.h"
|
||||
|
||||
struct _NimfEnginePrivate
|
||||
{
|
||||
gchar *surrounding_text;
|
||||
gint surrounding_cursor_index;
|
||||
};
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (NimfEngine, nimf_engine, G_TYPE_OBJECT);
|
||||
|
||||
/**
|
||||
* nimf_engine_reset:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
*
|
||||
* Resets the @engine.
|
||||
*/
|
||||
void nimf_engine_reset (NimfEngine *engine,
|
||||
NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_ENGINE (engine));
|
||||
|
||||
NimfEngineClass *class = NIMF_ENGINE_GET_CLASS (engine);
|
||||
|
||||
if (class->reset)
|
||||
class->reset (engine, ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_focus_in:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
*
|
||||
* Notifies the language engine that the caller has gained focus.
|
||||
*/
|
||||
void
|
||||
nimf_engine_focus_in (NimfEngine *engine,
|
||||
NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_ENGINE (engine));
|
||||
|
||||
NimfEngineClass *class = NIMF_ENGINE_GET_CLASS (engine);
|
||||
|
||||
if (class->focus_in)
|
||||
class->focus_in (engine, ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_focus_out:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
*
|
||||
* Notifies the language engine that the caller has lost focus.
|
||||
*/
|
||||
void nimf_engine_focus_out (NimfEngine *engine,
|
||||
NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_ENGINE (engine));
|
||||
|
||||
NimfEngineClass *class = NIMF_ENGINE_GET_CLASS (engine);
|
||||
|
||||
if (class->focus_out)
|
||||
class->focus_out (engine, ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_filter_event:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
* @event: a #NimfEvent
|
||||
*
|
||||
* Let the language engine handle the event.
|
||||
*
|
||||
* Returns: %TRUE if the language engine consumed the event.
|
||||
*/
|
||||
gboolean
|
||||
nimf_engine_filter_event (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
NimfEvent *event)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEngineClass *class = NIMF_ENGINE_GET_CLASS (engine);
|
||||
|
||||
if (class->filter_event)
|
||||
return class->filter_event (engine, ic, event);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_set_surrounding:
|
||||
* @engine: a #NimfEngine
|
||||
* @text: surrounding text
|
||||
* @len: the byte length of @text
|
||||
* @cursor_index: the character index of the cursor within @text.
|
||||
*
|
||||
* Sets surrounding text in @engine. This function is expected to be
|
||||
* called in response to nimf_engine_get_surrounding().
|
||||
*/
|
||||
void
|
||||
nimf_engine_set_surrounding (NimfEngine *engine,
|
||||
const char *text,
|
||||
gint len,
|
||||
gint cursor_index)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_ENGINE (engine));
|
||||
g_return_if_fail (text != NULL || len == 0);
|
||||
|
||||
g_free (engine->priv->surrounding_text);
|
||||
engine->priv->surrounding_text = g_strndup (text, len);
|
||||
engine->priv->surrounding_cursor_index = cursor_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_get_surrounding:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
* @text: (out) (transfer full): location to store surrounding text
|
||||
* @cursor_index: (out) (transfer full): location to store cursor index
|
||||
*
|
||||
* This function internally calls nimf_engine_emit_retrieve_surrounding().
|
||||
* Gets surrounding text from the caller of nimf_im_set_surrounding(),
|
||||
* if available.
|
||||
*
|
||||
* Returns: %TRUE if surrounding text is available
|
||||
*/
|
||||
gboolean
|
||||
nimf_engine_get_surrounding (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
gchar **text,
|
||||
gint *cursor_index)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
gboolean retval = nimf_engine_emit_retrieve_surrounding (engine, ic);
|
||||
|
||||
if (retval)
|
||||
{
|
||||
if (engine->priv->surrounding_text)
|
||||
*text = g_strdup (engine->priv->surrounding_text);
|
||||
else
|
||||
*text = g_strdup ("");
|
||||
|
||||
*cursor_index = engine->priv->surrounding_cursor_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
*text = NULL;
|
||||
*cursor_index = 0;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_set_method:
|
||||
* @engine: a #NimfEngine
|
||||
* @method_id: method id
|
||||
*
|
||||
* The engine may provide multiple input methods. Sets an input method by
|
||||
* @method_id
|
||||
*/
|
||||
void
|
||||
nimf_engine_set_method (NimfEngine *engine,
|
||||
const gchar *method_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEngineClass *class = NIMF_ENGINE_GET_CLASS (engine);
|
||||
|
||||
if (class->set_method)
|
||||
class->set_method (engine, method_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_emit_preedit_start:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
*
|
||||
* Emits the #NimfIM::preedit-start signal.
|
||||
*/
|
||||
void
|
||||
nimf_engine_emit_preedit_start (NimfEngine *engine,
|
||||
NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_service_ic_emit_preedit_start (ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_emit_preedit_changed:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
* @preedit_string: preedit string
|
||||
* @attrs: #NimfPreeditAttr array
|
||||
* @cursor_pos: cursor position within @preedit_string
|
||||
*
|
||||
* Emits the #NimfIM::preedit-changed signal.
|
||||
*/
|
||||
void
|
||||
nimf_engine_emit_preedit_changed (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
const gchar *preedit_string,
|
||||
NimfPreeditAttr **attrs,
|
||||
gint cursor_pos)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_service_ic_emit_preedit_changed (ic, preedit_string, attrs, cursor_pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_emit_preedit_end:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
*
|
||||
* Emits the #NimfIM::preedit-end signal.
|
||||
*/
|
||||
void
|
||||
nimf_engine_emit_preedit_end (NimfEngine *engine,
|
||||
NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_service_ic_emit_preedit_end (ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_emit_commit:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
* @text: text to commit
|
||||
*
|
||||
* Emits the #NimfIM::commit signal.
|
||||
*/
|
||||
void
|
||||
nimf_engine_emit_commit (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
const gchar *text)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_service_ic_emit_commit (ic, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_emit_delete_surrounding:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
* @offset: the character offset from the cursor position of the text to be
|
||||
* deleted. A negative value indicates a position before the cursor.
|
||||
* @n_chars: the number of characters to be deleted
|
||||
*
|
||||
* Emits the #NimfIM::delete-surrounding signal.
|
||||
*/
|
||||
gboolean
|
||||
nimf_engine_emit_delete_surrounding (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
gint offset,
|
||||
gint n_chars)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return nimf_service_ic_emit_delete_surrounding (ic, offset, n_chars);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_emit_retrieve_surrounding:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
*
|
||||
* Emits the #NimfIM::retrieve-surrounding signal.
|
||||
*/
|
||||
gboolean
|
||||
nimf_engine_emit_retrieve_surrounding (NimfEngine *engine,
|
||||
NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return nimf_service_ic_emit_retrieve_surrounding (ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_status_changed:
|
||||
* @engine: a #NimfEngine
|
||||
*
|
||||
* Notifies that the status of the @engine has changed.
|
||||
*/
|
||||
void
|
||||
nimf_engine_status_changed (NimfEngine *engine)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_signal_emit_by_name (nimf_server_get_default (), "engine-status-changed",
|
||||
nimf_engine_get_id (engine),
|
||||
nimf_engine_get_icon_name (engine));
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_emit_beep:
|
||||
* @engine: a #NimfEngine
|
||||
* @ic: a #NimfServiceIC associated with @engine
|
||||
*
|
||||
* Emits the #NimfIM::beep signal.
|
||||
*/
|
||||
void
|
||||
nimf_engine_emit_beep (NimfEngine *engine,
|
||||
NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_service_ic_emit_beep (ic);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_engine_init (NimfEngine *engine)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
engine->priv = nimf_engine_get_instance_private (engine);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_engine_finalize (GObject *object)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEngine *engine = NIMF_ENGINE (object);
|
||||
|
||||
g_free (engine->priv->surrounding_text);
|
||||
|
||||
G_OBJECT_CLASS (nimf_engine_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_get_id:
|
||||
* @engine: #NimfEngine
|
||||
*
|
||||
* Returns: (transfer none): engine id
|
||||
*/
|
||||
const gchar *
|
||||
nimf_engine_get_id (NimfEngine *engine)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEngineClass *class = NIMF_ENGINE_GET_CLASS (engine);
|
||||
|
||||
if (class->get_id)
|
||||
return class->get_id (engine);
|
||||
else
|
||||
g_critical ("You should implement your_engine_get_id ()");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_get_candidatable:
|
||||
* @engine: #NimfEngine
|
||||
*
|
||||
* Returns: (transfer none): a #NimfCandidatable
|
||||
*/
|
||||
NimfCandidatable *
|
||||
nimf_engine_get_candidatable (NimfEngine *engine)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return nimf_server_get_default ()->priv->candidatable;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_engine_get_icon_name:
|
||||
* @engine: #NimfEngine
|
||||
*
|
||||
* Returns: (transfer none): icon name
|
||||
*/
|
||||
const gchar *
|
||||
nimf_engine_get_icon_name (NimfEngine *engine)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEngineClass *class = NIMF_ENGINE_GET_CLASS (engine);
|
||||
|
||||
if (class->get_icon_name)
|
||||
return class->get_icon_name (engine);
|
||||
else
|
||||
g_critical ("You should implement your_engine_get_icon_name ()");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_engine_class_init (NimfEngineClass *class)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
G_OBJECT_CLASS (class)->finalize = nimf_engine_finalize;
|
||||
}
|
||||
151
Telegram/ThirdParty/nimf/libnimf/nimf-engine.h
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-engine.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_ENGINE_H__
|
||||
#define __NIMF_ENGINE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nimf-events.h"
|
||||
#include "nimf-service-ic.h"
|
||||
#include "nimf-candidatable.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_ENGINE (nimf_engine_get_type ())
|
||||
#define NIMF_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_TYPE_ENGINE, NimfEngine))
|
||||
#define NIMF_ENGINE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), NIMF_TYPE_ENGINE, NimfEngineClass))
|
||||
#define NIMF_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NIMF_TYPE_ENGINE))
|
||||
#define NIMF_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NIMF_TYPE_ENGINE, NimfEngineClass))
|
||||
|
||||
#ifndef __GTK_DOC_IGNORE__
|
||||
typedef struct _NimfServiceIC NimfServiceIC;
|
||||
typedef struct _NimfCandidatable NimfCandidatable;
|
||||
#endif
|
||||
typedef struct _NimfEngine NimfEngine;
|
||||
typedef struct _NimfEngineClass NimfEngineClass;
|
||||
typedef struct _NimfEnginePrivate NimfEnginePrivate;
|
||||
|
||||
struct _NimfEngine
|
||||
{
|
||||
GObject parent_instance;
|
||||
NimfEnginePrivate *priv;
|
||||
};
|
||||
|
||||
/**
|
||||
* NimfEngineClass:
|
||||
* @filter_event: If the language engine consumes the event, returns %TRUE.
|
||||
* @reset: Resets the language engine.
|
||||
* @focus_in: Called via nimf_im_focus_in() when the caller has gained focus.
|
||||
* @focus_out: Called via nimf_im_focus_out() when the caller has lost focus.
|
||||
* @set_method: Sets the method in the language engine.
|
||||
* @candidate_page_up: handler when candidate page up
|
||||
* @candidate_page_down: handler when candidate page down
|
||||
* @candidate_clicked: handler when candidate clicked
|
||||
* @candidate_scrolled: handler when candidate scrolled
|
||||
* @get_id: Gets the language engine id.
|
||||
* @get_icon_name: Gets the language engine name.
|
||||
*/
|
||||
struct _NimfEngineClass
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Virtual functions */
|
||||
gboolean (* filter_event) (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
NimfEvent *event);
|
||||
void (* reset) (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void (* focus_in) (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void (* focus_out) (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void (* set_method) (NimfEngine *engine,
|
||||
const gchar *method_id);
|
||||
/* candidate */
|
||||
gboolean (* candidate_page_up) (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
gboolean (* candidate_page_down) (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void (* candidate_clicked) (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
gchar *text,
|
||||
gint index);
|
||||
void (* candidate_scrolled) (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
gdouble value);
|
||||
/* info */
|
||||
const gchar * (* get_id) (NimfEngine *engine);
|
||||
const gchar * (* get_icon_name) (NimfEngine *engine);
|
||||
};
|
||||
|
||||
GType nimf_engine_get_type (void) G_GNUC_CONST;
|
||||
gboolean nimf_engine_filter_event (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
NimfEvent *event);
|
||||
void nimf_engine_reset (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void nimf_engine_focus_in (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void nimf_engine_focus_out (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void nimf_engine_set_surrounding (NimfEngine *engine,
|
||||
const char *text,
|
||||
gint len,
|
||||
gint cursor_index);
|
||||
gboolean nimf_engine_get_surrounding (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
gchar **text,
|
||||
gint *cursor_index);
|
||||
void nimf_engine_status_changed (NimfEngine *engine);
|
||||
void nimf_engine_set_method (NimfEngine *engine,
|
||||
const gchar *method_id);
|
||||
/* signals */
|
||||
void nimf_engine_emit_preedit_start (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void nimf_engine_emit_preedit_changed (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
const gchar *preedit_string,
|
||||
NimfPreeditAttr **attrs,
|
||||
gint cursor_pos);
|
||||
void nimf_engine_emit_preedit_end (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
void nimf_engine_emit_commit (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
gchar const *text);
|
||||
gboolean nimf_engine_emit_retrieve_surrounding (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
gboolean nimf_engine_emit_delete_surrounding (NimfEngine *engine,
|
||||
NimfServiceIC *ic,
|
||||
gint offset,
|
||||
gint n_chars);
|
||||
void nimf_engine_emit_beep (NimfEngine *engine,
|
||||
NimfServiceIC *ic);
|
||||
/* info */
|
||||
const gchar *nimf_engine_get_id (NimfEngine *engine);
|
||||
const gchar *nimf_engine_get_icon_name (NimfEngine *engine);
|
||||
/* candidate */
|
||||
NimfCandidatable *nimf_engine_get_candidatable (NimfEngine *engine);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_ENGINE_H__ */
|
||||
41
Telegram/ThirdParty/nimf/libnimf/nimf-enum-types-private.h.template
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/*** BEGIN file-header ***/
|
||||
/*
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_ENUM_TYPES_H__
|
||||
#define __NIMF_ENUM_TYPES_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN file-tail ***/
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_ENUM_TYPES_H__ */
|
||||
/*** END file-tail ***/
|
||||
55
Telegram/ThirdParty/nimf/libnimf/nimf-enum-types.c.template
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
/*** BEGIN file-header ***/
|
||||
/*
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-enum-types-private.h"
|
||||
#include "nimf-key-syms.h"
|
||||
#include "nimf-types.h"
|
||||
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GType
|
||||
@enum_name@_get_type (void)
|
||||
{
|
||||
static volatile gsize g_define_type_id__volatile = 0;
|
||||
|
||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||
{
|
||||
static const G@Type@Value values[] = {
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN value-production ***/
|
||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
/*** END value-production ***/
|
||||
|
||||
/*** BEGIN value-tail ***/
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
GType g_define_type_id =
|
||||
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||
}
|
||||
|
||||
return g_define_type_id__volatile;
|
||||
}
|
||||
|
||||
/*** END value-tail ***/
|
||||
163
Telegram/ThirdParty/nimf/libnimf/nimf-events.c
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-events.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-events.h"
|
||||
|
||||
/**
|
||||
* SECTION:nimf-events
|
||||
* @title: Events
|
||||
* @section_id: nimf-events
|
||||
*/
|
||||
|
||||
/**
|
||||
* nimf_event_keycode_to_qwerty_keyval:
|
||||
* @event: a #NimfEvent
|
||||
*
|
||||
* Converts @event to qwerty keyval. Use only for PC keyboards.
|
||||
*
|
||||
* Returns: the #guint value
|
||||
*/
|
||||
guint
|
||||
nimf_event_keycode_to_qwerty_keyval (const NimfEvent *event)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
guint keyval = 0;
|
||||
gboolean is_shift = event->key.state & NIMF_SHIFT_MASK;
|
||||
|
||||
switch (event->key.hardware_keycode)
|
||||
{
|
||||
/* 20(-) ~ 21(=) */
|
||||
case 20: keyval = is_shift ? '_' : '-'; break;
|
||||
case 21: keyval = is_shift ? '+' : '='; break;
|
||||
/* 24(q) ~ 35(]) */
|
||||
case 24: keyval = is_shift ? 'Q' : 'q'; break;
|
||||
case 25: keyval = is_shift ? 'W' : 'w'; break;
|
||||
case 26: keyval = is_shift ? 'E' : 'e'; break;
|
||||
case 27: keyval = is_shift ? 'R' : 'r'; break;
|
||||
case 28: keyval = is_shift ? 'T' : 't'; break;
|
||||
case 29: keyval = is_shift ? 'Y' : 'y'; break;
|
||||
case 30: keyval = is_shift ? 'U' : 'u'; break;
|
||||
case 31: keyval = is_shift ? 'I' : 'i'; break;
|
||||
case 32: keyval = is_shift ? 'O' : 'o'; break;
|
||||
case 33: keyval = is_shift ? 'P' : 'p'; break;
|
||||
case 34: keyval = is_shift ? '{' : '['; break;
|
||||
case 35: keyval = is_shift ? '}' : ']'; break;
|
||||
/* 38(a) ~ 48(') */
|
||||
case 38: keyval = is_shift ? 'A' : 'a'; break;
|
||||
case 39: keyval = is_shift ? 'S' : 's'; break;
|
||||
case 40: keyval = is_shift ? 'D' : 'd'; break;
|
||||
case 41: keyval = is_shift ? 'F' : 'f'; break;
|
||||
case 42: keyval = is_shift ? 'G' : 'g'; break;
|
||||
case 43: keyval = is_shift ? 'H' : 'h'; break;
|
||||
case 44: keyval = is_shift ? 'J' : 'j'; break;
|
||||
case 45: keyval = is_shift ? 'K' : 'k'; break;
|
||||
case 46: keyval = is_shift ? 'L' : 'l'; break;
|
||||
case 47: keyval = is_shift ? ':' : ';'; break;
|
||||
case 48: keyval = is_shift ? '"' : '\''; break;
|
||||
/* 52(z) ~ 61(?) */
|
||||
case 52: keyval = is_shift ? 'Z' : 'z'; break;
|
||||
case 53: keyval = is_shift ? 'X' : 'x'; break;
|
||||
case 54: keyval = is_shift ? 'C' : 'c'; break;
|
||||
case 55: keyval = is_shift ? 'V' : 'v'; break;
|
||||
case 56: keyval = is_shift ? 'B' : 'b'; break;
|
||||
case 57: keyval = is_shift ? 'N' : 'n'; break;
|
||||
case 58: keyval = is_shift ? 'M' : 'm'; break;
|
||||
case 59: keyval = is_shift ? '<' : ','; break;
|
||||
case 60: keyval = is_shift ? '>' : '.'; break;
|
||||
case 61: keyval = is_shift ? '?' : '/'; break;
|
||||
default: keyval = event->key.keyval; break;
|
||||
}
|
||||
|
||||
return keyval;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_event_matches:
|
||||
* @event: a #NimfEvent
|
||||
* @keys: a %NULL-terminated array of #NimfKey
|
||||
*
|
||||
* Checks if @event matches one of the @keys.
|
||||
*
|
||||
* Returns: #TRUE if a match was found.
|
||||
*/
|
||||
gboolean
|
||||
nimf_event_matches (NimfEvent *event, const NimfKey **keys)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: event->key.state: %d", G_STRFUNC, event->key.state);
|
||||
|
||||
gint i;
|
||||
|
||||
/* Ignore NIMF_MOD2_MASK (Number),
|
||||
* NIMF_LOCK_MASK (CapsLock),
|
||||
* virtual modifiers
|
||||
*/
|
||||
guint mods_mask = NIMF_SHIFT_MASK |
|
||||
NIMF_CONTROL_MASK |
|
||||
NIMF_MOD1_MASK |
|
||||
NIMF_MOD3_MASK |
|
||||
NIMF_MOD4_MASK |
|
||||
NIMF_MOD5_MASK;
|
||||
|
||||
for (i = 0; keys[i] != 0; i++)
|
||||
{
|
||||
if ((event->key.state & mods_mask) == (keys[i]->state & mods_mask) &&
|
||||
event->key.keyval == keys[i]->keyval)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_event_new:
|
||||
* @type: a #NimfEventType
|
||||
*
|
||||
* Creates a new event of the given type. All fields are set to 0.
|
||||
*
|
||||
* Returns: a new #NimfEvent, which should be freed with nimf_event_free().
|
||||
*/
|
||||
NimfEvent *
|
||||
nimf_event_new (NimfEventType type)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEvent *new_event = g_slice_new0 (NimfEvent);
|
||||
new_event->type = type;
|
||||
|
||||
return new_event;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_event_free:
|
||||
* @event: a #NimfEvent
|
||||
*
|
||||
* Frees @event.
|
||||
*/
|
||||
void
|
||||
nimf_event_free (NimfEvent *event)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
g_slice_free (NimfEvent, event);
|
||||
}
|
||||
88
Telegram/ThirdParty/nimf/libnimf/nimf-events.h
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-events.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_EVENTS_H__
|
||||
#define __NIMF_EVENTS_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nimf-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _NimfEventKey NimfEventKey;
|
||||
typedef union _NimfEvent NimfEvent;
|
||||
|
||||
/**
|
||||
* NimfEventType:
|
||||
* @NIMF_EVENT_NOTHING: a special code to indicate a null event.
|
||||
* @NIMF_EVENT_KEY_PRESS: a key has been pressed.
|
||||
* @NIMF_EVENT_KEY_RELEASE: a key has been released.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NIMF_EVENT_NOTHING = -1,
|
||||
NIMF_EVENT_KEY_PRESS = 0,
|
||||
NIMF_EVENT_KEY_RELEASE = 1,
|
||||
} NimfEventType;
|
||||
|
||||
/**
|
||||
* NimfEventKey:
|
||||
* @type: the type of the event (%NIMF_EVENT_KEY_PRESS or
|
||||
* %NIMF_EVENT_KEY_RELEASE).
|
||||
* @state: (type NimfModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #NimfModifierType.
|
||||
* @keyval: the key that was pressed or released. See the
|
||||
* `nimf-key-syms.h` header file for a complete list of Nimf key codes.
|
||||
* @hardware_keycode: the raw code of the key that was pressed or released.
|
||||
*
|
||||
* Describes a key press or key release event.
|
||||
*/
|
||||
struct _NimfEventKey
|
||||
{
|
||||
NimfEventType type;
|
||||
guint32 state;
|
||||
guint32 keyval;
|
||||
guint32 hardware_keycode;
|
||||
};
|
||||
|
||||
/**
|
||||
* NimfEvent:
|
||||
* @type: a #NimfEventType
|
||||
* @key: a #NimfEventKey
|
||||
*
|
||||
* A #NimfEvent contains a union.
|
||||
*/
|
||||
union _NimfEvent
|
||||
{
|
||||
NimfEventType type;
|
||||
NimfEventKey key;
|
||||
};
|
||||
|
||||
NimfEvent *nimf_event_new (NimfEventType type);
|
||||
void nimf_event_free (NimfEvent *event);
|
||||
gboolean nimf_event_matches (NimfEvent *event,
|
||||
const NimfKey **keys);
|
||||
guint nimf_event_keycode_to_qwerty_keyval (const NimfEvent *event);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_EVENTS_H__ */
|
||||
861
Telegram/ThirdParty/nimf/libnimf/nimf-im.c
vendored
Normal file
@@ -0,0 +1,861 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-im.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-im.h"
|
||||
#include <string.h>
|
||||
#include "nimf-marshalers-private.h"
|
||||
#include "nimf-message-private.h"
|
||||
#include <errno.h>
|
||||
#include <glib/gstdio.h>
|
||||
#include <gio/gunixsocketaddress.h>
|
||||
#include "nimf-utils.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
enum {
|
||||
PREEDIT_START,
|
||||
PREEDIT_END,
|
||||
PREEDIT_CHANGED,
|
||||
COMMIT,
|
||||
RETRIEVE_SURROUNDING,
|
||||
DELETE_SURROUNDING,
|
||||
BEEP,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint im_signals[LAST_SIGNAL] = { 0 };
|
||||
static GMainContext *nimf_im_context = NULL;
|
||||
static GSource *nimf_im_socket_source = NULL;
|
||||
static GSource *nimf_im_default_source = NULL;
|
||||
static GHashTable *nimf_im_table = NULL;
|
||||
static NimfResult *nimf_im_result = NULL;
|
||||
static GSocket *nimf_im_socket = NULL;
|
||||
static gchar *nimf_im_socket_path = NULL;
|
||||
|
||||
struct _NimfIMPrivate
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
gchar *preedit_string;
|
||||
NimfPreeditAttr **preedit_attrs;
|
||||
gint cursor_pos;
|
||||
|
||||
guint16 id;
|
||||
GFileMonitor *monitor;
|
||||
uid_t uid;
|
||||
gboolean created;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (NimfIM, nimf_im, G_TYPE_OBJECT);
|
||||
|
||||
static uid_t
|
||||
get_login_uid (void)
|
||||
{
|
||||
gchar *nptr;
|
||||
gsize length;
|
||||
uid_t uid;
|
||||
|
||||
if (!g_file_get_contents ("/proc/self/loginuid", &nptr, &length, NULL))
|
||||
return -1;
|
||||
|
||||
errno = 0;
|
||||
uid = strtol (nptr, NULL, 10);
|
||||
|
||||
if (errno)
|
||||
return -1;
|
||||
else
|
||||
return uid;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nimf_im_is_connected ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return nimf_im_socket && g_socket_is_connected (nimf_im_socket);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_incoming_message (GSocket *socket,
|
||||
GIOCondition condition,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: socket fd:%d", G_STRFUNC, g_socket_get_fd (socket));
|
||||
|
||||
nimf_message_unref (nimf_im_result->reply);
|
||||
nimf_im_result->is_dispatched = TRUE;
|
||||
|
||||
if (condition & (G_IO_HUP | G_IO_ERR))
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: G_IO_HUP | G_IO_ERR", G_STRFUNC);
|
||||
/* Because two GSource is created over one socket,
|
||||
* when G_IO_HUP | G_IO_ERR, callback can run two times.
|
||||
* the following code avoid that callback runs two times. */
|
||||
GSource *source = g_main_current_source ();
|
||||
|
||||
if (source == nimf_im_default_source)
|
||||
g_source_destroy (nimf_im_socket_source);
|
||||
else if (source == nimf_im_socket_source)
|
||||
g_source_destroy (nimf_im_default_source);
|
||||
|
||||
if (!g_socket_is_closed (socket))
|
||||
g_socket_close (socket, NULL);
|
||||
|
||||
nimf_im_result->reply = NULL;
|
||||
|
||||
gpointer im;
|
||||
GHashTableIter iter;
|
||||
|
||||
g_hash_table_iter_init (&iter, nimf_im_table);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, &im))
|
||||
NIMF_IM (im)->priv->created = FALSE;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
NimfMessage *message;
|
||||
message = nimf_recv_message (socket);
|
||||
nimf_im_result->reply = message;
|
||||
gboolean retval;
|
||||
|
||||
if (G_UNLIKELY (message == NULL))
|
||||
{
|
||||
g_debug (G_STRLOC ": NULL message");
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
NimfIM *im;
|
||||
im = g_hash_table_lookup (nimf_im_table,
|
||||
GUINT_TO_POINTER (message->header->icid));
|
||||
|
||||
switch (message->header->type)
|
||||
{
|
||||
/* signals */
|
||||
case NIMF_MESSAGE_PREEDIT_START:
|
||||
g_signal_emit (im, im_signals[PREEDIT_START], 0);
|
||||
nimf_send_message (socket, im->priv->id, NIMF_MESSAGE_PREEDIT_START_REPLY,
|
||||
NULL, 0, NULL);
|
||||
break;
|
||||
case NIMF_MESSAGE_PREEDIT_END:
|
||||
g_signal_emit (im, im_signals[PREEDIT_END], 0);
|
||||
nimf_send_message (socket, im->priv->id, NIMF_MESSAGE_PREEDIT_END_REPLY,
|
||||
NULL, 0, NULL);
|
||||
break;
|
||||
case NIMF_MESSAGE_PREEDIT_CHANGED:
|
||||
{
|
||||
gint i;
|
||||
|
||||
g_free (im->priv->preedit_string);
|
||||
im->priv->preedit_string = g_strndup (message->data,
|
||||
message->header->data_len - 1 - sizeof (gint));
|
||||
|
||||
gint str_len = strlen (message->data);
|
||||
gint n_attr = (message->header->data_len - str_len - 1 - sizeof (gint)) /
|
||||
sizeof (NimfPreeditAttr);
|
||||
|
||||
nimf_preedit_attr_freev (im->priv->preedit_attrs);
|
||||
im->priv->preedit_attrs = g_malloc0_n (n_attr + 1,
|
||||
sizeof (NimfPreeditAttr *));
|
||||
|
||||
for (i = 0; i < n_attr; i++)
|
||||
im->priv->preedit_attrs[i] = g_memdup (message->data + str_len + 1 + i * sizeof (NimfPreeditAttr),
|
||||
sizeof (NimfPreeditAttr));
|
||||
|
||||
im->priv->preedit_attrs[n_attr] = NULL;
|
||||
|
||||
im->priv->cursor_pos = *(gint *) (message->data +
|
||||
message->header->data_len - sizeof (gint));
|
||||
g_signal_emit (im, im_signals[PREEDIT_CHANGED], 0);
|
||||
nimf_send_message (socket, im->priv->id,
|
||||
NIMF_MESSAGE_PREEDIT_CHANGED_REPLY, NULL, 0, NULL);
|
||||
}
|
||||
break;
|
||||
case NIMF_MESSAGE_COMMIT:
|
||||
nimf_message_ref (message);
|
||||
g_signal_emit (im, im_signals[COMMIT], 0, (const gchar *) message->data);
|
||||
nimf_message_unref (message);
|
||||
nimf_send_message (socket, im->priv->id, NIMF_MESSAGE_COMMIT_REPLY,
|
||||
NULL, 0, NULL);
|
||||
break;
|
||||
case NIMF_MESSAGE_RETRIEVE_SURROUNDING:
|
||||
g_signal_emit (im, im_signals[RETRIEVE_SURROUNDING], 0, &retval);
|
||||
nimf_send_message (socket, im->priv->id,
|
||||
NIMF_MESSAGE_RETRIEVE_SURROUNDING_REPLY,
|
||||
&retval, sizeof (gboolean), NULL);
|
||||
break;
|
||||
case NIMF_MESSAGE_DELETE_SURROUNDING:
|
||||
nimf_message_ref (message);
|
||||
g_signal_emit (im, im_signals[DELETE_SURROUNDING], 0,
|
||||
((gint *) message->data)[0],
|
||||
((gint *) message->data)[1], &retval);
|
||||
nimf_message_unref (message);
|
||||
nimf_send_message (socket, im->priv->id,
|
||||
NIMF_MESSAGE_DELETE_SURROUNDING_REPLY,
|
||||
&retval, sizeof (gboolean), NULL);
|
||||
break;
|
||||
case NIMF_MESSAGE_BEEP:
|
||||
g_signal_emit (im, im_signals[BEEP], 0);
|
||||
nimf_send_message (socket, im->priv->id, NIMF_MESSAGE_BEEP_REPLY,
|
||||
NULL, 0, NULL);
|
||||
break;
|
||||
/* reply */
|
||||
case NIMF_MESSAGE_CREATE_CONTEXT_REPLY:
|
||||
case NIMF_MESSAGE_DESTROY_CONTEXT_REPLY:
|
||||
case NIMF_MESSAGE_FILTER_EVENT_REPLY:
|
||||
case NIMF_MESSAGE_RESET_REPLY:
|
||||
case NIMF_MESSAGE_FOCUS_IN_REPLY:
|
||||
case NIMF_MESSAGE_FOCUS_OUT_REPLY:
|
||||
case NIMF_MESSAGE_SET_SURROUNDING_REPLY:
|
||||
case NIMF_MESSAGE_SET_CURSOR_LOCATION_REPLY:
|
||||
case NIMF_MESSAGE_SET_USE_PREEDIT_REPLY:
|
||||
break;
|
||||
default:
|
||||
g_debug (G_STRLOC ": %s: Unknown message type: %d",
|
||||
G_STRFUNC, message->header->type);
|
||||
break;
|
||||
}
|
||||
|
||||
return G_SOURCE_CONTINUE;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_im_connect (NimfIM *im)
|
||||
{
|
||||
GMutex mutex;
|
||||
|
||||
g_mutex_init (&mutex);
|
||||
g_mutex_lock (&mutex);
|
||||
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (!nimf_im_is_connected ())
|
||||
{
|
||||
GSocketAddress *address;
|
||||
GStatBuf info;
|
||||
gint retry_limit = 4;
|
||||
gint retry_count = 0;
|
||||
GError *error = NULL;
|
||||
|
||||
if (nimf_im_socket)
|
||||
{
|
||||
if (nimf_im_socket_source)
|
||||
{
|
||||
g_source_destroy (nimf_im_socket_source);
|
||||
g_source_unref (nimf_im_socket_source);
|
||||
nimf_im_socket_source = NULL;
|
||||
}
|
||||
|
||||
if (nimf_im_default_source)
|
||||
{
|
||||
g_source_destroy (nimf_im_default_source);
|
||||
g_source_unref (nimf_im_default_source);
|
||||
nimf_im_default_source = NULL;
|
||||
}
|
||||
|
||||
g_object_unref (nimf_im_socket);
|
||||
nimf_im_socket = NULL;
|
||||
}
|
||||
|
||||
nimf_im_socket = g_socket_new (G_SOCKET_FAMILY_UNIX, G_SOCKET_TYPE_STREAM,
|
||||
G_SOCKET_PROTOCOL_DEFAULT, NULL);
|
||||
address = g_unix_socket_address_new_with_type (nimf_im_socket_path, -1,
|
||||
G_UNIX_SOCKET_ADDRESS_PATH);
|
||||
|
||||
for (retry_count = 0; retry_count < retry_limit; retry_count++)
|
||||
{
|
||||
if (g_stat (nimf_im_socket_path, &info) == 0)
|
||||
{
|
||||
if (im->priv->uid == info.st_uid)
|
||||
{
|
||||
if (g_socket_connect (nimf_im_socket, address, NULL, &error))
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: %s", G_STRFUNC, error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: Can't authenticate", G_STRFUNC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_debug ("Trying to execute nimf");
|
||||
|
||||
if (!g_spawn_command_line_sync ("nimf", NULL, NULL, NULL, &error))
|
||||
{
|
||||
g_debug ("Couldn't execute 'nimf': %s", error->message);
|
||||
g_clear_error (&error);
|
||||
break;
|
||||
}
|
||||
|
||||
g_debug ("Waiting for 1 sec");
|
||||
g_usleep (G_USEC_PER_SEC);
|
||||
}
|
||||
|
||||
g_object_unref (address);
|
||||
|
||||
if (nimf_im_is_connected ())
|
||||
{
|
||||
/* when g_main_context_iteration(), iterate only socket */
|
||||
nimf_im_socket_source = g_socket_create_source (nimf_im_socket, G_IO_IN, NULL);
|
||||
g_source_set_can_recurse (nimf_im_socket_source, TRUE);
|
||||
g_source_set_callback (nimf_im_socket_source,
|
||||
(GSourceFunc) on_incoming_message, NULL, NULL);
|
||||
g_source_attach (nimf_im_socket_source, nimf_im_context);
|
||||
|
||||
nimf_im_default_source = g_socket_create_source (nimf_im_socket, G_IO_IN, NULL);
|
||||
g_source_set_can_recurse (nimf_im_default_source, TRUE);
|
||||
g_source_set_callback (nimf_im_default_source,
|
||||
(GSourceFunc) on_incoming_message, NULL, NULL);
|
||||
g_source_attach (nimf_im_default_source, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: Couldn't connect to nimf server", G_STRFUNC);
|
||||
}
|
||||
}
|
||||
|
||||
g_mutex_unlock (&mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_im_create_context (NimfIM *im)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id,
|
||||
NIMF_MESSAGE_CREATE_CONTEXT, NULL, 0, NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_CREATE_CONTEXT_REPLY);
|
||||
im->priv->created = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_changed (GFileMonitor *monitor,
|
||||
GFile *file,
|
||||
GFile *other_file,
|
||||
GFileMonitorEvent event_type,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfIM *im = user_data;
|
||||
|
||||
if (event_type == G_FILE_MONITOR_EVENT_CREATED)
|
||||
{
|
||||
if (!nimf_im_is_connected ())
|
||||
nimf_im_connect (im);
|
||||
|
||||
if (nimf_im_is_connected () && !im->priv->created)
|
||||
nimf_im_create_context (im);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_focus_out:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* Notifies the input method that the caller has lost focus.
|
||||
*/
|
||||
void
|
||||
nimf_im_focus_out (NimfIM *im)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im) || !nimf_im_is_connected ())
|
||||
return;
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id, NIMF_MESSAGE_FOCUS_OUT,
|
||||
NULL, 0, NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_FOCUS_OUT_REPLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_set_cursor_location:
|
||||
* @im: a #NimfIM
|
||||
* @area: new location
|
||||
*
|
||||
* Notifies the input method that a change in cursor position has been made. The
|
||||
* location is the position of a window position in root window coordinates.
|
||||
*/
|
||||
void
|
||||
nimf_im_set_cursor_location (NimfIM *im,
|
||||
const NimfRectangle *area)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im) || !nimf_im_is_connected ())
|
||||
return;
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id,
|
||||
NIMF_MESSAGE_SET_CURSOR_LOCATION,
|
||||
(gchar *) area, sizeof (NimfRectangle), NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_SET_CURSOR_LOCATION_REPLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_set_use_preedit:
|
||||
* @im: a #NimfIM
|
||||
* @use_preedit: whether the input method should use an on-the-spot input style
|
||||
*
|
||||
* If @use_preedit is %FALSE (default is %TRUE), then the input method may use
|
||||
* some other input styles, such as over-the-spot, off-the-spot or root-window.
|
||||
*/
|
||||
void
|
||||
nimf_im_set_use_preedit (NimfIM *im,
|
||||
gboolean use_preedit)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im) || !nimf_im_is_connected ())
|
||||
return;
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id,
|
||||
NIMF_MESSAGE_SET_USE_PREEDIT,
|
||||
(gchar *) &use_preedit, sizeof (gboolean), NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_SET_USE_PREEDIT_REPLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_set_surrounding:
|
||||
* @im: a #NimfIM
|
||||
* @text: surrounding text
|
||||
* @len: the byte length of @text, or -1 if @text is nul-terminated.
|
||||
* @cursor_index: the character index of the cursor within @text.
|
||||
*
|
||||
* Sets surrounding text to input method. This function is expected to be
|
||||
* called in response to NimfIM::retrieve-surrounding which is emitted by
|
||||
* nimf_engine_emit_retrieve_surrounding().
|
||||
*/
|
||||
void
|
||||
nimf_im_set_surrounding (NimfIM *im,
|
||||
const char *text,
|
||||
gint len,
|
||||
gint cursor_index)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im) || !nimf_im_is_connected ())
|
||||
return;
|
||||
|
||||
gchar *data = NULL;
|
||||
gint str_len;
|
||||
|
||||
if (len == -1)
|
||||
str_len = strlen (text);
|
||||
else
|
||||
str_len = len;
|
||||
|
||||
data = g_strndup (text, str_len);
|
||||
data = g_realloc (data, str_len + 1 + 2 * sizeof (gint));
|
||||
|
||||
*(gint *) (data + str_len + 1) = len;
|
||||
*(gint *) (data + str_len + 1 + sizeof (gint)) = cursor_index;
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id,
|
||||
NIMF_MESSAGE_SET_SURROUNDING,
|
||||
data, str_len + 1 + 2 * sizeof (gint), g_free);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_SET_SURROUNDING_REPLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_focus_in:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* Notifies the input method that the caller has gained focus.
|
||||
*/
|
||||
void
|
||||
nimf_im_focus_in (NimfIM *im)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im) || !nimf_im_is_connected ())
|
||||
return;
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id,
|
||||
NIMF_MESSAGE_FOCUS_IN, NULL, 0, NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_FOCUS_IN_REPLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_get_preedit_string:
|
||||
* @im: a #NimfIM
|
||||
* @str: (out) (transfer full): location to store the retrieved
|
||||
* string. The string retrieved must be freed with g_free().
|
||||
* @attrs: (out) (transfer full): location to store the retrieved
|
||||
* attribute array. When you are done with this array, you
|
||||
* must free it with nimf_preedit_attr_freev().
|
||||
* @cursor_pos: (out) (transfer full): location to store position of cursor (in
|
||||
* characters) within the preedit string.
|
||||
*
|
||||
* Retrieve the current preedit string, an array of attributes to apply to the
|
||||
* string and position of cursor within the preedit string from the input
|
||||
* method.
|
||||
*/
|
||||
void
|
||||
nimf_im_get_preedit_string (NimfIM *im,
|
||||
gchar **str,
|
||||
NimfPreeditAttr ***attrs,
|
||||
gint *cursor_pos)
|
||||
{
|
||||
g_debug (G_STRLOC ":%s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im))
|
||||
return;
|
||||
|
||||
if (str)
|
||||
*str = g_strdup (im->priv->preedit_string);
|
||||
|
||||
if (attrs)
|
||||
*attrs = nimf_preedit_attrs_copy (im->priv->preedit_attrs);
|
||||
|
||||
if (cursor_pos)
|
||||
*cursor_pos = im->priv->cursor_pos;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_reset:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* Reset the input method.
|
||||
*/
|
||||
void
|
||||
nimf_im_reset (NimfIM *im)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im) || !nimf_im_is_connected ())
|
||||
return;
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id,
|
||||
NIMF_MESSAGE_RESET, NULL, 0, NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_RESET_REPLY);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_filter_event:
|
||||
* @im: a #NimfIM
|
||||
* @event: a #NimfEvent
|
||||
*
|
||||
* Let the input method handle the @event.
|
||||
*
|
||||
* Returns: %TRUE if the input method handled the @event.
|
||||
*/
|
||||
gboolean
|
||||
nimf_im_filter_event (NimfIM *im,
|
||||
NimfEvent *event)
|
||||
{
|
||||
g_debug (G_STRLOC ":%s", G_STRFUNC);
|
||||
|
||||
if (!NIMF_IS_IM (im) || !nimf_im_is_connected ())
|
||||
return FALSE;
|
||||
|
||||
nimf_send_message (nimf_im_socket, im->priv->id, NIMF_MESSAGE_FILTER_EVENT,
|
||||
event, sizeof (NimfEvent), NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context,
|
||||
im->priv->id, NIMF_MESSAGE_FILTER_EVENT_REPLY);
|
||||
|
||||
if (nimf_im_result->reply &&
|
||||
*(gboolean *) (nimf_im_result->reply->data))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_im_new:
|
||||
*
|
||||
* Creates a new #NimfIM.
|
||||
*
|
||||
* Returns: a new #NimfIM
|
||||
*/
|
||||
NimfIM *
|
||||
nimf_im_new ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_object_new (NIMF_TYPE_IM, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_im_init (NimfIM *im)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
im->priv = nimf_im_get_instance_private (im);
|
||||
|
||||
static guint16 next_id = 0;
|
||||
guint16 id;
|
||||
|
||||
if ((im->priv->uid = get_login_uid ()) == (uid_t) -1)
|
||||
im->priv->uid = getuid ();
|
||||
|
||||
if (!nimf_im_socket_path)
|
||||
nimf_im_socket_path = nimf_get_socket_path ();
|
||||
|
||||
if (nimf_im_context == NULL)
|
||||
nimf_im_context = g_main_context_new ();
|
||||
else
|
||||
g_main_context_ref (nimf_im_context);
|
||||
|
||||
if (nimf_im_result == NULL)
|
||||
nimf_im_result = nimf_result_new ();
|
||||
|
||||
if (nimf_im_table == NULL)
|
||||
nimf_im_table = g_hash_table_new_full (g_direct_hash, g_direct_equal,
|
||||
NULL, NULL);
|
||||
else
|
||||
g_hash_table_ref (nimf_im_table);
|
||||
|
||||
if (im->priv->monitor == NULL)
|
||||
{
|
||||
GFile *file;
|
||||
|
||||
file = g_file_new_for_path (nimf_im_socket_path);
|
||||
im->priv->monitor = g_file_monitor_file (file, G_FILE_MONITOR_NONE, NULL, NULL);
|
||||
g_file_monitor_set_rate_limit (im->priv->monitor, G_PRIORITY_LOW);
|
||||
g_signal_connect (im->priv->monitor, "changed", G_CALLBACK (on_changed), im);
|
||||
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
do {
|
||||
id = next_id++;
|
||||
} while (id == 0 || g_hash_table_contains (nimf_im_table,
|
||||
GUINT_TO_POINTER (id)));
|
||||
|
||||
im->priv->id = id;
|
||||
|
||||
g_hash_table_insert (nimf_im_table, GUINT_TO_POINTER (im->priv->id), im);
|
||||
|
||||
if (!nimf_im_is_connected ())
|
||||
nimf_im_connect (im);
|
||||
|
||||
if (nimf_im_is_connected () && !im->priv->created)
|
||||
nimf_im_create_context (im);
|
||||
|
||||
im->priv->preedit_string = g_strdup ("");
|
||||
im->priv->preedit_attrs = g_malloc0_n (1, sizeof (NimfPreeditAttr *));
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_im_finalize (GObject *object)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfIM *im = NIMF_IM (object);
|
||||
|
||||
if (nimf_im_is_connected () && im->priv->created)
|
||||
{
|
||||
nimf_send_message (nimf_im_socket, im->priv->id,
|
||||
NIMF_MESSAGE_DESTROY_CONTEXT, NULL, 0, NULL);
|
||||
nimf_result_iteration_until (nimf_im_result, nimf_im_context, im->priv->id,
|
||||
NIMF_MESSAGE_DESTROY_CONTEXT_REPLY);
|
||||
}
|
||||
|
||||
g_hash_table_remove (nimf_im_table, GUINT_TO_POINTER (im->priv->id));
|
||||
g_main_context_unref (nimf_im_context);
|
||||
|
||||
if (im->priv->monitor)
|
||||
g_object_unref (im->priv->monitor);
|
||||
|
||||
if (g_hash_table_size (nimf_im_table) == 0)
|
||||
{
|
||||
g_hash_table_unref (nimf_im_table);
|
||||
nimf_result_unref (nimf_im_result);
|
||||
|
||||
if (nimf_im_socket)
|
||||
g_object_unref (nimf_im_socket);
|
||||
|
||||
if (nimf_im_socket_source)
|
||||
g_source_destroy (nimf_im_socket_source);
|
||||
|
||||
if (nimf_im_socket_source)
|
||||
g_source_unref (nimf_im_socket_source);
|
||||
|
||||
if (nimf_im_default_source)
|
||||
g_source_destroy (nimf_im_default_source);
|
||||
|
||||
if (nimf_im_default_source)
|
||||
g_source_unref (nimf_im_default_source);
|
||||
|
||||
g_free (nimf_im_socket_path);
|
||||
|
||||
nimf_im_socket = NULL;
|
||||
nimf_im_socket_source = NULL;
|
||||
nimf_im_default_source = NULL;
|
||||
nimf_im_context = NULL;
|
||||
nimf_im_result = NULL;
|
||||
nimf_im_table = NULL;
|
||||
nimf_im_socket_path = NULL;
|
||||
}
|
||||
|
||||
g_free (im->priv->preedit_string);
|
||||
nimf_preedit_attr_freev (im->priv->preedit_attrs);
|
||||
|
||||
G_OBJECT_CLASS (nimf_im_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_im_class_init (NimfIMClass *klass)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = nimf_im_finalize;
|
||||
|
||||
/**
|
||||
* NimfIM::preedit-start:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* The #NimfIM::preedit-start signal is emitted when a new preediting
|
||||
* sequence starts.
|
||||
*/
|
||||
im_signals[PREEDIT_START] =
|
||||
g_signal_new (g_intern_static_string ("preedit-start"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfIMClass, preedit_start),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* NimfIM::preedit-end:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* The #NimfIM::preedit-end signal is emitted when a preediting sequence has
|
||||
* been completed or canceled.
|
||||
*/
|
||||
im_signals[PREEDIT_END] =
|
||||
g_signal_new (g_intern_static_string ("preedit-end"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfIMClass, preedit_end),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* NimfIM::preedit-changed:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* The #NimfIM::preedit-changed signal is emitted whenever the preedit
|
||||
* sequence has been changed.
|
||||
*/
|
||||
im_signals[PREEDIT_CHANGED] =
|
||||
g_signal_new (g_intern_static_string ("preedit-changed"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfIMClass, preedit_changed),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* NimfIM::commit:
|
||||
* @im: a #NimfIM
|
||||
* @text: text to commit
|
||||
*
|
||||
* The #NimfIM::commit signal is emitted when a complete input sequence has
|
||||
* been entered by the user.
|
||||
*/
|
||||
im_signals[COMMIT] =
|
||||
g_signal_new (g_intern_static_string ("commit"),
|
||||
G_OBJECT_CLASS_TYPE (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfIMClass, commit),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__STRING,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_STRING);
|
||||
|
||||
/**
|
||||
* NimfIM::retrieve-surrounding:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* The #NimfIM::retrieve-surrounding signal is emitted when the input method
|
||||
* requires the text surrounding the cursor. The callback should set the
|
||||
* input method surrounding text by calling the nimf_im_set_surrounding()
|
||||
* method.
|
||||
*
|
||||
* Returns: %TRUE if the signal was handled.
|
||||
*/
|
||||
im_signals[RETRIEVE_SURROUNDING] =
|
||||
g_signal_new (g_intern_static_string ("retrieve-surrounding"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfIMClass, retrieve_surrounding),
|
||||
g_signal_accumulator_true_handled, NULL,
|
||||
nimf_cclosure_marshal_BOOLEAN__VOID,
|
||||
G_TYPE_BOOLEAN, 0);
|
||||
|
||||
/**
|
||||
* NimfIM::delete-surrounding:
|
||||
* @im: a #NimfIM
|
||||
* @offset: the character offset from the cursor position of the text to be
|
||||
* deleted. A negative value indicates a position before the cursor.
|
||||
* @n_chars: the number of characters to be deleted
|
||||
*
|
||||
* The #NimfIM::delete-surrounding signal is emitted when the input method
|
||||
* needs to delete all or part of the text surrounding the cursor.
|
||||
*
|
||||
* Returns: %TRUE if the signal was handled.
|
||||
*/
|
||||
im_signals[DELETE_SURROUNDING] =
|
||||
g_signal_new (g_intern_static_string ("delete-surrounding"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfIMClass, delete_surrounding),
|
||||
g_signal_accumulator_true_handled, NULL,
|
||||
nimf_cclosure_marshal_BOOLEAN__INT_INT,
|
||||
G_TYPE_BOOLEAN, 2,
|
||||
G_TYPE_INT,
|
||||
G_TYPE_INT);
|
||||
|
||||
/**
|
||||
* NimfIM::beep:
|
||||
* @im: a #NimfIM
|
||||
*
|
||||
* The #NimfIM::beep signal is emitted when the input method needs to beep,
|
||||
* if supported.
|
||||
*/
|
||||
im_signals[BEEP] =
|
||||
g_signal_new (g_intern_static_string ("beep"),
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfIMClass, beep),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
91
Telegram/ThirdParty/nimf/libnimf/nimf-im.h
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-im.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_IM_H__
|
||||
#define __NIMF_IM_H__
|
||||
|
||||
#if !defined (__NIMF_H_INSIDE__) && !defined (NIMF_COMPILATION)
|
||||
#error "Only <nimf.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nimf-events.h"
|
||||
#include "nimf-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_IM (nimf_im_get_type ())
|
||||
#define NIMF_IM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_TYPE_IM, NimfIM))
|
||||
#define NIMF_IM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NIMF_TYPE_IM, NimfIMClass))
|
||||
#define NIMF_IS_IM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NIMF_TYPE_IM))
|
||||
#define NIMF_IM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NIMF_TYPE_IM, NimfIMClass))
|
||||
|
||||
typedef struct _NimfIM NimfIM;
|
||||
typedef struct _NimfIMClass NimfIMClass;
|
||||
typedef struct _NimfIMPrivate NimfIMPrivate;
|
||||
|
||||
struct _NimfIM
|
||||
{
|
||||
GObject parent_instance;
|
||||
NimfIMPrivate *priv;
|
||||
};
|
||||
|
||||
struct _NimfIMClass
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Signals */
|
||||
void (*preedit_start) (NimfIM *im);
|
||||
void (*preedit_end) (NimfIM *im);
|
||||
void (*preedit_changed) (NimfIM *im);
|
||||
void (*commit) (NimfIM *im, const gchar *text);
|
||||
gboolean (*retrieve_surrounding) (NimfIM *im);
|
||||
gboolean (*delete_surrounding) (NimfIM *im,
|
||||
gint offset,
|
||||
gint n_chars);
|
||||
void (*beep) (NimfIM *im);
|
||||
};
|
||||
|
||||
GType nimf_im_get_type (void) G_GNUC_CONST;
|
||||
NimfIM *nimf_im_new (void);
|
||||
void nimf_im_focus_in (NimfIM *im);
|
||||
void nimf_im_focus_out (NimfIM *im);
|
||||
void nimf_im_reset (NimfIM *im);
|
||||
gboolean nimf_im_filter_event (NimfIM *im,
|
||||
NimfEvent *event);
|
||||
void nimf_im_get_preedit_string (NimfIM *im,
|
||||
gchar **str,
|
||||
NimfPreeditAttr ***attrs,
|
||||
gint *cursor_pos);
|
||||
void nimf_im_set_cursor_location (NimfIM *im,
|
||||
const NimfRectangle *area);
|
||||
void nimf_im_set_use_preedit (NimfIM *im,
|
||||
gboolean use_preedit);
|
||||
void nimf_im_set_surrounding (NimfIM *im,
|
||||
const char *text,
|
||||
gint len,
|
||||
gint cursor_index);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_IM_H__ */
|
||||
418
Telegram/ThirdParty/nimf/libnimf/nimf-key-syms.h
vendored
Normal file
@@ -0,0 +1,418 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-key-syms.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_KEY_SYMS_H__
|
||||
#define __NIMF_KEY_SYMS_H__
|
||||
|
||||
#if !defined (__NIMF_H_INSIDE__) && !defined (NIMF_COMPILATION)
|
||||
#error "Only <nimf.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* SECTION:nimf-key-syms
|
||||
* @title: Key symbols
|
||||
* @section_id: nimf-key-syms
|
||||
*/
|
||||
|
||||
/**
|
||||
* NimfKeySym:
|
||||
* @NIMF_KEY_space: space
|
||||
* @NIMF_KEY_exclam: exclam
|
||||
* @NIMF_KEY_quotedbl: quotedbl
|
||||
* @NIMF_KEY_numbersign: numbersign
|
||||
* @NIMF_KEY_dollar: dollar
|
||||
* @NIMF_KEY_percent: percent
|
||||
* @NIMF_KEY_ampersand: ampersand
|
||||
* @NIMF_KEY_apostrophe: apostrophe
|
||||
* @NIMF_KEY_parenleft: parenleft
|
||||
* @NIMF_KEY_parenright: parenright
|
||||
* @NIMF_KEY_asterisk: asterisk
|
||||
* @NIMF_KEY_plus: plus
|
||||
* @NIMF_KEY_comma: comma
|
||||
* @NIMF_KEY_minus: minus
|
||||
* @NIMF_KEY_period: period
|
||||
* @NIMF_KEY_slash: slash
|
||||
* @NIMF_KEY_0: 0
|
||||
* @NIMF_KEY_1: 1
|
||||
* @NIMF_KEY_2: 2
|
||||
* @NIMF_KEY_3: 3
|
||||
* @NIMF_KEY_4: 4
|
||||
* @NIMF_KEY_5: 5
|
||||
* @NIMF_KEY_6: 6
|
||||
* @NIMF_KEY_7: 7
|
||||
* @NIMF_KEY_8: 8
|
||||
* @NIMF_KEY_9: 9
|
||||
* @NIMF_KEY_colon: colon
|
||||
* @NIMF_KEY_semicolon: semicolon
|
||||
* @NIMF_KEY_less: less
|
||||
* @NIMF_KEY_equal: equal
|
||||
* @NIMF_KEY_greater: greater
|
||||
* @NIMF_KEY_question: question
|
||||
* @NIMF_KEY_at: at
|
||||
* @NIMF_KEY_A: A
|
||||
* @NIMF_KEY_B: B
|
||||
* @NIMF_KEY_C: C
|
||||
* @NIMF_KEY_D: D
|
||||
* @NIMF_KEY_E: E
|
||||
* @NIMF_KEY_F: F
|
||||
* @NIMF_KEY_G: G
|
||||
* @NIMF_KEY_H: H
|
||||
* @NIMF_KEY_I: I
|
||||
* @NIMF_KEY_J: J
|
||||
* @NIMF_KEY_K: K
|
||||
* @NIMF_KEY_L: L
|
||||
* @NIMF_KEY_M: M
|
||||
* @NIMF_KEY_N: N
|
||||
* @NIMF_KEY_O: O
|
||||
* @NIMF_KEY_P: P
|
||||
* @NIMF_KEY_Q: Q
|
||||
* @NIMF_KEY_R: R
|
||||
* @NIMF_KEY_S: S
|
||||
* @NIMF_KEY_T: T
|
||||
* @NIMF_KEY_U: U
|
||||
* @NIMF_KEY_V: V
|
||||
* @NIMF_KEY_W: W
|
||||
* @NIMF_KEY_X: X
|
||||
* @NIMF_KEY_Y: Y
|
||||
* @NIMF_KEY_Z: Z
|
||||
* @NIMF_KEY_bracketleft: bracketleft
|
||||
* @NIMF_KEY_backslash: backslash
|
||||
* @NIMF_KEY_bracketright: bracketright
|
||||
* @NIMF_KEY_asciicircum: asciicircum
|
||||
* @NIMF_KEY_underscore: underscore
|
||||
* @NIMF_KEY_grave: grave
|
||||
* @NIMF_KEY_a: a
|
||||
* @NIMF_KEY_b: b
|
||||
* @NIMF_KEY_c: c
|
||||
* @NIMF_KEY_d: d
|
||||
* @NIMF_KEY_e: e
|
||||
* @NIMF_KEY_f: f
|
||||
* @NIMF_KEY_g: g
|
||||
* @NIMF_KEY_h: h
|
||||
* @NIMF_KEY_i: i
|
||||
* @NIMF_KEY_j: j
|
||||
* @NIMF_KEY_k: k
|
||||
* @NIMF_KEY_l: l
|
||||
* @NIMF_KEY_m: m
|
||||
* @NIMF_KEY_n: n
|
||||
* @NIMF_KEY_o: o
|
||||
* @NIMF_KEY_p: p
|
||||
* @NIMF_KEY_q: q
|
||||
* @NIMF_KEY_r: r
|
||||
* @NIMF_KEY_s: s
|
||||
* @NIMF_KEY_t: t
|
||||
* @NIMF_KEY_u: u
|
||||
* @NIMF_KEY_v: v
|
||||
* @NIMF_KEY_w: w
|
||||
* @NIMF_KEY_x: x
|
||||
* @NIMF_KEY_y: y
|
||||
* @NIMF_KEY_z: z
|
||||
* @NIMF_KEY_braceleft: braceleft
|
||||
* @NIMF_KEY_bar: bar
|
||||
* @NIMF_KEY_braceright: braceright
|
||||
* @NIMF_KEY_asciitilde: asciitilde
|
||||
* @NIMF_KEY_ISO_Level3_Shift: ISO_Level3_Shift
|
||||
* @NIMF_KEY_ISO_Left_Tab: ISO_Left_Tab
|
||||
* @NIMF_KEY_BackSpace: BackSpace
|
||||
* @NIMF_KEY_Tab: Tab
|
||||
* @NIMF_KEY_Return: Return
|
||||
* @NIMF_KEY_Pause: Pause
|
||||
* @NIMF_KEY_Scroll_Lock: Scroll_Lock
|
||||
* @NIMF_KEY_Sys_Req: Sys_Req
|
||||
* @NIMF_KEY_Escape: Escape
|
||||
* @NIMF_KEY_Multi_key: Multi_key
|
||||
* @NIMF_KEY_Kanji: Kanji
|
||||
* @NIMF_KEY_Kana_Shift: Kana_Shift
|
||||
* @NIMF_KEY_Hangul: Hangul
|
||||
* @NIMF_KEY_Hangul_Hanja: Hangul_Hanja
|
||||
* @NIMF_KEY_Home: Home
|
||||
* @NIMF_KEY_Left: Left
|
||||
* @NIMF_KEY_Up: Up
|
||||
* @NIMF_KEY_Right: Right
|
||||
* @NIMF_KEY_Down: Down
|
||||
* @NIMF_KEY_Page_Up: Page_Up
|
||||
* @NIMF_KEY_Page_Down: Page_Down
|
||||
* @NIMF_KEY_End: End
|
||||
* @NIMF_KEY_Print: Print
|
||||
* @NIMF_KEY_Execute: Execut
|
||||
* @NIMF_KEY_Insert: Insert
|
||||
* @NIMF_KEY_Menu: Menu
|
||||
* @NIMF_KEY_Break: Break
|
||||
* @NIMF_KEY_KP_Enter: KP_Enter
|
||||
* @NIMF_KEY_KP_Left: KP_Left
|
||||
* @NIMF_KEY_KP_Up: KP_Up
|
||||
* @NIMF_KEY_KP_Right: KP_Right
|
||||
* @NIMF_KEY_KP_Down: KP_Down
|
||||
* @NIMF_KEY_KP_Page_Up: KP_Page_Up
|
||||
* @NIMF_KEY_KP_Page_Down: KP_Page_Down
|
||||
* @NIMF_KEY_KP_Delete: KP_Delete
|
||||
* @NIMF_KEY_KP_Multiply: KP_Multiply
|
||||
* @NIMF_KEY_KP_Add: KP_Add
|
||||
* @NIMF_KEY_KP_Subtract: KP_Subtract
|
||||
* @NIMF_KEY_KP_Decimal: KP_Decimal
|
||||
* @NIMF_KEY_KP_Divide: KP_Divide
|
||||
* @NIMF_KEY_KP_0: KP_0
|
||||
* @NIMF_KEY_KP_1: KP_1
|
||||
* @NIMF_KEY_KP_2: KP_2
|
||||
* @NIMF_KEY_KP_3: KP_3
|
||||
* @NIMF_KEY_KP_4: KP_4
|
||||
* @NIMF_KEY_KP_5: KP_5
|
||||
* @NIMF_KEY_KP_6: KP_6
|
||||
* @NIMF_KEY_KP_7: KP_7
|
||||
* @NIMF_KEY_KP_8: KP_8
|
||||
* @NIMF_KEY_KP_9: KP_9
|
||||
* @NIMF_KEY_F1: F1
|
||||
* @NIMF_KEY_F2: F2
|
||||
* @NIMF_KEY_F3: F3
|
||||
* @NIMF_KEY_F4: F4
|
||||
* @NIMF_KEY_F5: F5
|
||||
* @NIMF_KEY_F6: F6
|
||||
* @NIMF_KEY_F7: F7
|
||||
* @NIMF_KEY_F8: F8
|
||||
* @NIMF_KEY_F9: F9
|
||||
* @NIMF_KEY_F10: F10
|
||||
* @NIMF_KEY_F11: F11
|
||||
* @NIMF_KEY_F12: F12
|
||||
* @NIMF_KEY_Shift_L: Shift_L
|
||||
* @NIMF_KEY_Shift_R: Shift_R
|
||||
* @NIMF_KEY_Control_L: Control_L
|
||||
* @NIMF_KEY_Control_R: Control_R
|
||||
* @NIMF_KEY_Caps_Lock: Caps_Lock
|
||||
* @NIMF_KEY_Shift_Lock: Shift_Lock
|
||||
* @NIMF_KEY_Meta_L: Meta_L
|
||||
* @NIMF_KEY_Meta_R: Meta_R
|
||||
* @NIMF_KEY_Alt_L: Alt_L
|
||||
* @NIMF_KEY_Alt_R: Alt_R
|
||||
* @NIMF_KEY_Super_L: Super_L
|
||||
* @NIMF_KEY_Super_R: Super_R
|
||||
* @NIMF_KEY_Delete: Delete
|
||||
* @NIMF_KEY_VoidSymbol: VoidSymbol
|
||||
* @NIMF_KEY_WakeUp: WakeUp
|
||||
* @NIMF_KEY_WebCam: WebCam
|
||||
* @NIMF_KEY_WLAN: WLAN
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NIMF_KEY_space = 0x020, /*< nick=space >*/
|
||||
NIMF_KEY_exclam = 0x021, /*< nick=exclam >*/
|
||||
NIMF_KEY_quotedbl = 0x022, /*< nick=quotedbl >*/
|
||||
NIMF_KEY_numbersign = 0x023, /*< nick=numbersign >*/
|
||||
NIMF_KEY_dollar = 0x024, /*< nick=dollar >*/
|
||||
NIMF_KEY_percent = 0x025, /*< nick=percent >*/
|
||||
NIMF_KEY_ampersand = 0x026, /*< nick=ampersand >*/
|
||||
NIMF_KEY_apostrophe = 0x027, /*< nick=apostrophe >*/
|
||||
NIMF_KEY_parenleft = 0x028, /*< nick=parenleft >*/
|
||||
NIMF_KEY_parenright = 0x029, /*< nick=parenright >*/
|
||||
NIMF_KEY_asterisk = 0x02a, /*< nick=asterisk >*/
|
||||
NIMF_KEY_plus = 0x02b, /*< nick=plus >*/
|
||||
NIMF_KEY_comma = 0x02c, /*< nick=comma >*/
|
||||
NIMF_KEY_minus = 0x02d, /*< nick=minus >*/
|
||||
NIMF_KEY_period = 0x02e, /*< nick=period >*/
|
||||
NIMF_KEY_slash = 0x02f, /*< nick=slash >*/
|
||||
NIMF_KEY_0 = 0x030, /*< nick=0 >*/
|
||||
NIMF_KEY_1 = 0x031, /*< nick=1 >*/
|
||||
NIMF_KEY_2 = 0x032, /*< nick=2 >*/
|
||||
NIMF_KEY_3 = 0x033, /*< nick=3 >*/
|
||||
NIMF_KEY_4 = 0x034, /*< nick=4 >*/
|
||||
NIMF_KEY_5 = 0x035, /*< nick=5 >*/
|
||||
NIMF_KEY_6 = 0x036, /*< nick=6 >*/
|
||||
NIMF_KEY_7 = 0x037, /*< nick=7 >*/
|
||||
NIMF_KEY_8 = 0x038, /*< nick=8 >*/
|
||||
NIMF_KEY_9 = 0x039, /*< nick=9 >*/
|
||||
NIMF_KEY_colon = 0x03a, /*< nick=colon >*/
|
||||
NIMF_KEY_semicolon = 0x03b, /*< nick=semicolon >*/
|
||||
NIMF_KEY_less = 0x03c, /*< nick=less >*/
|
||||
NIMF_KEY_equal = 0x03d, /*< nick=equal >*/
|
||||
NIMF_KEY_greater = 0x03e, /*< nick=greater >*/
|
||||
NIMF_KEY_question = 0x03f, /*< nick=question >*/
|
||||
NIMF_KEY_at = 0x040, /*< nick=at >*/
|
||||
NIMF_KEY_A = 0x041, /*< nick=A >*/
|
||||
NIMF_KEY_B = 0x042, /*< nick=B >*/
|
||||
NIMF_KEY_C = 0x043, /*< nick=C >*/
|
||||
NIMF_KEY_D = 0x044, /*< nick=D >*/
|
||||
NIMF_KEY_E = 0x045, /*< nick=E >*/
|
||||
NIMF_KEY_F = 0x046, /*< nick=F >*/
|
||||
NIMF_KEY_G = 0x047, /*< nick=G >*/
|
||||
NIMF_KEY_H = 0x048, /*< nick=H >*/
|
||||
NIMF_KEY_I = 0x049, /*< nick=I >*/
|
||||
NIMF_KEY_J = 0x04a, /*< nick=J >*/
|
||||
NIMF_KEY_K = 0x04b, /*< nick=K >*/
|
||||
NIMF_KEY_L = 0x04c, /*< nick=L >*/
|
||||
NIMF_KEY_M = 0x04d, /*< nick=M >*/
|
||||
NIMF_KEY_N = 0x04e, /*< nick=N >*/
|
||||
NIMF_KEY_O = 0x04f, /*< nick=O >*/
|
||||
NIMF_KEY_P = 0x050, /*< nick=P >*/
|
||||
NIMF_KEY_Q = 0x051, /*< nick=Q >*/
|
||||
NIMF_KEY_R = 0x052, /*< nick=R >*/
|
||||
NIMF_KEY_S = 0x053, /*< nick=S >*/
|
||||
NIMF_KEY_T = 0x054, /*< nick=T >*/
|
||||
NIMF_KEY_U = 0x055, /*< nick=U >*/
|
||||
NIMF_KEY_V = 0x056, /*< nick=V >*/
|
||||
NIMF_KEY_W = 0x057, /*< nick=W >*/
|
||||
NIMF_KEY_X = 0x058, /*< nick=X >*/
|
||||
NIMF_KEY_Y = 0x059, /*< nick=Y >*/
|
||||
NIMF_KEY_Z = 0x05a, /*< nick=Z >*/
|
||||
NIMF_KEY_bracketleft = 0x05b, /*< nick=bracketleft >*/
|
||||
NIMF_KEY_backslash = 0x05c, /*< nick=backslash >*/
|
||||
NIMF_KEY_bracketright = 0x05d, /*< nick=bracketright >*/
|
||||
NIMF_KEY_asciicircum = 0x05e, /*< nick=asciicircum >*/
|
||||
NIMF_KEY_underscore = 0x05f, /*< nick=underscore >*/
|
||||
NIMF_KEY_grave = 0x060, /*< nick=grave >*/
|
||||
NIMF_KEY_a = 0x061, /*< nick=a >*/
|
||||
NIMF_KEY_b = 0x062, /*< nick=b >*/
|
||||
NIMF_KEY_c = 0x063, /*< nick=c >*/
|
||||
NIMF_KEY_d = 0x064, /*< nick=d >*/
|
||||
NIMF_KEY_e = 0x065, /*< nick=e >*/
|
||||
NIMF_KEY_f = 0x066, /*< nick=f >*/
|
||||
NIMF_KEY_g = 0x067, /*< nick=g >*/
|
||||
NIMF_KEY_h = 0x068, /*< nick=h >*/
|
||||
NIMF_KEY_i = 0x069, /*< nick=i >*/
|
||||
NIMF_KEY_j = 0x06a, /*< nick=j >*/
|
||||
NIMF_KEY_k = 0x06b, /*< nick=k >*/
|
||||
NIMF_KEY_l = 0x06c, /*< nick=l >*/
|
||||
NIMF_KEY_m = 0x06d, /*< nick=m >*/
|
||||
NIMF_KEY_n = 0x06e, /*< nick=n >*/
|
||||
NIMF_KEY_o = 0x06f, /*< nick=o >*/
|
||||
NIMF_KEY_p = 0x070, /*< nick=p >*/
|
||||
NIMF_KEY_q = 0x071, /*< nick=q >*/
|
||||
NIMF_KEY_r = 0x072, /*< nick=r >*/
|
||||
NIMF_KEY_s = 0x073, /*< nick=s >*/
|
||||
NIMF_KEY_t = 0x074, /*< nick=t >*/
|
||||
NIMF_KEY_u = 0x075, /*< nick=u >*/
|
||||
NIMF_KEY_v = 0x076, /*< nick=v >*/
|
||||
NIMF_KEY_w = 0x077, /*< nick=w >*/
|
||||
NIMF_KEY_x = 0x078, /*< nick=x >*/
|
||||
NIMF_KEY_y = 0x079, /*< nick=y >*/
|
||||
NIMF_KEY_z = 0x07a, /*< nick=z >*/
|
||||
NIMF_KEY_braceleft = 0x07b, /*< nick=braceleft >*/
|
||||
NIMF_KEY_bar = 0x07c, /*< nick=bar >*/
|
||||
NIMF_KEY_braceright = 0x07d, /*< nick=braceright >*/
|
||||
NIMF_KEY_asciitilde = 0x07e, /*< nick=asciitilde >*/
|
||||
|
||||
NIMF_KEY_ISO_Level3_Shift = 0xfe03, /*< nick=ISO_Level3_Shift >*/
|
||||
NIMF_KEY_ISO_Left_Tab = 0xfe20, /*< nick=ISO_Left_Tab >*/
|
||||
|
||||
NIMF_KEY_BackSpace = 0xff08, /*< nick=BackSpace >*/
|
||||
NIMF_KEY_Tab = 0xff09, /*< nick=Tab >*/
|
||||
|
||||
NIMF_KEY_Return = 0xff0d, /*< nick=Return >*/
|
||||
|
||||
NIMF_KEY_Pause = 0xff13, /*< nick=Pause >*/
|
||||
NIMF_KEY_Scroll_Lock = 0xff14, /*< nick=Scroll_Lock >*/
|
||||
NIMF_KEY_Sys_Req = 0xff15, /*< nick=Sys_Req >*/
|
||||
|
||||
NIMF_KEY_Escape = 0xff1b, /*< nick=Escape >*/
|
||||
|
||||
NIMF_KEY_Multi_key = 0xff20, /*< nick=Multi_key >*/
|
||||
NIMF_KEY_Kanji = 0xff21, /*< nick=Kanji >*/
|
||||
|
||||
NIMF_KEY_Kana_Shift = 0xff2e, /*< nick=Kana_Shift >*/
|
||||
|
||||
NIMF_KEY_Hangul = 0xff31, /*< nick=Hangul >*/
|
||||
|
||||
NIMF_KEY_Hangul_Hanja = 0xff34, /*< nick=Hangul_Hanja >*/
|
||||
|
||||
NIMF_KEY_Home = 0xff50, /*< nick=Home >*/
|
||||
NIMF_KEY_Left = 0xff51, /*< nick=Left >*/
|
||||
NIMF_KEY_Up = 0xff52, /*< nick=Up >*/
|
||||
NIMF_KEY_Right = 0xff53, /*< nick=Right >*/
|
||||
NIMF_KEY_Down = 0xff54, /*< nick=Down >*/
|
||||
NIMF_KEY_Page_Up = 0xff55, /*< nick=Page_Up >*/
|
||||
NIMF_KEY_Page_Down = 0xff56, /*< nick=Page_Down >*/
|
||||
NIMF_KEY_End = 0xff57, /*< nick=End >*/
|
||||
|
||||
NIMF_KEY_Print = 0xff61, /*< nick=Print >*/
|
||||
NIMF_KEY_Execute = 0xff62, /*< nick=Execut >*/
|
||||
NIMF_KEY_Insert = 0xff63, /*< nick=Insert >*/
|
||||
|
||||
NIMF_KEY_Menu = 0xff67, /*< nick=Menu >*/
|
||||
|
||||
NIMF_KEY_Break = 0xff6b, /*< nick=Break >*/
|
||||
|
||||
NIMF_KEY_KP_Enter = 0xff8d, /*< nick=KP_Enter >*/
|
||||
|
||||
NIMF_KEY_KP_Left = 0xff96, /*< nick=KP_Left >*/
|
||||
NIMF_KEY_KP_Up = 0xff97, /*< nick=KP_Up >*/
|
||||
NIMF_KEY_KP_Right = 0xff98, /*< nick=KP_Right >*/
|
||||
NIMF_KEY_KP_Down = 0xff99, /*< nick=KP_Down >*/
|
||||
NIMF_KEY_KP_Page_Up = 0xff9a, /*< nick=KP_Page_Up >*/
|
||||
NIMF_KEY_KP_Page_Down = 0xff9b, /*< nick=KP_Page_Down >*/
|
||||
|
||||
NIMF_KEY_KP_Delete = 0xff9f, /*< nick=KP_Delete >*/
|
||||
|
||||
NIMF_KEY_KP_Multiply = 0xffaa, /*< nick=KP_Multiply >*/
|
||||
NIMF_KEY_KP_Add = 0xffab, /*< nick=KP_Add >*/
|
||||
|
||||
NIMF_KEY_KP_Subtract = 0xffad, /*< nick=KP_Subtract >*/
|
||||
NIMF_KEY_KP_Decimal = 0xffae, /*< nick=KP_Decimal >*/
|
||||
NIMF_KEY_KP_Divide = 0xffaf, /*< nick=KP_Divide >*/
|
||||
NIMF_KEY_KP_0 = 0xffb0, /*< nick=KP_0 >*/
|
||||
NIMF_KEY_KP_1 = 0xffb1, /*< nick=KP_1 >*/
|
||||
NIMF_KEY_KP_2 = 0xffb2, /*< nick=KP_2 >*/
|
||||
NIMF_KEY_KP_3 = 0xffb3, /*< nick=KP_3 >*/
|
||||
NIMF_KEY_KP_4 = 0xffb4, /*< nick=KP_4 >*/
|
||||
NIMF_KEY_KP_5 = 0xffb5, /*< nick=KP_5 >*/
|
||||
NIMF_KEY_KP_6 = 0xffb6, /*< nick=KP_6 >*/
|
||||
NIMF_KEY_KP_7 = 0xffb7, /*< nick=KP_7 >*/
|
||||
NIMF_KEY_KP_8 = 0xffb8, /*< nick=KP_8 >*/
|
||||
NIMF_KEY_KP_9 = 0xffb9, /*< nick=KP_9 >*/
|
||||
|
||||
NIMF_KEY_F1 = 0xffbe, /*< nick=F1 >*/
|
||||
NIMF_KEY_F2 = 0xffbf, /*< nick=F2 >*/
|
||||
NIMF_KEY_F3 = 0xffc0, /*< nick=F3 >*/
|
||||
NIMF_KEY_F4 = 0xffc1, /*< nick=F4 >*/
|
||||
NIMF_KEY_F5 = 0xffc2, /*< nick=F5 >*/
|
||||
NIMF_KEY_F6 = 0xffc3, /*< nick=F6 >*/
|
||||
NIMF_KEY_F7 = 0xffc4, /*< nick=F7 >*/
|
||||
NIMF_KEY_F8 = 0xffc5, /*< nick=F8 >*/
|
||||
NIMF_KEY_F9 = 0xffc6, /*< nick=F9 >*/
|
||||
NIMF_KEY_F10 = 0xffc7, /*< nick=F10 >*/
|
||||
NIMF_KEY_F11 = 0xffc8, /*< nick=F11 >*/
|
||||
NIMF_KEY_F12 = 0xffc9, /*< nick=F12 >*/
|
||||
|
||||
NIMF_KEY_Shift_L = 0xffe1, /*< nick=Shift_L >*/
|
||||
NIMF_KEY_Shift_R = 0xffe2, /*< nick=Shift_R >*/
|
||||
NIMF_KEY_Control_L = 0xffe3, /*< nick=Control_L >*/
|
||||
NIMF_KEY_Control_R = 0xffe4, /*< nick=Control_R >*/
|
||||
NIMF_KEY_Caps_Lock = 0xffe5, /*< nick=Caps_Lock >*/
|
||||
NIMF_KEY_Shift_Lock = 0xffe6, /*< nick=Shift_Lock >*/
|
||||
NIMF_KEY_Meta_L = 0xffe7, /*< nick=Meta_L >*/
|
||||
NIMF_KEY_Meta_R = 0xffe8, /*< nick=Meta_R >*/
|
||||
NIMF_KEY_Alt_L = 0xffe9, /*< nick=Alt_L >*/
|
||||
NIMF_KEY_Alt_R = 0xffea, /*< nick=Alt_R >*/
|
||||
NIMF_KEY_Super_L = 0xffeb, /*< nick=Super_L >*/
|
||||
NIMF_KEY_Super_R = 0xffec, /*< nick=Super_R >*/
|
||||
|
||||
NIMF_KEY_Delete = 0xffff, /*< nick=Delete >*/
|
||||
|
||||
NIMF_KEY_VoidSymbol = 0xffffff, /*< nick=VoidSymbol >*/
|
||||
NIMF_KEY_WakeUp = 0x1008ff2b, /*< nick=WakeUp >*/
|
||||
NIMF_KEY_WebCam = 0x1008ff8f, /*< nick=WebCam >*/
|
||||
NIMF_KEY_WLAN = 0x1008ff95 /*< nick=WLAN >*/
|
||||
} NimfKeySym;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_KEY_SYMS_H__ */
|
||||
5
Telegram/ThirdParty/nimf/libnimf/nimf-marshalers.list
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
VOID:VOID
|
||||
VOID:STRING
|
||||
VOID:STRING,STRING
|
||||
BOOLEAN:VOID
|
||||
BOOLEAN:INT,INT
|
||||
41
Telegram/ThirdParty/nimf/libnimf/nimf-message-enum-types-private.h.template
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/*** BEGIN file-header ***/
|
||||
/*
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_MESSAGE_ENUM_TYPES_H__
|
||||
#define __NIMF_MESSAGE_ENUM_TYPES_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN file-tail ***/
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_MESSAGE_ENUM_TYPES_H__ */
|
||||
/*** END file-tail ***/
|
||||
54
Telegram/ThirdParty/nimf/libnimf/nimf-message-enum-types.c.template
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/*** BEGIN file-header ***/
|
||||
/*
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-message-enum-types-private.h"
|
||||
#include "nimf-message-private.h"
|
||||
|
||||
/*** END file-header ***/
|
||||
|
||||
/*** BEGIN file-production ***/
|
||||
/* enumerations from "@filename@" */
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GType
|
||||
@enum_name@_get_type (void)
|
||||
{
|
||||
static volatile gsize g_define_type_id__volatile = 0;
|
||||
|
||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||
{
|
||||
static const G@Type@Value values[] = {
|
||||
/*** END value-header ***/
|
||||
|
||||
/*** BEGIN value-production ***/
|
||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
||||
/*** END value-production ***/
|
||||
|
||||
/*** BEGIN value-tail ***/
|
||||
{ 0, NULL, NULL }
|
||||
};
|
||||
GType g_define_type_id =
|
||||
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
||||
}
|
||||
|
||||
return g_define_type_id__volatile;
|
||||
}
|
||||
|
||||
/*** END value-tail ***/
|
||||
136
Telegram/ThirdParty/nimf/libnimf/nimf-message-private.h
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-message-private.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_MESSAGE_H__
|
||||
#define __NIMF_MESSAGE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nimf-events.h"
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _NimfMessage NimfMessage;
|
||||
typedef struct _NimfMessageHeader NimfMessageHeader;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
NIMF_MESSAGE_NONE = 0,
|
||||
/* im methods */
|
||||
NIMF_MESSAGE_CREATE_CONTEXT,
|
||||
NIMF_MESSAGE_CREATE_CONTEXT_REPLY,
|
||||
NIMF_MESSAGE_DESTROY_CONTEXT,
|
||||
NIMF_MESSAGE_DESTROY_CONTEXT_REPLY,
|
||||
NIMF_MESSAGE_FILTER_EVENT,
|
||||
NIMF_MESSAGE_FILTER_EVENT_REPLY,
|
||||
NIMF_MESSAGE_RESET,
|
||||
NIMF_MESSAGE_RESET_REPLY,
|
||||
NIMF_MESSAGE_FOCUS_IN,
|
||||
NIMF_MESSAGE_FOCUS_IN_REPLY,
|
||||
NIMF_MESSAGE_FOCUS_OUT,
|
||||
NIMF_MESSAGE_FOCUS_OUT_REPLY,
|
||||
NIMF_MESSAGE_SET_SURROUNDING,
|
||||
NIMF_MESSAGE_SET_SURROUNDING_REPLY,
|
||||
NIMF_MESSAGE_SET_CURSOR_LOCATION,
|
||||
NIMF_MESSAGE_SET_CURSOR_LOCATION_REPLY,
|
||||
NIMF_MESSAGE_SET_USE_PREEDIT,
|
||||
NIMF_MESSAGE_SET_USE_PREEDIT_REPLY,
|
||||
/* context signals */
|
||||
NIMF_MESSAGE_PREEDIT_START,
|
||||
NIMF_MESSAGE_PREEDIT_START_REPLY,
|
||||
NIMF_MESSAGE_PREEDIT_END,
|
||||
NIMF_MESSAGE_PREEDIT_END_REPLY,
|
||||
NIMF_MESSAGE_PREEDIT_CHANGED,
|
||||
NIMF_MESSAGE_PREEDIT_CHANGED_REPLY,
|
||||
NIMF_MESSAGE_COMMIT,
|
||||
NIMF_MESSAGE_COMMIT_REPLY,
|
||||
NIMF_MESSAGE_RETRIEVE_SURROUNDING,
|
||||
NIMF_MESSAGE_RETRIEVE_SURROUNDING_REPLY,
|
||||
NIMF_MESSAGE_DELETE_SURROUNDING,
|
||||
NIMF_MESSAGE_DELETE_SURROUNDING_REPLY,
|
||||
/* misc */
|
||||
NIMF_MESSAGE_BEEP,
|
||||
NIMF_MESSAGE_BEEP_REPLY,
|
||||
} NimfMessageType;
|
||||
|
||||
struct _NimfMessageHeader
|
||||
{
|
||||
guint16 icid;
|
||||
NimfMessageType type;
|
||||
guint16 data_len;
|
||||
};
|
||||
|
||||
struct _NimfMessage
|
||||
{
|
||||
NimfMessageHeader *header;
|
||||
gchar *data;
|
||||
GDestroyNotify data_destroy_func;
|
||||
gint ref_count;
|
||||
};
|
||||
|
||||
typedef struct _NimfResult NimfResult;
|
||||
|
||||
struct _NimfResult
|
||||
{
|
||||
gboolean is_dispatched;
|
||||
NimfMessage *reply;
|
||||
gint ref_count;
|
||||
};
|
||||
|
||||
NimfMessage *nimf_message_new (void);
|
||||
NimfMessage *nimf_message_new_full (NimfMessageType type,
|
||||
guint16 im_id,
|
||||
gpointer data,
|
||||
guint16 data_len,
|
||||
GDestroyNotify data_destroy_func);
|
||||
NimfMessage *nimf_message_ref (NimfMessage *message);
|
||||
void nimf_message_unref (NimfMessage *message);
|
||||
const NimfMessageHeader *
|
||||
nimf_message_get_header (NimfMessage *message);
|
||||
guint16 nimf_message_get_header_size (void);
|
||||
void nimf_message_set_body (NimfMessage *message,
|
||||
gchar *data,
|
||||
guint16 data_len,
|
||||
GDestroyNotify data_destroy_func);
|
||||
const gchar *nimf_message_get_body (NimfMessage *message);
|
||||
guint16 nimf_message_get_body_size (NimfMessage *message);
|
||||
const gchar *nimf_message_get_name (NimfMessage *message);
|
||||
const gchar *nimf_message_get_name_by_type (NimfMessageType type);
|
||||
|
||||
NimfResult *nimf_result_new (void);
|
||||
NimfResult *nimf_result_ref (NimfResult *result);
|
||||
void nimf_result_unref (NimfResult *result);
|
||||
void nimf_result_iteration_until (NimfResult *result,
|
||||
GMainContext *main_context,
|
||||
guint16 icid,
|
||||
NimfMessageType type);
|
||||
void nimf_send_message (GSocket *socket,
|
||||
guint16 im_id,
|
||||
NimfMessageType type,
|
||||
gpointer data,
|
||||
guint16 data_len,
|
||||
GDestroyNotify data_destroy_func);
|
||||
NimfMessage *nimf_recv_message (GSocket *socket);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_MESSAGE_H__ */
|
||||
352
Telegram/ThirdParty/nimf/libnimf/nimf-message.c
vendored
Normal file
@@ -0,0 +1,352 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-message.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-message-private.h"
|
||||
#include "nimf-types.h"
|
||||
#include "nimf-message-enum-types-private.h"
|
||||
#include <string.h>
|
||||
|
||||
NimfMessage *
|
||||
nimf_message_new ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return nimf_message_new_full (NIMF_MESSAGE_NONE, 0, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
NimfMessage *
|
||||
nimf_message_new_full (NimfMessageType type,
|
||||
guint16 icid,
|
||||
gpointer data,
|
||||
guint16 data_len,
|
||||
GDestroyNotify data_destroy_func)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfMessage *message;
|
||||
|
||||
message = g_slice_new0 (NimfMessage);
|
||||
message->header = g_slice_new0 (NimfMessageHeader);
|
||||
message->header->icid = icid;
|
||||
message->header->type = type;
|
||||
message->header->data_len = data_len;
|
||||
message->data = data;
|
||||
message->data_destroy_func = data_destroy_func;
|
||||
message->ref_count = 1;
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
NimfMessage *
|
||||
nimf_message_ref (NimfMessage *message)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_val_if_fail (message != NULL, NULL);
|
||||
|
||||
g_atomic_int_inc (&message->ref_count);
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
void
|
||||
nimf_message_unref (NimfMessage *message)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (message == NULL))
|
||||
return;
|
||||
|
||||
if (g_atomic_int_dec_and_test (&message->ref_count))
|
||||
{
|
||||
g_slice_free (NimfMessageHeader, message->header);
|
||||
|
||||
if (message->data_destroy_func)
|
||||
message->data_destroy_func (message->data);
|
||||
|
||||
g_slice_free (NimfMessage, message);
|
||||
}
|
||||
}
|
||||
|
||||
const NimfMessageHeader *
|
||||
nimf_message_get_header (NimfMessage *message)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return message->header;
|
||||
}
|
||||
|
||||
guint16
|
||||
nimf_message_get_header_size ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return sizeof (NimfMessageHeader);
|
||||
}
|
||||
|
||||
void
|
||||
nimf_message_set_body (NimfMessage *message,
|
||||
gchar *data,
|
||||
guint16 data_len,
|
||||
GDestroyNotify data_destroy_func)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
message->data = data;
|
||||
message->header->data_len = data_len;
|
||||
message->data_destroy_func = data_destroy_func;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
nimf_message_get_body (NimfMessage *message)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return message->data;
|
||||
}
|
||||
|
||||
guint16
|
||||
nimf_message_get_body_size (NimfMessage *message)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return message->header->data_len;
|
||||
}
|
||||
|
||||
const gchar *nimf_message_get_name (NimfMessage *message)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GEnumClass *enum_class = (GEnumClass *) g_type_class_ref (NIMF_TYPE_MESSAGE_TYPE);
|
||||
GEnumValue *enum_value = g_enum_get_value (enum_class, message->header->type);
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
return enum_value ? enum_value->value_name : NULL;
|
||||
}
|
||||
|
||||
const gchar *nimf_message_get_name_by_type (NimfMessageType type)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GEnumClass *enum_class = (GEnumClass *) g_type_class_ref (NIMF_TYPE_MESSAGE_TYPE);
|
||||
GEnumValue *enum_value = g_enum_get_value (enum_class, type);
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
return enum_value ? enum_value->value_name : NULL;
|
||||
}
|
||||
|
||||
NimfResult *
|
||||
nimf_result_new ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfResult *result;
|
||||
|
||||
result = g_slice_new0 (NimfResult);
|
||||
result->ref_count = 1;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NimfResult *
|
||||
nimf_result_ref (NimfResult *result)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_val_if_fail (result != NULL, NULL);
|
||||
|
||||
g_atomic_int_inc (&result->ref_count);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
nimf_result_unref (NimfResult *result)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (result == NULL))
|
||||
return;
|
||||
|
||||
if (g_atomic_int_dec_and_test (&result->ref_count))
|
||||
{
|
||||
if (result->reply)
|
||||
g_slice_free (NimfMessage, result->reply);
|
||||
|
||||
g_slice_free (NimfResult, result);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nimf_result_iteration_until (NimfResult *result,
|
||||
GMainContext *main_context,
|
||||
guint16 icid,
|
||||
NimfMessageType type)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_result_ref (result);
|
||||
|
||||
do {
|
||||
result->is_dispatched = FALSE;
|
||||
g_main_context_iteration (main_context, TRUE);
|
||||
} while ((result->is_dispatched == FALSE) ||
|
||||
(result->reply && ((result->reply->header->type != type) ||
|
||||
(result->reply->header->icid != icid))));
|
||||
|
||||
if (G_UNLIKELY (result->is_dispatched == TRUE && result->reply == NULL))
|
||||
g_debug (G_STRLOC ": %s: Can't receive %s",
|
||||
G_STRFUNC, nimf_message_get_name_by_type (type));
|
||||
|
||||
/* This prevents not checking reply in the following iteration
|
||||
* send commit (wait reply)
|
||||
* recv reset
|
||||
* send commit (wait reply)
|
||||
* recv commit-reply (is_dispatched: TRUE)
|
||||
* `result->is_dispatched = FALSE' prevents breaking loop
|
||||
* send reset-reply
|
||||
* recv commit-reply
|
||||
*/
|
||||
result->is_dispatched = FALSE;
|
||||
|
||||
nimf_result_unref (result);
|
||||
}
|
||||
|
||||
void
|
||||
nimf_send_message (GSocket *socket,
|
||||
guint16 icid,
|
||||
NimfMessageType type,
|
||||
gpointer data,
|
||||
guint16 data_len,
|
||||
GDestroyNotify data_destroy_func)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: fd = %d", G_STRFUNC, g_socket_get_fd (socket));
|
||||
|
||||
NimfMessage *message;
|
||||
GError *error = NULL;
|
||||
gssize n_written;
|
||||
GOutputVector vectors[2] = { { NULL, }, };
|
||||
|
||||
message = nimf_message_new_full (type, icid,
|
||||
data, data_len, data_destroy_func);
|
||||
|
||||
vectors[0].buffer = nimf_message_get_header (message);
|
||||
vectors[0].size = nimf_message_get_header_size ();
|
||||
vectors[1].buffer = message->data;
|
||||
vectors[1].size = message->header->data_len;
|
||||
|
||||
n_written = g_socket_send_message (socket, NULL, vectors,
|
||||
message->header->data_len > 0 ? 2 : 1,
|
||||
NULL, 0, 0, NULL, &error);
|
||||
|
||||
if (G_UNLIKELY (n_written != nimf_message_get_header_size () + message->header->data_len))
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: n_written %"G_GSSIZE_FORMAT" differs from %d",
|
||||
G_STRFUNC, n_written, nimf_message_get_header_size () + message->header->data_len);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: %s", G_STRFUNC, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
nimf_message_unref (message);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* debug message */
|
||||
const gchar *name = nimf_message_get_name (message);
|
||||
if (name)
|
||||
g_debug ("send: %s, icid: %d, fd: %d", name, icid, g_socket_get_fd(socket));
|
||||
else
|
||||
g_error (G_STRLOC ": unknown message type");
|
||||
|
||||
nimf_message_unref (message);
|
||||
}
|
||||
|
||||
NimfMessage *nimf_recv_message (GSocket *socket)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfMessage *message = nimf_message_new ();
|
||||
GError *error = NULL;
|
||||
gssize n_read = 0;
|
||||
|
||||
n_read = g_socket_receive (socket,
|
||||
(gchar *) message->header,
|
||||
nimf_message_get_header_size (),
|
||||
NULL, &error);
|
||||
|
||||
if (G_UNLIKELY (n_read < nimf_message_get_header_size ()))
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: received %"G_GSSIZE_FORMAT" less than %d",
|
||||
G_STRFUNC, n_read, nimf_message_get_header_size ());
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: %s", G_STRFUNC, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
nimf_message_unref (message);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (message->header->data_len > 0)
|
||||
{
|
||||
nimf_message_set_body (message,
|
||||
g_malloc0 (message->header->data_len),
|
||||
message->header->data_len,
|
||||
g_free);
|
||||
|
||||
n_read = g_socket_receive (socket,
|
||||
message->data,
|
||||
message->header->data_len,
|
||||
NULL, &error);
|
||||
|
||||
if (G_UNLIKELY (n_read < message->header->data_len))
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: received %"G_GSSIZE_FORMAT" less than %d",
|
||||
G_STRFUNC, n_read, message->header->data_len);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: %s", G_STRFUNC, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
nimf_message_unref (message);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* debug message */
|
||||
const gchar *name = nimf_message_get_name (message);
|
||||
if (name)
|
||||
g_debug ("recv: %s, icid: %d, fd: %d", name, message->header->icid, g_socket_get_fd (socket));
|
||||
else
|
||||
g_error (G_STRLOC ": unknown message type");
|
||||
|
||||
return message;
|
||||
}
|
||||
64
Telegram/ThirdParty/nimf/libnimf/nimf-module-private.h
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-module-private.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_MODULE_H__
|
||||
#define __NIMF_MODULE_H__
|
||||
|
||||
#if !defined (__NIMF_H_INSIDE__) && !defined (NIMF_COMPILATION)
|
||||
#error "Only <nimf.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
#include "nimf-engine.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_MODULE (nimf_module_get_type ())
|
||||
#define NIMF_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_TYPE_MODULE, NimfModule))
|
||||
#define NIMF_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NIMF_TYPE_MODULE, NimfModuleClass))
|
||||
#define NIMF_IS_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NIMF_TYPE_MODULE))
|
||||
#define NIMF_IS_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NIMF_TYPE_MODULE))
|
||||
#define NIMF_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NIMF_TYPE_MODULE, NimfModuleClass))
|
||||
|
||||
typedef struct _NimfModule NimfModule;
|
||||
typedef struct _NimfModuleClass NimfModuleClass;
|
||||
|
||||
struct _NimfModule
|
||||
{
|
||||
GTypeModule parent_instance;
|
||||
|
||||
gchar *path;
|
||||
GModule *library;
|
||||
GType type;
|
||||
};
|
||||
|
||||
struct _NimfModuleClass
|
||||
{
|
||||
GTypeModuleClass parent_class;
|
||||
};
|
||||
|
||||
GType nimf_module_get_type (void) G_GNUC_CONST;
|
||||
NimfModule *nimf_module_new (const gchar *path);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_MODULE_H__ */
|
||||
100
Telegram/ThirdParty/nimf/libnimf/nimf-module.c
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-module.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "nimf-module-private.h"
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_DEFINE_TYPE (NimfModule, nimf_module, G_TYPE_TYPE_MODULE);
|
||||
|
||||
NimfModule *
|
||||
nimf_module_new (const gchar *path)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_val_if_fail (path != NULL, NULL);
|
||||
|
||||
NimfModule *module = g_object_new (NIMF_TYPE_MODULE, NULL);
|
||||
|
||||
module->path = g_strdup (path);
|
||||
|
||||
return module;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nimf_module_load (GTypeModule *gmodule)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfModule *module = NIMF_MODULE (gmodule);
|
||||
void (* module_register_type) (GTypeModule *module);
|
||||
GType (* module_get_type) (void);
|
||||
|
||||
module->library = g_module_open (module->path, G_MODULE_BIND_LAZY |
|
||||
G_MODULE_BIND_LOCAL);
|
||||
|
||||
if (!module->library)
|
||||
{
|
||||
g_warning (G_STRLOC ": %s", g_module_error ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!g_module_symbol (module->library, "module_register_type",
|
||||
(gpointer *) &module_register_type) ||
|
||||
!g_module_symbol (module->library, "module_get_type",
|
||||
(gpointer *) &module_get_type))
|
||||
{
|
||||
g_warning (G_STRLOC ": %s", g_module_error ());
|
||||
g_module_close (module->library);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
module_register_type (gmodule);
|
||||
module->type = module_get_type ();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_module_unload (GTypeModule *gmodule)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_module_close (NIMF_MODULE (gmodule)->library);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_module_init (NimfModule *module)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_module_class_init (NimfModuleClass *class)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (class);
|
||||
|
||||
module_class->load = nimf_module_load;
|
||||
module_class->unload = nimf_module_unload;
|
||||
}
|
||||
134
Telegram/ThirdParty/nimf/libnimf/nimf-preeditable.c
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-preeditable.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2017-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-preeditable.h"
|
||||
|
||||
G_DEFINE_INTERFACE (NimfPreeditable, nimf_preeditable, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
nimf_preeditable_default_init (NimfPreeditableInterface *iface)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preeditable_show:
|
||||
* @preeditable: a #NimfPreeditable
|
||||
*
|
||||
* Shows @preeditable
|
||||
*/
|
||||
void
|
||||
nimf_preeditable_show (NimfPreeditable *preeditable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_PREEDITABLE (preeditable));
|
||||
|
||||
NimfPreeditableInterface *iface = NIMF_PREEDITABLE_GET_IFACE (preeditable);
|
||||
|
||||
if (iface->show)
|
||||
iface->show (preeditable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preeditable_hide:
|
||||
* @preeditable: a #NimfPreeditable
|
||||
*
|
||||
* Hides the @preeditable
|
||||
*/
|
||||
void
|
||||
nimf_preeditable_hide (NimfPreeditable *preeditable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_PREEDITABLE (preeditable));
|
||||
|
||||
NimfPreeditableInterface *iface = NIMF_PREEDITABLE_GET_IFACE (preeditable);
|
||||
|
||||
if (iface->hide)
|
||||
iface->hide (preeditable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preeditable_is_visible:
|
||||
* @preeditable: a #NimfPreeditable
|
||||
*
|
||||
* Returns: %TRUE if the @preeditable is visible
|
||||
*/
|
||||
gboolean
|
||||
nimf_preeditable_is_visible (NimfPreeditable *preeditable)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_val_if_fail (NIMF_IS_PREEDITABLE (preeditable), FALSE);
|
||||
|
||||
NimfPreeditableInterface *iface = NIMF_PREEDITABLE_GET_IFACE (preeditable);
|
||||
|
||||
if (iface->is_visible)
|
||||
return iface->is_visible (preeditable);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preeditable_set_text:
|
||||
* @preeditable: a #NimfPreeditable
|
||||
* @text: text
|
||||
* @cursor_pos: cursor position
|
||||
*
|
||||
* Sets @text to @preeditable.
|
||||
*/
|
||||
void
|
||||
nimf_preeditable_set_text (NimfPreeditable *preeditable,
|
||||
const gchar *text,
|
||||
gint cursor_pos)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_PREEDITABLE (preeditable));
|
||||
|
||||
NimfPreeditableInterface *iface = NIMF_PREEDITABLE_GET_IFACE (preeditable);
|
||||
|
||||
if (iface->set_text)
|
||||
iface->set_text (preeditable, text, cursor_pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preeditable_set_cursor_location:
|
||||
* @preeditable: a #NimfPreeditable
|
||||
* @area: a #NimfRectangle
|
||||
*
|
||||
* Notifies the @preeditable that a change in cursor position has been made.
|
||||
* The location is the position of a window position in root window coordinates.
|
||||
*/
|
||||
void
|
||||
nimf_preeditable_set_cursor_location (NimfPreeditable *preeditable,
|
||||
const NimfRectangle *area)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (NIMF_IS_PREEDITABLE (preeditable));
|
||||
|
||||
NimfPreeditableInterface *iface = NIMF_PREEDITABLE_GET_IFACE (preeditable);
|
||||
|
||||
if (iface->set_cursor_location)
|
||||
iface->set_cursor_location (preeditable, area);
|
||||
}
|
||||
71
Telegram/ThirdParty/nimf/libnimf/nimf-preeditable.h
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-preeditable.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2017-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_PREEDITABLE_H__
|
||||
#define __NIMF_PREEDITABLE_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include "nimf-types.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_PREEDITABLE nimf_preeditable_get_type ()
|
||||
|
||||
G_DECLARE_INTERFACE (NimfPreeditable, nimf_preeditable, NIMF, PREEDITABLE, GObject)
|
||||
|
||||
/**
|
||||
* NimfPreeditableInterface:
|
||||
* @parent: The parent interface.
|
||||
* @show: Shows the preeditable.
|
||||
* @hide: Hides the preeditable.
|
||||
* @is_visible: Checks if the preeditable is visible.
|
||||
* @set_text: Sets the text in the preeditable to the given value, replacing
|
||||
* the current contents.
|
||||
* @set_cursor_location: Sets the cursor position.
|
||||
*
|
||||
* Provides an interface for preedit gadget.
|
||||
*/
|
||||
struct _NimfPreeditableInterface
|
||||
{
|
||||
GTypeInterface parent;
|
||||
|
||||
void (* show) (NimfPreeditable *preeditable);
|
||||
void (* hide) (NimfPreeditable *preeditable);
|
||||
gboolean (* is_visible) (NimfPreeditable *preeditable);
|
||||
void (* set_text) (NimfPreeditable *preeditable,
|
||||
const gchar *text,
|
||||
gint cursor_pos);
|
||||
void (* set_cursor_location) (NimfPreeditable *preeditable,
|
||||
const NimfRectangle *area);
|
||||
};
|
||||
|
||||
void nimf_preeditable_show (NimfPreeditable *preeditable);
|
||||
void nimf_preeditable_hide (NimfPreeditable *preeditable);
|
||||
gboolean nimf_preeditable_is_visible (NimfPreeditable *preeditable);
|
||||
void nimf_preeditable_set_text (NimfPreeditable *preeditable,
|
||||
const gchar *text,
|
||||
gint cursor_pos);
|
||||
void nimf_preeditable_set_cursor_location (NimfPreeditable *preeditable,
|
||||
const NimfRectangle *area);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_PREEDITABLE_H__ */
|
||||
63
Telegram/ThirdParty/nimf/libnimf/nimf-server-private.h
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-server-private.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_SERVER_PRIVATE_H__
|
||||
#define __NIMF_SERVER_PRIVATE_H__
|
||||
|
||||
#include "nimf-server.h"
|
||||
#include "nimf-service-ic.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
struct _NimfServerPrivate
|
||||
{
|
||||
GHashTable *modules;
|
||||
GHashTable *services;
|
||||
GList *engines;
|
||||
NimfServiceIC *last_focused_im;
|
||||
const gchar *last_focused_service;
|
||||
GSettings *settings;
|
||||
NimfKey **hotkeys;
|
||||
GHashTable *shortcuts;
|
||||
gboolean use_singleton;
|
||||
GPtrArray *ics;
|
||||
/* facilities */
|
||||
NimfCandidatable *candidatable;
|
||||
NimfPreeditable *preeditable;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
GSettings *settings;
|
||||
NimfKey **to_lang;
|
||||
NimfKey **to_sys;
|
||||
} NimfShortcut;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
NimfEngine *nimf_server_get_default_engine (NimfServer *server);
|
||||
NimfEngine *nimf_server_get_next_engine (NimfServer *server,
|
||||
NimfEngine *engine);
|
||||
NimfEngine *nimf_server_get_engine_by_id (NimfServer *server,
|
||||
const gchar *engine_id);
|
||||
gboolean nimf_server_start (NimfServer *server);
|
||||
|
||||
#endif /* __NIMF_SERVER_PRIVATE_H__ */
|
||||
|
||||
826
Telegram/ThirdParty/nimf/libnimf/nimf-server.c
vendored
Normal file
@@ -0,0 +1,826 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-server.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
#include "nimf-server.h"
|
||||
#include "nimf-server-private.h"
|
||||
#include "nimf-service.h"
|
||||
#include <glib/gstdio.h>
|
||||
#include "nimf-marshalers-private.h"
|
||||
#include "nimf-module-private.h"
|
||||
#include <string.h>
|
||||
#include "nimf-service-ic-private.h"
|
||||
|
||||
enum {
|
||||
ENGINE_CHANGED,
|
||||
ENGINE_STATUS_CHANGED,
|
||||
ENGINE_LOADED,
|
||||
ENGINE_UNLOADED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint nimf_server_signals[LAST_SIGNAL] = { 0 };
|
||||
static NimfServer *_nimf_server_ = NULL;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (NimfServer, nimf_server, G_TYPE_OBJECT);
|
||||
|
||||
static gint
|
||||
on_comparing_engine_with_id (NimfEngine *engine, const gchar *engine_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_strcmp0 (nimf_engine_get_id (engine), engine_id);
|
||||
}
|
||||
|
||||
NimfEngine *
|
||||
nimf_server_get_engine_by_id (NimfServer *server,
|
||||
const gchar *engine_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GList *list;
|
||||
|
||||
list = g_list_find_custom (server->priv->engines, engine_id,
|
||||
(GCompareFunc) on_comparing_engine_with_id);
|
||||
if (list)
|
||||
return list->data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NimfEngine *
|
||||
nimf_server_get_next_engine (NimfServer *server, NimfEngine *engine)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GList *list;
|
||||
|
||||
list = g_list_find (server->priv->engines, engine);
|
||||
|
||||
if (list == NULL)
|
||||
list = g_list_find_custom (server->priv->engines, nimf_engine_get_id (engine),
|
||||
(GCompareFunc) on_comparing_engine_with_id);
|
||||
|
||||
list = g_list_next (list);
|
||||
|
||||
if (list == NULL)
|
||||
list = server->priv->engines;
|
||||
|
||||
return list->data;
|
||||
}
|
||||
|
||||
NimfEngine *
|
||||
nimf_server_get_default_engine (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GSettings *settings;
|
||||
gchar *engine_id;
|
||||
NimfEngine *engine;
|
||||
|
||||
settings = g_settings_new ("org.nimf.engines");
|
||||
engine_id = g_settings_get_string (settings, "default-engine");
|
||||
engine = nimf_server_get_engine_by_id (server, engine_id);
|
||||
|
||||
if (G_UNLIKELY (engine == NULL))
|
||||
{
|
||||
g_settings_reset (settings, "default-engine");
|
||||
g_free (engine_id);
|
||||
engine_id = g_settings_get_string (settings, "default-engine");
|
||||
engine = nimf_server_get_engine_by_id (server, engine_id);
|
||||
}
|
||||
|
||||
g_free (engine_id);
|
||||
g_object_unref (settings);
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_server_get_default:
|
||||
*
|
||||
* Returns the default #NimfServer instance.
|
||||
*
|
||||
* If there is no default server then %NULL is returned.
|
||||
*
|
||||
* Returns: (transfer none): the default server, or %NULL if server is not
|
||||
* running
|
||||
*/
|
||||
NimfServer *
|
||||
nimf_server_get_default ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return _nimf_server_;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_server_get_preeditable:
|
||||
* @server: a #NimfServer
|
||||
*
|
||||
* Returns the #NimfPreeditable instance.
|
||||
*
|
||||
* If there is no default preeditable then %NULL is returned.
|
||||
*
|
||||
* Returns: (transfer none): a #NimfPreeditable, or %NULL
|
||||
*/
|
||||
NimfPreeditable *
|
||||
nimf_server_get_preeditable (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return server->priv->preeditable;
|
||||
}
|
||||
|
||||
static void
|
||||
on_changed_hotkeys (GSettings *settings,
|
||||
gchar *key,
|
||||
NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
gchar **keys = g_settings_get_strv (settings, key);
|
||||
|
||||
nimf_key_freev (server->priv->hotkeys);
|
||||
server->priv->hotkeys = nimf_key_newv ((const gchar **) keys);
|
||||
|
||||
g_strfreev (keys);
|
||||
}
|
||||
|
||||
static void
|
||||
on_use_singleton (GSettings *settings,
|
||||
gchar *key,
|
||||
NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
server->priv->use_singleton = g_settings_get_boolean (server->priv->settings,
|
||||
"use-singleton");
|
||||
}
|
||||
|
||||
static void
|
||||
on_changed_shortcuts (GSettings *settings,
|
||||
gchar *key,
|
||||
NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfShortcut *shortcut;
|
||||
const gchar *engine_id;
|
||||
gchar *schema_id;
|
||||
|
||||
g_object_get (settings, "schema-id", &schema_id, NULL);
|
||||
engine_id = schema_id + strlen ("org.nimf.engines.");
|
||||
shortcut = g_hash_table_lookup (server->priv->shortcuts, engine_id);
|
||||
|
||||
if (g_strcmp0 (key, "shortcuts-to-lang") == 0)
|
||||
{
|
||||
gchar **keys;
|
||||
|
||||
keys = g_settings_get_strv (settings, key);
|
||||
shortcut->to_lang = nimf_key_newv ((const gchar **) keys);
|
||||
|
||||
g_strfreev (keys);
|
||||
}
|
||||
else if (g_strcmp0 (key, "shortcuts-to-sys") == 0)
|
||||
{
|
||||
gchar **keys;
|
||||
|
||||
keys = g_settings_get_strv (settings, key);
|
||||
shortcut->to_sys = nimf_key_newv ((const gchar **) keys);
|
||||
|
||||
g_strfreev (keys);
|
||||
}
|
||||
|
||||
g_free (schema_id);
|
||||
}
|
||||
|
||||
static NimfShortcut *
|
||||
nimf_server_shortcut_new (NimfServer *server,
|
||||
GSettings *settings)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GSettingsSchemaSource *source;
|
||||
GSettingsSchema *schema;
|
||||
NimfShortcut *shortcut;
|
||||
gchar *schema_id;
|
||||
|
||||
g_object_get (settings, "schema-id", &schema_id, NULL);
|
||||
source = g_settings_schema_source_get_default ();
|
||||
schema = g_settings_schema_source_lookup (source, schema_id, TRUE);
|
||||
shortcut = g_slice_new0 (NimfShortcut);
|
||||
|
||||
if (g_settings_schema_has_key (schema, "shortcuts-to-lang"))
|
||||
{
|
||||
gchar **to_lang;
|
||||
|
||||
to_lang = g_settings_get_strv (settings, "shortcuts-to-lang");
|
||||
shortcut->to_lang = nimf_key_newv ((const gchar **) to_lang);
|
||||
g_signal_connect (settings, "changed::shortcuts-to-lang",
|
||||
G_CALLBACK (on_changed_shortcuts), server);
|
||||
|
||||
g_strfreev (to_lang);
|
||||
}
|
||||
|
||||
if (g_settings_schema_has_key (schema, "shortcuts-to-sys"))
|
||||
{
|
||||
gchar **to_sys;
|
||||
|
||||
to_sys = g_settings_get_strv (settings, "shortcuts-to-sys");
|
||||
shortcut->to_sys = nimf_key_newv ((const gchar **) to_sys);
|
||||
g_signal_connect (settings, "changed::shortcuts-to-sys",
|
||||
G_CALLBACK (on_changed_shortcuts), server);
|
||||
|
||||
g_strfreev (to_sys);
|
||||
}
|
||||
|
||||
shortcut->settings = settings;
|
||||
|
||||
g_free (schema_id);
|
||||
g_settings_schema_unref (schema);
|
||||
|
||||
return shortcut;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_server_shortcut_free (NimfShortcut *shortcut)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (shortcut->settings)
|
||||
g_object_unref (shortcut->settings);
|
||||
|
||||
if (shortcut->to_lang)
|
||||
nimf_key_freev (shortcut->to_lang);
|
||||
|
||||
if (shortcut->to_sys)
|
||||
nimf_key_freev (shortcut->to_sys);
|
||||
|
||||
g_slice_free (NimfShortcut, shortcut);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_server_init (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
_nimf_server_ = server;
|
||||
server->priv = nimf_server_get_instance_private (server);
|
||||
server->priv->ics = g_ptr_array_new ();
|
||||
server->priv->settings = g_settings_new ("org.nimf");
|
||||
server->priv->use_singleton = g_settings_get_boolean (server->priv->settings,
|
||||
"use-singleton");
|
||||
server->priv->shortcuts =
|
||||
g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
||||
(GDestroyNotify) nimf_server_shortcut_free);
|
||||
gchar **hotkeys = g_settings_get_strv (server->priv->settings, "hotkeys");
|
||||
server->priv->hotkeys = nimf_key_newv ((const gchar **) hotkeys);
|
||||
g_strfreev (hotkeys);
|
||||
|
||||
server->priv->modules = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, NULL);
|
||||
server->priv->services = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, g_object_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_server_finalize (GObject *object)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServer *server = NIMF_SERVER (object);
|
||||
GHashTableIter iter;
|
||||
gpointer service;
|
||||
|
||||
g_ptr_array_free (server->priv->ics, FALSE);
|
||||
|
||||
g_hash_table_iter_init (&iter, server->priv->services);
|
||||
while (g_hash_table_iter_next (&iter, NULL, &service))
|
||||
nimf_service_stop (NIMF_SERVICE (service));
|
||||
|
||||
g_hash_table_unref (server->priv->modules);
|
||||
g_hash_table_unref (server->priv->services);
|
||||
|
||||
if (server->priv->engines)
|
||||
{
|
||||
g_list_free_full (server->priv->engines, g_object_unref);
|
||||
server->priv->engines = NULL;
|
||||
}
|
||||
|
||||
g_object_unref (server->priv->settings);
|
||||
g_hash_table_unref (server->priv->shortcuts);
|
||||
nimf_key_freev (server->priv->hotkeys);
|
||||
|
||||
G_OBJECT_CLASS (nimf_server_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_server_class_init (NimfServerClass *class)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
G_OBJECT_CLASS (class)->finalize = nimf_server_finalize;
|
||||
|
||||
/**
|
||||
* NimfServer::engine-changed:
|
||||
* @server: a #NimfServer
|
||||
* @engine_id: engine id
|
||||
* @icon_name: icon name
|
||||
*
|
||||
* The #NimfServer::engine-changed signal is emitted when the engine is
|
||||
* changed.
|
||||
*/
|
||||
nimf_server_signals[ENGINE_CHANGED] =
|
||||
g_signal_new (g_intern_static_string ("engine-changed"),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfServerClass, engine_changed),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__STRING_STRING,
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
/**
|
||||
* NimfServer::engine-status-changed:
|
||||
* @server: a #NimfServer
|
||||
* @engine_id: engine id
|
||||
* @icon_name: icon name
|
||||
*
|
||||
* The #NimfServer::engine-status-changed signal is emitted when the engine
|
||||
* status is changed.
|
||||
*/
|
||||
nimf_server_signals[ENGINE_STATUS_CHANGED] =
|
||||
g_signal_new (g_intern_static_string ("engine-status-changed"),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfServerClass, engine_status_changed),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__STRING_STRING,
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
/**
|
||||
* NimfServer::engine-loaded:
|
||||
* @server: a #NimfServer
|
||||
* @engine_id: engine id
|
||||
*
|
||||
* The #NimfServer::engine-loaded signal is emitted when the engine is loaded.
|
||||
*/
|
||||
nimf_server_signals[ENGINE_LOADED] =
|
||||
g_signal_new (g_intern_static_string ("engine-loaded"),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfServerClass, engine_loaded),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__STRING,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_STRING);
|
||||
/**
|
||||
* NimfServer::engine-unloaded:
|
||||
* @server: a #NimfServer
|
||||
* @engine_id: engine id
|
||||
*
|
||||
* The #NimfServer::engine-unloaded signal is emitted when the engine is
|
||||
* unloaded.
|
||||
*/
|
||||
nimf_server_signals[ENGINE_UNLOADED] =
|
||||
g_signal_new (g_intern_static_string ("engine-unloaded"),
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (NimfServerClass, engine_unloaded),
|
||||
NULL, NULL,
|
||||
nimf_cclosure_marshal_VOID__STRING,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_STRING);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_server_change_engine_by_id:
|
||||
* @server: a #NimfServer
|
||||
* @engine_id: engine id
|
||||
*
|
||||
* Changes the last focused engine to the engine with the given ID.
|
||||
*/
|
||||
void
|
||||
nimf_server_change_engine_by_id (NimfServer *server,
|
||||
const gchar *engine_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GHashTableIter iter;
|
||||
gpointer service;
|
||||
|
||||
g_hash_table_iter_init (&iter, server->priv->services);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, &service))
|
||||
{
|
||||
if (!g_strcmp0 (server->priv->last_focused_service,
|
||||
nimf_service_get_id (service)))
|
||||
nimf_service_change_engine_by_id (service, engine_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_server_change_engine:
|
||||
* @server: a #NimfServer
|
||||
* @engine_id: engine id
|
||||
* @method_id: method id
|
||||
*/
|
||||
void
|
||||
nimf_server_change_engine (NimfServer *server,
|
||||
const gchar *engine_id,
|
||||
const gchar *method_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GHashTableIter iter;
|
||||
gpointer service;
|
||||
|
||||
g_hash_table_iter_init (&iter, server->priv->services);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, &service))
|
||||
{
|
||||
if (!g_strcmp0 (server->priv->last_focused_service,
|
||||
nimf_service_get_id (service)))
|
||||
nimf_service_change_engine (service, engine_id, method_id);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
on_comparison (gconstpointer engine_id_a,
|
||||
gconstpointer engine_id_b)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GSettings *settings_a;
|
||||
GSettings *settings_b;
|
||||
gchar *schema_id_a;
|
||||
gchar *schema_id_b;
|
||||
gchar *schema_name_a;
|
||||
gchar *schema_name_b;
|
||||
gint retval;
|
||||
|
||||
schema_id_a = g_strdup_printf ("org.nimf.engines.%s", *(gchar **) engine_id_a);
|
||||
schema_id_b = g_strdup_printf ("org.nimf.engines.%s", *(gchar **) engine_id_b);
|
||||
|
||||
settings_a = g_settings_new (schema_id_a);
|
||||
settings_b = g_settings_new (schema_id_b);
|
||||
|
||||
schema_name_a = g_settings_get_string (settings_a, "hidden-schema-name");
|
||||
schema_name_b = g_settings_get_string (settings_b, "hidden-schema-name");
|
||||
|
||||
retval = g_utf8_collate (schema_name_a, schema_name_b);
|
||||
|
||||
g_free (schema_name_a);
|
||||
g_free (schema_name_b);
|
||||
g_free (schema_id_a);
|
||||
g_free (schema_id_b);
|
||||
g_object_unref (settings_a);
|
||||
g_object_unref (settings_b);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_server_get_loaded_engine_ids:
|
||||
* @server: a #NimfServer
|
||||
*
|
||||
* The array is %NULL-terminated.
|
||||
*
|
||||
* Returns: (transfer full): a new %NULL-terminated engine id array
|
||||
*/
|
||||
gchar **nimf_server_get_loaded_engine_ids (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GList *list;
|
||||
const gchar *engine_id;
|
||||
|
||||
GPtrArray *array = g_ptr_array_new ();
|
||||
|
||||
for (list = server->priv->engines; list != NULL; list = list->next)
|
||||
{
|
||||
engine_id = nimf_engine_get_id (list->data);
|
||||
g_ptr_array_add (array, g_strdup (engine_id));
|
||||
}
|
||||
|
||||
g_ptr_array_sort (array, on_comparison);
|
||||
g_ptr_array_add (array, NULL);
|
||||
|
||||
return (gchar **) g_ptr_array_free (array, FALSE);
|
||||
}
|
||||
|
||||
NimfServiceIC *
|
||||
nimf_server_get_last_focused_im (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return server->priv->last_focused_im;
|
||||
}
|
||||
|
||||
void
|
||||
nimf_server_set_last_focused_im (NimfServer *server,
|
||||
NimfServiceIC *im)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
server->priv->last_focused_im = im;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_server_load_service (NimfServer *server,
|
||||
const gchar *path)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfModule *module;
|
||||
NimfService *service;
|
||||
|
||||
module = nimf_module_new (path);
|
||||
|
||||
if (!g_type_module_use (G_TYPE_MODULE (module)))
|
||||
{
|
||||
g_warning (G_STRLOC ":" "Failed to load module: %s", path);
|
||||
g_object_unref (module);
|
||||
return;
|
||||
}
|
||||
|
||||
service = g_object_new (module->type, NULL);
|
||||
g_hash_table_insert (server->priv->services,
|
||||
g_strdup (nimf_service_get_id (service)), service);
|
||||
|
||||
g_type_module_unuse (G_TYPE_MODULE (module));
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_server_load_services (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GDir *dir;
|
||||
GError *error = NULL;
|
||||
const gchar *filename;
|
||||
gchar *path;
|
||||
|
||||
dir = g_dir_open (NIMF_SERVICE_MODULE_DIR, 0, &error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
g_warning (G_STRLOC ": %s: %s", G_STRFUNC, error->message);
|
||||
g_clear_error (&error);
|
||||
return;
|
||||
}
|
||||
|
||||
while ((filename = g_dir_read_name (dir)))
|
||||
{
|
||||
path = g_build_path (G_DIR_SEPARATOR_S, NIMF_SERVICE_MODULE_DIR, filename, NULL);
|
||||
nimf_server_load_service (server, path);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
g_dir_close (dir);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_server_load_engines (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GSettingsSchemaSource *source; /* do not free */
|
||||
gchar **schema_ids;
|
||||
GPtrArray *engine_ids;
|
||||
gchar **active_engines;
|
||||
gint i;
|
||||
|
||||
engine_ids = g_ptr_array_new ();
|
||||
source = g_settings_schema_source_get_default ();
|
||||
g_settings_schema_source_list_schemas (source, TRUE, &schema_ids, NULL);
|
||||
|
||||
for (i = 0; schema_ids[i] != NULL; i++)
|
||||
{
|
||||
if (g_str_has_prefix (schema_ids[i], "org.nimf.engines."))
|
||||
{
|
||||
GSettingsSchema *schema;
|
||||
GSettings *settings;
|
||||
const gchar *engine_id;
|
||||
gboolean active = TRUE;
|
||||
|
||||
engine_id = schema_ids[i] + strlen ("org.nimf.engines.");
|
||||
schema = g_settings_schema_source_lookup (source, schema_ids[i], TRUE);
|
||||
settings = g_settings_new (schema_ids[i]);
|
||||
|
||||
if (g_settings_schema_has_key (schema, "active-engine"))
|
||||
active = g_settings_get_boolean (settings, "active-engine");
|
||||
|
||||
if (active)
|
||||
{
|
||||
NimfModule *module;
|
||||
NimfEngine *engine;
|
||||
gchar *path;
|
||||
|
||||
path = g_module_build_path (NIMF_MODULE_DIR, engine_id);
|
||||
module = nimf_module_new (path);
|
||||
|
||||
if (!g_type_module_use (G_TYPE_MODULE (module)))
|
||||
{
|
||||
g_warning (G_STRLOC ": Failed to load module: %s", path);
|
||||
|
||||
g_object_unref (module);
|
||||
g_free (path);
|
||||
g_object_unref (settings);
|
||||
g_settings_schema_unref (schema);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
g_hash_table_insert (server->priv->modules, g_strdup (engine_id), module);
|
||||
engine = g_object_new (module->type, NULL);
|
||||
g_type_module_unuse (G_TYPE_MODULE (module));
|
||||
server->priv->engines = g_list_prepend (server->priv->engines, engine);
|
||||
g_ptr_array_add (engine_ids, g_strdup (engine_id));
|
||||
|
||||
if (g_settings_schema_has_key (schema, "shortcuts-to-lang"))
|
||||
g_hash_table_insert (server->priv->shortcuts, g_strdup (engine_id),
|
||||
nimf_server_shortcut_new (server, settings));
|
||||
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
g_settings_schema_unref (schema);
|
||||
}
|
||||
}
|
||||
|
||||
g_strfreev (schema_ids);
|
||||
g_ptr_array_add (engine_ids, NULL);
|
||||
active_engines = (gchar **) g_ptr_array_free (engine_ids, FALSE);
|
||||
g_settings_set_strv (server->priv->settings, "hidden-active-engines",
|
||||
(const gchar *const *) active_engines);
|
||||
g_strfreev (active_engines);
|
||||
}
|
||||
|
||||
static void
|
||||
on_changed_active_engines (GSettings *settings,
|
||||
gchar *key,
|
||||
NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GSettingsSchemaSource *source;
|
||||
gchar **engine_ids;
|
||||
gint i;
|
||||
|
||||
source = g_settings_schema_source_get_default ();
|
||||
engine_ids = g_settings_get_strv (settings, key);
|
||||
|
||||
for (i = 0; engine_ids[i]; i++)
|
||||
{
|
||||
if (!nimf_server_get_engine_by_id (server, engine_ids[i]))
|
||||
{
|
||||
GSettingsSchema *schema;
|
||||
gchar *schema_id;
|
||||
NimfEngine *engine;
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
NimfModule *module = g_hash_table_lookup (server->priv->modules, engine_ids[i]);
|
||||
gint index;
|
||||
|
||||
if (!module)
|
||||
{
|
||||
gchar *path;
|
||||
|
||||
path = g_module_build_path (NIMF_MODULE_DIR, engine_ids[i]);
|
||||
module = nimf_module_new (path);
|
||||
|
||||
if (!g_type_module_use (G_TYPE_MODULE (module)))
|
||||
{
|
||||
g_warning (G_STRLOC ": Failed to load module: %s", path);
|
||||
|
||||
g_object_unref (module);
|
||||
g_free (path);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
g_free (path);
|
||||
g_hash_table_insert (server->priv->modules, g_strdup (engine_ids[i]), module);
|
||||
}
|
||||
|
||||
g_type_module_use (G_TYPE_MODULE (module));
|
||||
engine = g_object_new (module->type, NULL);
|
||||
g_type_module_unuse (G_TYPE_MODULE (module));
|
||||
|
||||
server->priv->engines = g_list_prepend (server->priv->engines, engine);
|
||||
|
||||
for (index = 0; index < server->priv->ics->len; index++)
|
||||
{
|
||||
NimfServiceIC *ic = g_ptr_array_index (server->priv->ics, index);
|
||||
nimf_service_ic_load_engine (ic, engine_ids[i], server);
|
||||
}
|
||||
|
||||
schema_id = g_strdup_printf ("org.nimf.engines.%s", engine_ids[i]);
|
||||
schema = g_settings_schema_source_lookup (source, schema_id, TRUE);
|
||||
|
||||
if (g_settings_schema_has_key (schema, "shortcuts-to-lang"))
|
||||
g_hash_table_insert (server->priv->shortcuts, g_strdup (engine_ids[i]),
|
||||
nimf_server_shortcut_new (server, g_settings_new (schema_id)));
|
||||
|
||||
g_signal_emit (server, nimf_server_signals[ENGINE_LOADED], 0, engine_ids[i]);
|
||||
|
||||
g_free (schema_id);
|
||||
g_settings_schema_unref (schema);
|
||||
}
|
||||
}
|
||||
|
||||
GList *l = server->priv->engines;
|
||||
|
||||
while (l != NULL)
|
||||
{
|
||||
const gchar *engine_id = nimf_engine_get_id (l->data);
|
||||
GList *next = l->next;
|
||||
|
||||
if (g_strcmp0 (engine_id, "nimf-system-keyboard") &&
|
||||
!g_strv_contains ((const gchar * const *) engine_ids, engine_id))
|
||||
{
|
||||
NimfEngine *engine = l->data;
|
||||
gint index;
|
||||
|
||||
g_hash_table_remove (server->priv->shortcuts, engine_id);
|
||||
server->priv->engines = g_list_delete_link (server->priv->engines, l);
|
||||
|
||||
for (index = 0; index < server->priv->ics->len; index++)
|
||||
{
|
||||
NimfServiceIC *ic = g_ptr_array_index (server->priv->ics, index);
|
||||
nimf_service_ic_unload_engine (ic, engine_id, engine, server);
|
||||
}
|
||||
|
||||
g_signal_emit (server, nimf_server_signals[ENGINE_UNLOADED], 0, engine_id);
|
||||
g_object_unref (engine);
|
||||
}
|
||||
|
||||
l = next;
|
||||
}
|
||||
|
||||
g_strfreev (engine_ids);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nimf_server_start (NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_val_if_fail (NIMF_IS_SERVER (server), FALSE);
|
||||
|
||||
nimf_server_load_services (server);
|
||||
|
||||
server->priv->candidatable = g_hash_table_lookup (server->priv->services,
|
||||
"nimf-candidate");
|
||||
server->priv->preeditable = g_hash_table_lookup (server->priv->services,
|
||||
"nimf-preedit-window");
|
||||
nimf_service_start (NIMF_SERVICE (server->priv->candidatable));
|
||||
nimf_service_start (NIMF_SERVICE (server->priv->preeditable));
|
||||
|
||||
nimf_server_load_engines (server);
|
||||
|
||||
GHashTableIter iter;
|
||||
gpointer service;
|
||||
|
||||
g_hash_table_iter_init (&iter, server->priv->services);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, &service))
|
||||
{
|
||||
if (!g_strcmp0 (nimf_service_get_id (NIMF_SERVICE (service)), "nimf-candidate"))
|
||||
continue;
|
||||
else if (!g_strcmp0 (nimf_service_get_id (NIMF_SERVICE (service)), "nimf-preedit-window"))
|
||||
continue;
|
||||
|
||||
if (!nimf_service_start (NIMF_SERVICE (service)))
|
||||
g_hash_table_iter_remove (&iter);
|
||||
}
|
||||
|
||||
g_signal_connect (server->priv->settings, "changed::hotkeys",
|
||||
G_CALLBACK (on_changed_hotkeys), server);
|
||||
g_signal_connect (server->priv->settings, "changed::use-singleton",
|
||||
G_CALLBACK (on_use_singleton), server);
|
||||
g_signal_connect (server->priv->settings, "changed::hidden-active-engines",
|
||||
G_CALLBACK (on_changed_active_engines), server);
|
||||
return TRUE;
|
||||
}
|
||||
78
Telegram/ThirdParty/nimf/libnimf/nimf-server.h
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-server.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_SERVER_H__
|
||||
#define __NIMF_SERVER_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gio/gio.h>
|
||||
#include "nimf-preeditable.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_SERVER (nimf_server_get_type ())
|
||||
#define NIMF_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_TYPE_SERVER, NimfServer))
|
||||
#define NIMF_SERVER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), NIMF_TYPE_SERVER, NimfServerClass))
|
||||
#define NIMF_IS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NIMF_TYPE_SERVER))
|
||||
#define NIMF_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NIMF_TYPE_SERVER, NimfServerClass))
|
||||
|
||||
typedef struct _NimfServer NimfServer;
|
||||
typedef struct _NimfServerClass NimfServerClass;
|
||||
typedef struct _NimfServerPrivate NimfServerPrivate;
|
||||
|
||||
struct _NimfServer
|
||||
{
|
||||
GObject parent_instance;
|
||||
NimfServerPrivate *priv;
|
||||
};
|
||||
|
||||
struct _NimfServerClass
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Signals */
|
||||
void (* engine_changed) (NimfServer *server,
|
||||
const gchar *engine_id,
|
||||
const gchar *icon_name);
|
||||
void (* engine_status_changed) (NimfServer *server,
|
||||
const gchar *engine_id,
|
||||
const gchar *icon_name);
|
||||
void (* engine_loaded) (NimfServer *server,
|
||||
const gchar *engine_id);
|
||||
void (* engine_unloaded) (NimfServer *server,
|
||||
const gchar *engine_id);
|
||||
};
|
||||
|
||||
GType nimf_server_get_type (void) G_GNUC_CONST;
|
||||
void nimf_server_change_engine_by_id (NimfServer *server,
|
||||
const gchar *engine_id);
|
||||
void nimf_server_change_engine (NimfServer *server,
|
||||
const gchar *engine_id,
|
||||
const gchar *method_id);
|
||||
gchar **nimf_server_get_loaded_engine_ids (NimfServer *server);
|
||||
NimfServer *nimf_server_get_default (void);
|
||||
NimfPreeditable *nimf_server_get_preeditable (NimfServer *server);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_SERVER_H__ */
|
||||
41
Telegram/ThirdParty/nimf/libnimf/nimf-service-ic-private.h
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-service-ic-private.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_SERVICE_IC_PRIVATE_H__
|
||||
#define __NIMF_SERVICE_IC_PRIVATE_H__
|
||||
|
||||
#include "nimf-service-ic.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
extern void
|
||||
nimf_service_ic_load_engine (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
NimfServer *server);
|
||||
extern void
|
||||
nimf_service_ic_unload_engine (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
NimfEngine *signleton_engine_to_be_deleted,
|
||||
NimfServer *server);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_SERVICE_IC_PRIVATE_H__ */
|
||||
858
Telegram/ThirdParty/nimf/libnimf/nimf-service-ic.c
vendored
Normal file
@@ -0,0 +1,858 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-service-ic.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-service-ic.h"
|
||||
#include "nimf-module-private.h"
|
||||
#include <string.h>
|
||||
#include "nimf-preeditable.h"
|
||||
#include "nimf-key-syms.h"
|
||||
#include "nimf-server-private.h"
|
||||
#include "nimf-server.h"
|
||||
#include "nimf-service.h"
|
||||
|
||||
struct _NimfServiceICPrivate
|
||||
{
|
||||
NimfEngine *engine;
|
||||
GList *engines;
|
||||
gboolean use_preedit;
|
||||
NimfRectangle *cursor_area;
|
||||
/* preedit */
|
||||
NimfPreeditState preedit_state;
|
||||
gchar *preedit_string;
|
||||
NimfPreeditAttr **preedit_attrs;
|
||||
gint preedit_cursor_pos;
|
||||
};
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (NimfServiceIC, nimf_service_ic, G_TYPE_OBJECT);
|
||||
|
||||
/**
|
||||
* nimf_service_ic_emit_preedit_start:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Emits a #NimfIM::preedit-start signal.
|
||||
*/
|
||||
void nimf_service_ic_emit_preedit_start (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return;
|
||||
|
||||
ic->priv->preedit_state = NIMF_PREEDIT_STATE_START;
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
|
||||
if (class->emit_preedit_start && ic->priv->use_preedit)
|
||||
class->emit_preedit_start (ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_emit_preedit_changed:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @preedit_string: preedit string
|
||||
* @attrs: an array of #NimfPreeditAttr
|
||||
* @cursor_pos: cursor position
|
||||
*
|
||||
* Emits a #NimfIM::preedit-changed signal.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_emit_preedit_changed (NimfServiceIC *ic,
|
||||
const gchar *preedit_string,
|
||||
NimfPreeditAttr **attrs,
|
||||
gint cursor_pos)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return;
|
||||
|
||||
g_free (ic->priv->preedit_string);
|
||||
nimf_preedit_attr_freev (ic->priv->preedit_attrs);
|
||||
|
||||
ic->priv->preedit_string = g_strdup (preedit_string);
|
||||
ic->priv->preedit_attrs = nimf_preedit_attrs_copy (attrs);
|
||||
ic->priv->preedit_cursor_pos = cursor_pos;
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
if (class->emit_preedit_changed && ic->priv->use_preedit)
|
||||
class->emit_preedit_changed (ic, preedit_string, attrs, cursor_pos);
|
||||
|
||||
if (!ic->priv->use_preedit &&
|
||||
!nimf_candidatable_is_visible (server->priv->candidatable) &&
|
||||
strlen (preedit_string))
|
||||
{
|
||||
nimf_preeditable_set_text (server->priv->preeditable,
|
||||
preedit_string, cursor_pos);
|
||||
nimf_preeditable_show (server->priv->preeditable);
|
||||
}
|
||||
else
|
||||
{
|
||||
nimf_preeditable_hide (server->priv->preeditable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_emit_preedit_end:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Emits a #NimfIM::preedit-end signal.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_emit_preedit_end (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return;
|
||||
|
||||
ic->priv->preedit_state = NIMF_PREEDIT_STATE_END;
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
if (class->emit_preedit_end && ic->priv->use_preedit)
|
||||
class->emit_preedit_end (ic);
|
||||
|
||||
if (!ic->priv->use_preedit)
|
||||
nimf_preeditable_hide (server->priv->preeditable);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_emit_commit:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @text: text to commit
|
||||
*
|
||||
* Emits a #NimfIM::commit signal.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_emit_commit (NimfServiceIC *ic,
|
||||
const gchar *text)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return;
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
|
||||
if (class->emit_commit)
|
||||
class->emit_commit (ic, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_emit_retrieve_surrounding:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Emits a #NimfIM::retrieve-surrounding signal.
|
||||
*/
|
||||
gboolean
|
||||
nimf_service_ic_emit_retrieve_surrounding (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return FALSE;
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
|
||||
if (class->emit_retrieve_surrounding)
|
||||
return class->emit_retrieve_surrounding (ic);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_emit_delete_surrounding:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @offset: the character offset from the cursor position of the text to be
|
||||
* deleted. A negative value indicates a position before the cursor.
|
||||
* @n_chars: the number of characters to be deleted
|
||||
*
|
||||
* Emits a #NimfIM::delete-surrounding signal.
|
||||
*
|
||||
* Returns: %TRUE if the signal was handled.
|
||||
*/
|
||||
gboolean
|
||||
nimf_service_ic_emit_delete_surrounding (NimfServiceIC *ic,
|
||||
gint offset,
|
||||
gint n_chars)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return FALSE;
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
|
||||
if (class->emit_delete_surrounding)
|
||||
return class->emit_delete_surrounding (ic, offset, n_chars);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_engine_changed:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @engine_id: engine id
|
||||
* @name: name
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_engine_changed (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
const gchar *name)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return;
|
||||
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
g_signal_emit_by_name (server, "engine-changed", engine_id, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_emit_beep:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Emits a #NimfIM::beep signal.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_emit_beep (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (!ic))
|
||||
return;
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
|
||||
if (class->emit_beep)
|
||||
class->emit_beep (ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_focus_in:
|
||||
* @ic: a #NimfServiceIC
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_focus_in (NimfServiceIC *ic)
|
||||
{
|
||||
g_return_if_fail (ic != NULL);
|
||||
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (ic->priv->engine == NULL))
|
||||
return;
|
||||
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
nimf_engine_focus_in (ic->priv->engine, ic);
|
||||
server->priv->last_focused_im = ic;
|
||||
server->priv->last_focused_service = nimf_service_ic_get_service_id (ic);
|
||||
nimf_service_ic_engine_changed (ic, nimf_engine_get_id (ic->priv->engine),
|
||||
nimf_engine_get_icon_name (ic->priv->engine));
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_focus_out:
|
||||
* @ic: a #NimfServiceIC
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_focus_out (NimfServiceIC *ic)
|
||||
{
|
||||
g_return_if_fail (ic != NULL);
|
||||
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (G_UNLIKELY (ic->priv->engine == NULL))
|
||||
return;
|
||||
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
nimf_engine_focus_out (ic->priv->engine, ic);
|
||||
|
||||
if (server->priv->last_focused_im == ic)
|
||||
nimf_service_ic_engine_changed (ic, NULL, "nimf-focus-out");
|
||||
|
||||
nimf_preeditable_hide (server->priv->preeditable);
|
||||
}
|
||||
|
||||
static gint
|
||||
on_comparing_engine_with_id (NimfEngine *engine, const gchar *id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_strcmp0 (nimf_engine_get_id (engine), id);
|
||||
}
|
||||
|
||||
static GList *
|
||||
nimf_service_ic_load_engines (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GList *engines = NULL;
|
||||
NimfServer *server;
|
||||
GList *l;
|
||||
|
||||
server = nimf_server_get_default ();
|
||||
|
||||
for (l = server->priv->engines; l != NULL; l = l->next)
|
||||
{
|
||||
NimfModule *module;
|
||||
const gchar *engine_id;
|
||||
|
||||
engine_id = nimf_engine_get_id (NIMF_ENGINE (l->data));
|
||||
module = g_hash_table_lookup (server->priv->modules, engine_id);
|
||||
engines = g_list_prepend (engines, g_object_new (module->type, NULL));
|
||||
}
|
||||
|
||||
return engines;
|
||||
}
|
||||
|
||||
static NimfEngine *
|
||||
nimf_service_ic_get_engine_by_id (NimfServiceIC *ic, const gchar *engine_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GList *list;
|
||||
|
||||
if (ic->priv->engines == NULL)
|
||||
ic->priv->engines = nimf_service_ic_load_engines (ic);
|
||||
|
||||
list = g_list_find_custom (ic->priv->engines, engine_id,
|
||||
(GCompareFunc) on_comparing_engine_with_id);
|
||||
if (list)
|
||||
return list->data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static NimfEngine *
|
||||
nimf_service_ic_get_next_engine (NimfServiceIC *ic, NimfEngine *engine)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GList *list;
|
||||
|
||||
if (ic->priv->engines == NULL)
|
||||
ic->priv->engines = nimf_service_ic_load_engines (ic);
|
||||
|
||||
list = g_list_find (ic->priv->engines, engine);
|
||||
|
||||
if (list == NULL)
|
||||
list = g_list_find_custom (ic->priv->engines, nimf_engine_get_id (engine),
|
||||
(GCompareFunc) on_comparing_engine_with_id);
|
||||
|
||||
list = g_list_next (list);
|
||||
|
||||
if (list == NULL)
|
||||
list = ic->priv->engines;
|
||||
|
||||
return list->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_filter_event:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @event: a #NimfEvent
|
||||
*
|
||||
* Returns: TRUE if the event is consumed.
|
||||
*/
|
||||
gboolean
|
||||
nimf_service_ic_filter_event (NimfServiceIC *ic,
|
||||
NimfEvent *event)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_val_if_fail (ic != NULL, FALSE);
|
||||
|
||||
if (G_UNLIKELY (ic->priv->engine == NULL))
|
||||
return FALSE;
|
||||
|
||||
GHashTableIter iter;
|
||||
NimfShortcut *shortcut;
|
||||
gpointer engine_id;
|
||||
const gchar *engine_id0 = nimf_engine_get_id (ic->priv->engine);
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
g_hash_table_iter_init (&iter, server->priv->shortcuts);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, &engine_id, (gpointer) &shortcut))
|
||||
{
|
||||
if ((shortcut->to_lang &&
|
||||
nimf_event_matches (event, (const NimfKey **) shortcut->to_lang) &&
|
||||
g_strcmp0 (engine_id0, engine_id)))
|
||||
{
|
||||
if (event->key.type == NIMF_EVENT_KEY_PRESS)
|
||||
{
|
||||
nimf_service_ic_reset (ic);
|
||||
nimf_service_ic_change_engine_by_id (ic, engine_id);
|
||||
}
|
||||
|
||||
if (event->key.keyval == NIMF_KEY_Escape)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ((shortcut->to_sys &&
|
||||
nimf_event_matches (event, (const NimfKey **) shortcut->to_sys) &&
|
||||
!g_strcmp0 (engine_id0, engine_id)))
|
||||
{
|
||||
if (event->key.type == NIMF_EVENT_KEY_PRESS)
|
||||
{
|
||||
nimf_service_ic_reset (ic);
|
||||
nimf_service_ic_change_engine_by_id (ic, "nimf-system-keyboard");
|
||||
}
|
||||
|
||||
if (event->key.keyval == NIMF_KEY_Escape)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (nimf_event_matches (event, (const NimfKey **) server->priv->hotkeys))
|
||||
{
|
||||
if (event->key.type == NIMF_EVENT_KEY_PRESS)
|
||||
{
|
||||
nimf_service_ic_reset (ic);
|
||||
|
||||
if (server->priv->use_singleton)
|
||||
ic->priv->engine = nimf_server_get_next_engine (server, ic->priv->engine);
|
||||
else
|
||||
ic->priv->engine = nimf_service_ic_get_next_engine (ic, ic->priv->engine);
|
||||
|
||||
nimf_service_ic_engine_changed (ic, nimf_engine_get_id (ic->priv->engine),
|
||||
nimf_engine_get_icon_name (ic->priv->engine));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return nimf_engine_filter_event (ic->priv->engine, ic, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_set_surrounding:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @text: text
|
||||
* @len: length
|
||||
* @cursor_index: cursor index
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_set_surrounding (NimfServiceIC *ic,
|
||||
const char *text,
|
||||
gint len,
|
||||
gint cursor_index)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (ic != NULL);
|
||||
|
||||
if (G_UNLIKELY (ic->priv->engine == NULL))
|
||||
return;
|
||||
|
||||
nimf_engine_set_surrounding (ic->priv->engine, text, len, cursor_index);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_set_use_preedit:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @use_preedit: whether the input method should use an on-the-spot input style
|
||||
*
|
||||
* If @use_preedit is %FALSE (default is %TRUE), then the input method may use
|
||||
* some other input styles, such as over-the-spot, off-the-spot or root-window.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_set_use_preedit (NimfServiceIC *ic,
|
||||
gboolean use_preedit)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: %d", G_STRFUNC, use_preedit);
|
||||
|
||||
g_return_if_fail (ic != NULL);
|
||||
|
||||
if (ic->priv->use_preedit == TRUE && use_preedit == FALSE)
|
||||
{
|
||||
ic->priv->use_preedit = FALSE;
|
||||
|
||||
if (ic->priv->preedit_state == NIMF_PREEDIT_STATE_START)
|
||||
{
|
||||
nimf_service_ic_emit_preedit_changed (ic, ic->priv->preedit_string,
|
||||
ic->priv->preedit_attrs,
|
||||
ic->priv->preedit_cursor_pos);
|
||||
nimf_service_ic_emit_preedit_end (ic);
|
||||
}
|
||||
}
|
||||
else if (ic->priv->use_preedit == FALSE && use_preedit == TRUE)
|
||||
{
|
||||
ic->priv->use_preedit = TRUE;
|
||||
|
||||
if (ic->priv->preedit_string[0] != 0)
|
||||
{
|
||||
nimf_service_ic_emit_preedit_start (ic);
|
||||
nimf_service_ic_emit_preedit_changed (ic, ic->priv->preedit_string,
|
||||
ic->priv->preedit_attrs,
|
||||
ic->priv->preedit_cursor_pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_get_use_preedit:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Returns: TRUE if an on-the-spot input style is used
|
||||
*/
|
||||
gboolean
|
||||
nimf_service_ic_get_use_preedit (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return ic->priv->use_preedit;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_set_cursor_location:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @area: a #NimfRectangle
|
||||
*
|
||||
* Notifies the service @ic that a change in cursor position has been made. The
|
||||
* location is the position of a window position in root window coordinates.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_set_cursor_location (NimfServiceIC *ic,
|
||||
const NimfRectangle *area)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (ic != NULL);
|
||||
|
||||
if (G_UNLIKELY (ic->priv->engine == NULL))
|
||||
return;
|
||||
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
*ic->priv->cursor_area = *area;
|
||||
|
||||
if (!ic->priv->use_preedit)
|
||||
nimf_preeditable_set_cursor_location (server->priv->preeditable, area);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_get_cursor_location:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Returns: (transfer none): a #NimfRectangle
|
||||
*/
|
||||
const NimfRectangle *
|
||||
nimf_service_ic_get_cursor_location (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return ic->priv->cursor_area;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_reset:
|
||||
* @ic: a #NimfServiceIC
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_reset (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (ic != NULL);
|
||||
|
||||
if (G_LIKELY (ic->priv->engine))
|
||||
nimf_engine_reset (ic->priv->engine, ic);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_change_engine_by_id:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @engine_id: engine id
|
||||
*
|
||||
* Changes the engine by engine id.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_change_engine_by_id (NimfServiceIC *ic,
|
||||
const gchar *engine_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEngine *engine;
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
if (server->priv->use_singleton)
|
||||
engine = nimf_server_get_engine_by_id (server, engine_id);
|
||||
else
|
||||
engine = nimf_service_ic_get_engine_by_id (ic, engine_id);
|
||||
|
||||
g_return_if_fail (engine != NULL);
|
||||
|
||||
ic->priv->engine = engine;
|
||||
nimf_service_ic_engine_changed (ic, engine_id,
|
||||
nimf_engine_get_icon_name (ic->priv->engine));
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_change_engine:
|
||||
* @ic: a #NimfServiceIC
|
||||
* @engine_id: engine id
|
||||
* @method_id: method id
|
||||
*
|
||||
* Changes the engine by engine id and method id.
|
||||
*/
|
||||
void
|
||||
nimf_service_ic_change_engine (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
const gchar *method_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEngine *engine;
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
if (server->priv->use_singleton)
|
||||
engine = nimf_server_get_engine_by_id (server, engine_id);
|
||||
else
|
||||
engine = nimf_service_ic_get_engine_by_id (ic, engine_id);
|
||||
|
||||
g_return_if_fail (engine != NULL);
|
||||
|
||||
ic->priv->engine = engine;
|
||||
nimf_engine_set_method (engine, method_id);
|
||||
nimf_service_ic_engine_changed (ic, engine_id,
|
||||
nimf_engine_get_icon_name (ic->priv->engine));
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_get_service_id:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Returns: (transfer none): a service id
|
||||
*/
|
||||
const gchar *
|
||||
nimf_service_ic_get_service_id (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceICClass *class = NIMF_SERVICE_IC_GET_CLASS (ic);
|
||||
|
||||
if (class->get_service_id)
|
||||
{
|
||||
return class->get_service_id (ic);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_critical (G_STRLOC ": %s: You should implement your_get_service_id ()",
|
||||
G_STRFUNC);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_ic_get_engine:
|
||||
* @ic: a #NimfServiceIC
|
||||
*
|
||||
* Returns the associated #NimfEngine instance.
|
||||
*
|
||||
* Returns: (transfer none): the engine instance
|
||||
*/
|
||||
NimfEngine *
|
||||
nimf_service_ic_get_engine (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return ic->priv->engine;
|
||||
}
|
||||
|
||||
static NimfEngine *
|
||||
nimf_service_ic_get_default_engine (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GSettings *settings;
|
||||
gchar *engine_id;
|
||||
NimfEngine *engine;
|
||||
|
||||
settings = g_settings_new ("org.nimf.engines");
|
||||
engine_id = g_settings_get_string (settings, "default-engine");
|
||||
engine = nimf_service_ic_get_engine_by_id (ic, engine_id);
|
||||
|
||||
if (G_UNLIKELY (engine == NULL))
|
||||
{
|
||||
g_settings_reset (settings, "default-engine");
|
||||
g_free (engine_id);
|
||||
engine_id = g_settings_get_string (settings, "default-engine");
|
||||
engine = nimf_service_ic_get_engine_by_id (ic, engine_id);
|
||||
}
|
||||
|
||||
g_free (engine_id);
|
||||
g_object_unref (settings);
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_service_ic_init (NimfServiceIC *ic)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
ic->priv = nimf_service_ic_get_instance_private (ic);
|
||||
ic->priv->cursor_area = g_slice_new0 (NimfRectangle);
|
||||
}
|
||||
|
||||
void
|
||||
nimf_service_ic_load_engine (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (ic->priv->engines)
|
||||
{
|
||||
if (server->priv->use_singleton)
|
||||
{
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
if (g_list_find (server->priv->engines, ic->priv->engine) == NULL)
|
||||
{
|
||||
const gchar *id = nimf_engine_get_id (ic->priv->engine);
|
||||
ic->priv->engine = nimf_server_get_engine_by_id (server, id);
|
||||
}
|
||||
|
||||
g_list_free_full (ic->priv->engines, g_object_unref);
|
||||
ic->priv->engines = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
NimfModule *module;
|
||||
NimfEngine *engine;
|
||||
|
||||
module = g_hash_table_lookup (server->priv->modules, engine_id);
|
||||
engine = g_object_new (module->type, NULL);
|
||||
ic->priv->engines = g_list_prepend (ic->priv->engines, engine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nimf_service_ic_unload_engine (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
NimfEngine *signleton_engine_to_be_deleted,
|
||||
NimfServer *server)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (ic->priv->engines)
|
||||
{
|
||||
GList *list;
|
||||
list = g_list_find_custom (ic->priv->engines, engine_id,
|
||||
(GCompareFunc) on_comparing_engine_with_id);
|
||||
if (list)
|
||||
{
|
||||
if (ic->priv->engine == list->data)
|
||||
{
|
||||
if (server->priv->use_singleton)
|
||||
ic->priv->engine = nimf_server_get_default_engine (server);
|
||||
else
|
||||
ic->priv->engine = nimf_service_ic_get_default_engine (ic);
|
||||
}
|
||||
|
||||
g_object_unref (list->data);
|
||||
ic->priv->engines = g_list_delete_link (ic->priv->engines, list);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ic->priv->engine == signleton_engine_to_be_deleted)
|
||||
{
|
||||
if (server->priv->use_singleton)
|
||||
ic->priv->engine = nimf_server_get_default_engine (server);
|
||||
else
|
||||
ic->priv->engine = nimf_service_ic_get_default_engine (ic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_service_ic_constructed (GObject *object)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceIC *ic = NIMF_SERVICE_IC (object);
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
ic->priv->use_preedit = TRUE;
|
||||
ic->priv->preedit_state = NIMF_PREEDIT_STATE_END;
|
||||
|
||||
if (server->priv->use_singleton)
|
||||
{
|
||||
ic->priv->engine = nimf_server_get_default_engine (server);
|
||||
}
|
||||
else
|
||||
{
|
||||
ic->priv->engines = nimf_service_ic_load_engines (ic);
|
||||
ic->priv->engine = nimf_service_ic_get_default_engine (ic);
|
||||
}
|
||||
|
||||
ic->priv->preedit_string = g_strdup ("");
|
||||
ic->priv->preedit_attrs = g_malloc0_n (1, sizeof (NimfPreeditAttr *));
|
||||
ic->priv->preedit_attrs[0] = NULL;
|
||||
ic->priv->preedit_cursor_pos = 0;
|
||||
|
||||
g_ptr_array_add (server->priv->ics, ic);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_service_ic_finalize (GObject *object)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceIC *ic = NIMF_SERVICE_IC (object);
|
||||
NimfServer *server = nimf_server_get_default ();
|
||||
|
||||
g_ptr_array_remove_fast (server->priv->ics, ic);
|
||||
|
||||
if (ic->priv->engines)
|
||||
g_list_free_full (ic->priv->engines, g_object_unref);
|
||||
|
||||
g_free (ic->priv->preedit_string);
|
||||
nimf_preedit_attr_freev (ic->priv->preedit_attrs);
|
||||
g_slice_free (NimfRectangle, ic->priv->cursor_area);
|
||||
|
||||
G_OBJECT_CLASS (nimf_service_ic_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_service_ic_class_init (NimfServiceICClass *class)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = nimf_service_ic_finalize;
|
||||
object_class->constructed = nimf_service_ic_constructed;
|
||||
}
|
||||
119
Telegram/ThirdParty/nimf/libnimf/nimf-service-ic.h
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-service-ic.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_SERVICE_IC_H__
|
||||
#define __NIMF_SERVICE_IC_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include "nimf-types.h"
|
||||
#include "nimf-events.h"
|
||||
#include "nimf-engine.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_SERVICE_IC (nimf_service_ic_get_type ())
|
||||
#define NIMF_SERVICE_IC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_TYPE_SERVICE_IC, NimfServiceIC))
|
||||
#define NIMF_SERVICE_IC_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), NIMF_TYPE_SERVICE_IC, NimfServiceICClass))
|
||||
#define NIMF_IS_SERVICE_IC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NIMF_TYPE_SERVICE_IC))
|
||||
#define NIMF_SERVICE_IC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NIMF_TYPE_SERVICE_IC, NimfServiceICClass))
|
||||
|
||||
#ifndef __GTK_DOC_IGNORE__
|
||||
typedef struct _NimfEngine NimfEngine;
|
||||
#endif
|
||||
typedef struct _NimfServiceIC NimfServiceIC;
|
||||
typedef struct _NimfServiceICClass NimfServiceICClass;
|
||||
typedef struct _NimfServiceICPrivate NimfServiceICPrivate;
|
||||
|
||||
struct _NimfServiceICClass
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Virtual functions */
|
||||
const gchar * (* get_service_id) (NimfServiceIC *ic);
|
||||
|
||||
void (* emit_commit) (NimfServiceIC *ic,
|
||||
const gchar *text);
|
||||
void (* emit_preedit_start) (NimfServiceIC *ic);
|
||||
void (* emit_preedit_changed) (NimfServiceIC *ic,
|
||||
const gchar *preedit_string,
|
||||
NimfPreeditAttr **attrs,
|
||||
gint cursor_pos);
|
||||
void (* emit_preedit_end) (NimfServiceIC *ic);
|
||||
gboolean (* emit_retrieve_surrounding) (NimfServiceIC *ic);
|
||||
gboolean (* emit_delete_surrounding) (NimfServiceIC *ic,
|
||||
gint offset,
|
||||
gint n_chars);
|
||||
void (* emit_beep) (NimfServiceIC *ic);
|
||||
};
|
||||
|
||||
struct _NimfServiceIC
|
||||
{
|
||||
GObject parent_instance;
|
||||
NimfServiceICPrivate *priv;
|
||||
};
|
||||
|
||||
GType nimf_service_ic_get_type (void) G_GNUC_CONST;
|
||||
void nimf_service_ic_focus_in (NimfServiceIC *ic);
|
||||
void nimf_service_ic_focus_out (NimfServiceIC *ic);
|
||||
gboolean nimf_service_ic_filter_event (NimfServiceIC *ic,
|
||||
NimfEvent *event);
|
||||
void nimf_service_ic_set_surrounding (NimfServiceIC *ic,
|
||||
const char *text,
|
||||
gint len,
|
||||
gint cursor_index);
|
||||
void nimf_service_ic_set_use_preedit (NimfServiceIC *ic,
|
||||
gboolean use_preedit);
|
||||
gboolean nimf_service_ic_get_use_preedit (NimfServiceIC *ic);
|
||||
void nimf_service_ic_set_cursor_location (NimfServiceIC *ic,
|
||||
const NimfRectangle *area);
|
||||
const NimfRectangle *
|
||||
nimf_service_ic_get_cursor_location (NimfServiceIC *ic);
|
||||
void nimf_service_ic_reset (NimfServiceIC *ic);
|
||||
void nimf_service_ic_change_engine_by_id (NimfServiceIC *ic,
|
||||
const gchar *engine_id);
|
||||
void nimf_service_ic_change_engine (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
const gchar *method_id);
|
||||
void nimf_service_ic_engine_changed (NimfServiceIC *ic,
|
||||
const gchar *engine_id,
|
||||
const gchar *name);
|
||||
NimfEngine *nimf_service_ic_get_engine (NimfServiceIC *ic);
|
||||
const gchar *nimf_service_ic_get_service_id (NimfServiceIC *ic);
|
||||
/* signals */
|
||||
void nimf_service_ic_emit_preedit_start (NimfServiceIC *ic);
|
||||
void nimf_service_ic_emit_preedit_changed (NimfServiceIC *ic,
|
||||
const gchar *preedit_string,
|
||||
NimfPreeditAttr **attrs,
|
||||
gint cursor_pos);
|
||||
void nimf_service_ic_emit_preedit_end (NimfServiceIC *ic);
|
||||
void nimf_service_ic_emit_commit (NimfServiceIC *ic,
|
||||
const gchar *text);
|
||||
gboolean nimf_service_ic_emit_retrieve_surrounding (NimfServiceIC *ic);
|
||||
gboolean nimf_service_ic_emit_delete_surrounding (NimfServiceIC *ic,
|
||||
gint offset,
|
||||
gint n_chars);
|
||||
void nimf_service_ic_emit_beep (NimfServiceIC *ic);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_SERVICE_IC_H__ */
|
||||
172
Telegram/ThirdParty/nimf/libnimf/nimf-service.c
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-service.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2017-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-service.h"
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (NimfService, nimf_service, G_TYPE_OBJECT);
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_SERVER
|
||||
};
|
||||
|
||||
static void
|
||||
nimf_service_init (NimfService *service)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_service_finalize (GObject *object)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
G_OBJECT_CLASS (nimf_service_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_get_id:
|
||||
* @service: a #NimfService
|
||||
*
|
||||
* Gets the ID of a @service.
|
||||
*
|
||||
* Returns: the ID of a service
|
||||
*/
|
||||
const gchar *
|
||||
nimf_service_get_id (NimfService *service)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceClass *class = NIMF_SERVICE_GET_CLASS (service);
|
||||
|
||||
if (class->get_id (service))
|
||||
return class->get_id (service);
|
||||
else
|
||||
g_error (G_STRLOC ": %s: You should implement your_service_get_id ()",
|
||||
G_STRFUNC);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_start:
|
||||
* @service: a #NimfService
|
||||
*
|
||||
* Starts @service.
|
||||
*
|
||||
* Returns: %TRUE if a service is started.
|
||||
*/
|
||||
gboolean
|
||||
nimf_service_start (NimfService *service)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceClass *class = NIMF_SERVICE_GET_CLASS (service);
|
||||
|
||||
if (class->start)
|
||||
return class->start (service);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_stop:
|
||||
* @service: a #NimfService
|
||||
*
|
||||
* Stops a @service.
|
||||
*/
|
||||
void
|
||||
nimf_service_stop (NimfService *service)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceClass *class = NIMF_SERVICE_GET_CLASS (service);
|
||||
|
||||
if (class->stop)
|
||||
class->stop (service);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_is_active:
|
||||
* @service: a #NimfService
|
||||
*
|
||||
* Returns: %TRUE if a service is active
|
||||
*/
|
||||
gboolean
|
||||
nimf_service_is_active (NimfService *service)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceClass *class = NIMF_SERVICE_GET_CLASS (service);
|
||||
|
||||
if (class->is_active (service))
|
||||
return class->is_active (service);
|
||||
else
|
||||
g_error (G_STRLOC ": %s: You should implement your_service_is_active ()",
|
||||
G_STRFUNC);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_change_engine_by_id:
|
||||
* @service: a #NimfService
|
||||
* @engine_id: engine id
|
||||
*/
|
||||
void
|
||||
nimf_service_change_engine_by_id (NimfService *service,
|
||||
const gchar *engine_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceClass *class = NIMF_SERVICE_GET_CLASS (service);
|
||||
|
||||
if (class->change_engine_by_id)
|
||||
class->change_engine_by_id (service, engine_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_service_change_engine:
|
||||
* @service: a #NimfService
|
||||
* @engine_id: engine id
|
||||
* @method_id: method id
|
||||
*/
|
||||
void
|
||||
nimf_service_change_engine (NimfService *service,
|
||||
const gchar *engine_id,
|
||||
const gchar *method_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfServiceClass *class = NIMF_SERVICE_GET_CLASS (service);
|
||||
|
||||
if (class->change_engine_by_id)
|
||||
class->change_engine (service, engine_id, method_id);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_service_class_init (NimfServiceClass *class)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
G_OBJECT_CLASS (class)->finalize = nimf_service_finalize;
|
||||
}
|
||||
87
Telegram/ThirdParty/nimf/libnimf/nimf-service.h
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-service.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2017-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_SERVICE_H__
|
||||
#define __NIMF_SERVICE_H__
|
||||
|
||||
#if !defined (__NIMF_H_INSIDE__) && !defined (NIMF_COMPILATION)
|
||||
#error "Only <nimf.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NIMF_TYPE_SERVICE (nimf_service_get_type ())
|
||||
#define NIMF_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_TYPE_SERVICE, NimfService))
|
||||
#define NIMF_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), NIMF_TYPE_SERVICE, NimfServiceClass))
|
||||
#define NIMF_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NIMF_TYPE_SERVICE))
|
||||
#define NIMF_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NIMF_TYPE_SERVICE, NimfServiceClass))
|
||||
|
||||
typedef struct _NimfService NimfService;
|
||||
typedef struct _NimfServiceClass NimfServiceClass;
|
||||
|
||||
struct _NimfService
|
||||
{
|
||||
GObject parent_instance;
|
||||
};
|
||||
|
||||
/**
|
||||
* NimfServiceClass:
|
||||
* @get_id: Returns a service id.
|
||||
* @start: Starts a service.
|
||||
* @stop: Stops a service.
|
||||
* @is_active: Whether a service is active or not
|
||||
* @change_engine_by_id: Changes an engine by engine id.
|
||||
* @change_engine: Changes an engine with engine id and method id.
|
||||
*/
|
||||
struct _NimfServiceClass
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Virtual functions */
|
||||
const gchar * (* get_id) (NimfService *service);
|
||||
gboolean (* start) (NimfService *service);
|
||||
void (* stop) (NimfService *service);
|
||||
gboolean (* is_active) (NimfService *service);
|
||||
void (* change_engine_by_id) (NimfService *service,
|
||||
const gchar *engine_id);
|
||||
void (* change_engine) (NimfService *service,
|
||||
const gchar *engine_id,
|
||||
const gchar *method_id);
|
||||
};
|
||||
|
||||
GType nimf_service_get_type (void) G_GNUC_CONST;
|
||||
gboolean nimf_service_start (NimfService *service);
|
||||
void nimf_service_stop (NimfService *service);
|
||||
gboolean nimf_service_is_active (NimfService *service);
|
||||
const gchar *nimf_service_get_id (NimfService *service);
|
||||
void nimf_service_change_engine_by_id (NimfService *service,
|
||||
const gchar *engine_id);
|
||||
void nimf_service_change_engine (NimfService *service,
|
||||
const gchar *engine_id,
|
||||
const gchar *method_id);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_SERVICE_H__ */
|
||||
297
Telegram/ThirdParty/nimf/libnimf/nimf-types.c
vendored
Normal file
@@ -0,0 +1,297 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-types.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-types.h"
|
||||
#include "nimf-enum-types-private.h"
|
||||
|
||||
/**
|
||||
* SECTION:nimf-types
|
||||
* @title: Types
|
||||
* @section_id: nimf-types
|
||||
*/
|
||||
|
||||
/**
|
||||
* nimf_key_new:
|
||||
*
|
||||
* Creates a new #NimfKey. All fields are set to 0.
|
||||
*
|
||||
* Return: a new #NimfKey, which should be freed with nimf_key_free().
|
||||
*/
|
||||
NimfKey *
|
||||
nimf_key_new ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_slice_new0 (NimfKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_key_new_from_nicks:
|
||||
* @nicks: an array of gchar
|
||||
*
|
||||
* Return: a new #NimfKey, which should be freed with nimf_key_free().
|
||||
*/
|
||||
NimfKey *
|
||||
nimf_key_new_from_nicks (const gchar **nicks)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfKey *key = g_slice_new0 (NimfKey);
|
||||
GEnumValue *enum_value; /* Do not free */
|
||||
GFlagsValue *flags_value; /* Do not free */
|
||||
GFlagsClass *flags_class = g_type_class_ref (NIMF_TYPE_MODIFIER_TYPE);
|
||||
GEnumClass *enum_class = g_type_class_ref (NIMF_TYPE_KEY_SYM);
|
||||
|
||||
gint i;
|
||||
for (i = 0; nicks[i] != NULL; i++)
|
||||
{
|
||||
if (g_str_has_prefix (nicks[i], "<"))
|
||||
{
|
||||
flags_value = g_flags_get_value_by_nick (flags_class, nicks[i]);
|
||||
|
||||
if (flags_value)
|
||||
key->state |= flags_value->value;
|
||||
else
|
||||
g_warning ("NimfModifierType doesn't have a member with that nickname: %s", nicks[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
enum_value = g_enum_get_value_by_nick (enum_class, nicks[i]);
|
||||
|
||||
if (enum_value)
|
||||
key->keyval = enum_value->value;
|
||||
else
|
||||
g_warning ("NimfKeySym doesn't have a member with that nickname: %s", nicks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
g_type_class_unref (flags_class);
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_key_newv:
|
||||
* @keys: an array of gchar
|
||||
*
|
||||
* Creates a new array of #NimfKey.
|
||||
*
|
||||
* Returns: a new array of #NimfKey, which should be freed with
|
||||
* nimf_key_freev().
|
||||
*/
|
||||
NimfKey **
|
||||
nimf_key_newv (const gchar **keys)
|
||||
{
|
||||
NimfKey **nimf_keys = g_malloc0_n (1, sizeof (NimfKey *));
|
||||
|
||||
gint i;
|
||||
for (i = 0; keys[i] != NULL; i++)
|
||||
{
|
||||
gchar **nicks = g_strsplit (keys[i], " ", -1);
|
||||
NimfKey *key = nimf_key_new_from_nicks ((const gchar **) nicks);
|
||||
g_strfreev (nicks);
|
||||
|
||||
nimf_keys = g_realloc_n (nimf_keys, sizeof (NimfKey *), i + 2);
|
||||
nimf_keys[i] = key;
|
||||
nimf_keys[i + 1] = NULL;
|
||||
}
|
||||
|
||||
return nimf_keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_key_freev:
|
||||
* @keys: an array of #NimfKey
|
||||
*
|
||||
* Frees an array of @keys
|
||||
*/
|
||||
void
|
||||
nimf_key_freev (NimfKey **keys)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (keys)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; keys[i] != NULL; i++)
|
||||
nimf_key_free (keys[i]);
|
||||
|
||||
g_free (keys);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_key_free:
|
||||
* @key: a #NimfKey
|
||||
*
|
||||
* Frees a @key
|
||||
*/
|
||||
void
|
||||
nimf_key_free (NimfKey *key)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_return_if_fail (key != NULL);
|
||||
|
||||
g_slice_free (NimfKey, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preedit_attr_new:
|
||||
* @type: a #NimfPreeditAttrType
|
||||
* @start_index: start index in characters
|
||||
* @end_index: end index in characters; The character at this index is not
|
||||
* included.
|
||||
*
|
||||
* Returns: a new #NimfPreeditAttr, which should be freed with
|
||||
* nimf_preedit_attr_free().
|
||||
*/
|
||||
NimfPreeditAttr *
|
||||
nimf_preedit_attr_new (NimfPreeditAttrType type,
|
||||
guint start_index,
|
||||
guint end_index)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfPreeditAttr *attr;
|
||||
|
||||
attr = g_new (NimfPreeditAttr, 1);
|
||||
attr->type = type;
|
||||
attr->start_index = start_index;
|
||||
attr->end_index = end_index;
|
||||
|
||||
return attr;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preedit_attrs_copy:
|
||||
* @attrs: an array of #NimfPreeditAttr
|
||||
*
|
||||
* Returns: a new array of #NimfPreeditAttr, which should be freed with
|
||||
* nimf_preedit_attr_freev().
|
||||
*/
|
||||
NimfPreeditAttr **
|
||||
nimf_preedit_attrs_copy (NimfPreeditAttr **attrs)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfPreeditAttr **preedit_attrs;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (attrs, NULL);
|
||||
|
||||
preedit_attrs = g_malloc0_n (1, sizeof (NimfPreeditAttr *));
|
||||
|
||||
for (i = 0; attrs[i] != NULL; i++)
|
||||
{
|
||||
preedit_attrs = g_realloc_n (preedit_attrs, 1 + i + 1, sizeof (NimfPreeditAttr *));
|
||||
preedit_attrs[i] = g_memdup (attrs[i], sizeof (NimfPreeditAttr));
|
||||
preedit_attrs[i + 1] = NULL;
|
||||
}
|
||||
|
||||
return preedit_attrs;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preedit_attr_free:
|
||||
* @attr: a #NimfPreeditAttr
|
||||
*
|
||||
* Frees a @attr
|
||||
*/
|
||||
void
|
||||
nimf_preedit_attr_free (NimfPreeditAttr *attr)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_free (attr);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_preedit_attr_freev:
|
||||
* @attrs: an array of #NimfPreeditAttr
|
||||
*
|
||||
* Frees an array of @attrs
|
||||
*/
|
||||
void
|
||||
nimf_preedit_attr_freev (NimfPreeditAttr **attrs)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (attrs)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; attrs[i] != NULL; i++)
|
||||
nimf_preedit_attr_free (attrs[i]);
|
||||
|
||||
g_free (attrs);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_method_info_new:
|
||||
*
|
||||
* Returns: a new #NimfMethodInfo, which should be freed with
|
||||
* nimf_method_info_free().
|
||||
*/
|
||||
NimfMethodInfo *
|
||||
nimf_method_info_new ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_slice_new0 (NimfMethodInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_method_info_free:
|
||||
* @info: a #NimfMethodInfo
|
||||
*
|
||||
* Frees an @info.
|
||||
*/
|
||||
void
|
||||
nimf_method_info_free (NimfMethodInfo *info)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (info)
|
||||
g_slice_free (NimfMethodInfo, info);
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_method_info_freev:
|
||||
* @infos: an array of #NimfMethodInfo
|
||||
*
|
||||
* Frees an array of @infos.
|
||||
*/
|
||||
void
|
||||
nimf_method_info_freev (NimfMethodInfo **infos)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (infos)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; infos[i]; i++)
|
||||
nimf_method_info_free (infos[i]);
|
||||
|
||||
g_free (infos);
|
||||
}
|
||||
}
|
||||
210
Telegram/ThirdParty/nimf/libnimf/nimf-types.h
vendored
Normal file
@@ -0,0 +1,210 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-types.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_TYPES_H__
|
||||
#define __NIMF_TYPES_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* copied from GdkModifierType in gdktypes.h for compatibility */
|
||||
/**
|
||||
* NimfModifierType:
|
||||
* @NIMF_SHIFT_MASK: the Shift key.
|
||||
* @NIMF_LOCK_MASK: a Lock key (depending on the modifier mapping of the
|
||||
* X server this may either be CapsLock or ShiftLock).
|
||||
* @NIMF_CONTROL_MASK: the Control key.
|
||||
* @NIMF_MOD1_MASK: the fourth modifier key (it depends on the modifier
|
||||
* mapping of the X server which key is interpreted as this modifier, but
|
||||
* normally it is the Alt key).
|
||||
* @NIMF_MOD2_MASK: the fifth modifier key (it depends on the modifier
|
||||
* mapping of the X server which key is interpreted as this modifier).
|
||||
* @NIMF_MOD3_MASK: the sixth modifier key (it depends on the modifier
|
||||
* mapping of the X server which key is interpreted as this modifier).
|
||||
* @NIMF_MOD4_MASK: the seventh modifier key (it depends on the modifier
|
||||
* mapping of the X server which key is interpreted as this modifier).
|
||||
* @NIMF_MOD5_MASK: the eighth modifier key (it depends on the modifier
|
||||
* mapping of the X server which key is interpreted as this modifier).
|
||||
* @NIMF_BUTTON1_MASK: the first mouse button.
|
||||
* @NIMF_BUTTON2_MASK: the second mouse button.
|
||||
* @NIMF_BUTTON3_MASK: the third mouse button.
|
||||
* @NIMF_BUTTON4_MASK: the fourth mouse button.
|
||||
* @NIMF_BUTTON5_MASK: the fifth mouse button.
|
||||
* @NIMF_MODIFIER_RESERVED_13_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_14_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_15_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_16_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_17_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_18_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_19_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_20_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_21_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_22_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_23_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_24_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_MODIFIER_RESERVED_25_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_SUPER_MASK: the Super modifier.
|
||||
* @NIMF_HYPER_MASK: the Hyper modifier.
|
||||
* @NIMF_META_MASK: the Meta modifier.
|
||||
* @NIMF_MODIFIER_RESERVED_29_MASK: A reserved bit flag; do not use in your own code
|
||||
* @NIMF_RELEASE_MASK: exists because of compatibility.
|
||||
* @NIMF_MODIFIER_MASK: a mask covering all modifier types.
|
||||
*
|
||||
* A set of bit-flags to indicate the state of modifier keys and mouse buttons
|
||||
* in various event types. Typical modifier keys are Shift, Control, Meta,
|
||||
* Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NIMF_SHIFT_MASK = 1 << 0, /*< nick=<Shift> >*/
|
||||
NIMF_LOCK_MASK = 1 << 1, /*< nick=<Lock> >*/
|
||||
NIMF_CONTROL_MASK = 1 << 2, /*< nick=<Control> >*/
|
||||
NIMF_MOD1_MASK = 1 << 3, /*< nick=<Mod1> >*/
|
||||
NIMF_MOD2_MASK = 1 << 4, /*< nick=<Mod2> >*/
|
||||
NIMF_MOD3_MASK = 1 << 5, /*< nick=<Mod3> >*/
|
||||
NIMF_MOD4_MASK = 1 << 6, /*< nick=<Mod4> >*/
|
||||
NIMF_MOD5_MASK = 1 << 7, /*< nick=<Mod5> >*/
|
||||
NIMF_BUTTON1_MASK = 1 << 8, /*< nick=<Button1> >*/
|
||||
NIMF_BUTTON2_MASK = 1 << 9, /*< nick=<Button2> >*/
|
||||
NIMF_BUTTON3_MASK = 1 << 10, /*< nick=<Button3> >*/
|
||||
NIMF_BUTTON4_MASK = 1 << 11, /*< nick=<Button4> >*/
|
||||
NIMF_BUTTON5_MASK = 1 << 12, /*< nick=<Button5> >*/
|
||||
|
||||
NIMF_MODIFIER_RESERVED_13_MASK = 1 << 13,
|
||||
NIMF_MODIFIER_RESERVED_14_MASK = 1 << 14,
|
||||
NIMF_MODIFIER_RESERVED_15_MASK = 1 << 15,
|
||||
NIMF_MODIFIER_RESERVED_16_MASK = 1 << 16,
|
||||
NIMF_MODIFIER_RESERVED_17_MASK = 1 << 17,
|
||||
NIMF_MODIFIER_RESERVED_18_MASK = 1 << 18,
|
||||
NIMF_MODIFIER_RESERVED_19_MASK = 1 << 19,
|
||||
NIMF_MODIFIER_RESERVED_20_MASK = 1 << 20,
|
||||
NIMF_MODIFIER_RESERVED_21_MASK = 1 << 21,
|
||||
NIMF_MODIFIER_RESERVED_22_MASK = 1 << 22,
|
||||
NIMF_MODIFIER_RESERVED_23_MASK = 1 << 23,
|
||||
NIMF_MODIFIER_RESERVED_24_MASK = 1 << 24,
|
||||
NIMF_MODIFIER_RESERVED_25_MASK = 1 << 25,
|
||||
|
||||
NIMF_SUPER_MASK = 1 << 26, /*< nick=<Super> >*/
|
||||
NIMF_HYPER_MASK = 1 << 27, /*< nick=<Hyper> >*/
|
||||
NIMF_META_MASK = 1 << 28, /*< nick=<Meta> >*/
|
||||
|
||||
NIMF_MODIFIER_RESERVED_29_MASK = 1 << 29,
|
||||
|
||||
NIMF_RELEASE_MASK = 1 << 30, /*< nick=<Release> >*/
|
||||
|
||||
/* Combination of NIMF_SHIFT_MASK..NIMF_BUTTON5_MASK + NIMF_SUPER_MASK
|
||||
+ NIMF_HYPER_MASK + NIMF_META_MASK + NIMF_RELEASE_MASK */
|
||||
NIMF_MODIFIER_MASK = 0x5c001fff
|
||||
} NimfModifierType;
|
||||
|
||||
/**
|
||||
* NimfRectangle:
|
||||
* @x: x
|
||||
* @y: y
|
||||
* @width: width
|
||||
* @height: height
|
||||
*
|
||||
* Defines the position and size of a rectangle.
|
||||
*/
|
||||
typedef struct {
|
||||
int x, y;
|
||||
int width, height;
|
||||
} NimfRectangle;
|
||||
|
||||
/**
|
||||
* NimfKey:
|
||||
* @state: a bit-mask representing the state of the modifier keys
|
||||
* @keyval: the key that was pressed or released.
|
||||
*/
|
||||
typedef struct {
|
||||
guint32 state;
|
||||
guint32 keyval;
|
||||
} NimfKey;
|
||||
|
||||
/**
|
||||
* NimfPreeditState:
|
||||
* @NIMF_PREEDIT_STATE_START: presents preedit-start state.
|
||||
* @NIMF_PREEDIT_STATE_END: presents preedit-end state.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NIMF_PREEDIT_STATE_START = 1,
|
||||
NIMF_PREEDIT_STATE_END = 0
|
||||
} NimfPreeditState;
|
||||
|
||||
/**
|
||||
* NimfPreeditAttrType:
|
||||
* @NIMF_PREEDIT_ATTR_UNDERLINE: whether the text has an underline
|
||||
* @NIMF_PREEDIT_ATTR_HIGHLIGHT: whether the text has a highlight
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
NIMF_PREEDIT_ATTR_UNDERLINE,
|
||||
NIMF_PREEDIT_ATTR_HIGHLIGHT
|
||||
} NimfPreeditAttrType;
|
||||
|
||||
/**
|
||||
* NimfPreeditAttr:
|
||||
* @type: a #NimfPreeditAttrType
|
||||
* @start_index: the start index of the range (in characters).
|
||||
* @end_index: end index of the range (in characters). The character at this
|
||||
* index is not included in the range.
|
||||
*/
|
||||
typedef struct {
|
||||
NimfPreeditAttrType type;
|
||||
guint start_index; /* in characters */
|
||||
guint end_index; /* in characters. The character at this index is not included */
|
||||
} NimfPreeditAttr;
|
||||
|
||||
/**
|
||||
* NimfMethodInfo:
|
||||
* @method_id: method id of the engine
|
||||
* @label: human readable label
|
||||
* @group: human readable group name
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
gchar *method_id; /* method id */
|
||||
gchar *label; /* Human readable label */
|
||||
gchar *group; /* Human readable group name */
|
||||
} NimfMethodInfo;
|
||||
|
||||
NimfKey *nimf_key_new (void);
|
||||
NimfKey *nimf_key_new_from_nicks (const gchar **nicks);
|
||||
void nimf_key_free (NimfKey *key);
|
||||
NimfKey **nimf_key_newv (const gchar **keys);
|
||||
void nimf_key_freev (NimfKey **keys);
|
||||
|
||||
NimfPreeditAttr *nimf_preedit_attr_new (NimfPreeditAttrType type,
|
||||
guint start_index,
|
||||
guint end_index);
|
||||
NimfPreeditAttr **nimf_preedit_attrs_copy (NimfPreeditAttr **attrs);
|
||||
void nimf_preedit_attr_free (NimfPreeditAttr *attr);
|
||||
void nimf_preedit_attr_freev (NimfPreeditAttr **attrs);
|
||||
|
||||
NimfMethodInfo *nimf_method_info_new (void);
|
||||
void nimf_method_info_free (NimfMethodInfo *info);
|
||||
void nimf_method_info_freev (NimfMethodInfo **infos);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_TYPES_H__ */
|
||||
33
Telegram/ThirdParty/nimf/libnimf/nimf-utils-private.h
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-utils-private.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_UTILS_PRIVATE_H__
|
||||
#define __NIMF_UTILS_PRIVATE_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
gboolean gnome_is_running (void);
|
||||
gboolean gnome_xkb_is_available (void);
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_UTILS_PRIVATE_H__ */
|
||||
116
Telegram/ThirdParty/nimf/libnimf/nimf-utils.c
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-utils.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "nimf-utils.h"
|
||||
#include "nimf-enum-types-private.h"
|
||||
#include <gio/gio.h>
|
||||
|
||||
/**
|
||||
* SECTION:nimf-utils
|
||||
* @title: Utility Functions
|
||||
* @section_id: nimf-utils
|
||||
*/
|
||||
|
||||
/**
|
||||
* nimf_keyval_to_keysym_name:
|
||||
* @keyval: a keyval
|
||||
*
|
||||
* Returns: keysym name
|
||||
*/
|
||||
const gchar *
|
||||
nimf_keyval_to_keysym_name (guint keyval)
|
||||
{
|
||||
GEnumClass *enum_class = (GEnumClass *) g_type_class_ref (NIMF_TYPE_KEY_SYM);
|
||||
GEnumValue *enum_value = g_enum_get_value (enum_class, keyval);
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
return enum_value ? enum_value->value_nick : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* nimf_get_socket_path:
|
||||
*
|
||||
* Returns: nimf socket path, which should be freed with g_free()
|
||||
*/
|
||||
gchar *
|
||||
nimf_get_socket_path ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_strconcat (g_get_user_runtime_dir (), "/nimf/socket", NULL);
|
||||
}
|
||||
|
||||
/* private */
|
||||
gboolean
|
||||
gnome_xkb_is_available ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GSettingsSchema *schema;
|
||||
GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
|
||||
gboolean retval;
|
||||
|
||||
schema = g_settings_schema_source_lookup (source,
|
||||
"org.gnome.desktop.input-sources",
|
||||
TRUE);
|
||||
if (!schema)
|
||||
return FALSE;
|
||||
|
||||
retval = g_settings_schema_has_key (schema, "xkb-options");
|
||||
|
||||
g_settings_schema_unref (schema);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnome_is_running ()
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
const gchar *desktop;
|
||||
gboolean retval = FALSE;
|
||||
|
||||
if ((desktop = g_getenv ("XDG_SESSION_DESKTOP")))
|
||||
{
|
||||
gchar *s1;
|
||||
|
||||
if ((s1 = g_ascii_strdown (desktop, -1)))
|
||||
retval = !!g_strrstr (s1, "gnome");
|
||||
|
||||
g_free (s1);
|
||||
}
|
||||
|
||||
if (retval)
|
||||
return TRUE;
|
||||
|
||||
if ((desktop = g_getenv ("XDG_CURRENT_DESKTOP")))
|
||||
{
|
||||
gchar *s2;
|
||||
|
||||
if ((s2 = g_ascii_strdown (desktop, -1)))
|
||||
retval = !!g_strrstr (s2, "gnome");
|
||||
|
||||
g_free (s2);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
34
Telegram/ThirdParty/nimf/libnimf/nimf-utils.h
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf-utils.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_UTILS_H__
|
||||
#define __NIMF_UTILS_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
const gchar *nimf_keyval_to_keysym_name (guint keyval);
|
||||
gchar *nimf_get_socket_path (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __NIMF_UTILS_H__ */
|
||||
41
Telegram/ThirdParty/nimf/libnimf/nimf.h
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* nimf.h
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __NIMF_H__
|
||||
#define __NIMF_H__
|
||||
|
||||
#define __NIMF_H_INSIDE__
|
||||
|
||||
#include "nimf-candidatable.h"
|
||||
#include "nimf-engine.h"
|
||||
#include "nimf-events.h"
|
||||
#include "nimf-im.h"
|
||||
#include "nimf-key-syms.h"
|
||||
#include "nimf-preeditable.h"
|
||||
#include "nimf-server.h"
|
||||
#include "nimf-service.h"
|
||||
#include "nimf-service-ic.h"
|
||||
#include "nimf-types.h"
|
||||
#include "nimf-utils.h"
|
||||
|
||||
#undef __NIMF_H_INSIDE__
|
||||
|
||||
#endif /* __NIMF_H__ */
|
||||
11
Telegram/ThirdParty/nimf/libnimf/nimf.pc.in
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: Nimf
|
||||
Description: Nimf Input Method Framework Library
|
||||
Version: @VERSION@
|
||||
Requires: @LIBNIMF_REQUIRES@
|
||||
Libs: -L${libdir} -lnimf
|
||||
Cflags: -I${includedir}/nimf
|
||||
67
Telegram/ThirdParty/nimf/libnimf/org.nimf.gschema.xml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<schemalist>
|
||||
<schema id="org.nimf" path="/org/nimf/" gettext-domain="nimf">
|
||||
<child schema="org.nimf.services" name="services"/>
|
||||
<child schema="org.nimf.clients" name="clients"/>
|
||||
<child schema="org.nimf.engines" name="engines"/>
|
||||
<key type="s" name="hidden-schema-name">
|
||||
<default l10n="messages">'Nimf'</default>
|
||||
<summary>schema name for nimf-settings</summary>
|
||||
<description>This key is intended for nimf-settings.</description>
|
||||
</key>
|
||||
<key type="as" name="hotkeys">
|
||||
<default>['<Control> space']</default>
|
||||
<summary>Hotkeys for rotating input method engines</summary>
|
||||
<description>Hotkeys for rotating input method engines</description>
|
||||
</key>
|
||||
<key type="as" name="hidden-active-engines">
|
||||
<default>['']</default>
|
||||
<summary>active engines</summary>
|
||||
<description>DO NOT EDIT MANUALLY</description>
|
||||
</key>
|
||||
<key type="b" name="use-singleton">
|
||||
<default>true</default>
|
||||
<summary>Use singleton mode</summary>
|
||||
<description>Create one instance per language engine.
|
||||
Singleton mode reduces memory usage.</description>
|
||||
</key>
|
||||
<key type="b" name="setup-environment-variables">
|
||||
<default>true</default>
|
||||
<summary>Setup environment variables</summary>
|
||||
<description>Turning on this option will create a
|
||||
$HOME/.config/environment.d/50-input.conf link file, and will add
|
||||
"export $(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)"
|
||||
to the .xprofile once, while turning off this option will delete the link file.
|
||||
Turn off this option to use other input methods such as ibus, fcitx, etc.
|
||||
When this option is turned on or off, file operations are performed immediately.
|
||||
But the effect will appear after you login again.
|
||||
</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="org.nimf.services" path="/org/nimf/services/" gettext-domain="nimf">
|
||||
<key type="s" name="hidden-schema-name">
|
||||
<default l10n="messages">'Services'</default>
|
||||
<summary>schema name for nimf-settings</summary>
|
||||
<description>This key is intended for nimf-settings.</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="org.nimf.clients" path="/org/nimf/clients/" gettext-domain="nimf">
|
||||
<key type="s" name="hidden-schema-name">
|
||||
<default l10n="messages">'Clients'</default>
|
||||
<summary>schema name for nimf-settings</summary>
|
||||
<description>This key is intended for nimf-settings.</description>
|
||||
</key>
|
||||
</schema>
|
||||
<schema id="org.nimf.engines" path="/org/nimf/engines/" gettext-domain="nimf">
|
||||
<key type="s" name="hidden-schema-name">
|
||||
<default l10n="messages">'Language engines'</default>
|
||||
<summary>schema name for nimf-settings</summary>
|
||||
<description>This key is intended for nimf-settings.</description>
|
||||
</key>
|
||||
<key type="s" name="default-engine">
|
||||
<default>'nimf-system-keyboard'</default>
|
||||
<summary>Default language engine</summary>
|
||||
<description>Default language engine on startup</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
3
Telegram/ThirdParty/nimf/modules/Makefile.am
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
SUBDIRS = engines clients services
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
11
Telegram/ThirdParty/nimf/modules/clients/Makefile.am
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
SUBDIRS = gtk
|
||||
|
||||
if HAVE_QT5
|
||||
SUBDIRS += qt5
|
||||
endif
|
||||
|
||||
if HAVE_QT6
|
||||
SUBDIRS += qt6
|
||||
endif
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
42
Telegram/ThirdParty/nimf/modules/clients/gtk/Makefile.am
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
gsettings_SCHEMAS = org.nimf.clients.gtk.gschema.xml
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
AM_CFLAGS = \
|
||||
$(EXTRA_CFLAGS) \
|
||||
-I$(top_srcdir)/libnimf \
|
||||
-DG_LOG_DOMAIN=\"nimf\"
|
||||
|
||||
# for gtk3
|
||||
|
||||
gtk3_im_moduledir = $(GTK3_LIBDIR)/gtk-3.0/$(GTK3_BINARY_VERSION)/immodules
|
||||
gtk3_im_module_LTLIBRARIES = im-nimf-gtk3.la
|
||||
|
||||
im_nimf_gtk3_la_SOURCES = im-nimf.c
|
||||
im_nimf_gtk3_la_CFLAGS = $(IM_NIMF_GTK3_DEPS_CFLAGS) $(AM_CFLAGS)
|
||||
im_nimf_gtk3_la_LDFLAGS = $(IM_NIMF_GTK3_DEPS_LIBS) -avoid-version -module
|
||||
im_nimf_gtk3_la_LIBADD = $(top_builddir)/libnimf/libnimf.la
|
||||
|
||||
# for gtk2
|
||||
|
||||
gtk2_im_moduledir = $(GTK2_LIBDIR)/gtk-2.0/$(GTK2_BINARY_VERSION)/immodules
|
||||
gtk2_im_module_LTLIBRARIES = im-nimf-gtk2.la
|
||||
|
||||
im_nimf_gtk2_la_SOURCES = im-nimf.c
|
||||
im_nimf_gtk2_la_CFLAGS = $(IM_NIMF_GTK2_DEPS_CFLAGS) $(AM_CFLAGS) \
|
||||
-Wno-error=deprecated-declarations
|
||||
im_nimf_gtk2_la_LDFLAGS = $(IM_NIMF_GTK2_DEPS_LIBS) -avoid-version -module
|
||||
im_nimf_gtk2_la_LIBADD = $(top_builddir)/libnimf/libnimf.la
|
||||
|
||||
DISTCLEANFILES = Makefile.in
|
||||
|
||||
install-data-hook:
|
||||
chmod -x $(DESTDIR)$(gtk3_im_moduledir)/im-nimf-gtk3.so
|
||||
chmod -x $(DESTDIR)$(gtk2_im_moduledir)/im-nimf-gtk2.so
|
||||
rm -f $(DESTDIR)$(gtk3_im_moduledir)/im-nimf-gtk3.la
|
||||
rm -f $(DESTDIR)$(gtk2_im_moduledir)/im-nimf-gtk2.la
|
||||
|
||||
uninstall-hook:
|
||||
rm -f $(DESTDIR)$(gtk3_im_moduledir)/im-nimf-gtk3.so
|
||||
rm -f $(DESTDIR)$(gtk2_im_moduledir)/im-nimf-gtk2.so
|
||||
$(GTK_QUERY_IMMODULES2) --update-cache
|
||||
$(GTK_QUERY_IMMODULES3) --update-cache
|
||||
592
Telegram/ThirdParty/nimf/modules/clients/gtk/im-nimf.c
vendored
Normal file
@@ -0,0 +1,592 @@
|
||||
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
|
||||
/*
|
||||
* im-nimf.c
|
||||
* This file is part of Nimf.
|
||||
*
|
||||
* Copyright (C) 2015-2019 Hodong Kim <cogniti@gmail.com>
|
||||
*
|
||||
* Nimf is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Lesser General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Nimf 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 Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <gtk/gtk.h>
|
||||
#include <gtk/gtkimmodule.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <nimf.h>
|
||||
#include <X11/XKBlib.h>
|
||||
#if GTK_CHECK_VERSION (3, 6, 0)
|
||||
#include <gdk/gdkx.h>
|
||||
#endif
|
||||
|
||||
|
||||
#define NIMF_GTK_TYPE_IM_CONTEXT (nimf_gtk_im_context_get_type ())
|
||||
#define NIMF_GTK_IM_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NIMF_GTK_TYPE_IM_CONTEXT, NimfGtkIMContext))
|
||||
|
||||
typedef struct _NimfGtkIMContext NimfGtkIMContext;
|
||||
typedef struct _NimfGtkIMContextClass NimfGtkIMContextClass;
|
||||
|
||||
struct _NimfGtkIMContext
|
||||
{
|
||||
GtkIMContext parent_instance;
|
||||
|
||||
NimfIM *im;
|
||||
GtkIMContext *simple;
|
||||
GdkWindow *client_window;
|
||||
GSettings *settings;
|
||||
gboolean is_reset_on_gdk_button_press_event;
|
||||
gboolean is_hook_gdk_event_key;
|
||||
gboolean has_focus;
|
||||
gboolean has_event_filter;
|
||||
};
|
||||
|
||||
struct _NimfGtkIMContextClass
|
||||
{
|
||||
GtkIMContextClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_DYNAMIC_TYPE (NimfGtkIMContext, nimf_gtk_im_context, GTK_TYPE_IM_CONTEXT);
|
||||
|
||||
static NimfEvent *
|
||||
translate_gdk_event_key (GdkEventKey *event)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfEvent *nimf_event = nimf_event_new (NIMF_EVENT_NOTHING);
|
||||
|
||||
if (event->type == GDK_KEY_PRESS)
|
||||
nimf_event->key.type = NIMF_EVENT_KEY_PRESS;
|
||||
else
|
||||
nimf_event->key.type = NIMF_EVENT_KEY_RELEASE;
|
||||
|
||||
nimf_event->key.state = event->state;
|
||||
nimf_event->key.keyval = event->keyval;
|
||||
nimf_event->key.hardware_keycode = event->hardware_keycode;
|
||||
|
||||
return nimf_event;
|
||||
}
|
||||
|
||||
static NimfEvent *
|
||||
translate_xkey_event (XEvent *xevent)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GdkKeymap *keymap = gdk_keymap_get_for_display (gdk_display_get_default ());
|
||||
GdkModifierType consumed, state;
|
||||
|
||||
NimfEvent *nimf_event = nimf_event_new (NIMF_EVENT_NOTHING);
|
||||
|
||||
if (xevent->type == KeyPress)
|
||||
nimf_event->key.type = NIMF_EVENT_KEY_PRESS;
|
||||
else
|
||||
nimf_event->key.type = NIMF_EVENT_KEY_RELEASE;
|
||||
|
||||
nimf_event->key.state = (NimfModifierType) xevent->xkey.state;
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 6, 0)
|
||||
gint group = gdk_x11_keymap_get_group_for_state (keymap, xevent->xkey.state);
|
||||
#else
|
||||
gint group = XkbGroupForCoreState (xevent->xkey.state);
|
||||
#endif
|
||||
|
||||
nimf_event->key.hardware_keycode = xevent->xkey.keycode;
|
||||
nimf_event->key.keyval = NIMF_KEY_VoidSymbol;
|
||||
|
||||
gdk_keymap_translate_keyboard_state (keymap,
|
||||
nimf_event->key.hardware_keycode,
|
||||
nimf_event->key.state,
|
||||
group,
|
||||
&nimf_event->key.keyval,
|
||||
NULL, NULL, &consumed);
|
||||
|
||||
state = nimf_event->key.state & ~consumed;
|
||||
nimf_event->key.state |= (NimfModifierType) state;
|
||||
|
||||
return nimf_event;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nimf_gtk_im_context_filter_keypress (GtkIMContext *context,
|
||||
GdkEventKey *event)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
gboolean retval;
|
||||
NimfEvent *nimf_event;
|
||||
|
||||
nimf_event = translate_gdk_event_key (event);
|
||||
retval = nimf_im_filter_event (NIMF_GTK_IM_CONTEXT (context)->im, nimf_event);
|
||||
nimf_event_free (nimf_event);
|
||||
|
||||
if (retval == FALSE)
|
||||
return gtk_im_context_filter_keypress (NIMF_GTK_IM_CONTEXT (context)->simple, event);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_reset (GtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_im_reset (NIMF_GTK_IM_CONTEXT (context)->im);
|
||||
gtk_im_context_reset (NIMF_GTK_IM_CONTEXT (context)->simple);
|
||||
}
|
||||
|
||||
static GdkFilterReturn
|
||||
on_gdk_x_event (XEvent *xevent,
|
||||
GdkEvent *event,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s: %p, %" G_GINT64_FORMAT, G_STRFUNC, context,
|
||||
g_get_real_time ());
|
||||
|
||||
gboolean retval = FALSE;
|
||||
|
||||
if (context->has_focus == FALSE || context->client_window == NULL)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
|
||||
switch (xevent->type)
|
||||
{
|
||||
case KeyPress:
|
||||
case KeyRelease:
|
||||
if (context->is_hook_gdk_event_key)
|
||||
{
|
||||
NimfEvent *nimf_event = translate_xkey_event (xevent);
|
||||
retval = nimf_im_filter_event (context->im, nimf_event);
|
||||
nimf_event_free (nimf_event);
|
||||
}
|
||||
break;
|
||||
case ButtonPress:
|
||||
if (context->is_reset_on_gdk_button_press_event)
|
||||
nimf_im_reset (context->im);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (retval == FALSE)
|
||||
return GDK_FILTER_CONTINUE;
|
||||
else
|
||||
return GDK_FILTER_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_set_client_window (GtkIMContext *context,
|
||||
GdkWindow *window)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfGtkIMContext *a_context = NIMF_GTK_IM_CONTEXT (context);
|
||||
|
||||
if (a_context->client_window)
|
||||
{
|
||||
g_object_unref (a_context->client_window);
|
||||
a_context->client_window = NULL;
|
||||
}
|
||||
|
||||
if (window)
|
||||
a_context->client_window = g_object_ref (window);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_get_preedit_string (GtkIMContext *context,
|
||||
gchar **str,
|
||||
PangoAttrList **attrs,
|
||||
gint *cursor_pos)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfPreeditAttr **preedit_attrs;
|
||||
gchar *preedit_str;
|
||||
|
||||
nimf_im_get_preedit_string (NIMF_GTK_IM_CONTEXT (context)->im,
|
||||
&preedit_str, &preedit_attrs, cursor_pos);
|
||||
|
||||
if (str)
|
||||
*str = preedit_str;
|
||||
|
||||
if (attrs)
|
||||
{
|
||||
PangoAttribute *attr;
|
||||
gchar *ptr1;
|
||||
gchar *ptr2;
|
||||
gint i;
|
||||
|
||||
*attrs = pango_attr_list_new ();
|
||||
|
||||
for (i = 0; preedit_attrs[i] != NULL; i++)
|
||||
{
|
||||
ptr1 = g_utf8_offset_to_pointer (preedit_str, preedit_attrs[i]->start_index);
|
||||
ptr2 = g_utf8_offset_to_pointer (preedit_str, preedit_attrs[i]->end_index);
|
||||
|
||||
switch (preedit_attrs[i]->type)
|
||||
{
|
||||
case NIMF_PREEDIT_ATTR_UNDERLINE:
|
||||
attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
|
||||
break;
|
||||
case NIMF_PREEDIT_ATTR_HIGHLIGHT:
|
||||
attr = pango_attr_background_new (0, 0xffff, 0);
|
||||
attr->start_index = ptr1 - preedit_str;
|
||||
attr->end_index = ptr2 - preedit_str;
|
||||
pango_attr_list_insert (*attrs, attr);
|
||||
|
||||
attr = pango_attr_foreground_new (0, 0, 0);
|
||||
break;
|
||||
default:
|
||||
attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
|
||||
break;
|
||||
}
|
||||
|
||||
attr->start_index = ptr1 - preedit_str;
|
||||
attr->end_index = ptr2 - preedit_str;
|
||||
pango_attr_list_insert (*attrs, attr);
|
||||
}
|
||||
}
|
||||
|
||||
nimf_preedit_attr_freev (preedit_attrs);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_focus_in (GtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfGtkIMContext *a_context = NIMF_GTK_IM_CONTEXT (context);
|
||||
a_context->has_focus = TRUE;
|
||||
nimf_im_focus_in (a_context->im);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_focus_out (GtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfGtkIMContext *a_context = NIMF_GTK_IM_CONTEXT (context);
|
||||
nimf_im_focus_out (a_context->im);
|
||||
a_context->has_focus = FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_set_cursor_location (GtkIMContext *context,
|
||||
GdkRectangle *area)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfGtkIMContext *nimf_context = NIMF_GTK_IM_CONTEXT (context);
|
||||
|
||||
GdkRectangle root_area = *area;
|
||||
|
||||
if (nimf_context->client_window)
|
||||
gdk_window_get_root_coords (nimf_context->client_window,
|
||||
area->x,
|
||||
area->y,
|
||||
&root_area.x,
|
||||
&root_area.y);
|
||||
|
||||
nimf_im_set_cursor_location (NIMF_GTK_IM_CONTEXT (context)->im,
|
||||
(const NimfRectangle *) &root_area);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_set_use_preedit (GtkIMContext *context,
|
||||
gboolean use_preedit)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_im_set_use_preedit (NIMF_GTK_IM_CONTEXT (context)->im, use_preedit);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_set_surrounding (GtkIMContext *context,
|
||||
const char *text,
|
||||
gint len,
|
||||
gint cursor_index)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_im_set_surrounding (NIMF_GTK_IM_CONTEXT (context)->im,
|
||||
text, len, g_utf8_strlen (text, cursor_index));
|
||||
}
|
||||
|
||||
GtkIMContext *
|
||||
nimf_gtk_im_context_new (void)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
return g_object_new (NIMF_GTK_TYPE_IM_CONTEXT, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
on_commit (NimfIM *im,
|
||||
const gchar *text,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
g_signal_emit_by_name (context, "commit", text);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_delete_surrounding (NimfIM *im,
|
||||
gint offset,
|
||||
gint n_chars,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
gboolean retval;
|
||||
g_signal_emit_by_name (context,
|
||||
"delete-surrounding", offset, n_chars, &retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
on_preedit_changed (NimfIM *im,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
g_signal_emit_by_name (context, "preedit-changed");
|
||||
}
|
||||
|
||||
static void
|
||||
on_preedit_end (NimfIM *im,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
g_signal_emit_by_name (context, "preedit-end");
|
||||
}
|
||||
|
||||
static void
|
||||
on_preedit_start (NimfIM *im,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
g_signal_emit_by_name (context, "preedit-start");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_retrieve_surrounding (NimfIM *im,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
gboolean retval;
|
||||
g_signal_emit_by_name (context, "retrieve-surrounding", &retval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
on_beep (NimfIM *im,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
gdk_display_beep (gdk_display_get_default ());
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_update_event_filter (NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (context->is_reset_on_gdk_button_press_event ||
|
||||
context->is_hook_gdk_event_key)
|
||||
{
|
||||
if (context->has_event_filter == FALSE)
|
||||
{
|
||||
context->has_event_filter = TRUE;
|
||||
gdk_window_add_filter (NULL, (GdkFilterFunc) on_gdk_x_event, context);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (context->has_event_filter == TRUE)
|
||||
{
|
||||
context->has_event_filter = FALSE;
|
||||
gdk_window_remove_filter (NULL, (GdkFilterFunc) on_gdk_x_event, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_changed_reset_on_gdk_button_press_event (GSettings *settings,
|
||||
gchar *key,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
context->is_reset_on_gdk_button_press_event =
|
||||
g_settings_get_boolean (context->settings, key);
|
||||
|
||||
nimf_gtk_im_context_update_event_filter (context);
|
||||
}
|
||||
|
||||
static void
|
||||
on_changed_hook_gdk_event_key (GSettings *settings,
|
||||
gchar *key,
|
||||
NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
context->is_hook_gdk_event_key =
|
||||
g_settings_get_boolean (context->settings, key);
|
||||
|
||||
nimf_gtk_im_context_update_event_filter (context);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_init (NimfGtkIMContext *context)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
context->im = nimf_im_new ();
|
||||
context->simple = gtk_im_context_simple_new ();
|
||||
|
||||
g_signal_connect (context->im, "commit",
|
||||
G_CALLBACK (on_commit), context);
|
||||
g_signal_connect (context->im, "delete-surrounding",
|
||||
G_CALLBACK (on_delete_surrounding), context);
|
||||
g_signal_connect (context->im, "preedit-changed",
|
||||
G_CALLBACK (on_preedit_changed), context);
|
||||
g_signal_connect (context->im, "preedit-end",
|
||||
G_CALLBACK (on_preedit_end), context);
|
||||
g_signal_connect (context->im, "preedit-start",
|
||||
G_CALLBACK (on_preedit_start), context);
|
||||
g_signal_connect (context->im, "retrieve-surrounding",
|
||||
G_CALLBACK (on_retrieve_surrounding), context);
|
||||
g_signal_connect (context->im, "beep",
|
||||
G_CALLBACK (on_beep), context);
|
||||
|
||||
g_signal_connect (context->simple, "commit",
|
||||
G_CALLBACK (on_commit), context);
|
||||
g_signal_connect (context->simple, "delete-surrounding",
|
||||
G_CALLBACK (on_delete_surrounding), context);
|
||||
g_signal_connect (context->simple, "preedit-changed",
|
||||
G_CALLBACK (on_preedit_changed), context);
|
||||
g_signal_connect (context->simple, "preedit-end",
|
||||
G_CALLBACK (on_preedit_end), context);
|
||||
g_signal_connect (context->simple, "preedit-start",
|
||||
G_CALLBACK (on_preedit_start), context);
|
||||
g_signal_connect (context->simple, "retrieve-surrounding",
|
||||
G_CALLBACK (on_retrieve_surrounding), context);
|
||||
|
||||
context->settings = g_settings_new ("org.nimf.clients.gtk");
|
||||
|
||||
context->is_reset_on_gdk_button_press_event =
|
||||
g_settings_get_boolean (context->settings,
|
||||
"reset-on-gdk-button-press-event");
|
||||
|
||||
context->is_hook_gdk_event_key =
|
||||
g_settings_get_boolean (context->settings, "hook-gdk-event-key");
|
||||
|
||||
nimf_gtk_im_context_update_event_filter (context);
|
||||
|
||||
g_signal_connect (context->settings,
|
||||
"changed::reset-on-gdk-button-press-event",
|
||||
G_CALLBACK (on_changed_reset_on_gdk_button_press_event),
|
||||
context);
|
||||
g_signal_connect (context->settings, "changed::hook-gdk-event-key",
|
||||
G_CALLBACK (on_changed_hook_gdk_event_key), context);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_finalize (GObject *object)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
NimfGtkIMContext *context = NIMF_GTK_IM_CONTEXT (object);
|
||||
|
||||
if (context->has_event_filter)
|
||||
gdk_window_remove_filter (NULL, (GdkFilterFunc) on_gdk_x_event, context);
|
||||
|
||||
g_object_unref (context->im);
|
||||
g_object_unref (context->simple);
|
||||
g_object_unref (context->settings);
|
||||
|
||||
if (context->client_window)
|
||||
g_object_unref (context->client_window);
|
||||
|
||||
G_OBJECT_CLASS (nimf_gtk_im_context_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_class_init (NimfGtkIMContextClass *class)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkIMContextClass *im_context_class = GTK_IM_CONTEXT_CLASS (class);
|
||||
|
||||
im_context_class->set_client_window = nimf_gtk_im_context_set_client_window;
|
||||
im_context_class->get_preedit_string = nimf_gtk_im_context_get_preedit_string;
|
||||
im_context_class->filter_keypress = nimf_gtk_im_context_filter_keypress;
|
||||
im_context_class->focus_in = nimf_gtk_im_context_focus_in;
|
||||
im_context_class->focus_out = nimf_gtk_im_context_focus_out;
|
||||
im_context_class->reset = nimf_gtk_im_context_reset;
|
||||
im_context_class->set_cursor_location = nimf_gtk_im_context_set_cursor_location;
|
||||
im_context_class->set_use_preedit = nimf_gtk_im_context_set_use_preedit;
|
||||
im_context_class->set_surrounding = nimf_gtk_im_context_set_surrounding;
|
||||
|
||||
object_class->finalize = nimf_gtk_im_context_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
nimf_gtk_im_context_class_finalize (NimfGtkIMContextClass *class)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
}
|
||||
|
||||
static const GtkIMContextInfo nimf_info = {
|
||||
PACKAGE, /* ID */
|
||||
N_("Nimf"), /* Human readable name */
|
||||
GETTEXT_PACKAGE, /* Translation domain */
|
||||
NIMF_LOCALE_DIR, /* Directory for bindtextdomain */
|
||||
"ko:ja:zh" /* Languages for which this module is the default */
|
||||
};
|
||||
|
||||
static const GtkIMContextInfo *info_list[] = {
|
||||
&nimf_info
|
||||
};
|
||||
|
||||
G_MODULE_EXPORT void im_module_init (GTypeModule *type_module)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
nimf_gtk_im_context_register_type (type_module);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void im_module_exit (void)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void im_module_list (const GtkIMContextInfo ***contexts,
|
||||
int *n_contexts)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
*contexts = info_list;
|
||||
*n_contexts = G_N_ELEMENTS (info_list);
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT GtkIMContext *im_module_create (const gchar *context_id)
|
||||
{
|
||||
g_debug (G_STRLOC ": %s", G_STRFUNC);
|
||||
|
||||
if (g_strcmp0 (context_id, PACKAGE) == 0)
|
||||
return nimf_gtk_im_context_new ();
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||