layout.c revision 46633cdb66707c52c31cadcfbc4ce38c68f47d2e
/* -*- Mode: C; indent-tabs-mode:nil; tab-width:4 -*-
*
* Copyright (C) 2010 Robert Ancell.
* Author: Robert Ancell <robert.ancell@canonical.com>
*
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2 or version 3 of the License.
* See http://www.gnu.org/copyleft/lgpl.html the full text of the license.
*/
#include <libxklavier/xklavier.h>
enum {
};
typedef struct
{
#define GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE ((obj), LIGHTDM_TYPE_LAYOUT, LightDMLayoutPrivate)
static gchar *
{
return NULL;
else
}
static void
{
if (!name)
return;
if (split[0])
{
if (split[1])
}
g_strfreev (split);
}
static void
const XklConfigItem *item,
{
layout = g_object_new (LIGHTDM_TYPE_LAYOUT, "name", full_name, "short-description", item->short_description, "description", item->description, NULL);
}
static void
const XklConfigItem *item,
{
layout = g_object_new (LIGHTDM_TYPE_LAYOUT, "name", item->name, "short-description", item->short_description, "description", item->description, NULL);
}
/**
* lightdm_get_layouts:
*
* Get a list of keyboard layouts to present to the user.
*
* Return value: (element-type LightDMLayout) (transfer none): A list of #LightDMLayout that should be presented to the user.
**/
GList *
lightdm_get_layouts (void)
{
if (have_layouts)
return layouts;
xkl_config = xkl_config_rec_new ();
g_warning ("Failed to get Xkl configuration from server");
have_layouts = TRUE;
return layouts;
}
/**
* lightdm_set_layout:
* @layout: The layout to use
*
* Set the layout for this session.
**/
void
{
config = xkl_config_rec_new ();
g_warning ("Failed to activate XKL config");
}
/**
* lightdm_get_layout:
*
* Get the current keyboard layout.
*
* Return value: (transfer none): The currently active layout for this user.
**/
lightdm_get_layout (void)
{
{
{
{
break;
}
}
}
return default_layout;
}
/**
* lightdm_layout_get_name:
* @layout: A #LightDMLayout
*
* Get the name of a layout.
*
* Return value: The name of the layout
**/
const gchar *
{
}
/**
* lightdm_layout_get_short_description:
* @layout: A #LightDMLayout
*
* Get the short description of a layout.
*
* Return value: A short description of the layout
**/
const gchar *
{
}
/**
* lightdm_layout_get_description:
* @layout: A #LightDMLayout
*
* Get the long description of a layout.
*
* Return value: A long description of the layout
**/
const gchar *
{
}
static void
{
}
static void
{
switch (prop_id) {
case PROP_NAME:
break;
case PROP_SHORT_DESCRIPTION:
break;
case PROP_DESCRIPTION:
break;
default:
break;
}
}
static void
{
switch (prop_id) {
case PROP_NAME:
break;
case PROP_SHORT_DESCRIPTION:
break;
case PROP_DESCRIPTION:
break;
default:
break;
}
}
static void
{
g_param_spec_string ("name",
"name",
"Name of the layout",
NULL,
g_param_spec_string ("short-description",
"short-description",
"Short description of the layout",
NULL,
g_param_spec_string ("description",
"description",
"Long description of the layout",
NULL,
}