-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
linhuman
authored and
linhuman
committed
Apr 10, 2019
1 parent
79437e7
commit c070c5b
Showing
11 changed files
with
1,710 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
project(ibus-lunispim) | ||
cmake_minimum_required(VERSION 2.8) | ||
include_directories (${PROJECT_SOURCE_DIR}/include) | ||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||
include(${CMAKE_ROOT}/Modules/FindPkgConfig.cmake) | ||
pkg_check_modules(IBus REQUIRED ibus-1.0) | ||
if(IBus_FOUND) | ||
include_directories(${IBus_INCLUDE_DIRS}) | ||
link_directories(${IBus_LIBRARY_DIRS}) | ||
endif(IBus_FOUND) | ||
|
||
pkg_check_modules(LIBNOTIFY REQUIRED libnotify) | ||
if (LIBNOTIFY_FOUND) | ||
include_directories(${LIBNOTIFY_INCLUDE_DIRS}) | ||
link_directories(${LIBNOTIFY_LIBRARY_DIRS}) | ||
endif(LIBNOTIFY_FOUND) | ||
|
||
pkg_check_modules(LUNISPIM REQUIRED lunispim) | ||
if (LUNISPIM_FOUND) | ||
include_directories(${LUNISPIM_INCLUDE_DIRS}) | ||
link_directories(${LUNISPIM_LIBRARY_DIRS}) | ||
endif(LUNISPIM_FOUND) | ||
|
||
set(PREFIX_DIR "${CMAKE_INSTALL_PREFIX}") | ||
set(IBUS_COMPONENT_DIR "${PREFIX_DIR}/share/ibus/component") | ||
set(BIN_INSTALL_DIR "${PREFIX_DIR}/bin/ibus-lunispim") | ||
set(SHARE_DIR "${PREFIX_DIR}/share") | ||
set(IBUS_LUNISPIM_VERSION 0.1) | ||
configure_file( | ||
${PROJECT_SOURCE_DIR}/lunispim.xml.in | ||
${PROJECT_BINARY_DIR}/lunispim.xml | ||
@ONLY) | ||
aux_source_directory(src IBUS_LUNISPIM_SRC) | ||
add_executable(ibus-engine-lunispim ${IBUS_LUNISPIM_SRC}) | ||
target_link_libraries(ibus-engine-lunispim ${IBus_LIBRARIES} ${LIBNOTIFY_LIBRARIES} ${LUNISPIM_LIBRARIES}) | ||
if(DEFINED DESTDIR) | ||
install(FILES ${PROJECT_BINARY_DIR}/ibus-engine-lunispim DESTINATION ${DESTDIR}${BIN_INSTALL_DIR}) | ||
install(FILES ${PROJECT_BINARY_DIR}/lunispim.xml DESTINATION ${DESTDIR}${IBUS_COMPONENT_DIR}) | ||
else() | ||
install(FILES ${PROJECT_BINARY_DIR}/ibus-engine-lunispim DESTINATION ${BIN_INSTALL_DIR}) | ||
install(FILES ${PROJECT_BINARY_DIR}/lunispim.xml DESTINATION ${IBUS_COMPONENT_DIR}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ifeq (${PREFIX},) | ||
PREFIX=/usr | ||
endif | ||
sharedir = $(DESTDIR)$(PREFIX)/share | ||
libexecdir = $(DESTDIR)$(PREFIX)/bin | ||
builddir=build | ||
|
||
all: ibus-engine-lunispim | ||
|
||
ibus-engine-lunispim: | ||
mkdir -p $(builddir) | ||
(cd $(builddir); cmake -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DDESTDIR=$(DESTDIR) .. && make) | ||
@echo ':)' | ||
|
||
install: | ||
make -C $(builddir) install | ||
|
||
uninstall: | ||
rm $(sharedir)/ibus/component/lunispim.xml | ||
rm -R $(libexecdir)/ibus-lunispim | ||
|
||
clean: | ||
if [ -e $(builddir) ]; then rm -R $(builddir); fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef RIME_CONFIG_H_ | ||
#define RIME_CONFIG_H_ | ||
|
||
#define IBUS_LUNISPIM_VERSION "0.1" | ||
|
||
#define IBUS_LUNISPIM_INSTALL_PREFIX "/usr" | ||
#define IBUS_LUNISPIM_SHARED_DATA_DIR "/share/lunispim/" | ||
#define IBUS_LUNISPIM_ICONS_DIR "/share/lunispim/icons" | ||
|
||
#endif // RIME_CONFIG_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef __IBUS_RIME_ENGINE_H__ | ||
#define __IBUS_RIME_ENGINE_H__ | ||
|
||
#include <ibus.h> | ||
#include <stdio.h> | ||
#define IBUS_TYPE_UNISPIM_ENGINE \ | ||
(ibus_unispim_engine_get_type()) | ||
|
||
GType ibus_unispim_engine_get_type(); | ||
#define DEBUG_ECHO(fmt, arg...) printf("=====[File: %s Func: %s Line: %d]=====\n", strrchr(__FILE__, '/'), __FUNCTION__, __LINE__);printf(fmt, ##arg);printf("\n\n"); | ||
#define TICK "✓" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef __IBUS_RIME_SETTINGS_H__ | ||
#define __IBUS_RIME_SETTINGS_H__ | ||
|
||
#include <ibus.h> | ||
|
||
// colors | ||
#define COLOR_LIGHT 0xd4d4d4 | ||
#define COLOR_DARK 0x606060 | ||
#define COLOR_BLACK 0x000000 | ||
#define COLOR_RED 0xcf0000 | ||
#define COLOR_BLUE 0x4a90d9 | ||
#define COLOR_WHITE 0xffffff | ||
#define COLOR_PINK 0xFF656D | ||
#define COLOR_GREEN 0x01a226 | ||
#define COLOR_POWDER_GREEN 0x73C06A | ||
#define COLOR_ORANGE 0xFF0000 | ||
struct ColorSchemeDefinition { | ||
const char* color_scheme_id; | ||
int text_color; | ||
int back_color; | ||
}; | ||
|
||
struct IBusUnispimSettings { | ||
gboolean embed_preedit_text; | ||
gint lookup_table_orientation; | ||
struct ColorSchemeDefinition* color_scheme; | ||
}; | ||
|
||
struct IBusUnispimSettings g_ibus_unispim_settings; | ||
|
||
void | ||
ibus_unispim_load_settings(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- filename: unispim.xml --> | ||
<component> | ||
<name>im.lunispim.Lunispim</name> | ||
<description>Lunispim Component</description> | ||
<exec>@BIN_INSTALL_DIR@/ibus-engine-lunispim</exec> | ||
<version>@IBUS_LUNISPIM_VERSION@</version> | ||
<author>linhumans <[email protected]></author> | ||
<license>GPL</license> | ||
<homepage></homepage> | ||
<textdomain>ibus-lunispim</textdomain> | ||
<engines> | ||
<engine> | ||
<name>lunispim</name> | ||
<language>zh</language> | ||
<license>GPL</license> | ||
<author>linhuman <[email protected]></author> | ||
<icon>@SHARE_DIR@/lunispim/icons/logo.png</icon> | ||
<layout>default</layout> | ||
<longname>Lunispim</longname> | ||
<description>Lunispim Input Method Engine</description> | ||
<rank>0</rank> | ||
<symbol>㞢</symbol> | ||
</engine> | ||
</engines> | ||
</component> |
Oops, something went wrong.