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

This commit is contained in:
allhaileris
2026-02-16 15:50:16 +03:00
commit afb81b8278
13816 changed files with 3689732 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_qt_static_plugins_hime STATIC)
add_library(desktop-app::external_qt_static_plugins_hime ALIAS external_qt_static_plugins_hime)
init_target(external_qt_static_plugins_hime "(external)")
set(hime_loc ${third_party_loc}/hime)
set(hime_qt_src ${hime_loc}/src/qt5-im)
set_target_properties(external_qt_static_plugins_hime PROPERTIES AUTOMOC ON)
nice_target_sources(external_qt_static_plugins_hime ${hime_qt_src}
PRIVATE
hime-imcontext-qt.cpp
hime-imcontext-qt.h
hime-qt.cpp
hime-qt.h
)
target_include_directories(external_qt_static_plugins_hime
PRIVATE
${hime_qt_src}
)
target_compile_definitions(external_qt_static_plugins_hime
PRIVATE
QT_STATICPLUGIN
)
add_subdirectory(hime_im_client)
target_link_libraries(external_qt_static_plugins_hime
PRIVATE
desktop-app::external_qt_static_plugins_hime_im_client
desktop-app::external_qt
)
add_library(external_qt_static_plugins_hime_init OBJECT)
add_library(desktop-app::external_qt_static_plugins_hime_init ALIAS external_qt_static_plugins_hime_init)
init_target(external_qt_static_plugins_hime_init "(external)")
nice_target_sources(external_qt_static_plugins_hime_init ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
init.cpp
)
target_link_libraries(external_qt_static_plugins_hime_init
PRIVATE
desktop-app::external_qt
)
target_link_libraries(external_qt_static_plugins_hime
INTERFACE
external_qt_static_plugins_hime_init
$<TARGET_OBJECTS:external_qt_static_plugins_hime_init>
)

View File

@@ -0,0 +1,35 @@
# This file is part of Desktop App Toolkit,
# a set of libraries for developing nice desktop applications.
#
# For license and copyright information please follow this link:
# https://github.com/desktop-app/legal/blob/master/LEGAL
add_library(external_qt_static_plugins_hime_im_client STATIC)
add_library(desktop-app::external_qt_static_plugins_hime_im_client ALIAS external_qt_static_plugins_hime_im_client)
init_target(external_qt_static_plugins_hime_im_client "(external)")
set(hime_loc ${third_party_loc}/hime)
set(hime_im_client_src ${hime_loc}/src/im-client)
nice_target_sources(external_qt_static_plugins_hime_im_client ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE
hime_im_client_helper.cpp
)
target_include_directories(external_qt_static_plugins_hime_im_client
PUBLIC
${hime_im_client_src}
)
target_link_libraries(external_qt_static_plugins_hime_im_client
PRIVATE
desktop-app::lib_base
)
find_package(PkgConfig REQUIRED)
pkg_check_modules(DESKTOP_APP_X11 REQUIRED x11)
target_include_directories(external_qt_static_plugins_hime_im_client SYSTEM
PRIVATE
${DESKTOP_APP_X11_INCLUDE_DIRS}
)

View File

@@ -0,0 +1,179 @@
// This file is part of Desktop App Toolkit,
// a set of libraries for developing nice desktop applications.
//
// For license and copyright information please follow this link:
// https://github.com/desktop-app/legal/blob/master/LEGAL
//
#include "base/platform/linux/base_linux_library.h"
#include <X11/Xlib.h>
#include <hime-im-client.h>
namespace HimeHelper {
namespace {
void (*hime_im_client_close)(HIME_client_handle *handle);
void (*hime_im_client_focus_in)(HIME_client_handle *handle);
void (*hime_im_client_focus_out)(HIME_client_handle *handle);
void (*hime_im_client_focus_out2)(HIME_client_handle *handle, char **rstr);
int (*hime_im_client_forward_key_press)(
HIME_client_handle *handle,
const KeySym key,
const uint32_t state,
char **rstr);
int (*hime_im_client_forward_key_release)(
HIME_client_handle *handle,
const KeySym key,
const uint32_t state,
char **rstr);
int (*hime_im_client_get_preedit)(
HIME_client_handle *handle,
char **str,
HIME_PREEDIT_ATTR att[],
int *cursor,
int *sub_comp_len);
HIME_client_handle *(*hime_im_client_open)(Display *display);
void (*hime_im_client_reset)(HIME_client_handle *handle);
void (*hime_im_client_set_cursor_location)(
HIME_client_handle *handle,
const int x,
const int y);
void (*hime_im_client_set_flags)(
HIME_client_handle *handle,
const int flags,
int *ret_flags);
void (*hime_im_client_set_client_window)(
HIME_client_handle *handle,
const Window win);
void (*hime_im_client_set_window)(HIME_client_handle *handle, Window win);
bool Resolve() {
static const auto loaded = [&] {
const auto lib = base::Platform::LoadLibrary(
"libhime-im-client.so.1",
RTLD_NODELETE);
return lib
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_close)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_focus_in)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_focus_out)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_focus_out2)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_forward_key_press)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_forward_key_release)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_get_preedit)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_open)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_reset)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_cursor_location)
&& LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_flags)
&& (LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_client_window)
|| LOAD_LIBRARY_SYMBOL(lib, hime_im_client_set_window));
}();
return loaded;
}
} // namespace
} // namespace HimeHelper
void hime_im_client_close(HIME_client_handle *handle) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_close(handle);
}
void hime_im_client_focus_in(HIME_client_handle *handle) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_focus_in(handle);
}
void hime_im_client_focus_out(HIME_client_handle *handle) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_focus_out(handle);
}
void hime_im_client_focus_out2(HIME_client_handle *handle, char **rstr) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_focus_out2(handle, rstr);
}
int hime_im_client_forward_key_press(
HIME_client_handle *handle,
const KeySym key,
const uint32_t state,
char **rstr) {
HimeHelper::Resolve();
return HimeHelper::hime_im_client_forward_key_press(
handle,
key,
state,
rstr);
}
int hime_im_client_forward_key_release(
HIME_client_handle *handle,
const KeySym key,
const uint32_t state,
char **rstr) {
HimeHelper::Resolve();
return HimeHelper::hime_im_client_forward_key_release(
handle,
key,
state,
rstr);
}
int hime_im_client_get_preedit(
HIME_client_handle *handle,
char **str,
HIME_PREEDIT_ATTR att[],
int *cursor,
int *sub_comp_len) {
HimeHelper::Resolve();
return HimeHelper::hime_im_client_get_preedit(
handle,
str,
att,
cursor,
sub_comp_len);
}
HIME_client_handle *hime_im_client_open(Display *display) {
HimeHelper::Resolve();
return HimeHelper::hime_im_client_open(display);
}
void hime_im_client_reset(HIME_client_handle *handle) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_reset(handle);
}
void hime_im_client_set_cursor_location(
HIME_client_handle *handle,
const int x,
const int y) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_set_cursor_location(
handle,
x,
y);
}
void hime_im_client_set_flags(
HIME_client_handle *handle,
const int flags,
int *ret_flags) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_set_flags(
handle,
flags,
ret_flags);
}
void hime_im_client_set_client_window(
HIME_client_handle *handle,
const Window win) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_set_client_window(handle, win);
}
void hime_im_client_set_window(HIME_client_handle *handle, Window win) {
HimeHelper::Resolve();
HimeHelper::hime_im_client_set_window(handle, win);
}

View File

@@ -0,0 +1,10 @@
/*
This file is part of Desktop App Toolkit,
a set of libraries for developing nice desktop applications.
For license and copyright information please follow this link:
https://github.com/desktop-app/legal/blob/master/LEGAL
*/
#include <QtCore/QtPlugin>
Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)