ibus-ui-emoijer needs to be built at last in ui/gtk3
Also fixed po/POTFILES.in for `make dist`
Now I moved libibusemojidialog.so and IBusEmojiDialog-1.0.[gir|typelib]
and ibus-emoji-dialog-1.0.vapi to noinst because now
ibus-ui-emojier is available and they are private libraries.

R=Shawn.P.Huang@gmail.com

Review URL: https://codereview.appspot.com/312610043
This commit is contained in:
fujiwarat 2017-04-17 16:00:26 +09:00
Родитель da33672bc7
Коммит 290f786b82
4 изменённых файлов: 54 добавлений и 71 удалений

Просмотреть файл

@ -31,6 +31,7 @@ ibus/object.py
ibus/panel.py
ibus/property.py
ibus/utility.py
setup/emojilang.py
setup/engineabout.py
setup/enginecombobox.py
setup/enginedialog.py

Просмотреть файл

@ -101,24 +101,9 @@ CLEANFILES = \
if ENABLE_EMOJI_DICT
if ENABLE_UI
AM_CPPFLAGS += \
-I$(top_srcdir)/ui/gtk3 \
-I$(top_builddir)/ui/gtk3 \
$(NULL)
AM_CFLAGS += \
@GTK3_CFLAGS@ \
$(NULL)
AM_LDADD += \
@GTK3_LIBS@ \
$(libibus_emoji_dialog) \
$(NULL)
AM_VALAFLAGS += \
--define=EMOJI_DICT \
--vapidir=$(top_builddir)/ui/gtk3 \
--vapidir=$(top_srcdir)/ui/gtk3 \
--pkg=ibus-emoji-dialog-1.0 \
--pkg=gtk+-3.0 \
$(NULL)
--define=EMOJI_DICT \
$(NULL)
endif
endif

Просмотреть файл

@ -81,7 +81,9 @@ AM_VALAFLAGS = \
--target-glib="$(VALA_TARGET_GLIB_VERSION)" \
$(NULL)
MAINTAINERCLEANFILES =
CONFIG_CLEAN_FILES =
noinst_DATA =
if ENABLE_LIBNOTIFY
AM_CFLAGS += \
@ -108,10 +110,6 @@ endif
libexec_PROGRAMS = ibus-ui-gtk3
if ENABLE_EMOJI_DICT
libexec_PROGRAMS += ibus-ui-emojier
endif
ibus_ui_gtk3_SOURCES = \
application.vala \
candidatearea.vala \
@ -136,26 +134,6 @@ ibus_ui_gtk3_LDADD = \
$(AM_LDADD) \
$(NULL)
if ENABLE_EMOJI_DICT
AM_VALAFLAGS += \
--define=EMOJI_DICT \
--vapidir=$(top_builddir)/ui/gtk3 \
--vapidir=$(top_srcdir)/ui/gtk3 \
--pkg=ibus-emoji-dialog-1.0 \
--pkg=gtk+-3.0 \
$(NULL)
ibus_ui_emojier_SOURCES = \
emojierapp.vala \
$(NULL)
ibus_ui_emojier_LDADD = \
$(AM_LDADD) \
$(libibus_emoji_dialog) \
$(NULL)
endif
gen-%.xml.c: %.xml
echo "Building $@ from $<"
echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@
@ -185,11 +163,17 @@ EXTRA_DIST = \
$(NULL)
if ENABLE_EMOJI_DICT
AM_VALAFLAGS += --define=EMOJI_DICT
AM_VALAFLAGS += \
--define=EMOJI_DICT \
--vapidir=$(top_builddir)/ui/gtk3 \
--vapidir=$(top_srcdir)/ui/gtk3 \
--pkg=ibus-emoji-dialog-1.0 \
--pkg=gtk+-3.0 \
$(NULL)
libibus_emoji_dialog = libibus-emoji-dialog-1.0.la
lib_LTLIBRARIES = $(libibus_emoji_dialog)
noinst_LTLIBRARIES = $(libibus_emoji_dialog)
libibus_emoji_dialog_1_0_la_CFLAGS = $(AM_CFLAGS)
libibus_emoji_dialog_1_0_la_LDFLAGS = \
@ -198,11 +182,22 @@ libibus_emoji_dialog_1_0_la_LDFLAGS = \
-version-info @LT_VERSION_INFO@ \
$(NULL)
libibus_emoji_dialog_1_0_la_SOURCES = \
candidatearea.c \
emojier.c \
iconwidget.c \
pango.c \
separator.c \
candidatearea.vala \
emojier.vala \
iconwidget.vala \
pango.vala \
separator.vala \
$(NULL)
libexec_PROGRAMS += ibus-ui-emojier
ibus_ui_emojier_SOURCES = \
$(libibus_emoji_dialog_1_0_la_SOURCES) \
emojierapp.vala \
$(NULL)
ibus_ui_emojier_LDADD = \
$(AM_LDADD) \
$(NULL)
-include $(INTROSPECTION_MAKEFILE)
@ -214,10 +209,6 @@ INTROSPECTION_COMPILER_ARGS = \
$(NULL)
if HAVE_INTROSPECTION
ibusincludedir = $(includedir)/ibus-@IBUS_API_VERSION@
ibusinclude_HEADERS = \
$(emoji_headers) \
$(NULL)
introspection_sources = \
$(emoji_headers) \
$(NULL)
@ -242,12 +233,13 @@ IBusEmojiDialog_1_0_gir_CFLAGS = \
INTROSPECTION_GIRS = IBusEmojiDialog-1.0.gir
girdir = $(datadir)/gir-1.0
dist_gir_DATA = $(INTROSPECTION_GIRS)
noinst_DATA += $(INTROSPECTION_GIRS)
CLEANFILES += $(INTROSPECTION_GIRS)
typelibsdir = $(libdir)/girepository-1.0
typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
noinst_DATA += $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA)
if ENABLE_VAPIGEN
-include $(VAPIGEN_MAKEFILE)
@ -261,9 +253,9 @@ ibus_emoji_dialog_1_0_vapi_METADATADIRS = $(srcdir)
ibus_emoji_dialog_1_0_vapi_FILES = $(INTROSPECTION_GIRS)
vapidir = $(datadir)/vala/vapi
vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
noinst_DATA += $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
MAINTAINERCLEANFILES = $(VAPIGEN_VAPIS)
MAINTAINERCLEANFILES += $(VAPIGEN_VAPIS)
# for make distclean
CONFIG_CLEAN_FILES += $(VAPIGEN_VAPIS)
EXTRA_DIST += $(VAPIGEN_VAPIS)

Просмотреть файл

@ -24,52 +24,55 @@ string emoji_font = null;
string annotation_lang = null;
public class EmojiApplication : Application {
private IBus.Emojier emojier = new IBus.Emojier();
private IBusEmojier m_emojier = new IBusEmojier();
private EmojiApplication() {
Object(application_id: "org.freedesktop.ibus.panel.emojier",
flags: ApplicationFlags.HANDLES_COMMAND_LINE);
flags: ApplicationFlags.HANDLES_COMMAND_LINE);
set_inactivity_timeout(100000);
}
private void show_dialog(ApplicationCommandLine command_line) {
Gdk.Event event = new Gdk.Event(Gdk.EventType.KEY_PRESS);
var display = Gdk.Display.get_default();
var device_manager = display.get_device_manager();
var device = device_manager.list_devices(Gdk.DeviceType.MASTER).data;
event.set_device(device);
string emoji = emojier.run(event, "");
string emoji = m_emojier.run(event, "");
if (emoji == null) {
emojier.reset();
m_emojier.reset();
command_line.print("%s\n", _("Canceled to choose an emoji."));
return;
}
Gtk.Clipboard clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD);
clipboard.set_text(emoji, -1);
clipboard.store();
emojier.reset();
m_emojier.reset();
command_line.print("%s\n", _("Copied an emoji to your clipboard."));
}
public void activate_dialog(ApplicationCommandLine command_line) {
this.hold ();
// show dialog
if (emojier.has_loaded_emoji_dict()) {
if (m_emojier.has_loaded_emoji_dict()) {
show_dialog(command_line);
} else {
emojier.loaded_emoji_dict.connect(() => {
// The signal is called when the language is changed.
if (emojier.is_running())
m_emojier.loaded_emoji_dict.connect(() => {
// The signal is called when the language is changed.
if (m_emojier.is_running())
return;
show_dialog(command_line);
});
show_dialog(command_line);
});
}
this.release ();
}
private int _command_line (ApplicationCommandLine command_line) {
const OptionEntry[] options = {
{ "font", 0, 0, OptionArg.STRING, out emoji_font,
@ -114,15 +117,16 @@ public class EmojiApplication : Application {
}
if (emoji_font != null && emoji_font != "")
emojier.set_emoji_font(emoji_font);
m_emojier.set_emoji_font(emoji_font);
if (annotation_lang != null && annotation_lang != "")
emojier.set_annotation_lang(annotation_lang);
m_emojier.set_annotation_lang(annotation_lang);
activate_dialog(command_line);
return Posix.EXIT_SUCCESS;
}
public override int command_line (ApplicationCommandLine command_line) {
// keep the application running until we are done with this commandline
this.hold();
@ -131,9 +135,10 @@ public class EmojiApplication : Application {
return result;
}
public static int main (string[] args) {
GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE,
Config.GLIB_LOCALE_DIR);
Config.GLIB_LOCALE_DIR);
GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8");
GLib.Intl.textdomain(Config.GETTEXT_PACKAGE);