/usr/include/d/gtkd-3/atk/ObjectAtk.d is in libgtkd-3-dev 3.7.5-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 | /*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version, with
* some exceptions, please read the COPYING file.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/
// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage
module atk.ObjectAtk;
private import atk.RelationSet;
private import atk.StateSet;
private import atk.c.functions;
public import atk.c.types;
private import glib.Str;
private import gobject.ObjectG;
private import gobject.Signals;
public import gtkc.atktypes;
private import std.algorithm;
/**
* This class is the primary class for accessibility support via the
* Accessibility ToolKit (ATK). Objects which are instances of
* #AtkObject (or instances of AtkObject-derived types) are queried
* for properties which relate basic (and generic) properties of a UI
* component such as name and description. Instances of #AtkObject
* may also be queried as to whether they implement other ATK
* interfaces (e.g. #AtkAction, #AtkComponent, etc.), as appropriate
* to the role which a given UI component plays in a user interface.
*
* All UI components in an application which provide useful
* information or services to the user must provide corresponding
* #AtkObject instances on request (in GTK+, for instance, usually on
* a call to #gtk_widget_get_accessible ()), either via ATK support
* built into the toolkit for the widget class or ancestor class, or
* in the case of custom widgets, if the inherited #AtkObject
* implementation is insufficient, via instances of a new #AtkObject
* subclass.
*
* See also: #AtkObjectFactory, #AtkRegistry. (GTK+ users see also
* #GtkAccessible).
*/
public class ObjectAtk : ObjectG
{
/** the main Gtk struct */
protected AtkObject* atkObject;
/** Get the main Gtk struct */
public AtkObject* getObjectAtkStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return atkObject;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)atkObject;
}
protected override void setStruct(GObject* obj)
{
atkObject = cast(AtkObject*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (AtkObject* atkObject, bool ownedRef = false)
{
this.atkObject = atkObject;
super(cast(GObject*)atkObject, ownedRef);
}
/** */
public static GType getType()
{
return atk_object_get_type();
}
/**
* Adds a relationship of the specified type with the specified target.
*
* Params:
* relationship = The #AtkRelationType of the relation
* target = The #AtkObject which is to be the target of the relation.
*
* Returns: TRUE if the relationship is added.
*/
public bool addRelationship(AtkRelationType relationship, ObjectAtk target)
{
return atk_object_add_relationship(atkObject, relationship, (target is null) ? null : target.getObjectAtkStruct()) != 0;
}
/**
*
*
* Deprecated: Since 2.12. Connect directly to property-change or
* notify signals.
*
* Params:
* handler = a function to be called when a property changes its value
*
* Returns: a #guint which is the handler id used in
* atk_object_remove_property_change_handler()
*/
public uint connectPropertyChangeHandler(AtkPropertyChangeHandler* handler)
{
return atk_object_connect_property_change_handler(atkObject, handler);
}
/**
* Get a list of properties applied to this object as a whole, as an #AtkAttributeSet consisting of
* name-value pairs. As such these attributes may be considered weakly-typed properties or annotations,
* as distinct from strongly-typed object data available via other get/set methods.
* Not all objects have explicit "name-value pair" #AtkAttributeSet properties.
*
* Returns: an #AtkAttributeSet consisting of all
* explicit properties/annotations applied to the object, or an empty
* set if the object has no name-value pair attributes assigned to
* it. This #atkattributeset should be freed by a call to
* atk_attribute_set_free().
*
* Since: 1.12
*/
public AtkAttributeSet* getAttributes()
{
return atk_object_get_attributes(atkObject);
}
/**
* Gets the accessible description of the accessible.
*
* Returns: a character string representing the accessible description
* of the accessible.
*/
public string getDescription()
{
return Str.toString(atk_object_get_description(atkObject));
}
/**
* Gets the 0-based index of this accessible in its parent; returns -1 if the
* accessible does not have an accessible parent.
*
* Returns: an integer which is the index of the accessible in its parent
*/
public int getIndexInParent()
{
return atk_object_get_index_in_parent(atkObject);
}
/**
* Gets the layer of the accessible.
*
* Deprecated: Use atk_component_get_layer instead.
*
* Returns: an #AtkLayer which is the layer of the accessible
*/
public AtkLayer getLayer()
{
return atk_object_get_layer(atkObject);
}
/**
* Gets the zorder of the accessible. The value G_MININT will be returned
* if the layer of the accessible is not ATK_LAYER_MDI.
*
* Deprecated: Use atk_component_get_mdi_zorder instead.
*
* Returns: a gint which is the zorder of the accessible, i.e. the depth at
* which the component is shown in relation to other components in the same
* container.
*/
public int getMdiZorder()
{
return atk_object_get_mdi_zorder(atkObject);
}
/**
* Gets the number of accessible children of the accessible.
*
* Returns: an integer representing the number of accessible children
* of the accessible.
*/
public int getNAccessibleChildren()
{
return atk_object_get_n_accessible_children(atkObject);
}
/**
* Gets the accessible name of the accessible.
*
* Returns: a character string representing the accessible name of the object.
*/
public string getName()
{
return Str.toString(atk_object_get_name(atkObject));
}
/**
* Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale
* of @accessible.
*
* Returns: a UTF-8 string indicating the POSIX-style LC_MESSAGES
* locale of @accessible.
*
* Since: 2.8
*/
public string getObjectLocale()
{
return Str.toString(atk_object_get_object_locale(atkObject));
}
/**
* Gets the accessible parent of the accessible. By default this is
* the one assigned with atk_object_set_parent(), but it is assumed
* that ATK implementors have ways to get the parent of the object
* without the need of assigning it manually with
* atk_object_set_parent(), and will return it with this method.
*
* If you are only interested on the parent assigned with
* atk_object_set_parent(), use atk_object_peek_parent().
*
* Returns: an #AtkObject representing the accessible
* parent of the accessible
*/
public ObjectAtk getParent()
{
auto p = atk_object_get_parent(atkObject);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p);
}
/**
* Gets the role of the accessible.
*
* Returns: an #AtkRole which is the role of the accessible
*/
public AtkRole getRole()
{
return atk_object_get_role(atkObject);
}
/**
* This function is called when implementing subclasses of #AtkObject.
* It does initialization required for the new object. It is intended
* that this function should called only in the ..._new() functions used
* to create an instance of a subclass of #AtkObject
*
* Params:
* data = a #gpointer which identifies the object for which the AtkObject was created.
*/
public void initialize(void* data)
{
atk_object_initialize(atkObject, data);
}
/**
* Emits a state-change signal for the specified state.
*
* Note that as a general rule when the state of an existing object changes,
* emitting a notification is expected.
*
* Params:
* state = an #AtkState whose state is changed
* value = a gboolean which indicates whether the state is being set on or off
*/
public void notifyStateChange(AtkState state, bool value)
{
atk_object_notify_state_change(atkObject, state, value);
}
/**
* Gets the accessible parent of the accessible, if it has been
* manually assigned with atk_object_set_parent. Otherwise, this
* function returns %NULL.
*
* This method is intended as an utility for ATK implementors, and not
* to be exposed to accessible tools. See atk_object_get_parent() for
* further reference.
*
* Returns: an #AtkObject representing the accessible
* parent of the accessible if assigned
*/
public ObjectAtk peekParent()
{
auto p = atk_object_peek_parent(atkObject);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p);
}
/**
* Gets a reference to the specified accessible child of the object.
* The accessible children are 0-based so the first accessible child is
* at index 0, the second at index 1 and so on.
*
* Params:
* i = a gint representing the position of the child, starting from 0
*
* Returns: an #AtkObject representing the specified
* accessible child of the accessible.
*/
public ObjectAtk refAccessibleChild(int i)
{
auto p = atk_object_ref_accessible_child(atkObject, i);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(ObjectAtk)(cast(AtkObject*) p, true);
}
/**
* Gets the #AtkRelationSet associated with the object.
*
* Returns: an #AtkRelationSet representing the relation set
* of the object.
*/
public RelationSet refRelationSet()
{
auto p = atk_object_ref_relation_set(atkObject);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(RelationSet)(cast(AtkRelationSet*) p, true);
}
/**
* Gets a reference to the state set of the accessible; the caller must
* unreference it when it is no longer needed.
*
* Returns: a reference to an #AtkStateSet which is the state
* set of the accessible
*/
public StateSet refStateSet()
{
auto p = atk_object_ref_state_set(atkObject);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(StateSet)(cast(AtkStateSet*) p, true);
}
/**
*
*
* Deprecated: Since 2.12.
*
* Removes a property change handler.
*
* Params:
* handlerId = a guint which identifies the handler to be removed.
*/
public void removePropertyChangeHandler(uint handlerId)
{
atk_object_remove_property_change_handler(atkObject, handlerId);
}
/**
* Removes a relationship of the specified type with the specified target.
*
* Params:
* relationship = The #AtkRelationType of the relation
* target = The #AtkObject which is the target of the relation to be removed.
*
* Returns: TRUE if the relationship is removed.
*/
public bool removeRelationship(AtkRelationType relationship, ObjectAtk target)
{
return atk_object_remove_relationship(atkObject, relationship, (target is null) ? null : target.getObjectAtkStruct()) != 0;
}
/**
* Sets the accessible description of the accessible. You can't set
* the description to NULL. This is reserved for the initial value. In
* this aspect NULL is similar to ATK_ROLE_UNKNOWN. If you want to set
* the name to a empty value you can use "".
*
* Params:
* description = a character string to be set as the accessible description
*/
public void setDescription(string description)
{
atk_object_set_description(atkObject, Str.toStringz(description));
}
/**
* Sets the accessible name of the accessible. You can't set the name
* to NULL. This is reserved for the initial value. In this aspect
* NULL is similar to ATK_ROLE_UNKNOWN. If you want to set the name to
* a empty value you can use "".
*
* Params:
* name = a character string to be set as the accessible name
*/
public void setName(string name)
{
atk_object_set_name(atkObject, Str.toStringz(name));
}
/**
* Sets the accessible parent of the accessible. @parent can be NULL.
*
* Params:
* parent = an #AtkObject to be set as the accessible parent
*/
public void setParent(ObjectAtk parent)
{
atk_object_set_parent(atkObject, (parent is null) ? null : parent.getObjectAtkStruct());
}
/**
* Sets the role of the accessible.
*
* Params:
* role = an #AtkRole to be set as the role
*/
public void setRole(AtkRole role)
{
atk_object_set_role(atkObject, role);
}
protected class OnActiveDescendantChangedDelegateWrapper
{
void delegate(void*, ObjectAtk) dlg;
gulong handlerId;
this(void delegate(void*, ObjectAtk) dlg)
{
this.dlg = dlg;
onActiveDescendantChangedListeners ~= this;
}
void remove(OnActiveDescendantChangedDelegateWrapper source)
{
foreach(index, wrapper; onActiveDescendantChangedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onActiveDescendantChangedListeners[index] = null;
onActiveDescendantChangedListeners = std.algorithm.remove(onActiveDescendantChangedListeners, index);
break;
}
}
}
}
OnActiveDescendantChangedDelegateWrapper[] onActiveDescendantChangedListeners;
/**
* The "active-descendant-changed" signal is emitted by an object
* which has the state ATK_STATE_MANAGES_DESCENDANTS when the focus
* object in the object changes. For instance, a table will emit the
* signal when the cell in the table which has focus changes.
*
* Params:
* arg1 = the newly focused object.
*/
gulong addOnActiveDescendantChanged(void delegate(void*, ObjectAtk) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnActiveDescendantChangedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"active-descendant-changed",
cast(GCallback)&callBackActiveDescendantChanged,
cast(void*)wrapper,
cast(GClosureNotify)&callBackActiveDescendantChangedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackActiveDescendantChanged(AtkObject* objectatkStruct, void* arg1, OnActiveDescendantChangedDelegateWrapper wrapper)
{
wrapper.dlg(arg1, wrapper.outer);
}
extern(C) static void callBackActiveDescendantChangedDestroy(OnActiveDescendantChangedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnChildrenChangedDelegateWrapper
{
void delegate(uint, void*, ObjectAtk) dlg;
gulong handlerId;
this(void delegate(uint, void*, ObjectAtk) dlg)
{
this.dlg = dlg;
onChildrenChangedListeners ~= this;
}
void remove(OnChildrenChangedDelegateWrapper source)
{
foreach(index, wrapper; onChildrenChangedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onChildrenChangedListeners[index] = null;
onChildrenChangedListeners = std.algorithm.remove(onChildrenChangedListeners, index);
break;
}
}
}
}
OnChildrenChangedDelegateWrapper[] onChildrenChangedListeners;
/**
* The signal "children-changed" is emitted when a child is added or
* removed form an object. It supports two details: "add" and
* "remove"
*
* Params:
* arg1 = The index of the added or removed child. The value can be
* -1. This is used if the value is not known by the implementor
* when the child is added/removed or irrelevant.
* arg2 = A gpointer to the child AtkObject which was added or
* removed. If the child was removed, it is possible that it is not
* available for the implementor. In that case this pointer can be
* NULL.
*/
gulong addOnChildrenChanged(void delegate(uint, void*, ObjectAtk) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnChildrenChangedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"children-changed",
cast(GCallback)&callBackChildrenChanged,
cast(void*)wrapper,
cast(GClosureNotify)&callBackChildrenChangedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackChildrenChanged(AtkObject* objectatkStruct, uint arg1, void* arg2, OnChildrenChangedDelegateWrapper wrapper)
{
wrapper.dlg(arg1, arg2, wrapper.outer);
}
extern(C) static void callBackChildrenChangedDestroy(OnChildrenChangedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnFocusDelegateWrapper
{
void delegate(bool, ObjectAtk) dlg;
gulong handlerId;
this(void delegate(bool, ObjectAtk) dlg)
{
this.dlg = dlg;
onFocusListeners ~= this;
}
void remove(OnFocusDelegateWrapper source)
{
foreach(index, wrapper; onFocusListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onFocusListeners[index] = null;
onFocusListeners = std.algorithm.remove(onFocusListeners, index);
break;
}
}
}
}
OnFocusDelegateWrapper[] onFocusListeners;
/**
* The signal "focus-event" is emitted when an object gained or lost
* focus.
*
* Deprecated: Use the #AtkObject::state-change signal instead.
*
* Params:
* arg1 = a boolean value which indicates whether the object gained
* or lost focus.
*/
gulong addOnFocus(void delegate(bool, ObjectAtk) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnFocusDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"focus-event",
cast(GCallback)&callBackFocus,
cast(void*)wrapper,
cast(GClosureNotify)&callBackFocusDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackFocus(AtkObject* objectatkStruct, bool arg1, OnFocusDelegateWrapper wrapper)
{
wrapper.dlg(arg1, wrapper.outer);
}
extern(C) static void callBackFocusDestroy(OnFocusDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnPropertyChangeDelegateWrapper
{
void delegate(void*, ObjectAtk) dlg;
gulong handlerId;
this(void delegate(void*, ObjectAtk) dlg)
{
this.dlg = dlg;
onPropertyChangeListeners ~= this;
}
void remove(OnPropertyChangeDelegateWrapper source)
{
foreach(index, wrapper; onPropertyChangeListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onPropertyChangeListeners[index] = null;
onPropertyChangeListeners = std.algorithm.remove(onPropertyChangeListeners, index);
break;
}
}
}
}
OnPropertyChangeDelegateWrapper[] onPropertyChangeListeners;
/**
* The signal "property-change" is emitted when an object's property
* value changes. @arg1 contains an #AtkPropertyValues with the name
* and the new value of the property whose value has changed. Note
* that, as with GObject notify, getting this signal does not
* guarantee that the value of the property has actually changed; it
* may also be emitted when the setter of the property is called to
* reinstate the previous value.
*
* Toolkit implementor note: ATK implementors should use
* g_object_notify() to emit property-changed
* notifications. #AtkObject::property-changed is needed by the
* implementation of atk_add_global_event_listener() because GObject
* notify doesn't support emission hooks.
*
* Params:
* arg1 = an #AtkPropertyValues containing the new value of the
* property which changed.
*/
gulong addOnPropertyChange(void delegate(void*, ObjectAtk) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnPropertyChangeDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"property-change",
cast(GCallback)&callBackPropertyChange,
cast(void*)wrapper,
cast(GClosureNotify)&callBackPropertyChangeDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackPropertyChange(AtkObject* objectatkStruct, void* arg1, OnPropertyChangeDelegateWrapper wrapper)
{
wrapper.dlg(arg1, wrapper.outer);
}
extern(C) static void callBackPropertyChangeDestroy(OnPropertyChangeDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnStateChangeDelegateWrapper
{
void delegate(string, bool, ObjectAtk) dlg;
gulong handlerId;
this(void delegate(string, bool, ObjectAtk) dlg)
{
this.dlg = dlg;
onStateChangeListeners ~= this;
}
void remove(OnStateChangeDelegateWrapper source)
{
foreach(index, wrapper; onStateChangeListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onStateChangeListeners[index] = null;
onStateChangeListeners = std.algorithm.remove(onStateChangeListeners, index);
break;
}
}
}
}
OnStateChangeDelegateWrapper[] onStateChangeListeners;
/**
* The "state-change" signal is emitted when an object's state
* changes. The detail value identifies the state type which has
* changed.
*
* Params:
* arg1 = The name of the state which has changed
* arg2 = A boolean which indicates whether the state has been set or unset.
*/
gulong addOnStateChange(void delegate(string, bool, ObjectAtk) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnStateChangeDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"state-change",
cast(GCallback)&callBackStateChange,
cast(void*)wrapper,
cast(GClosureNotify)&callBackStateChangeDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackStateChange(AtkObject* objectatkStruct, char* arg1, bool arg2, OnStateChangeDelegateWrapper wrapper)
{
wrapper.dlg(Str.toString(arg1), arg2, wrapper.outer);
}
extern(C) static void callBackStateChangeDestroy(OnStateChangeDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnVisibleDataChangedDelegateWrapper
{
void delegate(ObjectAtk) dlg;
gulong handlerId;
this(void delegate(ObjectAtk) dlg)
{
this.dlg = dlg;
onVisibleDataChangedListeners ~= this;
}
void remove(OnVisibleDataChangedDelegateWrapper source)
{
foreach(index, wrapper; onVisibleDataChangedListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onVisibleDataChangedListeners[index] = null;
onVisibleDataChangedListeners = std.algorithm.remove(onVisibleDataChangedListeners, index);
break;
}
}
}
}
OnVisibleDataChangedDelegateWrapper[] onVisibleDataChangedListeners;
/**
* The "visible-data-changed" signal is emitted when the visual
* appearance of the object changed.
*/
gulong addOnVisibleDataChanged(void delegate(ObjectAtk) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnVisibleDataChangedDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"visible-data-changed",
cast(GCallback)&callBackVisibleDataChanged,
cast(void*)wrapper,
cast(GClosureNotify)&callBackVisibleDataChangedDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackVisibleDataChanged(AtkObject* objectatkStruct, OnVisibleDataChangedDelegateWrapper wrapper)
{
wrapper.dlg(wrapper.outer);
}
extern(C) static void callBackVisibleDataChangedDestroy(OnVisibleDataChangedDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
/**
* Get the #AtkRole type corresponding to a rolew name.
*
* Params:
* name = a string which is the (non-localized) name of an ATK role.
*
* Returns: the #AtkRole enumerated type corresponding to the specified name,
* or #ATK_ROLE_INVALID if no matching role is found.
*/
public static AtkRole roleForName(string name)
{
return atk_role_for_name(Str.toStringz(name));
}
/**
* Gets the localized description string describing the #AtkRole @role.
*
* Params:
* role = The #AtkRole whose localized name is required
*
* Returns: the localized string describing the AtkRole
*/
public static string roleGetLocalizedName(AtkRole role)
{
return Str.toString(atk_role_get_localized_name(role));
}
/**
* Gets the description string describing the #AtkRole @role.
*
* Params:
* role = The #AtkRole whose name is required
*
* Returns: the string describing the AtkRole
*/
public static string roleGetName(AtkRole role)
{
return Str.toString(atk_role_get_name(role));
}
/**
* Registers the role specified by @name. @name must be a meaningful
* name. So it should not be empty, or consisting on whitespaces.
*
* Deprecated: Since 2.12. If your application/toolkit doesn't find a
* suitable role for a specific object defined at #AtkRole, please
* submit a bug in order to add a new role to the specification.
*
* Params:
* name = a character string describing the new role.
*
* Returns: an #AtkRole for the new role if added
* properly. ATK_ROLE_INVALID in case of error.
*/
public static AtkRole roleRegister(string name)
{
return atk_role_register(Str.toStringz(name));
}
}
|