diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2016-03-16 16:45:47 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2016-03-16 16:45:47 +0100 |
commit | 586920ad91df351a7f38f3f1286a313b072e3f44 (patch) | |
tree | 4e91099a39f8e71cb9e0b45c5a63983267a26f3d | |
parent | b5518536ee41dd1cdf2dea6228bb67f46615649f (diff) |
Remove public ufo_signal_emit symbol
-rw-r--r-- | ufo/CMakeLists.txt | 2 | ||||
-rw-r--r-- | ufo/ufo-misc.c | 64 | ||||
-rw-r--r-- | ufo/ufo-misc.h | 39 | ||||
-rw-r--r-- | ufo/ufo-task-iface.c | 21 | ||||
-rw-r--r-- | ufo/ufo.h | 1 |
5 files changed, 18 insertions, 109 deletions
diff --git a/ufo/CMakeLists.txt b/ufo/CMakeLists.txt index aeb1b11..fd9ebe7 100644 --- a/ufo/CMakeLists.txt +++ b/ufo/CMakeLists.txt @@ -20,7 +20,6 @@ set(ufocore_SRCS ufo-local-scheduler.c ufo-messenger-iface.c ufo-method-iface.c - ufo-misc.c ufo-node.c ufo-output-task.c ufo-plugin-manager.c @@ -56,7 +55,6 @@ set(ufocore_HDRS ufo-local-scheduler.h ufo-messenger-iface.h ufo-method-iface.h - ufo-misc.h ufo-node.h ufo-output-task.h ufo-plugin-manager.h diff --git a/ufo/ufo-misc.c b/ufo/ufo-misc.c deleted file mode 100644 index c18ae52..0000000 --- a/ufo/ufo-misc.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2011-2015 Karlsruhe Institute of Technology - * - * This file is part of Ufo. - * - * 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 library. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "config.h" - -#ifdef WITH_PYTHON -#include <Python.h> -#endif - -#include <ufo/ufo.h> - -/** - * ufo_signal_emit: - * @instance: (type GObject.Object): the instance the signal is being emitted on. - * @signal_id: the signal id - * @detail: the detail - * @...: parameters to be passed to the signal, followed by a - * location for the return value. If the return type of the signal - * is #G_TYPE_NONE, the return value location can be omitted. - * - * Emits a signal just like g_signal_emit(). In case ufo-core is compiled with - * Python-support, the GIL will be locked before signalling. - * - * Note that g_signal_emit() resets the return value to the default - * if no handlers are connected, in contrast to g_signal_emitv(). - */ -void -ufo_signal_emit (gpointer instance, - guint signal_id, - GQuark detail, - ...) -{ - va_list var_args; - -#ifdef WITH_PYTHON - if (Py_IsInitialized ()) { - PyGILState_STATE state = PyGILState_Ensure (); -#endif - - va_start (var_args, detail); - g_signal_emit_valist (instance, signal_id, detail, var_args); - va_end (var_args); - -#ifdef WITH_PYTHON - PyGILState_Release (state); - } -#endif -} diff --git a/ufo/ufo-misc.h b/ufo/ufo-misc.h deleted file mode 100644 index 5b70f4c..0000000 --- a/ufo/ufo-misc.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2011-2015 Karlsruhe Institute of Technology - * - * This file is part of Ufo. - * - * 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 library. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef UFO_MISC_H -#define UFO_MISC_H - -#if !defined (__UFO_H_INSIDE__) && !defined (UFO_COMPILATION) -#error "Only <ufo/ufo.h> can be included directly." -#endif - -#include <glib-object.h> - -G_BEGIN_DECLS - -void ufo_signal_emit (gpointer instance, - guint signal_id, - GQuark detail, - ...); - - -G_END_DECLS - -#endif diff --git a/ufo/ufo-task-iface.c b/ufo/ufo-task-iface.c index 5e8dd74..a355522 100644 --- a/ufo/ufo-task-iface.c +++ b/ufo/ufo-task-iface.c @@ -19,7 +19,6 @@ #include <ufo/ufo-task-iface.h> #include <ufo/ufo-task-node.h> -#include <ufo/ufo-misc.h> /** * SECTION:ufo-task-iface @@ -107,6 +106,22 @@ ufo_task_set_json_object_property (UfoTask *task, UFO_TASK_GET_IFACE (task)->set_json_object_property (task, prop_name, object); } +static void +emit_signal (gpointer instance, guint signal_id, GQuark detail) +{ +#ifdef WITH_PYTHON + if (Py_IsInitialized ()) { + PyGILState_STATE state = PyGILState_Ensure (); +#endif + + g_signal_emit (instance, signal_id, detail, G_TYPE_NONE); + +#ifdef WITH_PYTHON + PyGILState_Release (state); + } +#endif +} + gboolean ufo_task_process (UfoTask *task, UfoBuffer **inputs, @@ -121,7 +136,7 @@ ufo_task_process (UfoTask *task, result = UFO_TASK_GET_IFACE (task)->process (task, inputs, output, requisition); ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_PROCESS | UFO_TRACE_EVENT_END); - ufo_signal_emit (task, signals[PROCESSED], 0); + emit_signal (task, signals[PROCESSED], 0); ufo_task_node_increase_processed (UFO_TASK_NODE (task)); return result; @@ -140,7 +155,7 @@ ufo_task_generate (UfoTask *task, result = UFO_TASK_GET_IFACE (task)->generate (task, output, requisition); ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_GENERATE | UFO_TRACE_EVENT_END); - ufo_signal_emit (task, signals[GENERATED], 0); + emit_signal (task, signals[GENERATED], 0); return result; } @@ -37,7 +37,6 @@ #include <ufo/ufo-input-task.h> #include <ufo/ufo-messenger-iface.h> #include <ufo/ufo-method-iface.h> -#include <ufo/ufo-misc.h> #include <ufo/ufo-node.h> #include <ufo/ufo-output-task.h> #include <ufo/ufo-plugin-manager.h> |