|
Packit Service |
1d8f1c |
/* application.c generated by valac 0.40.8, the Vala compiler
|
|
Packit Service |
1d8f1c |
* generated from application.vala, do not modify */
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* vim:set et sts=4 sw=4:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* ibus - The Input Bus
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Copyright(c) 2011 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright(c) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
* Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
* USA
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include <glib.h>
|
|
Packit Service |
1d8f1c |
#include <glib-object.h>
|
|
Packit Service |
1d8f1c |
#include <ibus.h>
|
|
Packit Service |
1d8f1c |
#include <stdlib.h>
|
|
Packit Service |
1d8f1c |
#include <string.h>
|
|
Packit Service |
1d8f1c |
#include <glib/gi18n-lib.h>
|
|
Packit Service |
1d8f1c |
#include <config.h>
|
|
Packit Service |
1d8f1c |
#include <gtk/gtk.h>
|
|
Packit Service |
1d8f1c |
#include <gio/gio.h>
|
|
Packit Service |
1d8f1c |
#include <gdk/gdk.h>
|
|
Packit Service |
1d8f1c |
#include <gobject/gvaluecollector.h>
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#define TYPE_APPLICATION (application_get_type ())
|
|
Packit Service |
1d8f1c |
#define APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_APPLICATION, Application))
|
|
Packit Service |
1d8f1c |
#define APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_APPLICATION, ApplicationClass))
|
|
Packit Service |
1d8f1c |
#define IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_APPLICATION))
|
|
Packit Service |
1d8f1c |
#define IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_APPLICATION))
|
|
Packit Service |
1d8f1c |
#define APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_APPLICATION, ApplicationClass))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _Application Application;
|
|
Packit Service |
1d8f1c |
typedef struct _ApplicationClass ApplicationClass;
|
|
Packit Service |
1d8f1c |
typedef struct _ApplicationPrivate ApplicationPrivate;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#define TYPE_PANEL (panel_get_type ())
|
|
Packit Service |
1d8f1c |
#define PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PANEL, Panel))
|
|
Packit Service |
1d8f1c |
#define PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PANEL, PanelClass))
|
|
Packit Service |
1d8f1c |
#define IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PANEL))
|
|
Packit Service |
1d8f1c |
#define IS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PANEL))
|
|
Packit Service |
1d8f1c |
#define PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PANEL, PanelClass))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _Panel Panel;
|
|
Packit Service |
1d8f1c |
typedef struct _PanelClass PanelClass;
|
|
Packit Service |
1d8f1c |
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
|
|
Packit Service |
1d8f1c |
#define _application_unref0(var) ((var == NULL) ? NULL : (var = (application_unref (var), NULL)))
|
|
Packit Service |
1d8f1c |
typedef struct _ParamSpecApplication ParamSpecApplication;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _Application {
|
|
Packit Service |
1d8f1c |
GTypeInstance parent_instance;
|
|
Packit Service |
1d8f1c |
volatile int ref_count;
|
|
Packit Service |
1d8f1c |
ApplicationPrivate * priv;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _ApplicationClass {
|
|
Packit Service |
1d8f1c |
GTypeClass parent_class;
|
|
Packit Service |
1d8f1c |
void (*finalize) (Application *self);
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _ApplicationPrivate {
|
|
Packit Service |
1d8f1c |
IBusBus* m_bus;
|
|
Packit Service |
1d8f1c |
Panel* m_panel;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _ParamSpecApplication {
|
|
Packit Service |
1d8f1c |
GParamSpec parent_instance;
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static gpointer application_parent_class = NULL;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gpointer application_ref (gpointer instance);
|
|
Packit Service |
1d8f1c |
void application_unref (gpointer instance);
|
|
Packit Service |
1d8f1c |
GParamSpec* param_spec_application (const gchar* name,
|
|
Packit Service |
1d8f1c |
const gchar* nick,
|
|
Packit Service |
1d8f1c |
const gchar* blurb,
|
|
Packit Service |
1d8f1c |
GType object_type,
|
|
Packit Service |
1d8f1c |
GParamFlags flags);
|
|
Packit Service |
1d8f1c |
void value_set_application (GValue* value,
|
|
Packit Service |
1d8f1c |
gpointer v_object);
|
|
Packit Service |
1d8f1c |
void value_take_application (GValue* value,
|
|
Packit Service |
1d8f1c |
gpointer v_object);
|
|
Packit Service |
1d8f1c |
gpointer value_get_application (const GValue* value);
|
|
Packit Service |
1d8f1c |
GType application_get_type (void) G_GNUC_CONST;
|
|
Packit Service |
1d8f1c |
GType panel_get_type (void) G_GNUC_CONST;
|
|
Packit Service |
1d8f1c |
#define APPLICATION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_APPLICATION, ApplicationPrivate))
|
|
Packit Service |
1d8f1c |
Application* application_new (gchar** argv,
|
|
Packit Service |
1d8f1c |
int argv_length1);
|
|
Packit Service |
1d8f1c |
Application* application_construct (GType object_type,
|
|
Packit Service |
1d8f1c |
gchar** argv,
|
|
Packit Service |
1d8f1c |
int argv_length1);
|
|
Packit Service |
1d8f1c |
static void application_bus_connected (Application* self,
|
|
Packit Service |
1d8f1c |
IBusBus* bus);
|
|
Packit Service |
1d8f1c |
static void _application_bus_connected_ibus_bus_connected (IBusBus* _sender,
|
|
Packit Service |
1d8f1c |
gpointer self);
|
|
Packit Service |
1d8f1c |
static void application_bus_disconnected (Application* self,
|
|
Packit Service |
1d8f1c |
IBusBus* bus);
|
|
Packit Service |
1d8f1c |
static void _application_bus_disconnected_ibus_bus_disconnected (IBusBus* _sender,
|
|
Packit Service |
1d8f1c |
gpointer self);
|
|
Packit Service |
1d8f1c |
static void application_init (Application* self);
|
|
Packit Service |
1d8f1c |
static void application_bus_name_acquired_cb (Application* self,
|
|
Packit Service |
1d8f1c |
GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters);
|
|
Packit Service |
1d8f1c |
static void _application_bus_name_acquired_cb_gd_bus_signal_callback (GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters,
|
|
Packit Service |
1d8f1c |
gpointer self);
|
|
Packit Service |
1d8f1c |
static void application_bus_name_lost_cb (Application* self,
|
|
Packit Service |
1d8f1c |
GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters);
|
|
Packit Service |
1d8f1c |
static void _application_bus_name_lost_cb_gd_bus_signal_callback (GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters,
|
|
Packit Service |
1d8f1c |
gpointer self);
|
|
Packit Service |
1d8f1c |
gint application_run (Application* self);
|
|
Packit Service |
1d8f1c |
Panel* panel_new (IBusBus* bus);
|
|
Packit Service |
1d8f1c |
Panel* panel_construct (GType object_type,
|
|
Packit Service |
1d8f1c |
IBusBus* bus);
|
|
Packit Service |
1d8f1c |
void panel_load_settings (Panel* self);
|
|
Packit Service |
1d8f1c |
void panel_disconnect_signals (Panel* self);
|
|
Packit Service |
1d8f1c |
void application_main (gchar** argv,
|
|
Packit Service |
1d8f1c |
int argv_length1);
|
|
Packit Service |
1d8f1c |
static void application_finalize (Application * obj);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
_application_bus_connected_ibus_bus_connected (IBusBus* _sender,
|
|
Packit Service |
1d8f1c |
gpointer self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
application_bus_connected ((Application*) self, _sender);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
_application_bus_disconnected_ibus_bus_disconnected (IBusBus* _sender,
|
|
Packit Service |
1d8f1c |
gpointer self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
application_bus_disconnected ((Application*) self, _sender);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
Application*
|
|
Packit Service |
1d8f1c |
application_construct (GType object_type,
|
|
Packit Service |
1d8f1c |
gchar** argv,
|
|
Packit Service |
1d8f1c |
int argv_length1)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application* self = NULL;
|
|
Packit Service |
1d8f1c |
IBusBus* _tmp0_;
|
|
Packit Service |
1d8f1c |
IBusBus* _tmp1_;
|
|
Packit Service |
1d8f1c |
IBusBus* _tmp2_;
|
|
Packit Service |
1d8f1c |
IBusBus* _tmp3_;
|
|
Packit Service |
1d8f1c |
self = (Application*) g_type_create_instance (object_type);
|
|
Packit Service |
1d8f1c |
bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
|
|
Packit Service |
1d8f1c |
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
Packit Service |
1d8f1c |
ibus_init ();
|
|
Packit Service |
1d8f1c |
gtk_init (&argv_length1, &argv);
|
|
Packit Service |
1d8f1c |
_tmp0_ = ibus_bus_new ();
|
|
Packit Service |
1d8f1c |
g_object_ref_sink (_tmp0_);
|
|
Packit Service |
1d8f1c |
_g_object_unref0 (self->priv->m_bus);
|
|
Packit Service |
1d8f1c |
self->priv->m_bus = _tmp0_;
|
|
Packit Service |
1d8f1c |
_tmp1_ = self->priv->m_bus;
|
|
Packit Service |
1d8f1c |
g_signal_connect (_tmp1_, "connected", (GCallback) _application_bus_connected_ibus_bus_connected, self);
|
|
Packit Service |
1d8f1c |
_tmp2_ = self->priv->m_bus;
|
|
Packit Service |
1d8f1c |
g_signal_connect (_tmp2_, "disconnected", (GCallback) _application_bus_disconnected_ibus_bus_disconnected, self);
|
|
Packit Service |
1d8f1c |
_tmp3_ = self->priv->m_bus;
|
|
Packit Service |
1d8f1c |
if (ibus_bus_is_connected (_tmp3_)) {
|
|
Packit Service |
1d8f1c |
application_init (self);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
return self;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
Application*
|
|
Packit Service |
1d8f1c |
application_new (gchar** argv,
|
|
Packit Service |
1d8f1c |
int argv_length1)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
return application_construct (TYPE_APPLICATION, argv, argv_length1);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static gpointer
|
|
Packit Service |
1d8f1c |
_g_object_ref0 (gpointer self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
return self ? g_object_ref (self) : NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
_application_bus_name_acquired_cb_gd_bus_signal_callback (GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters,
|
|
Packit Service |
1d8f1c |
gpointer self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
application_bus_name_acquired_cb ((Application*) self, connection, sender_name, object_path, interface_name, signal_name, parameters);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
_application_bus_name_lost_cb_gd_bus_signal_callback (GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters,
|
|
Packit Service |
1d8f1c |
gpointer self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
application_bus_name_lost_cb ((Application*) self, connection, sender_name, object_path, interface_name, signal_name, parameters);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_init (Application* self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
GDBusConnection* connection = NULL;
|
|
Packit Service |
1d8f1c |
IBusBus* _tmp0_;
|
|
Packit Service |
1d8f1c |
GDBusConnection* _tmp1_;
|
|
Packit Service |
1d8f1c |
GDBusConnection* _tmp2_;
|
|
Packit Service |
1d8f1c |
IBusBusNameFlag flags = 0;
|
|
Packit Service |
1d8f1c |
IBusBus* _tmp3_;
|
|
Packit Service |
1d8f1c |
g_return_if_fail (self != NULL);
|
|
Packit Service |
1d8f1c |
_tmp0_ = self->priv->m_bus;
|
|
Packit Service |
1d8f1c |
_tmp1_ = ibus_bus_get_connection (_tmp0_);
|
|
Packit Service |
1d8f1c |
_tmp2_ = _g_object_ref0 (_tmp1_);
|
|
Packit Service |
1d8f1c |
connection = _tmp2_;
|
|
Packit Service |
1d8f1c |
g_dbus_connection_signal_subscribe (connection, "org.freedesktop.DBus", "org.freedesktop.DBus", "NameAcquired", "/org/freedesktop/DBus", IBUS_SERVICE_PANEL, G_DBUS_SIGNAL_FLAGS_NONE, _application_bus_name_acquired_cb_gd_bus_signal_callback, application_ref (self), application_unref);
|
|
Packit Service |
1d8f1c |
g_dbus_connection_signal_subscribe (connection, "org.freedesktop.DBus", "org.freedesktop.DBus", "NameLost", "/org/freedesktop/DBus", IBUS_SERVICE_PANEL, G_DBUS_SIGNAL_FLAGS_NONE, _application_bus_name_lost_cb_gd_bus_signal_callback, application_ref (self), application_unref);
|
|
Packit Service |
1d8f1c |
flags = IBUS_BUS_NAME_FLAG_ALLOW_REPLACEMENT | IBUS_BUS_NAME_FLAG_REPLACE_EXISTING;
|
|
Packit Service |
1d8f1c |
_tmp3_ = self->priv->m_bus;
|
|
Packit Service |
1d8f1c |
ibus_bus_request_name (_tmp3_, IBUS_SERVICE_PANEL, (guint32) flags);
|
|
Packit Service |
1d8f1c |
_g_object_unref0 (connection);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gint
|
|
Packit Service |
1d8f1c |
application_run (Application* self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
gint result = 0;
|
|
Packit Service |
1d8f1c |
g_return_val_if_fail (self != NULL, 0);
|
|
Packit Service |
1d8f1c |
gtk_main ();
|
|
Packit Service |
1d8f1c |
result = 0;
|
|
Packit Service |
1d8f1c |
return result;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_bus_name_acquired_cb (Application* self,
|
|
Packit Service |
1d8f1c |
GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
IBusBus* _tmp0_;
|
|
Packit Service |
1d8f1c |
Panel* _tmp1_;
|
|
Packit Service |
1d8f1c |
Panel* _tmp2_;
|
|
Packit Service |
1d8f1c |
g_return_if_fail (self != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (connection != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (sender_name != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (object_path != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (interface_name != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (signal_name != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (parameters != NULL);
|
|
Packit Service |
1d8f1c |
g_debug ("application.vala:78: signal_name = %s", signal_name);
|
|
Packit Service |
1d8f1c |
_tmp0_ = self->priv->m_bus;
|
|
Packit Service |
1d8f1c |
_tmp1_ = panel_new (_tmp0_);
|
|
Packit Service |
1d8f1c |
g_object_ref_sink (_tmp1_);
|
|
Packit Service |
1d8f1c |
_g_object_unref0 (self->priv->m_panel);
|
|
Packit Service |
1d8f1c |
self->priv->m_panel = _tmp1_;
|
|
Packit Service |
1d8f1c |
_tmp2_ = self->priv->m_panel;
|
|
Packit Service |
1d8f1c |
panel_load_settings (_tmp2_);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_bus_name_lost_cb (Application* self,
|
|
Packit Service |
1d8f1c |
GDBusConnection* connection,
|
|
Packit Service |
1d8f1c |
const gchar* sender_name,
|
|
Packit Service |
1d8f1c |
const gchar* object_path,
|
|
Packit Service |
1d8f1c |
const gchar* interface_name,
|
|
Packit Service |
1d8f1c |
const gchar* signal_name,
|
|
Packit Service |
1d8f1c |
GVariant* parameters)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Panel* _tmp0_;
|
|
Packit Service |
1d8f1c |
g_return_if_fail (self != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (connection != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (sender_name != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (object_path != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (interface_name != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (signal_name != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (parameters != NULL);
|
|
Packit Service |
1d8f1c |
g_debug ("application.vala:95: signal_name = %s", signal_name);
|
|
Packit Service |
1d8f1c |
_tmp0_ = self->priv->m_panel;
|
|
Packit Service |
1d8f1c |
panel_disconnect_signals (_tmp0_);
|
|
Packit Service |
1d8f1c |
_g_object_unref0 (self->priv->m_panel);
|
|
Packit Service |
1d8f1c |
self->priv->m_panel = NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_bus_disconnected (Application* self,
|
|
Packit Service |
1d8f1c |
IBusBus* bus)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_return_if_fail (self != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (bus != NULL);
|
|
Packit Service |
1d8f1c |
g_debug ("application.vala:103: connection is lost.");
|
|
Packit Service |
1d8f1c |
gtk_main_quit ();
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_bus_connected (Application* self,
|
|
Packit Service |
1d8f1c |
IBusBus* bus)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_return_if_fail (self != NULL);
|
|
Packit Service |
1d8f1c |
g_return_if_fail (bus != NULL);
|
|
Packit Service |
1d8f1c |
application_init (self);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
application_main (gchar** argv,
|
|
Packit Service |
1d8f1c |
int argv_length1)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application* app = NULL;
|
|
Packit Service |
1d8f1c |
Application* _tmp0_;
|
|
Packit Service |
1d8f1c |
g_unsetenv ("GDK_CORE_DEVICE_EVENTS");
|
|
Packit Service |
1d8f1c |
gdk_set_allowed_backends ("x11");
|
|
Packit Service |
1d8f1c |
_tmp0_ = application_new (argv, argv_length1);
|
|
Packit Service |
1d8f1c |
app = _tmp0_;
|
|
Packit Service |
1d8f1c |
application_run (app);
|
|
Packit Service |
1d8f1c |
_application_unref0 (app);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
int
|
|
Packit Service |
1d8f1c |
main (int argc,
|
|
Packit Service |
1d8f1c |
char ** argv)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
application_main (argv, argc);
|
|
Packit Service |
1d8f1c |
return 0;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
value_application_init (GValue* value)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
value->data[0].v_pointer = NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
value_application_free_value (GValue* value)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
if (value->data[0].v_pointer) {
|
|
Packit Service |
1d8f1c |
application_unref (value->data[0].v_pointer);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
value_application_copy_value (const GValue* src_value,
|
|
Packit Service |
1d8f1c |
GValue* dest_value)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
if (src_value->data[0].v_pointer) {
|
|
Packit Service |
1d8f1c |
dest_value->data[0].v_pointer = application_ref (src_value->data[0].v_pointer);
|
|
Packit Service |
1d8f1c |
} else {
|
|
Packit Service |
1d8f1c |
dest_value->data[0].v_pointer = NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static gpointer
|
|
Packit Service |
1d8f1c |
value_application_peek_pointer (const GValue* value)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
return value->data[0].v_pointer;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static gchar*
|
|
Packit Service |
1d8f1c |
value_application_collect_value (GValue* value,
|
|
Packit Service |
1d8f1c |
guint n_collect_values,
|
|
Packit Service |
1d8f1c |
GTypeCValue* collect_values,
|
|
Packit Service |
1d8f1c |
guint collect_flags)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
if (collect_values[0].v_pointer) {
|
|
Packit Service |
1d8f1c |
Application * object;
|
|
Packit Service |
1d8f1c |
object = collect_values[0].v_pointer;
|
|
Packit Service |
1d8f1c |
if (object->parent_instance.g_class == NULL) {
|
|
Packit Service |
1d8f1c |
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
|
|
Packit Service |
1d8f1c |
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
|
|
Packit Service |
1d8f1c |
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
value->data[0].v_pointer = application_ref (object);
|
|
Packit Service |
1d8f1c |
} else {
|
|
Packit Service |
1d8f1c |
value->data[0].v_pointer = NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static gchar*
|
|
Packit Service |
1d8f1c |
value_application_lcopy_value (const GValue* value,
|
|
Packit Service |
1d8f1c |
guint n_collect_values,
|
|
Packit Service |
1d8f1c |
GTypeCValue* collect_values,
|
|
Packit Service |
1d8f1c |
guint collect_flags)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application ** object_p;
|
|
Packit Service |
1d8f1c |
object_p = collect_values[0].v_pointer;
|
|
Packit Service |
1d8f1c |
if (!object_p) {
|
|
Packit Service |
1d8f1c |
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
if (!value->data[0].v_pointer) {
|
|
Packit Service |
1d8f1c |
*object_p = NULL;
|
|
Packit Service |
1d8f1c |
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
|
|
Packit Service |
1d8f1c |
*object_p = value->data[0].v_pointer;
|
|
Packit Service |
1d8f1c |
} else {
|
|
Packit Service |
1d8f1c |
*object_p = application_ref (value->data[0].v_pointer);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
return NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GParamSpec*
|
|
Packit Service |
1d8f1c |
param_spec_application (const gchar* name,
|
|
Packit Service |
1d8f1c |
const gchar* nick,
|
|
Packit Service |
1d8f1c |
const gchar* blurb,
|
|
Packit Service |
1d8f1c |
GType object_type,
|
|
Packit Service |
1d8f1c |
GParamFlags flags)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
ParamSpecApplication* spec;
|
|
Packit Service |
1d8f1c |
g_return_val_if_fail (g_type_is_a (object_type, TYPE_APPLICATION), NULL);
|
|
Packit Service |
1d8f1c |
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
|
|
Packit Service |
1d8f1c |
G_PARAM_SPEC (spec)->value_type = object_type;
|
|
Packit Service |
1d8f1c |
return G_PARAM_SPEC (spec);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gpointer
|
|
Packit Service |
1d8f1c |
value_get_application (const GValue* value)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_APPLICATION), NULL);
|
|
Packit Service |
1d8f1c |
return value->data[0].v_pointer;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
value_set_application (GValue* value,
|
|
Packit Service |
1d8f1c |
gpointer v_object)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application * old;
|
|
Packit Service |
1d8f1c |
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_APPLICATION));
|
|
Packit Service |
1d8f1c |
old = value->data[0].v_pointer;
|
|
Packit Service |
1d8f1c |
if (v_object) {
|
|
Packit Service |
1d8f1c |
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_APPLICATION));
|
|
Packit Service |
1d8f1c |
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
|
Packit Service |
1d8f1c |
value->data[0].v_pointer = v_object;
|
|
Packit Service |
1d8f1c |
application_ref (value->data[0].v_pointer);
|
|
Packit Service |
1d8f1c |
} else {
|
|
Packit Service |
1d8f1c |
value->data[0].v_pointer = NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
if (old) {
|
|
Packit Service |
1d8f1c |
application_unref (old);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
value_take_application (GValue* value,
|
|
Packit Service |
1d8f1c |
gpointer v_object)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application * old;
|
|
Packit Service |
1d8f1c |
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_APPLICATION));
|
|
Packit Service |
1d8f1c |
old = value->data[0].v_pointer;
|
|
Packit Service |
1d8f1c |
if (v_object) {
|
|
Packit Service |
1d8f1c |
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_APPLICATION));
|
|
Packit Service |
1d8f1c |
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
|
|
Packit Service |
1d8f1c |
value->data[0].v_pointer = v_object;
|
|
Packit Service |
1d8f1c |
} else {
|
|
Packit Service |
1d8f1c |
value->data[0].v_pointer = NULL;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
if (old) {
|
|
Packit Service |
1d8f1c |
application_unref (old);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_class_init (ApplicationClass * klass)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
application_parent_class = g_type_class_peek_parent (klass);
|
|
Packit Service |
1d8f1c |
((ApplicationClass *) klass)->finalize = application_finalize;
|
|
Packit Service |
1d8f1c |
g_type_class_add_private (klass, sizeof (ApplicationPrivate));
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_instance_init (Application * self)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
self->priv = APPLICATION_GET_PRIVATE (self);
|
|
Packit Service |
1d8f1c |
self->ref_count = 1;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
static void
|
|
Packit Service |
1d8f1c |
application_finalize (Application * obj)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application * self;
|
|
Packit Service |
1d8f1c |
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_APPLICATION, Application);
|
|
Packit Service |
1d8f1c |
g_signal_handlers_destroy (self);
|
|
Packit Service |
1d8f1c |
_g_object_unref0 (self->priv->m_bus);
|
|
Packit Service |
1d8f1c |
_g_object_unref0 (self->priv->m_panel);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GType
|
|
Packit Service |
1d8f1c |
application_get_type (void)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
static volatile gsize application_type_id__volatile = 0;
|
|
Packit Service |
1d8f1c |
if (g_once_init_enter (&application_type_id__volatile)) {
|
|
Packit Service |
1d8f1c |
static const GTypeValueTable g_define_type_value_table = { value_application_init, value_application_free_value, value_application_copy_value, value_application_peek_pointer, "p", value_application_collect_value, "p", value_application_lcopy_value };
|
|
Packit Service |
1d8f1c |
static const GTypeInfo g_define_type_info = { sizeof (ApplicationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) application_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Application), 0, (GInstanceInitFunc) application_instance_init, &g_define_type_value_table };
|
|
Packit Service |
1d8f1c |
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
|
|
Packit Service |
1d8f1c |
GType application_type_id;
|
|
Packit Service |
1d8f1c |
application_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Application", &g_define_type_info, &g_define_type_fundamental_info, 0);
|
|
Packit Service |
1d8f1c |
g_once_init_leave (&application_type_id__volatile, application_type_id);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
return application_type_id__volatile;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
gpointer
|
|
Packit Service |
1d8f1c |
application_ref (gpointer instance)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application * self;
|
|
Packit Service |
1d8f1c |
self = instance;
|
|
Packit Service |
1d8f1c |
g_atomic_int_inc (&self->ref_count);
|
|
Packit Service |
1d8f1c |
return instance;
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
void
|
|
Packit Service |
1d8f1c |
application_unref (gpointer instance)
|
|
Packit Service |
1d8f1c |
{
|
|
Packit Service |
1d8f1c |
Application * self;
|
|
Packit Service |
1d8f1c |
self = instance;
|
|
Packit Service |
1d8f1c |
if (g_atomic_int_dec_and_test (&self->ref_count)) {
|
|
Packit Service |
1d8f1c |
APPLICATION_GET_CLASS (self)->finalize (self);
|
|
Packit Service |
1d8f1c |
g_type_free_instance ((GTypeInstance *) self);
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
}
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
|