Fixing the build process

This commit is contained in:
Sergey V. Udaltsov 2006-07-06 19:45:13 +00:00
parent 61e73528ac
commit da40a9f294
11 changed files with 44 additions and 132 deletions

View file

@ -1,3 +1,7 @@
2006-07-06 Sergey Udaltsov <svu@gnome.org>
Fixing the build process
2006-06-25 Sergey Udaltsov <svu@gnome.org>
*.c: massive libgswitchit API change

View file

@ -30,7 +30,7 @@
#include <gconf/gconf-client.h>
#include <glade/glade.h>
#include "libgswitchit/gswitchit_config.h"
#include "libgswitchit/gswitchit-config.h"
#include "capplet-util.h"
#include "gconf-property-editor.h"

View file

@ -29,7 +29,7 @@
#include <gconf/gconf-client.h>
#include <glade/glade.h>
#include "libgswitchit/gswitchit_config.h"
#include "libgswitchit/gswitchit-config.h"
#include "capplet-util.h"
#include "gconf-property-editor.h"

View file

@ -30,7 +30,7 @@
#include <gconf/gconf-client.h>
#include <glade/glade.h>
#include "libgswitchit/gswitchit_config.h"
#include "libgswitchit/gswitchit-config.h"
#include "capplet-util.h"
#include "gconf-property-editor.h"

View file

@ -28,7 +28,7 @@
#include <gnome.h>
#include <glade/glade.h>
#include "libgswitchit/gswitchit_config.h"
#include "libgswitchit/gswitchit-config.h"
#include "capplet-util.h"

View file

@ -1,3 +1,7 @@
2006-07-06 Sergey Udaltsov <svu@gnome.org>
Fixing the build process
2006-06-23 Sergey Udaltsov <svu@gnome.org>
* factory.c, gnome-settings-daemon.c,

View file

@ -263,6 +263,7 @@ gnome_settings_daemon_new (void)
GSList *list;
GnomeSettingsDaemon *daemon;
GdkDisplay *display;
GObject *dbusServer;
int i;
int n_screens;
@ -394,6 +395,8 @@ gnome_settings_daemon_new (void)
gnome_settings_xrdb_load (client);
gnome_settings_typing_break_load (client);
dbusServer = g_object_new (gnome_settings_server_get_type (), NULL);
return G_OBJECT (daemon);
}

View file

@ -68,6 +68,11 @@ void gnome_settings_daemon_spawn_with_input (char **argv,
GConfClient *gnome_settings_daemon_get_conf_client (void);
/**
* DBUS server
*/
GType gnome_settings_server_get_type (void);
G_END_DECLS
#endif /* __GNOME_SETTINGS_DAEMON_H */

View file

@ -1,31 +1,26 @@
#include <stdio.h>
#include <X11/Xlib.h>
#include <dbus/dbus-glib-bindings.h>
#include "gnome-settings-keyboard-xkb.h"
#include <gnome-settings-daemon.h>
static GObjectClass *parent_class = NULL;
typedef struct KeyboardConfigRegistry KeyboardConfigRegistry;
typedef struct KeyboardConfigRegistryClass KeyboardConfigRegistryClass;
typedef struct GnomeSettingsServer GnomeSettingsServer;
typedef struct GnomeSettingsServerClass GnomeSettingsServerClass;
struct KeyboardConfigRegistry {
struct GnomeSettingsServer {
GObject parent;
XklConfigRegistry *registry;
};
struct KeyboardConfigRegistryClass {
struct GnomeSettingsServerClass {
GObjectClass parent;
DBusGConnection *connection;
};
#define KEYBOARD_CONFIG_TYPE_REGISTRY (keyboard_config_registry_get_type ())
#define KEYBOARD_CONFIG_REGISTRY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), KEYBOARD_CONFIG_TYPE_REGISTRY, KeyboardConfigRegistry))
#define KEYBOARD_CONFIG_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), KEYBOARD_CONFIG_TYPE_REGISTRY, KeyboardConfigRegistryClass))
#define KEYBOARD_CONFIG_IS_REGISTRY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), KEYBOARD_CONFIG_TYPE_REGISTRY))
#define KEYBOARD_CONFIG_IS_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), KEYBOARD_CONFIG_TYPE_REGISTRY))
#define KEYBOARD_CONFIG_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), KEYBOARD_CONFIG_TYPE_REGISTRY, KeyboardConfigRegistryClass))
#define GNOME_SETTINGS_TYPE_SERVER (gnome_settings_server_get_type ())
#define GNOME_SETTINGS_SERVER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GNOME_SETTINGS_TYPE_SERVER, GnomeSettingsServer))
#define GNOME_SETTINGS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_SETTINGS_TYPE_SERVER, GnomeSettingsServerClass))
#define GNOME_SETTINGS_IS_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GNOME_SETTINGS_TYPE_SERVER))
#define GNOME_SETTINGS_IS_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_SETTINGS_TYPE_SERVER))
#define GNOME_SETTINGS_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_SETTINGS_TYPE_SERVER, GnomeSettingsServerClass))
gboolean
settings_daemon_awake (GObject * object, GError ** error)
@ -33,94 +28,11 @@ settings_daemon_awake (GObject * object, GError ** error)
return TRUE;
}
gboolean
keyboard_config_registry_get_current_descriptions_as_utf8
(KeyboardConfigRegistry * registry,
gchar *** short_layout_descriptions,
gchar *** long_layout_descriptions,
gchar *** short_variant_descriptions,
gchar *** long_variant_descriptions, GError ** error) {
if (!
(xkl_engine_get_features (xkl_engine) &
XKLF_MULTIPLE_LAYOUTS_SUPPORTED))
return FALSE;
XklConfigRec *xkl_config = xkl_config_rec_new ();
if (!xkl_config_rec_get_from_server (xkl_config, xkl_engine))
return FALSE;
char **pl = xkl_config->layouts;
char **pv = xkl_config->variants;
guint total_layouts = g_strv_length (xkl_config->layouts);
gchar **sld = *short_layout_descriptions =
g_new0 (char *, total_layouts + 1);
gchar **lld = *long_layout_descriptions =
g_new0 (char *, total_layouts + 1);
gchar **svd = *short_variant_descriptions =
g_new0 (char *, total_layouts + 1);
gchar **lvd = *long_variant_descriptions =
g_new0 (char *, total_layouts + 1);
while (pl != NULL && *pl != NULL) {
XklConfigItem item;
g_snprintf (item.name, sizeof item.name, "%s", *pl);
if (xkl_config_registry_find_layout
(registry->registry, &item)) {
*sld++ = g_strdup (item.short_description);
*lld++ = g_strdup (item.description);
} else {
*sld++ = g_strdup ("");
*lld++ = g_strdup ("");
}
if (*pv != NULL) {
g_snprintf (item.name, sizeof item.name, "%s",
*pv);
if (xkl_config_registry_find_variant
(registry->registry, *pl, &item)) {
*svd = g_strdup (item.short_description);
*lvd = g_strdup (item.description);
} else {
*svd++ = g_strdup ("");
*lvd++ = g_strdup ("");
}
} else {
*svd++ = g_strdup ("");
*lvd++ = g_strdup ("");
}
*pl++, *pv++;
}
g_object_unref (G_OBJECT (xkl_config));
return TRUE;
}
G_DEFINE_TYPE (KeyboardConfigRegistry, keyboard_config_registry,
G_TYPE_OBJECT)
G_DEFINE_TYPE (GnomeSettingsServer, gnome_settings_server, G_TYPE_OBJECT)
#include "gnome-settings-server.h"
static void
finalize (GObject * object)
{
KeyboardConfigRegistry *registry;
registry = KEYBOARD_CONFIG_REGISTRY (object);
if (registry->registry == NULL) {
return;
}
g_object_unref (registry->registry);
registry->registry = NULL;
g_object_unref (xkl_engine);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
keyboard_config_registry_class_init (KeyboardConfigRegistryClass * klass)
gnome_settings_server_class_init (GnomeSettingsServerClass * klass)
{
GError *error = NULL;
GObjectClass *object_class;
@ -135,29 +47,27 @@ keyboard_config_registry_class_init (KeyboardConfigRegistryClass * klass)
}
/* &dbus_glib__object_info is provided in the server-bindings.h file */
dbus_g_object_type_install_info (KEYBOARD_CONFIG_TYPE_REGISTRY,
dbus_g_object_type_install_info (GNOME_SETTINGS_TYPE_SERVER,
&dbus_glib_settings_daemon_object_info);
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = finalize;
parent_class = g_type_class_peek_parent (klass);
}
static void
keyboard_config_registry_init (KeyboardConfigRegistry * registry)
gnome_settings_server_init (GnomeSettingsServer * server)
{
GError *error = NULL;
DBusGProxy *driver_proxy;
KeyboardConfigRegistryClass *klass =
KEYBOARD_CONFIG_REGISTRY_GET_CLASS (registry);
GnomeSettingsServerClass *klass =
GNOME_SETTINGS_SERVER_GET_CLASS (server);
unsigned request_ret;
/* Register DBUS path */
dbus_g_connection_register_g_object (klass->connection,
"/org/gnome/SettingsDaemon",
G_OBJECT (registry));
G_OBJECT (server));
/* Register the service name, the constant here are defined in dbus-glib-bindings.h */
driver_proxy = dbus_g_proxy_new_for_name (klass->connection,
@ -165,18 +75,13 @@ keyboard_config_registry_init (KeyboardConfigRegistry * registry)
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS);
if (!org_freedesktop_DBus_request_name (driver_proxy, "org.gnome.SettingsDaemon", 0, &request_ret, /* See tutorial for more infos about these */
if (!org_freedesktop_DBus_request_name
(driver_proxy, "org.gnome.SettingsDaemon", 0, &request_ret,
&error)) {
g_warning ("Unable to register service: %s",
error->message);
g_error_free (error);
}
g_object_unref (driver_proxy);
/* Init libxklavier stuff */
g_object_ref (xkl_engine);
registry->registry = xkl_config_registry_get_instance (xkl_engine);
xkl_config_registry_load (registry->registry);
}

View file

@ -35,7 +35,8 @@
#include <string.h>
#include <time.h>
#include <libgswitchit/gswitchit_config.h>
#include <libgswitchit/gswitchit-config.h>
#include <libgswitchit/keyboard-config-registry.h>
#include "gnome-settings-keyboard-xkb.h"
#include "gnome-settings-daemon.h"

View file

@ -5,14 +5,4 @@
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="settings_daemon"/>
<method name="Awake"/>
</interface>
<interface name="org.gnome.KeyboardConfigRegistry">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="keyboard_config_registry"/>
<method name="GetCurrentDescriptionsAsUtf8">
<arg type="as" name="shortLayoutDescriptions" direction="out" />
<arg type="as" name="longLayoutDescriptions" direction="out" />
<arg type="as" name="shortVariantDescriptions" direction="out" />
<arg type="as" name="longVariantDescriptions" direction="out" />
</method>
<!-- Add more methods/signals if you want -->
</interface>
</node>