/*
 * Signature the prototype of a (*show) callback, meeting the requirements
 * of the third parameter to g_signal_connect() for signal 'show'.
 */
static void
window_show_handler
(
	GtkWidget* widget,
	gpointer user_data
)
{
	if (DEBUG_MEMORY_MANAGEMENT) {
		g_printerr("mem: show caught for\t\t%s\n", bindings_java_memory_pointerToString(widget));
	}
	g_object_ref(widget);
}
/*
 * Signature the prototype of a (*hide) callback, meeting the requirements of
 * the third parameter to g_signal_connect() for signal 'hide'.
 */
static void
window_hide_handler
(
	GtkWidget* widget,
	gpointer user_data
)
{
	if (DEBUG_MEMORY_MANAGEMENT) {
		g_printerr("mem: hide caught for\t\t%s\n", bindings_java_memory_pointerToString(widget));
	}
	gdk_threads_add_timeout_full(G_PRIORITY_LOW, 100, window_hide_deref, widget, NULL);
}
Beispiel #3
0
/*
 * Implements
 *   org.freedesktop.bindings.Plumbing.toHexString(long pointer)
 */
JNIEXPORT jstring JNICALL
Java_org_freedesktop_bindings_Plumbing_toHexString
(
	JNIEnv *env,
	jclass cls,
	jlong _pointer
)
{
	const gchar* result;
	
	result = bindings_java_memory_pointerToString((gpointer) _pointer);
	
	return bindings_java_newString(env, result);
}
/*
 * Signature the prototype of a (*delete-event) callback, meeting the
 * requirements of the third parameter to g_signal_connect_after() for signal
 * 'delete-event'.
 */
static gboolean
window_delete_handler
(
	GtkWidget* object,
	gpointer user_data
)
{
	if (DEBUG_MEMORY_MANAGEMENT) {
		g_printerr("mem: delete caught for\t\t%s\n", bindings_java_memory_pointerToString(object));
	}
	gtk_widget_hide(object);
	
	return TRUE;
}