|
Packit Service |
ef73c4 |
/* ATK - Accessibility Toolkit
|
|
Packit Service |
ef73c4 |
* Copyright (C) 2009 Novell, Inc.
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
ef73c4 |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
ef73c4 |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
ef73c4 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
ef73c4 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
ef73c4 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
ef73c4 |
* Lesser General Public License for more details.
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
ef73c4 |
* License along with this library; if not, write to the
|
|
Packit Service |
ef73c4 |
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Packit Service |
ef73c4 |
* Boston, MA 02111-1307, USA.
|
|
Packit Service |
ef73c4 |
*/
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
#include "config.h"
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
#include "atk.h"
|
|
Packit Service |
ef73c4 |
#include "atkplug.h"
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
/**
|
|
Packit Service |
ef73c4 |
* SECTION:atkplug
|
|
Packit Service |
ef73c4 |
* @Short_description: Toplevel for embedding into other processes
|
|
Packit Service |
ef73c4 |
* @Title: AtkPlug
|
|
Packit Service |
ef73c4 |
* @See_also: #AtkPlug
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* See #AtkSocket
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
*/
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
static void atk_component_interface_init (AtkComponentIface *iface);
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
static void atk_plug_class_init (AtkPlugClass *klass);
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
G_DEFINE_TYPE_WITH_CODE (AtkPlug, atk_plug, ATK_TYPE_OBJECT,
|
|
Packit Service |
ef73c4 |
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
static void
|
|
Packit Service |
ef73c4 |
atk_plug_init (AtkPlug* obj)
|
|
Packit Service |
ef73c4 |
{
|
|
Packit Service |
ef73c4 |
}
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
static void
|
|
Packit Service |
ef73c4 |
atk_plug_class_init (AtkPlugClass* klass)
|
|
Packit Service |
ef73c4 |
{
|
|
Packit Service |
ef73c4 |
klass->get_object_id = NULL;
|
|
Packit Service |
ef73c4 |
}
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
static void
|
|
Packit Service |
ef73c4 |
atk_component_interface_init (AtkComponentIface *iface)
|
|
Packit Service |
ef73c4 |
{
|
|
Packit Service |
ef73c4 |
}
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
AtkObject*
|
|
Packit Service |
ef73c4 |
atk_plug_new (void)
|
|
Packit Service |
ef73c4 |
{
|
|
Packit Service |
ef73c4 |
AtkObject* accessible;
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
accessible = g_object_new (ATK_TYPE_PLUG, NULL);
|
|
Packit Service |
ef73c4 |
g_return_val_if_fail (accessible != NULL, NULL);
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
accessible->role = ATK_ROLE_FILLER;
|
|
Packit Service |
ef73c4 |
accessible->layer = ATK_LAYER_WIDGET;
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
return accessible;
|
|
Packit Service |
ef73c4 |
}
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
/**
|
|
Packit Service |
ef73c4 |
* atk_plug_get_id:
|
|
Packit Service |
ef73c4 |
* @plug: an #AtkPlug
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* Gets the unique ID of an #AtkPlug object, which can be used to
|
|
Packit Service |
ef73c4 |
* embed inside of an #AtkSocket using atk_socket_embed().
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* Internally, this calls a class function that should be registered
|
|
Packit Service |
ef73c4 |
* by the IPC layer (usually at-spi2-atk). The implementor of an
|
|
Packit Service |
ef73c4 |
* #AtkPlug object should call this function (after atk-bridge is
|
|
Packit Service |
ef73c4 |
* loaded) and pass the value to the process implementing the
|
|
Packit Service |
ef73c4 |
* #AtkSocket, so it could embed the plug.
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* Returns: the unique ID for the plug
|
|
Packit Service |
ef73c4 |
*
|
|
Packit Service |
ef73c4 |
* Since: 1.30
|
|
Packit Service |
ef73c4 |
**/
|
|
Packit Service |
ef73c4 |
gchar*
|
|
Packit Service |
ef73c4 |
atk_plug_get_id (AtkPlug* plug)
|
|
Packit Service |
ef73c4 |
{
|
|
Packit Service |
ef73c4 |
AtkPlugClass *klass;
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
g_return_val_if_fail (ATK_IS_PLUG (plug), NULL);
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
klass = g_type_class_peek (ATK_TYPE_PLUG);
|
|
Packit Service |
ef73c4 |
|
|
Packit Service |
ef73c4 |
if (klass && klass->get_object_id)
|
|
Packit Service |
ef73c4 |
return (klass->get_object_id) (plug);
|
|
Packit Service |
ef73c4 |
else
|
|
Packit Service |
ef73c4 |
return NULL;
|
|
Packit Service |
ef73c4 |
}
|