Esempio n. 1
0
/*
 * Class:     org_java_gtk_gtk_Widget
 * Method:    gtk_widget_add_destroy_handler
 * Signature: (JLorg/java_gtk/gtk/Widget/DestroyHandler;Lorg/java_gtk/gtk/Widget;)V
 */
JNIEXPORT void JNICALL Java_org_java_1gtk_gtk_Widget_gtk_1widget_1add_1destroy_1handler
  (JNIEnv *env, jclass cls, jlong instance, jobject handler, jclass receiver)
{
	callback *c;
	long handle_id;
	c = create_callback(env, handler, receiver, "destroyReceiver", "(Lorg/java_gtk/gtk/Widget$DestroyHandler;J)V");
	handle_id = connect_callback((gpointer)instance, "destroy", G_CALLBACK(widget_destroy_handler), c);
	update_handle(env, handler, "setHandleId", "(J)V", handle_id);
}
Esempio n. 2
0
/*
 * Class:     org_java_gtk_gtk_Widget
 * Method:    gtk_widget_add_configure_event_handler
 * Signature: (JLorg/java_gtk/gtk/Widget/ConfigureEventHandler;Lorg/java_gtk/gtk/Widget;)V
 */
JNIEXPORT void JNICALL Java_org_java_1gtk_gtk_Widget_gtk_1widget_1add_1configure_1event_1handler
  (JNIEnv *env, jclass cls, jlong instance, jobject handler, jclass receiver)
{
	callback *c;
	long handle_id;
	c = create_callback(env, handler, receiver, "configureEventReceiver", "(Lorg/java_gtk/gtk/Widget$ConfigureEventHandler;JJ)Z");
	handle_id = connect_callback((gpointer)instance, "configure-event", G_CALLBACK(widget_event_handler), c);
	update_handle(env, handler, "setHandleId", "(J)V", handle_id);
}
Esempio n. 3
0
/*
 * Class:     org_java_gtk_gtk_ComboBox
 * Method:    gtk_combo_box_add_changed_event_handler
 * Signature: (JLorg/java_gtk/gtk/ComboBox/ChangedEventHandler;Ljava/lang/Class;)V
 */
JNIEXPORT void JNICALL Java_org_java_1gtk_gtk_ComboBox_gtk_1combo_1box_1add_1changed_1event_1handler
  (JNIEnv *env, jclass cls, jlong instance, jobject handler, jclass receiver)
{
	callback *c;
	long handle_id;
	c = create_callback(env, handler, receiver, "changedEventReceiver", "(Lorg/java_gtk/gtk/ComboBox$ChangedEventHandler;J)V");
	handle_id = (long)connect_callback((gpointer)instance, "changed", G_CALLBACK(combo_box_changed_event_handler), c);
	update_handle(env, handler, "setHandleId", "(J)V", handle_id);
}
Esempio n. 4
0
static void
connect_callbackX(
    void *		cookie,
    security_handle_t *	security_handle,
    security_status_t	status)
{
    proto_t *p = cookie;
    p->security_handle = security_handle;
    p->status = status;
    connect_callback(p);
}
Esempio n. 5
0
void forward_start(CLIENT_ENTRY *entry)
{
	const char *myname = "forward_start";
	ACL_ASTREAM *server;

	/* 先从连接池中尝试一个连接流 */
	server = peek_server_conn(entry);
	if (server == NULL) {
		/* 如果连接池中没有可利用的连接流,则开始连接服务端 */
		server = forward_connect_next(entry);
		if (server == NULL) {
			acl_msg_error("%s: connect server_addr(%s:%d) error(%s)",
				myname, entry->domain_key, entry->server_port,
				acl_last_serror());
#if 1
			if (entry->connect_error_fn)
				entry->connect_error_fn(entry);
#else
			forward_complete(entry);
#endif
			return;
		}
		entry->flag_conn_reuse = 0;

		client_entry_set_server(entry, server);
		acl_aio_ctl(server,
			ACL_AIO_CTL_CONNECT_FN, connect_callback,
			ACL_AIO_CTL_CTX, entry,
			ACL_AIO_CTL_CLOSE_HOOK_ADD, connect_close_callback, entry,
			ACL_AIO_CTL_TIMEO_HOOK_ADD, connect_timeout_callback, entry,
			ACL_AIO_CTL_END);

	} else {
		/* 复用连接池中的连接 */

		entry->flag_conn_reuse = 1;
		client_entry_set_server(entry, server);
		acl_aio_ctl(server, ACL_AIO_CTL_CTX, entry, ACL_AIO_CTL_END);
		connect_callback(server, entry);
	}
}