[prev in list] [next in list] [prev in thread] [next in thread]
List: moblin-commits
Subject: [Moblin-Commits] mconf: Changes to 'master'
From: tebrandt () moblin ! org (Todd E Brandt)
Date: 2008-09-16 17:32:18
Message-ID: 20080916173218.0956A92C1AB () moblin ! org
[Download RAW message or body]
This email list is read-only. Emails sent to this list will be discarded
----------------------------------
config.h.in | 18 -
configure.in | 20 +-
mconf/Makefile.am | 9 +-
mconf/keymanager.c | 182 +++++++++--
mconf/keymanager.h | 95 +++++--
mconf/mconf-dbus.c | 91 +-----
mconf/mconf-dbus.h | 33 +-
mconf/mconf-infos.xml | 59 ++++
mconf/mconf-tool.c | 646 ++++++++++---------------------------
mconf/mconf-tool.sgml | 8 +-
mconf/mconf.c | 78 -----
mconf/mconf.conf | 12 -
mconf/mconf.h | 33 --
mconf/mconfd.c | 78 +++++
mconf/mconfd.h | 33 ++
mconf/org.moblin.mconf.service.in | 2 +-
scripts/distclean | 2 +-
17 files changed, 622 insertions(+), 777 deletions(-)
New commits:
commit 002ccb24f604342b81dcb6082fdb39d28dde19d0
Author: Todd Brandt <todd.e.brandt@intel.com>
Date: Tue Sep 16 10:30:37 2008 -0700
new interface in place
Diff in this email is a maximum of 400 lines.
diff --git a/config.h.in b/config.h.in
index 6d7ded1..5f54acc 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,11 +1,5 @@
/* config.h.in. Generated from configure.in by autoheader. */
-/* Include the battery module */
-#undef HAVE_BATTERY
-
-/* Include the datetime module */
-#undef HAVE_DATETIME
-
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -15,18 +9,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* Include the lcdbacklight module */
-#undef HAVE_LCDBACKLIGHT
-
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Use PolicyKit */
-#undef HAVE_POLKIT
-
-/* Include the sound module */
-#undef HAVE_SOUND
-
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -45,9 +30,6 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
-/* Include the touchscreen module */
-#undef HAVE_TOUCHSCREEN
-
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
diff --git a/configure.in b/configure.in
index 3eda910..4fb0971 100644
--- a/configure.in
+++ b/configure.in
@@ -89,22 +89,12 @@ fi
AC_MSG_RESULT($have_glib_2_14)
# check for PolicyKit
-AC_ARG_ENABLE(policy-kit,
- [ --enable-policy-kit Use PolicyKit (default yes)], ,
- enable_policy_kit=yes)
-AM_CONDITIONAL(HAVE_POLKIT, test x$enable_policy_kit = xyes)
-if test "$enable_policy_kit" = "yes"; then
- AC_DEFINE(HAVE_POLKIT, [1], [Use PolicyKit])
- PKG_CHECK_MODULES(POLKIT, polkit >= 0.7 polkit-dbus >= 0.7)
- AC_SUBST(POLKIT_CFLAGS)
- AC_SUBST(POLKIT_LIBS)
- COMMON_CFLAGS="${SYMBOL_DEFINES} ${DBUS_CFLAGS} ${POLKIT_CFLAGS}"
- COMMON_LIBS="${DBUS_LIBS} ${POLKIT_LIBS}"
-else
- COMMON_CFLAGS="${SYMBOL_DEFINES} ${DBUS_CFLAGS}"
- COMMON_LIBS="${DBUS_LIBS}"
-fi
+PKG_CHECK_MODULES(POLKIT, polkit >= 0.7 polkit-dbus >= 0.7)
+AC_SUBST(POLKIT_CFLAGS)
+AC_SUBST(POLKIT_LIBS)
+COMMON_CFLAGS="${SYMBOL_DEFINES} ${DBUS_CFLAGS} ${POLKIT_CFLAGS}"
+COMMON_LIBS="${DBUS_LIBS} ${POLKIT_LIBS}"
AC_SUBST(COMMON_CFLAGS)
AC_SUBST(COMMON_LIBS)
diff --git a/mconf/Makefile.am b/mconf/Makefile.am
index eb4ee63..fecd137 100644
--- a/mconf/Makefile.am
+++ b/mconf/Makefile.am
@@ -9,8 +9,9 @@ INCLUDES= $(MCONF_CFLAGS)
mconf_tool_SOURCES = mconf-tool.c
mconf_tool_LDADD = $(MCONF_LIBS)
-mconf_SOURCES = \
- mconf.c \
+mconf_SOURCES = \
+ mconfd.c \
+ keymanager.c keymanager.h \
mconf-dbus.c mconf-dbus.h
mconf_LDADD = \
@@ -46,11 +47,9 @@ mconf-client.h: mconf-infos.xml
dbus-binding-tool --prefix=mconf --mode=glib-client $< > $@
# DBUS stuff
-servicedir = $(datadir)/dbus-1/system-services
+servicedir = $(datadir)/dbus-1/services
service_in_files = org.moblin.mconf.service.in
service_DATA = $(service_in_files:.service.in=.service)
-dbusconfdir = $(sysconfdir)/dbus-1/system.d
-dbusconf_DATA = mconf.conf
org.moblin.mconf.service: org.moblin.mconf.service.in Makefile
@sed -e "s|\@sbindir\@|$(sbindir)|" $< > $@
diff --git a/mconf/keymanager.c b/mconf/keymanager.c
index 523b3d0..b7073b6 100644
--- a/mconf/keymanager.c
+++ b/mconf/keymanager.c
@@ -1,47 +1,185 @@
-#include "moblin-system-dbus.h"
+#include <glib.h>
+#include "mconf-dbus.h"
+
+static GQuark error_quark;
+enum
+{
+ ERROR_VAL_NOT_INT,
+ ERROR_COUNT
+};
+static gchar *errortext[ERROR_COUNT] = {
+
+};
+
+
+/* Create a new key */
+
+gboolean
+create_key(MconfServer *server,
+ const gchar *key, const gchar *value, gint permissions,
+ GError **error)
+{
+ return TRUE;
+}
+
+gboolean
+mconf_create_key_string(MconfServer *server,
+ const gchar *key, const gchar *value, gint permissions,
+ GError **error)
+{
+ return create_key(server, key, value, permissions, error);
+}
+
+gboolean
+mconf_create_key_int(MconfServer *server,
+ const gchar *key, gint value, gint permissions,
+ GError **error)
+{
+ gchar val[20];
+ sprintf(val, "%d", value);
+ return create_key(server, key, val, permissions, error);
+}
+
+gboolean
+mconf_create_key_float(MconfServer *server,
+ const gchar *key, gdouble value, gint permissions,
+ GError **error)
+{
+ gchar val[20];
+ sprintf(val, "%.8lf", value);
+ return create_key(server, key, val, permissions, error);
+}
+
+gboolean
+mconf_create_key_bool(MconfServer *server,
+ const gchar *key, gboolean value, gint permissions,
+ GError **error)
+{
+ gchar val[2] = {'0', '\0'};
+ if(value) val[0] = '1';
+ return create_key(server, key, val, permissions, error);
+}
+
+/* Read a key value */
+
+gboolean
+read_key(MconfServer *server,
+ const gchar *key, gchar **value,
+ GError **error)
+{
+ return TRUE;
+}
+
+gboolean
+mconf_read_key_string(MconfServer *server,
+ const gchar *key, gchar **value,
+ GError **error)
+{
+ return read_key(server, key, value, error);
+}
gboolean
-system_daemon_keycreate(
- MoblinSystemServer *server,
- const gchar *name,
- const gchar *value,
- const gchar *action,
+mconf_read_key_int(MconfServer *server,
+ const gchar *key, gint *value,
+ GError **error)
+{
+ gchar **val;
+ gboolean ret = FALSE;
+
+ if(read_key(server, key, val, error))
+ {
+ sscanf(*val, "%d", value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+gboolean
+mconf_read_key_float(MconfServer *server,
+ const gchar *key, gdouble *value,
+ GError **error)
+{
+ gchar **val;
+ gboolean ret = FALSE;
+
+ if(read_key(server, key, val, error))
+ {
+ sscanf(*val, "%lf", value);
+ ret = TRUE;
+ }
+ return ret;
+}
+
+gboolean
+mconf_read_key_bool(MconfServer *server,
+ const gchar *key, gboolean *value,
+ GError **error)
+{
+ gchar **val;
+ gboolean ret = FALSE;
+ gint ival;
+
+ if(read_key(server, key, val, error))
+ {
+ ret = TRUE;
+ }
+ return ret;
+}
+
+
+
+
+
+
+
+
+gboolean
+mconf_write_key_string(MconfServer *server,
+ const gchar *key, const gchar *value,
GError **error)
{
return TRUE;
}
+
gboolean
-system_daemon_keyread(
- MoblinSystemServer *server,
- const gchar *name,
- gchar **value,
+mconf_write_key_int(MconfServer *server,
+ const gchar *key, gint value,
GError **error)
{
return TRUE;
}
+
gboolean
-system_daemon_keywrite(
- MoblinSystemServer *server,
- const gchar *name,
- const gchar *value,
+mconf_write_key_float(MconfServer *server,
+ const gchar *key, gdouble value,
GError **error)
{
return TRUE;
}
+
gboolean
-system_daemon_keyaction(
- MoblinSystemServer *server,
- const gchar *name,
- gchar **action,
+mconf_write_key_bool(MconfServer *server,
+ const gchar *key, gboolean value,
+ GError **error)
+{
+ return TRUE;
+}
+
+
+
+
+
+
+gboolean mconf_remove_key(MconfServer *server,
+ const gchar *key,
GError **error)
{
return TRUE;
}
+
gboolean
-system_daemon_list_keys(
- MoblinSystemServer *server,
- gint *numkeys,
- gchar ***keylist,
+mconf_change_key_permissions(MconfServer *server,
+ const gchar *key, gint permissions,
GError **error)
{
return TRUE;
diff --git a/mconf/keymanager.h b/mconf/keymanager.h
index 0103336..418b67a 100644
--- a/mconf/keymanager.h
+++ b/mconf/keymanager.h
@@ -1,36 +1,91 @@
#ifndef __KEYMANAGER_H__
#define __KEYMANAGER_H__
+gboolean mconf_remove_key(
+ MconfServer *server,
+ const gchar *key,
+ GError **error);
+gboolean
+mconf_change_key_permissions(
+ MconfServer *server,
+ const gchar *key,
+ gint permissions,
+ GError **error);
gboolean
-system_daemon_keycreate(
- MoblinSystemServer *server,
- const gchar *name,
+mconf_create_key_string(
+ MconfServer *server,
+ const gchar *key,
const gchar *value,
- const gchar *action,
+ gint permissions,
+ GError **error);
+gboolean
+mconf_read_key_string(
+ MconfServer *server,
+ const gchar *key,
+ gchar **value,
+ GError **error);
+gboolean
+mconf_write_key_string(
+ MconfServer *server,
+ const gchar *key,
+ const gchar *value,
+ GError **error);
+gboolean
+mconf_create_key_int(
+ MconfServer *server,
+ const gchar *key,
+ gint value,
+ gint permissions,
+ GError **error);
+gboolean
+mconf_read_key_int(
+ MconfServer *server,
+ const gchar *key,
+ gint *value,
+ GError **error);
+gboolean
+mconf_write_key_int(
+ MconfServer *server,
+ const gchar *key,
+ gint value,
+ GError **error);
+gboolean
+mconf_create_key_bool(
+ MconfServer *server,
+ const gchar *key,
+ gboolean value,
+ gint permissions,
+ GError **error);
+gboolean
+mconf_read_key_bool(
+ MconfServer *server,
+ const gchar *key,
+ gboolean *value,
GError **error);
gboolean
-system_daemon_keyread(
- MoblinSystemServer *server,
- const gchar *name,
- gchar **value,
+mconf_write_key_bool(
+ MconfServer *server,
+ const gchar *key,
+ gboolean value,
_______________________________________________
Commits mailing list
Commits@moblin.org
https://www.moblin.org/mailman/listinfo/commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic