/usr/include/d/gtkd-3/gtk/ActionGroup.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 | /*
* 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 gtk.ActionGroup;
private import glib.ConstructionException;
private import glib.ListG;
private import glib.Str;
private import gobject.ObjectG;
private import gobject.Signals;
private import gtk.AccelGroup;
private import gtk.Action;
private import gtk.BuildableIF;
private import gtk.BuildableT;
private import gtk.Widget;
private import gtk.c.functions;
public import gtk.c.types;
public import gtkc.gtktypes;
private import std.algorithm;
/**
* Actions are organised into groups. An action group is essentially a
* map from names to #GtkAction objects.
*
* All actions that would make sense to use in a particular context
* should be in a single group. Multiple action groups may be used for a
* particular user interface. In fact, it is expected that most nontrivial
* applications will make use of multiple groups. For example, in an
* application that can edit multiple documents, one group holding global
* actions (e.g. quit, about, new), and one group per document holding
* actions that act on that document (eg. save, cut/copy/paste, etc). Each
* window’s menus would be constructed from a combination of two action
* groups.
*
* ## Accelerators ## {#Action-Accel}
*
* Accelerators are handled by the GTK+ accelerator map. All actions are
* assigned an accelerator path (which normally has the form
* `<Actions>/group-name/action-name`) and a shortcut is associated with
* this accelerator path. All menuitems and toolitems take on this accelerator
* path. The GTK+ accelerator map code makes sure that the correct shortcut
* is displayed next to the menu item.
*
* # GtkActionGroup as GtkBuildable # {#GtkActionGroup-BUILDER-UI}
*
* The #GtkActionGroup implementation of the #GtkBuildable interface accepts
* #GtkAction objects as <child> elements in UI definitions.
*
* Note that it is probably more common to define actions and action groups
* in the code, since they are directly related to what the code can do.
*
* The GtkActionGroup implementation of the GtkBuildable interface supports
* a custom <accelerator> element, which has attributes named “key“ and
* “modifiers“ and allows to specify accelerators. This is similar to the
* <accelerator> element of #GtkWidget, the main difference is that
* it doesn’t allow you to specify a signal.
*
* ## A #GtkDialog UI definition fragment. ##
* |[
* <object class="GtkActionGroup" id="actiongroup">
* <child>
* <object class="GtkAction" id="About">
* <property name="name">About</property>
* <property name="stock_id">gtk-about</property>
* <signal handler="about_activate" name="activate"/>
* </object>
* <accelerator key="F1" modifiers="GDK_CONTROL_MASK | GDK_SHIFT_MASK"/>
* </child>
* </object>
* ]|
*/
public class ActionGroup : ObjectG, BuildableIF
{
/** the main Gtk struct */
protected GtkActionGroup* gtkActionGroup;
/** Get the main Gtk struct */
public GtkActionGroup* getActionGroupStruct(bool transferOwnership = false)
{
if (transferOwnership)
ownedRef = false;
return gtkActionGroup;
}
/** the main Gtk struct as a void* */
protected override void* getStruct()
{
return cast(void*)gtkActionGroup;
}
protected override void setStruct(GObject* obj)
{
gtkActionGroup = cast(GtkActionGroup*)obj;
super.setStruct(obj);
}
/**
* Sets our main struct and passes it to the parent class.
*/
public this (GtkActionGroup* gtkActionGroup, bool ownedRef = false)
{
this.gtkActionGroup = gtkActionGroup;
super(cast(GObject*)gtkActionGroup, ownedRef);
}
// add the Buildable capabilities
mixin BuildableT!(GtkActionGroup);
/** */
public static GType getType()
{
return gtk_action_group_get_type();
}
/**
* Creates a new #GtkActionGroup object. The name of the action group
* is used when associating [keybindings][Action-Accel]
* with the actions.
*
* Params:
* name = the name of the action group.
*
* Returns: the new #GtkActionGroup
*
* Since: 2.4
*
* Throws: ConstructionException GTK+ fails to create the object.
*/
public this(string name)
{
auto p = gtk_action_group_new(Str.toStringz(name));
if(p is null)
{
throw new ConstructionException("null returned by new");
}
this(cast(GtkActionGroup*) p, true);
}
/**
* Adds an action object to the action group. Note that this function
* does not set up the accel path of the action, which can lead to problems
* if a user tries to modify the accelerator of a menuitem associated with
* the action. Therefore you must either set the accel path yourself with
* gtk_action_set_accel_path(), or use
* `gtk_action_group_add_action_with_accel (..., NULL)`.
*
* Params:
* action = an action
*
* Since: 2.4
*/
public void addAction(Action action)
{
gtk_action_group_add_action(gtkActionGroup, (action is null) ? null : action.getActionStruct());
}
/**
* Adds an action object to the action group and sets up the accelerator.
*
* If @accelerator is %NULL, attempts to use the accelerator associated
* with the stock_id of the action.
*
* Accel paths are set to `<Actions>/group-name/action-name`.
*
* Params:
* action = the action to add
* accelerator = the accelerator for the action, in
* the format understood by gtk_accelerator_parse(), or "" for no accelerator, or
* %NULL to use the stock accelerator
*
* Since: 2.4
*/
public void addActionWithAccel(Action action, string accelerator)
{
gtk_action_group_add_action_with_accel(gtkActionGroup, (action is null) ? null : action.getActionStruct(), Str.toStringz(accelerator));
}
/**
* This is a convenience function to create a number of actions and add them
* to the action group.
*
* The “activate” signals of the actions are connected to the callbacks
* and their accel paths are set to `<Actions>/group-name/action-name`.
*
* Params:
* entries = an array of action descriptions
* userData = data to pass to the action callbacks
*
* Since: 2.4
*/
public void addActions(GtkActionEntry[] entries, void* userData)
{
gtk_action_group_add_actions(gtkActionGroup, entries.ptr, cast(uint)entries.length, userData);
}
/**
* This variant of gtk_action_group_add_actions() adds a #GDestroyNotify
* callback for @user_data.
*
* Params:
* entries = an array of action descriptions
* userData = data to pass to the action callbacks
* destroy = destroy notification callback for @user_data
*
* Since: 2.4
*/
public void addActionsFull(GtkActionEntry[] entries, void* userData, GDestroyNotify destroy)
{
gtk_action_group_add_actions_full(gtkActionGroup, entries.ptr, cast(uint)entries.length, userData, destroy);
}
/**
* This is a convenience routine to create a group of radio actions and
* add them to the action group.
*
* The “changed” signal of the first radio action is connected to the
* @on_change callback and the accel paths of the actions are set to
* `<Actions>/group-name/action-name`.
*
* Params:
* entries = an array of radio action descriptions
* value = the value of the action to activate initially, or -1 if
* no action should be activated
* onChange = the callback to connect to the changed signal
* userData = data to pass to the action callbacks
*
* Since: 2.4
*/
public void addRadioActions(GtkRadioActionEntry[] entries, int value, GCallback onChange, void* userData)
{
gtk_action_group_add_radio_actions(gtkActionGroup, entries.ptr, cast(uint)entries.length, value, onChange, userData);
}
/**
* This variant of gtk_action_group_add_radio_actions() adds a
* #GDestroyNotify callback for @user_data.
*
* Params:
* entries = an array of radio action descriptions
* value = the value of the action to activate initially, or -1 if
* no action should be activated
* onChange = the callback to connect to the changed signal
* userData = data to pass to the action callbacks
* destroy = destroy notification callback for @user_data
*
* Since: 2.4
*/
public void addRadioActionsFull(GtkRadioActionEntry[] entries, int value, GCallback onChange, void* userData, GDestroyNotify destroy)
{
gtk_action_group_add_radio_actions_full(gtkActionGroup, entries.ptr, cast(uint)entries.length, value, onChange, userData, destroy);
}
/**
* This is a convenience function to create a number of toggle actions and add them
* to the action group.
*
* The “activate” signals of the actions are connected to the callbacks
* and their accel paths are set to `<Actions>/group-name/action-name`.
*
* Params:
* entries = an array of toggle action descriptions
* userData = data to pass to the action callbacks
*
* Since: 2.4
*/
public void addToggleActions(GtkToggleActionEntry[] entries, void* userData)
{
gtk_action_group_add_toggle_actions(gtkActionGroup, entries.ptr, cast(uint)entries.length, userData);
}
/**
* This variant of gtk_action_group_add_toggle_actions() adds a
* #GDestroyNotify callback for @user_data.
*
* Params:
* entries = an array of toggle action descriptions
* userData = data to pass to the action callbacks
* destroy = destroy notification callback for @user_data
*
* Since: 2.4
*/
public void addToggleActionsFull(GtkToggleActionEntry[] entries, void* userData, GDestroyNotify destroy)
{
gtk_action_group_add_toggle_actions_full(gtkActionGroup, entries.ptr, cast(uint)entries.length, userData, destroy);
}
/**
* Gets the accelerator group.
*
* Returns: the accelerator group associated with this action
* group or %NULL if there is none.
*
* Since: 3.6
*/
public AccelGroup getAccelGroup()
{
auto p = gtk_action_group_get_accel_group(gtkActionGroup);
if(p is null)
{
return null;
}
return ObjectG.getDObject!(AccelGroup)(cast(GtkAccelGroup*) p);
}
/**
* Looks up an action in the action group by name.
*
* Params:
* actionName = the name of the action
*
* Returns: the action, or %NULL if no action by that name exists
*
* Since: 2.4
*/
public Action getAction(string actionName)
{
auto p = gtk_action_group_get_action(gtkActionGroup, Str.toStringz(actionName));
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Action)(cast(GtkAction*) p);
}
/**
* Gets the name of the action group.
*
* Returns: the name of the action group.
*
* Since: 2.4
*/
public string getName()
{
return Str.toString(gtk_action_group_get_name(gtkActionGroup));
}
/**
* Returns %TRUE if the group is sensitive. The constituent actions
* can only be logically sensitive (see gtk_action_is_sensitive()) if
* they are sensitive (see gtk_action_get_sensitive()) and their group
* is sensitive.
*
* Returns: %TRUE if the group is sensitive.
*
* Since: 2.4
*/
public bool getSensitive()
{
return gtk_action_group_get_sensitive(gtkActionGroup) != 0;
}
/**
* Returns %TRUE if the group is visible. The constituent actions
* can only be logically visible (see gtk_action_is_visible()) if
* they are visible (see gtk_action_get_visible()) and their group
* is visible.
*
* Returns: %TRUE if the group is visible.
*
* Since: 2.4
*/
public bool getVisible()
{
return gtk_action_group_get_visible(gtkActionGroup) != 0;
}
/**
* Lists the actions in the action group.
*
* Returns: an allocated list of the action objects in the action group
*
* Since: 2.4
*/
public ListG listActions()
{
auto p = gtk_action_group_list_actions(gtkActionGroup);
if(p is null)
{
return null;
}
return new ListG(cast(GList*) p);
}
/**
* Removes an action object from the action group.
*
* Params:
* action = an action
*
* Since: 2.4
*/
public void removeAction(Action action)
{
gtk_action_group_remove_action(gtkActionGroup, (action is null) ? null : action.getActionStruct());
}
/**
* Sets the accelerator group to be used by every action in this group.
*
* Params:
* accelGroup = a #GtkAccelGroup to set or %NULL
*
* Since: 3.6
*/
public void setAccelGroup(AccelGroup accelGroup)
{
gtk_action_group_set_accel_group(gtkActionGroup, (accelGroup is null) ? null : accelGroup.getAccelGroupStruct());
}
/**
* Changes the sensitivity of @action_group
*
* Params:
* sensitive = new sensitivity
*
* Since: 2.4
*/
public void setSensitive(bool sensitive)
{
gtk_action_group_set_sensitive(gtkActionGroup, sensitive);
}
/**
* Sets a function to be used for translating the @label and @tooltip of
* #GtkActionEntrys added by gtk_action_group_add_actions().
*
* If you’re using gettext(), it is enough to set the translation domain
* with gtk_action_group_set_translation_domain().
*
* Params:
* func = a #GtkTranslateFunc
* data = data to be passed to @func and @notify
* notify = a #GDestroyNotify function to be called when @action_group is
* destroyed and when the translation function is changed again
*
* Since: 2.4
*/
public void setTranslateFunc(GtkTranslateFunc func, void* data, GDestroyNotify notify)
{
gtk_action_group_set_translate_func(gtkActionGroup, func, data, notify);
}
/**
* Sets the translation domain and uses g_dgettext() for translating the
* @label and @tooltip of #GtkActionEntrys added by
* gtk_action_group_add_actions().
*
* If you’re not using gettext() for localization, see
* gtk_action_group_set_translate_func().
*
* Params:
* domain = the translation domain to use for g_dgettext()
* calls, or %NULL to use the domain set with textdomain()
*
* Since: 2.4
*/
public void setTranslationDomain(string domain)
{
gtk_action_group_set_translation_domain(gtkActionGroup, Str.toStringz(domain));
}
/**
* Changes the visible of @action_group.
*
* Params:
* visible = new visiblity
*
* Since: 2.4
*/
public void setVisible(bool visible)
{
gtk_action_group_set_visible(gtkActionGroup, visible);
}
/**
* Translates a string using the function set with
* gtk_action_group_set_translate_func(). This
* is mainly intended for language bindings.
*
* Params:
* str = a string
*
* Returns: the translation of @string
*
* Since: 2.6
*/
public string translateString(string str)
{
return Str.toString(gtk_action_group_translate_string(gtkActionGroup, Str.toStringz(str)));
}
protected class OnConnectProxyDelegateWrapper
{
void delegate(Action, Widget, ActionGroup) dlg;
gulong handlerId;
this(void delegate(Action, Widget, ActionGroup) dlg)
{
this.dlg = dlg;
onConnectProxyListeners ~= this;
}
void remove(OnConnectProxyDelegateWrapper source)
{
foreach(index, wrapper; onConnectProxyListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onConnectProxyListeners[index] = null;
onConnectProxyListeners = std.algorithm.remove(onConnectProxyListeners, index);
break;
}
}
}
}
OnConnectProxyDelegateWrapper[] onConnectProxyListeners;
/**
* The ::connect-proxy signal is emitted after connecting a proxy to
* an action in the group. Note that the proxy may have been connected
* to a different action before.
*
* This is intended for simple customizations for which a custom action
* class would be too clumsy, e.g. showing tooltips for menuitems in the
* statusbar.
*
* #GtkUIManager proxies the signal and provides global notification
* just before any action is connected to a proxy, which is probably more
* convenient to use.
*
* Params:
* action = the action
* proxy = the proxy
*
* Since: 2.4
*/
gulong addOnConnectProxy(void delegate(Action, Widget, ActionGroup) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnConnectProxyDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"connect-proxy",
cast(GCallback)&callBackConnectProxy,
cast(void*)wrapper,
cast(GClosureNotify)&callBackConnectProxyDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackConnectProxy(GtkActionGroup* actiongroupStruct, GtkAction* action, GtkWidget* proxy, OnConnectProxyDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(Action)(action), ObjectG.getDObject!(Widget)(proxy), wrapper.outer);
}
extern(C) static void callBackConnectProxyDestroy(OnConnectProxyDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnDisconnectProxyDelegateWrapper
{
void delegate(Action, Widget, ActionGroup) dlg;
gulong handlerId;
this(void delegate(Action, Widget, ActionGroup) dlg)
{
this.dlg = dlg;
onDisconnectProxyListeners ~= this;
}
void remove(OnDisconnectProxyDelegateWrapper source)
{
foreach(index, wrapper; onDisconnectProxyListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onDisconnectProxyListeners[index] = null;
onDisconnectProxyListeners = std.algorithm.remove(onDisconnectProxyListeners, index);
break;
}
}
}
}
OnDisconnectProxyDelegateWrapper[] onDisconnectProxyListeners;
/**
* The ::disconnect-proxy signal is emitted after disconnecting a proxy
* from an action in the group.
*
* #GtkUIManager proxies the signal and provides global notification
* just before any action is connected to a proxy, which is probably more
* convenient to use.
*
* Params:
* action = the action
* proxy = the proxy
*
* Since: 2.4
*/
gulong addOnDisconnectProxy(void delegate(Action, Widget, ActionGroup) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnDisconnectProxyDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"disconnect-proxy",
cast(GCallback)&callBackDisconnectProxy,
cast(void*)wrapper,
cast(GClosureNotify)&callBackDisconnectProxyDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackDisconnectProxy(GtkActionGroup* actiongroupStruct, GtkAction* action, GtkWidget* proxy, OnDisconnectProxyDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(Action)(action), ObjectG.getDObject!(Widget)(proxy), wrapper.outer);
}
extern(C) static void callBackDisconnectProxyDestroy(OnDisconnectProxyDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnPostActivateDelegateWrapper
{
void delegate(Action, ActionGroup) dlg;
gulong handlerId;
this(void delegate(Action, ActionGroup) dlg)
{
this.dlg = dlg;
onPostActivateListeners ~= this;
}
void remove(OnPostActivateDelegateWrapper source)
{
foreach(index, wrapper; onPostActivateListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onPostActivateListeners[index] = null;
onPostActivateListeners = std.algorithm.remove(onPostActivateListeners, index);
break;
}
}
}
}
OnPostActivateDelegateWrapper[] onPostActivateListeners;
/**
* The ::post-activate signal is emitted just after the @action in the
* @action_group is activated
*
* This is intended for #GtkUIManager to proxy the signal and provide global
* notification just after any action is activated.
*
* Params:
* action = the action
*
* Since: 2.4
*/
gulong addOnPostActivate(void delegate(Action, ActionGroup) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnPostActivateDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"post-activate",
cast(GCallback)&callBackPostActivate,
cast(void*)wrapper,
cast(GClosureNotify)&callBackPostActivateDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackPostActivate(GtkActionGroup* actiongroupStruct, GtkAction* action, OnPostActivateDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(Action)(action), wrapper.outer);
}
extern(C) static void callBackPostActivateDestroy(OnPostActivateDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
protected class OnPreActivateDelegateWrapper
{
void delegate(Action, ActionGroup) dlg;
gulong handlerId;
this(void delegate(Action, ActionGroup) dlg)
{
this.dlg = dlg;
onPreActivateListeners ~= this;
}
void remove(OnPreActivateDelegateWrapper source)
{
foreach(index, wrapper; onPreActivateListeners)
{
if (wrapper.handlerId == source.handlerId)
{
onPreActivateListeners[index] = null;
onPreActivateListeners = std.algorithm.remove(onPreActivateListeners, index);
break;
}
}
}
}
OnPreActivateDelegateWrapper[] onPreActivateListeners;
/**
* The ::pre-activate signal is emitted just before the @action in the
* @action_group is activated
*
* This is intended for #GtkUIManager to proxy the signal and provide global
* notification just before any action is activated.
*
* Params:
* action = the action
*
* Since: 2.4
*/
gulong addOnPreActivate(void delegate(Action, ActionGroup) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
{
auto wrapper = new OnPreActivateDelegateWrapper(dlg);
wrapper.handlerId = Signals.connectData(
this,
"pre-activate",
cast(GCallback)&callBackPreActivate,
cast(void*)wrapper,
cast(GClosureNotify)&callBackPreActivateDestroy,
connectFlags);
return wrapper.handlerId;
}
extern(C) static void callBackPreActivate(GtkActionGroup* actiongroupStruct, GtkAction* action, OnPreActivateDelegateWrapper wrapper)
{
wrapper.dlg(ObjectG.getDObject!(Action)(action), wrapper.outer);
}
extern(C) static void callBackPreActivateDestroy(OnPreActivateDelegateWrapper wrapper, GClosure* closure)
{
wrapper.remove(wrapper);
}
}
|