Blame atk/atkplug.c

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