Add initial universal-access module and UI

This commit is contained in:
Thomas Wood 2010-05-25 11:17:03 +01:00
parent 6f7d9d9364
commit 98ffb24bf1
8 changed files with 3115 additions and 1 deletions

View file

@ -390,6 +390,8 @@ capplets/display/display-properties.desktop.in
panels/keybindings/Makefile
panels/keybindings/gnome-keybindings.pc
panels/keybindings/gnome-keybindings-panel.desktop.in
panels/universal-access/Makefile
panels/universal-access/gnome-universal-access.desktop.in
docs/Makefile
docs/reference/Makefile
docs/reference/libgnome-control-center/Makefile

View file

@ -1 +1 @@
SUBDIRS=mouse keyboard network default-applications keybindings
SUBDIRS=mouse keyboard network default-applications keybindings universal-access

View file

@ -0,0 +1,31 @@
INCLUDES = \
$(PANEL_CFLAGS) \
$(GNOMECC_CAPPLETS_CFLAGS) \
-DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
$(NULL)
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libuniversal-access.la
libuniversal_access_la_SOURCES = \
universal-access-module.c \
cc-ua-panel.c \
cc-ua-panel.h
libuniversal_access_la_LIBADD = $(PANEL_LIBS)
libuniversal_access_la_LDFLAGS = $(PANEL_LDFLAGS)
uidir = $(pkgdatadir)/ui
ui_DATA = uap.ui
@INTLTOOL_DESKTOP_RULE@
desktopdir = $(datadir)/applications
desktop_in_files = gnome-universal-access.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
CLEANFILES = $(desktop_in_files) $(desktop_DATA)
-include $(top_srcdir)/git.mk

View file

@ -0,0 +1,142 @@
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include "cc-ua-panel.h"
G_DEFINE_DYNAMIC_TYPE (CcUaPanel, cc_ua_panel, CC_TYPE_PANEL)
#define UA_PANEL_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_UA_PANEL, CcUaPanelPrivate))
struct _CcUaPanelPrivate
{
GtkBuilder *builder;
};
static void
cc_ua_panel_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
cc_ua_panel_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
switch (property_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
}
static void
cc_ua_panel_dispose (GObject *object)
{
CcUaPanelPrivate *priv = CC_UA_PANEL (object)->priv;
if (priv->builder)
{
g_object_unref (priv->builder);
priv->builder = NULL;
}
G_OBJECT_CLASS (cc_ua_panel_parent_class)->dispose (object);
}
static void
cc_ua_panel_finalize (GObject *object)
{
G_OBJECT_CLASS (cc_ua_panel_parent_class)->finalize (object);
}
static void
cc_ua_panel_class_init (CcUaPanelClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (CcUaPanelPrivate));
object_class->get_property = cc_ua_panel_get_property;
object_class->set_property = cc_ua_panel_set_property;
object_class->dispose = cc_ua_panel_dispose;
object_class->finalize = cc_ua_panel_finalize;
}
static void
cc_ua_panel_class_finalize (CcUaPanelClass *klass)
{
}
static void
cc_ua_panel_init (CcUaPanel *self)
{
CcUaPanelPrivate *priv;
GtkWidget *widget;
GError *err = NULL;
gchar *objects[] = { "universal_access_box", "contrast_model",
"text_size_model", "slowkeys_delay_adjustment",
"bouncekeys_delay_adjustment", "click_delay_adjustment",
"dwell_time_adjustment", "dwell_threshold_adjustment" };
priv = self->priv = UA_PANEL_PRIVATE (self);
priv->builder = gtk_builder_new ();
gtk_builder_add_objects_from_file (priv->builder,
GNOMECC_DATA_DIR "/ui/uap.ui",
objects,
&err);
if (err)
{
g_warning ("Could not load interface file: %s", err->message);
g_error_free (err);
g_object_unref (priv->builder);
priv->builder = NULL;
return;
}
widget = (GtkWidget*) gtk_builder_get_object (priv->builder,
"universal_access_box");
gtk_container_add (GTK_CONTAINER (self), widget);
}
void
cc_ua_panel_register (GIOModule *module)
{
cc_ua_panel_register_type (G_TYPE_MODULE (module));
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
CC_TYPE_UA_PANEL,
"gnome-universal-access.desktop", 0);
}

View file

@ -0,0 +1,74 @@
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#ifndef _CC_UA_PANEL_H
#define _CC_UA_PANEL_H
#include <libgnome-control-center/cc-panel.h>
G_BEGIN_DECLS
#define CC_TYPE_UA_PANEL cc_ua_panel_get_type()
#define CC_UA_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
CC_TYPE_UA_PANEL, CcUaPanel))
#define CC_UA_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
CC_TYPE_UA_PANEL, CcUaPanelClass))
#define CC_IS_UA_PANEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
CC_TYPE_UA_PANEL))
#define CC_IS_UA_PANEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
CC_TYPE_UA_PANEL))
#define CC_UA_PANEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
CC_TYPE_UA_PANEL, CcUaPanelClass))
typedef struct _CcUaPanel CcUaPanel;
typedef struct _CcUaPanelClass CcUaPanelClass;
typedef struct _CcUaPanelPrivate CcUaPanelPrivate;
struct _CcUaPanel
{
CcPanel parent;
CcUaPanelPrivate *priv;
};
struct _CcUaPanelClass
{
CcPanelClass parent_class;
};
GType cc_ua_panel_get_type (void) G_GNUC_CONST;
void cc_ua_panel_register (GIOModule *module);
G_END_DECLS
#endif /* _CC_UA_PANEL_H */

View file

@ -0,0 +1,11 @@
[Desktop Entry]
_Name=Universal Access
_Comment=Universal Access Preferences
Exec=gnome-example-properties
Icon=preferences-desktop-accessibility
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Settings;DesktopSettings;
OnlyShowIn=GNOME;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,41 @@
/*
* Copyright (C) 2010 Intel, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Thomas Wood <thomas.wood@intel.com>
*
*/
#include <config.h>
#include "cc-ua-panel.h"
#include <glib/gi18n.h>
void
g_io_module_load (GIOModule *module)
{
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
/* register the panel */
cc_ua_panel_register (module);
}
void
g_io_module_unload (GIOModule *module)
{
}