本文整理汇总了C++中ATK_OBJECT函数的典型用法代码示例。如果您正苦于以下问题:C++ ATK_OBJECT函数的具体用法?C++ ATK_OBJECT怎么用?C++ ATK_OBJECT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ATK_OBJECT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jaw_table_get_summary
static AtkObject*
jaw_table_get_summary (AtkTable *table)
{
JawObject *jaw_obj = JAW_OBJECT(table);
TableData *data = jaw_object_get_interface_data(jaw_obj, INTERFACE_TABLE);
jobject atk_table = data->atk_table;
JNIEnv *jniEnv = jaw_util_get_jni_env();
jclass classAtkTable = (*jniEnv)->FindClass(jniEnv, "org/GNOME/Accessibility/AtkTable");
jmethodID jmid = (*jniEnv)->GetMethodID(jniEnv, classAtkTable, "get_summary", "()Ljavax/accessibility/AccessibleContext;");
jobject jac = (*jniEnv)->CallObjectMethod(jniEnv, atk_table, jmid);
if (!jac) {
return NULL;
}
JawImpl* jaw_impl = jaw_impl_get_instance( jniEnv, jac );
return ATK_OBJECT(jaw_impl);
}
示例2: accessible_image_view_new
AtkObject *
accessible_image_view_new (GtkWidget *widget)
{
GObject *object;
AtkObject *accessible;
GtkAccessible *gtk_accessible;
object = g_object_new (ACCESSIBLE_TYPE_IMAGE_VIEW, NULL);
g_return_val_if_fail(object != NULL, NULL);
accessible = ATK_OBJECT (object);
gtk_accessible = GTK_ACCESSIBLE (accessible);
gtk_accessible->widget = widget;
atk_object_initialize (accessible, widget);
accessible->role = ATK_ROLE_IMAGE;
return accessible;
}
示例3: gail_button_notify_weak_ref
static void
gail_button_notify_weak_ref (gpointer data, GObject* obj)
{
GtkLabel *label = NULL;
AtkObject* atk_obj = ATK_OBJECT (obj);
if (data && GTK_IS_WIDGET (data))
{
label = GTK_LABEL (data);
if (label)
{
g_signal_handlers_disconnect_by_func (label,
(GCallback) gail_button_notify_label_gtk,
GAIL_BUTTON (atk_obj));
g_object_weak_unref (G_OBJECT (label),
gail_button_notify_label_weak_ref,
GAIL_BUTTON (atk_obj));
}
}
}
示例4: window_event_listener
static gboolean
window_event_listener (GSignalInvocationHint * signal_hint,
guint n_param_values,
const GValue * param_values, gpointer data)
{
AtkObject *accessible;
GSignalQuery signal_query;
const gchar *name, *s;
g_signal_query (signal_hint->signal_id, &signal_query);
name = signal_query.signal_name;
accessible = ATK_OBJECT (g_value_get_object (¶m_values[0]));
s = atk_object_get_name (accessible);
g_print ("Detected window event \"%s\" from object \"%p\" named \"%s\"\n",
name, accessible, s);
return TRUE;
}
示例5: getRowHeaderCB
static AtkObject*
getRowHeaderCB(AtkTable *aTable, gint aRow)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (!accWrap)
return nsnull;
nsCOMPtr<nsIAccessibleTable> accTable;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
getter_AddRefs(accTable));
NS_ENSURE_TRUE(accTable, nsnull);
nsCOMPtr<nsIAccessible> accCell;
accTable->GetCellAt(aRow, 0, getter_AddRefs(accCell));
if (!accCell)
return nsnull;
// If the cell at the first column is row header then assume it is row
// header for all columns,
if (nsAccUtils::Role(accCell) == nsIAccessibleRole::ROLE_ROWHEADER)
return nsAccessibleWrap::GetAtkObject(accCell);
// otherwise get row header for the data cell at the first column.
nsCOMPtr<nsIAccessibleTableCell> accTableCell =
do_QueryInterface(accCell);
if (accTableCell) {
nsCOMPtr<nsIArray> headerCells;
accTableCell->GetRowHeaderCells(getter_AddRefs(headerCells));
if (headerCells) {
nsresult rv;
nsCOMPtr<nsIAccessible> accHeaderCell =
do_QueryElementAt(headerCells, 0, &rv);
NS_ENSURE_SUCCESS(rv, nsnull);
return nsAccessibleWrap::GetAtkObject(accHeaderCell);
}
}
return nsnull;
}
示例6: JSStringCreateWithCharacters
JSStringRef AccessibilityUIElement::language()
{
if (!m_element)
return JSStringCreateWithCharacters(0, 0);
// In ATK, the document language is exposed as the document's locale.
if (atk_object_get_role(ATK_OBJECT(m_element)) == ATK_ROLE_DOCUMENT_FRAME)
return JSStringCreateWithUTF8CString(g_strdup_printf("AXLanguage: %s", atk_document_get_locale(ATK_DOCUMENT(m_element))));
// For all other objects, the language is exposed as an AtkText attribute.
if (!ATK_IS_TEXT(m_element))
return JSStringCreateWithCharacters(0, 0);
for (GSList* textAttributes = atk_text_get_default_attributes(ATK_TEXT(m_element)); textAttributes; textAttributes = textAttributes->next) {
AtkAttribute* atkAttribute = static_cast<AtkAttribute*>(textAttributes->data);
if (!strcmp(atkAttribute->name, atk_text_attribute_get_name(ATK_TEXT_ATTR_LANGUAGE)))
return JSStringCreateWithUTF8CString(g_strdup_printf("AXLanguage: %s", atkAttribute->value));
}
return JSStringCreateWithCharacters(0, 0);
}
示例7: _close_combo_list
static gint _close_combo_list (gpointer data)
{
AtkObject *obj = ATK_OBJECT (data);
gint count;
gint n_children;
AtkObject *list;
count = atk_selection_get_selection_count (ATK_SELECTION (obj));
g_return_val_if_fail (count == 0, FALSE);
list = atk_object_ref_accessible_child (obj, 0);
n_children = atk_object_get_n_accessible_children (list);
g_object_unref (G_OBJECT (list));
atk_selection_add_selection (ATK_SELECTION (obj), n_children - 1);
atk_action_do_action (ATK_ACTION (obj), 0);
return FALSE;
}
示例8: setRunAttributesCB
gboolean
setRunAttributesCB(AtkEditableText *aText, AtkAttributeSet *aAttribSet,
gint aStartOffset, gint aEndOffset)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return FALSE;
nsCOMPtr<nsIAccessibleEditableText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, FALSE);
nsCOMPtr<nsISupports> attrSet;
/* how to insert attributes into nsISupports ??? */
nsresult rv = accText->SetAttributes(aStartOffset, aEndOffset,
attrSet);
return NS_FAILED(rv) ? FALSE : TRUE;
}
示例9: get_atk_object_ref
static AtkObject *
get_atk_object_ref (GObject *gobject)
{
AtkObject *aobject;
if (ATK_IS_IMPLEMENTOR (gobject))
{
aobject = atk_implementor_ref_accessible (ATK_IMPLEMENTOR (gobject));
}
else if (ATK_IS_OBJECT (gobject))
{
aobject = ATK_OBJECT (gobject);
g_object_ref (G_OBJECT (aobject));
}
else
{
aobject = NULL;
g_error ("received event from non-AtkImplementor");
}
return aobject;
}
示例10: table_remove_row_selection
static gboolean
table_remove_row_selection (AtkTable *table,
gint row)
{
ETableItem *item;
GalA11yETableItemPrivate *priv = GET_PRIVATE (table);
if (atk_state_set_contains_state (priv->state_set, ATK_STATE_DEFUNCT))
return FALSE;
item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
if (!item)
return FALSE;
if (!atk_table_is_row_selected (table, row))
return TRUE;
e_selection_model_toggle_single_row (
item->selection, view_to_model_row (item, row));
return TRUE;
}
示例11: eail_gengrid_item_handle_unrealized_event
/**
* @brief Handler for unrealized event, used to notify about gengrid content
* changes
*
* @param data passed to callback
* @param obj object that raised event
* @param event_info additional event info (item is passed here)
*/
void
eail_gengrid_item_handle_unrealized_event(void *data,
Evas_Object *obj,
void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *) event_info;
AtkObject *atk_item = NULL, *atk_parent = NULL;
atk_parent = ATK_OBJECT(data);
if (!atk_parent) return;
atk_item = eail_factory_get_item_atk_obj
(item, ATK_ROLE_LIST_ITEM, atk_parent);
if (!atk_item) return;
eail_emit_children_changed_obj(FALSE, atk_parent, atk_item);
atk_object_notify_state_change(atk_item, ATK_STATE_DEFUNCT, TRUE);
DBG("Unregistering item from cache...");
eail_factory_unregister_item_from_cache(item);
}
示例12: notify_child_added
static gint
notify_child_added (gpointer data)
{
GailNotebookPage *page;
AtkObject *atk_object, *atk_parent;
g_return_val_if_fail (GAIL_IS_NOTEBOOK_PAGE (data), FALSE);
page = GAIL_NOTEBOOK_PAGE (data);
atk_object = ATK_OBJECT (data);
page->notify_child_added_id = 0;
/* The widget page->notebook may be deleted before this handler is called */
if (page->notebook != NULL)
{
atk_parent = gtk_widget_get_accessible (GTK_WIDGET (page->notebook));
atk_object_set_parent (atk_object, atk_parent);
g_signal_emit_by_name (atk_parent, "children_changed::add", page->index, atk_object, NULL);
}
return FALSE;
}
示例13: getLinkCB
AtkHyperlink *
getLinkCB(AtkHypertext *aText, gint aLinkIndex)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
nsHyperTextAccessible* hyperText = accWrap->AsHyperText();
NS_ENSURE_TRUE(hyperText, nsnull);
nsAccessible* hyperLink = hyperText->GetLinkAt(aLinkIndex);
if (!hyperLink)
return nsnull;
AtkObject* hyperLinkAtkObj = nsAccessibleWrap::GetAtkObject(hyperLink);
nsAccessibleWrap *accChild = GetAccessibleWrap(hyperLinkAtkObj);
NS_ENSURE_TRUE(accChild, nsnull);
MaiHyperlink *maiHyperlink = accChild->GetMaiHyperlink();
NS_ENSURE_TRUE(maiHyperlink, nsnull);
return maiHyperlink->GetAtkHyperlink();
}
示例14: refSelectionCB
AtkObject *
refSelectionCB(AtkSelection *aSelection, gint i)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
NS_ENSURE_TRUE(accWrap, nsnull);
nsCOMPtr<nsIAccessibleSelectable> accSelection;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
getter_AddRefs(accSelection));
NS_ENSURE_TRUE(accSelection, nsnull);
AtkObject *atkObj = nsnull;
nsCOMPtr<nsIAccessible> accSelect;
nsresult rv = accSelection->RefSelection(i, getter_AddRefs(accSelect));
if (NS_SUCCEEDED(rv) && accSelect) {
nsIAccessible *tmpAcc = accSelect;
nsAccessibleWrap *refAccWrap =
NS_STATIC_CAST(nsAccessibleWrap *, tmpAcc);
atkObj = refAccWrap->GetAtkObject();
if (atkObj)
g_object_ref(atkObj);
}
示例15: eti_ref_accessible_at_point
static AtkObject *
eti_ref_accessible_at_point (AtkComponent *component,
gint x,
gint y,
AtkCoordType coord_type)
{
gint row = -1;
gint col = -1;
gint x_origin, y_origin;
ETableItem *item;
GtkWidget *tableOrTree;
item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (component)));
if (!item)
return NULL;
atk_component_get_extents (
component,
&x_origin,
&y_origin,
NULL,
NULL,
coord_type);
x -= x_origin;
y -= y_origin;
tableOrTree = gtk_widget_get_parent (GTK_WIDGET (item->parent.canvas));
if (E_IS_TREE (tableOrTree))
e_tree_get_cell_at (E_TREE (tableOrTree), x, y, &row, &col);
else
e_table_get_cell_at (E_TABLE (tableOrTree), x, y, &row, &col);
if (row != -1 && col != -1) {
return eti_ref_at (ATK_TABLE (component), row, col);
} else {
return NULL;
}
}