14
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
* Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17
* Thomas Voß <thomas.voss@canonical.com>
17
* Thomas Voß <thomas.voss@canonical.com>
20
20
#ifndef UBUNTU_APPLICATION_INSTANCE_H_
30
/** \defgroup application_support Functions and types to support application development. */
33
* \brief Opaque type describing an application instance.
34
* \ingroup application_support
35
* An application instance encapsulates the event loop of an app.
30
37
typedef void UApplicationInstance;
40
* \brief Creates a new application instance with a reference count of 1.
41
* \ingroup application_support
42
* \returns A new application instance or NULL in case of low-memory.
43
* \param[in] desc A description object, must not be NULL.
44
* \param[in] options An options object, must not be NULL.
32
46
UApplicationInstance*
33
47
u_application_instance_new_from_description_with_options(
34
UApplicationDescription *desc,
35
UApplicationOptions *options);
48
UApplicationDescription *desc,
49
UApplicationOptions *options);
52
* \brief Increments the reference count of an application instance.
53
* \ingroup application_support
54
* \param[in] instance The instance to increment the reference count for.
38
57
u_application_instance_ref(
39
UApplicationInstance *instance);
58
UApplicationInstance *instance);
61
* \brief Decrements the reference count of an application instance and releases all resources held by the object if the reference count reaches 0.
62
* \ingroup application_support
63
* \param[in] instance The instance to decrement the reference count for.
42
66
u_application_instance_unref(
43
UApplicationInstance *instance);
67
UApplicationInstance *instance);
70
* \brief Destroys the application instance and releases all its resources.
71
* \ingroup application_support
72
* \param[in] instance The instance to be destroyed.
46
75
u_application_instance_destroy(
47
UApplicationInstance *instance);
76
UApplicationInstance *instance);
79
* \brief Executes the event loop of the application instance
80
* \ingroup application_support
81
* \param[in] instance The instance to be executed.
50
84
u_application_instance_run(
51
UApplicationInstance *instance);
85
UApplicationInstance *instance);
57
91
#endif /* UBUNTU_APPLICATION_INSTANCE_H_ */