本文整理汇总了C++中ATK_OBJECT函数的典型用法代码示例。如果您正苦于以下问题:C++ ATK_OBJECT函数的具体用法?C++ ATK_OBJECT怎么用?C++ ATK_OBJECT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ATK_OBJECT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:h4ck3rm1k3,项目名称:java-atk-wrapper,代码行数:20,代码来源:jawtable.c
示例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;
}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:20,代码来源:accessible-image-view.c
示例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));
}
}
}
开发者ID:BYC,项目名称:gtk,代码行数:20,代码来源:gailbutton.c
示例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;
}
开发者ID:spatulasnout,项目名称:clutter,代码行数:20,代码来源:cally-atkevents-example.c
示例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;
}
开发者ID:pupadam,项目名称:mozilla-central,代码行数:41,代码来源:nsMaiInterfaceTable.cpp
示例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);
}
开发者ID:fatman2021,项目名称:webkitgtk,代码行数:21,代码来源:AccessibilityUIElementAtk.cpp
示例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;
}
开发者ID:BYC,项目名称:gtk,代码行数:21,代码来源:testcombo.c
示例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;
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:21,代码来源:nsMaiInterfaceEditableText.cpp
示例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;
}
开发者ID:GNOME,项目名称:at-spi,代码行数:22,代码来源:application.c
示例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;
}
开发者ID:Oliver-Luo,项目名称:evolution,代码行数:22,代码来源:gal-a11y-e-table-item.c
示例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);
}
开发者ID:patrykka,项目名称:eail,代码行数:30,代码来源:eail_gengrid.c
示例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;
}
开发者ID:coapp-packages,项目名称:gtk,代码行数:22,代码来源:gailnotebookpage.c
示例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();
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:22,代码来源:nsMaiInterfaceHypertext.cpp
示例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);
}
开发者ID:mmadia,项目名称:bezilla,代码行数:22,代码来源:nsMaiInterfaceSelection.cpp
示例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;
}
}
开发者ID:Oliver-Luo,项目名称:evolution,代码行数:39,代码来源:gal-a11y-e-table-item.c
示例16: _eail_naviframe_get_naviframe_page_for_item
/**
* @brief Returns naviframe-page implementation for given object item
*
* @param naviframe an naviframe AtkObject
* @param item an Elm_Object_Item for naviframe-page
*
* @returns an AtkObject* representation for naviframe-page
*/
static AtkObject *
_eail_naviframe_get_naviframe_page_for_item(AtkObject *naviframe,
Elm_Object_Item *item)
{
EailFactoryObj *factory_obj = NULL;
AtkObject *naviframe_page = NULL;
factory_obj = eail_factory_find_obj_for_item(item);
if (factory_obj)
{
if (!factory_obj->atk_obj)
ERR("No atk obj created for factory item object");
return factory_obj->atk_obj;
}
naviframe_page = eail_naviframe_page_new(naviframe, item);
atk_object_initialize(naviframe_page, item);
eail_factory_append_item_to_cache(ATK_OBJECT(naviframe_page), item);
return naviframe_page;
}
开发者ID:patrykka,项目名称:eail,代码行数:30,代码来源:eail_naviframe.c
示例17: eti_get_row_extent_at
static gint
eti_get_row_extent_at (AtkTable *table,
gint row,
gint column)
{
ETableItem *item;
gint height;
item = E_TABLE_ITEM (eti_a11y_get_gobject (ATK_OBJECT (table)));
if (!item)
return -1;
e_table_item_get_cell_geometry (item,
&row,
&column,
NULL,
NULL,
NULL,
&height);
return height;
}
开发者ID:jdapena,项目名称:evolution,代码行数:22,代码来源:gal-a11y-e-table-item.c
示例18: focus_notify_handler
static gboolean
focus_notify_handler (gpointer p)
{
CallbackPara *para = (CallbackPara*)p;
jobject global_ac = para->global_ac;
JNIEnv *jniEnv = jaw_util_get_jni_env();
if (jniEnv == NULL)
{
if (jaw_debug)
g_warning("\nfocus_notify_handler: env == NULL\n");
free_callback_para(para);
return G_SOURCE_REMOVE;
}
if (global_ac == NULL)
{
if (jaw_debug)
g_warning("\nfocus_notify_handler: global_ac == NULL\n");
free_callback_para(para);
return G_SOURCE_REMOVE;
}
JawImpl* jaw_impl = jaw_impl_get_instance(jniEnv, global_ac);
if (jaw_impl == NULL)
{
if (jaw_debug)
g_warning("\nfocus_notify_handler: jaw_impl == NULL\n");
free_callback_para(para);
return G_SOURCE_REMOVE;
}
AtkObject* atk_obj = ATK_OBJECT(jaw_impl);
atk_object_notify_state_change(atk_obj,
ATK_STATE_SHOWING,
1);
free_callback_para(para);
return G_SOURCE_REMOVE;
}
开发者ID:thisMagpie,项目名称:java-atk-wrapper,代码行数:39,代码来源:AtkWrapper.c
示例19: window_state_change_handler
static gboolean
window_state_change_handler (gpointer p)
{
CallbackPara *para = (CallbackPara*)p;
jobject global_ac = para->global_ac;
JNIEnv *jniEnv = jaw_util_get_jni_env();
if (jniEnv == NULL)
{
if (jaw_debug)
g_warning("window_state_change_handler: env == NULL");
free_callback_para(para);
return G_SOURCE_REMOVE;
}
if (global_ac == NULL)
{
if (jaw_debug)
g_warning("window_state_change_handler: global_ac == NULL");
free_callback_para(para);
return G_SOURCE_REMOVE;
}
JawImpl* jaw_impl = jaw_impl_get_instance(jniEnv, global_ac);
if (jaw_impl == NULL)
{
if (jaw_debug)
g_warning("window_state_change_handler: jaw_impl == NULL");
free_callback_para(para);
return G_SOURCE_REMOVE;
}
AtkObject* atk_obj = ATK_OBJECT(jaw_impl);
g_signal_emit_by_name(atk_obj, "state-change", 0);
free_callback_para(para);
return G_SOURCE_REMOVE;
}
开发者ID:thisMagpie,项目名称:java-atk-wrapper,代码行数:39,代码来源:AtkWrapper.c
示例20: getTextCB
gchar *
getTextCB(AtkText *aText, gint aStartOffset, gint aEndOffset)
{
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
if (!accWrap)
return nsnull;
nsCOMPtr<nsIAccessibleText> accText;
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
getter_AddRefs(accText));
NS_ENSURE_TRUE(accText, nsnull);
nsAutoString autoStr;
nsresult rv = accText->GetText(aStartOffset, aEndOffset, autoStr);
NS_ENSURE_SUCCESS(rv, nsnull);
ConvertTexttoAsterisks(accWrap, autoStr);
NS_ConvertUTF16toUTF8 cautoStr(autoStr);
//copy and return, libspi will free it.
return (cautoStr.get()) ? g_strdup(cautoStr.get()) : nsnull;
}
开发者ID:AntonSilviu,项目名称:v8monkey,代码行数:22,代码来源:nsMaiInterfaceText.cpp
注:本文中的ATK_OBJECT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论