Trigger callbacks for event.

@param  {String} name Event name.
@param  {Mixed}  argX Arguments passed to callback.

@return {Void}
964154
function trigger(name, arg1, arg2, arg3, arg4) {
            // Common arguments for events
            switch (name) {
                case 'active':
                    arg2 = arg1;
                    arg1 = $items;
                    break;

                case 'activePage':
                    arg2 = arg1;
                    arg1 = pages;
                    break;

                default:
                    arg4 = arg1;
                    arg1 = pos;
                    arg2 = $items;
                    arg3 = rel;
            }

            if (callbacks[name]) {
                for (var i = 0, l = callbacks[name].length; i < l; i++) {
                    callbacks[name][i].call(frame, arg1, arg2, arg3, arg4);
                }
            }

            if (o.domEvents && !parallax) {
                $frame.trigger(pluginName + ':' + name, [arg1, arg2, arg3, arg4]);
            }
        }
580422
function(name, callback, context) {
      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
      this._events || (this._events = {});
      var events = this._events[name] || (this._events[name] = []);
      events.push({callback: callback, context: context, ctx: context || this});
      return this;
    }
550597
function(name, callback, context) {
      if (!(eventsApi(this, 'on', name, [callback, context]) && callback)) return this;
      this._events || (this._events = {});
      var list = this._events[name] || (this._events[name] = []);
      list.push({callback: callback, context: context, ctx: context || this});
      return this;
    }
772143
def emit name, *args
      # Trigger callbacks in scripts before triggering events in the client.
      EM.defer { notify_scripts name, *args }

      matching_callbacks = callbacks[name]
      return false unless matching_callbacks&.any?

      EM.defer do
        matching_callbacks.each { |callback| callback.call *args }
      end
    end
1106327
function triggerEvent(eventName, _args) {
    if (typeof this[events][eventName] === 'undefined') return;
    for (let i = 0; i < this[events][eventName].length; i++) {
      try {
        this[events][eventName][i](_args);
      } catch (e) {
        console.error('Thorin.Intent: triggered event ' + eventName + ' on callback function threw an exception.');
        console.error(e);
      }
    }
    this[eventsFired][eventName] = true;
    delete this[events][eventName];
  }
858166
protected void trigger(GwtEvent<?> e, Function callback, Element element) {
    trigger(e, callback, element, eventBus);
  }
618068
function(name) {
		var args = arguments;
		args[0] = this.eventName(name);
		$.fn.on.apply(this.$el, args);
	}
472320
function triggerIfHandlers(that, handlerListName, event) {
    triggerIfHandlerList(that[handlerListName][event], event)
    triggerIfHandlerList(that[normalHandlerToAllHandlerProperty(handlerListName)], event)
}
1286557
function(event, name) {
            var that = this;

            if (!(event in that.__events)) {
                that.__events[event] = {};
            }

            if (!_.isUndefined(name)) {
                if (!that.__hasEventListener(event, name)) {
                    throw new Error('There is no "' + event +  (name ? '"::"' + name : '') + '" event callback!');
                }

                that.__events[event][name] = undefined;
            }
            else {

                _.each(that.__getEventListeners(event), function(listener, name) {
                    that.__events[event][name] = undefined;
                });
            }

            return that;
        }
309302
public function triggerSubEvent($name, $event, $args = [])
    {
        return $this->getDispatcher($name)->triggerEvent($event, $args);
    }
120793
def _trigger_event(self, event, namespace, *args):
        """"""
        # first see if we have an explicit handler for the event
        if namespace in self.handlers and event in self.handlers[namespace]:
            return self.handlers[namespace][event](*args)

        # or else, forward the event to a namespace handler if one exists
        elif namespace in self.namespace_handlers:
            return self.namespace_handlers[namespace].trigger_event(
                event, *args)
211774
function(obj, name, sentinel, args) {
  if (obj._events) {
    // If `sentinel` is not the trigger sentinel, trigger was called
    // with a `{event: value}` object, and it is `value`.
    if (sentinel !== triggerSentinel) args = [sentinel].concat(args);

    var events = obj._events[name];
    var allEvents = obj._events.all;
    if (events) triggerEvents(events, args);
    if (allEvents) triggerEvents(allEvents, [name].concat(args));
  }
  return obj;
}
375569
def fire_event(self, evt_name, *args, **kwargs):
        
        listeners = self.__get_listeners(evt_name)
        evt = self.generate_event(evt_name)
        for listener in listeners:
            listener(evt, *args, **kwargs)
1258705
protected function addEventListener($name, $callback, $priority, $accepted_args)
    {
        $this->hooks[$name] = [$callback, $priority, $accepted_args];
        $this->addAction($name, $callback, $priority, $accepted_args);
    }
560842
function on(eventName, handler, context, args, once) {
    this.__listeners = this.__listeners || {};
    this.__listeners[eventName] = this.__listeners[eventName] || [];
    this.__listeners[eventName].push({
        fn: handler,
        context: context,
        args: args,
        once: !!once
    });
}
522047
function _triggerLayerEvent($canvas, data, layer, eventType, arg) {
	// If layer can legally fire this event type
	if (_layerCanFireEvent(layer, eventType)) {

		// Do not set a custom cursor on layer mouseout
		if (eventType !== 'mouseout') {
			// Update cursor if one is defined for this event
			_setCursor($canvas, layer, eventType);
		}

		// Trigger the user-defined event callback
		_runEventCallback($canvas, layer, eventType, layer, arg);
		// Trigger the canvas-bound event hook
		_runEventCallback($canvas, layer, eventType, data.eventHooks, arg);
		// Trigger the global event hook
		_runEventCallback($canvas, layer, eventType, jCanvas.eventHooks, arg);

	}
}
746701
function (name) {
			return function (args, onDone) {
				
				if (typeof args === 'function') {
					onDone = args;
					args = {};
				}
				
				console.log('calling API [' + name + ']...');
				
				// NOTE: by default callbacks are always kept
				SR.sendEvent(name, args, function (result) {
					if (result.err) {
						console.error(result.err);
						return SR.safeCall(onDone, result.err);
					}
					
					SR.safeCall(onDone, null, result.result);
				}, undefined, true);
			}
		}