Commit 95c8ae37 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

No need to keep ibus 1.4.* compatibility anymore

Summary: 1.5 was first released in July 2014, I don't see why keep it around.

Test Plan: Still builds

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24414
parent 9e7f2a91
find_package(IBus)
find_package(IBus 1.5.0)
find_package(GLIB2)
find_package(GIO)
find_package(GObject)
if(IBUS_FOUND AND GLIB2_FOUND AND GIO_FOUND AND GOBJECT_FOUND)
configure_file(config-kimpanel.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kimpanel.h)
include_directories(${IBUS_INCLUDE_DIR})
include_directories(${GIO_INCLUDE_DIR})
include_directories(${GOBJECT_INCLUDE_DIR})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
if (${IBUS_VERSION} VERSION_LESS "1.5.0")
set(kimpanel_ibus_panel_SRCS ibus14/panel.c ibus14/main.c)
find_package(Qt5X11Extras)
find_package(XCB COMPONENTS XCB KEYSYMS)
if (Qt5X11Extras_FOUND AND XCB_XCB_FOUND AND XCB_KEYSYMS_FOUND)
include_directories(${Qt5X11Extras_INCLUDE_DIRS})
include_directories(${XCB_XCB_INCLUDE_DIRS})
include_directories(${XCB_KEYSYMS_INCLUDE_DIRS})
set(kimpanel_ibus_panel_SRCS
ibus15/xkblayoutmanager.cpp
ibus15/gtkaccelparse_p.c
ibus15/gdkkeynames_p.c
ibus15/app.cpp
ibus15/enginemanager.cpp
ibus15/main.cpp
ibus15/panel.cpp
ibus15/propertymanager.cpp)
add_definitions(-DQT_NO_KEYWORDS)
add_executable(kimpanel-ibus-panel ${kimpanel_ibus_panel_SRCS})
target_link_libraries(kimpanel-ibus-panel ${IBUS_LIBRARIES} GLIB2::GLIB2 ${GIO_LIBRARIES} ${GOBJECT_LIBRARIES})
target_link_libraries(kimpanel-ibus-panel ${IBUS_LIBRARIES} GLIB2::GLIB2 ${GIO_LIBRARIES} ${GOBJECT_LIBRARIES} Qt5::Core Qt5::DBus Qt5::Gui Qt5::X11Extras XCB::KEYSYMS)
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kimpanel.xml.in ${CMAKE_CURRENT_BINARY_DIR}/kimpanel.xml @ONLY)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kimpanel.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/ibus/component)
else()
find_package(Qt5X11Extras)
find_package(XCB COMPONENTS XCB KEYSYMS)
if (Qt5X11Extras_FOUND AND XCB_XCB_FOUND AND XCB_KEYSYMS_FOUND)
include_directories(${Qt5X11Extras_INCLUDE_DIRS})
include_directories(${XCB_XCB_INCLUDE_DIRS})
include_directories(${XCB_KEYSYMS_INCLUDE_DIRS})
set(kimpanel_ibus_panel_SRCS
ibus15/xkblayoutmanager.cpp
ibus15/gtkaccelparse_p.c
ibus15/gdkkeynames_p.c
ibus15/app.cpp
ibus15/enginemanager.cpp
ibus15/main.cpp
ibus15/panel.cpp
ibus15/propertymanager.cpp)
add_definitions(-DQT_NO_KEYWORDS)
add_executable(kimpanel-ibus-panel ${kimpanel_ibus_panel_SRCS})
target_link_libraries(kimpanel-ibus-panel ${IBUS_LIBRARIES} GLIB2::GLIB2 ${GIO_LIBRARIES} ${GOBJECT_LIBRARIES} Qt5::Core Qt5::DBus Qt5::Gui Qt5::X11Extras XCB::KEYSYMS)
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kimpanel.xml.in ${CMAKE_CURRENT_BINARY_DIR}/kimpanel.xml @ONLY)
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kimpanel.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/ibus/component)
endif()
endif()
if (TARGET kimpanel-ibus-panel)
target_include_directories(kimpanel-ibus-panel PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_executable(kimpanel-ibus-panel-launcher launcher.cpp)
......
/*
* This file is part of KIMToy, an input method frontend for KDE
* Copyright (C) 2011 Ni Hui <shuizhuyuanluo@126.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <ibus.h>
#include <stdlib.h>
#include <locale.h>
#include "panel.h"
#define _UNUSED(x) ((void) x)
static IBusBus *bus = NULL;
static IBusPanelImpanel *impanel = NULL;
/* options */
static gboolean ibus = FALSE;
static gboolean verbose = FALSE;
static const GOptionEntry entries[] =
{
{ "ibus", 'i', 0, G_OPTION_ARG_NONE, &ibus, "component is executed by ibus", NULL },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "verbose", NULL },
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL },
};
static void
ibus_disconnected_cb (IBusBus *bus,
gpointer user_data)
{
_UNUSED(bus);
_UNUSED(user_data);
ibus_quit ();
}
static void
ibus_impanel_start (void)
{
ibus_init ();
bus = ibus_bus_new ();
if (!ibus_bus_is_connected (bus)) {
exit (-1);
}
g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL);
impanel = ibus_panel_impanel_new (ibus_bus_get_connection (bus));
ibus_bus_request_name (bus, IBUS_SERVICE_PANEL, 0);
ibus_panel_impanel_set_bus(impanel, bus);
ibus_main ();
}
gint
main (gint argc, gchar **argv)
{
GError *error = NULL;
GOptionContext *context;
setlocale (LC_ALL, "");
context = g_option_context_new ("- ibus impanel component");
g_option_context_add_main_entries (context, entries, "ibus-impanel");
if (!g_option_context_parse (context, &argc, &argv, &error)) {
g_print ("Option parsing failed: %s\n", error->message);
exit (-1);
}
ibus_impanel_start ();
return 0;
}
This diff is collapsed.
/*
* This file is part of KIMToy, an input method frontend for KDE
* Copyright (C) 2011 Ni Hui <shuizhuyuanluo@126.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __PANEL_IMPANEL_H__
#define __PANEL_IMPANEL_H__
#include <ibus.h>
#define IBUS_TYPE_PANEL_IMPANEL \
(ibus_panel_impanel_get_type ())
#define IBUS_PANEL_IMPANEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PANEL_IMPANEL, IBusPanelImpanel))
#define IBUS_PANEL_IMPANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PANEL_IMPANEL, IBusPanelImpanelClass))
#define IBUS_IS_PANEL_IMPANEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PANEL_IMPANEL))
#define IBUS_IS_PANEL_IMPANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PANEL_IMPANEL))
#define IBUS_PANEL_IMPANEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PANEL_IMPANEL, IBusPanelImpanelClass))
typedef struct _IBusPanelImpanel IBusPanelImpanel;
GType ibus_panel_impanel_get_type (void);
#if !IBUS_CHECK_VERSION(1,3,99)
IBusPanelImpanel *ibus_panel_impanel_new (IBusConnection *connection);
#else
IBusPanelImpanel *ibus_panel_impanel_new (GDBusConnection *connection);
#endif
void ibus_panel_impanel_set_bus (IBusPanelImpanel *impanel,
IBusBus *bus);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment