Esempio n. 1
0
bool pq_PHP_emit(const QString &qosignal, QObject *sender, QEvent *event)
{
    int index = PHPQt5::acceptedPHPSlots_indexes.value(sender, -1);

    if(index >= 0) {
        if(PHPQt5::acceptedPHPSlots_list.at(index).contains(qosignal)) {
            TSRMLS_FETCH();

            pq_access_function_entry afe = PHPQt5::acceptedPHPSlots_list.at(index).value(qosignal);
            zend_function *copy_fptr = zend_get_closure_invoke_method(afe.zo TSRMLS_CC);
            zval *zevent = PHPQt5::pq_qevent_to_zobject(event TSRMLS_CC);

            PHPQt5::pq_eventHash.insert(Z_OBJVAL_P(zevent).handle, pq_event_wrapper{zevent, event});
            zval *zobject = PHPQt5::objectFactory()->getZObject(sender);

            zend_call_method_with_2_params(&afe.zo,
                                           Z_OBJCE_P(afe.zo),
                                           &copy_fptr,
                                           "__invoke",
                                           NULL,
                                           zobject,
                                           zevent);

            PHPQt5::pq_eventHash.remove(Z_OBJVAL_P(zevent).handle);
            zval_ptr_dtor(&zevent);

            return true;
        }
    }

    return false;
}
Esempio n. 2
0
static zend_function *zend_closure_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
	if (zend_string_equals_literal_ci(method, ZEND_INVOKE_FUNC_NAME)) {
		return zend_get_closure_invoke_method(*object);
	}

	return zend_std_get_method(object, method, key);
}
Esempio n. 3
0
static zend_function *zend_closure_get_method(zend_object **object, zend_string *method, const zval *key) /* {{{ */
{
	zend_string *lc_name;

	lc_name = zend_string_tolower(method);
	if (zend_string_equals_literal(method, ZEND_INVOKE_FUNC_NAME)) {
		zend_string_release(lc_name);
		return zend_get_closure_invoke_method(*object);
	}
	zend_string_release(lc_name);
	return std_object_handlers.get_method(object, method, key);
}