[java-atk-wrapper] Add JAW_DEBUG - Set environment JAW_DEBUG=1 to get debug messages



commit 1684769599c20bfb9ea346d345b09815f1600c50
Author: Ke Wang <ke wang sun com>
Date:   Thu Jan 14 17:00:46 2010 +0800

    Add JAW_DEBUG - Set environment JAW_DEBUG=1 to get debug messages

 jni/src/AtkWrapper.c                               |   11 +++++++++++
 wrapper/org/GNOME/Accessibility/AtkWrapper.java.in |    8 ++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index 10cc1a4..04122ae 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -46,6 +46,8 @@ struct _DummyDispatch
 	GDestroyNotify destroy;
 };
 
+gboolean jaw_debug = FALSE;
+
 GMutex *atk_bridge_mutex = NULL;
 GCond *atk_bridge_cond = NULL;
 
@@ -128,6 +130,10 @@ jaw_load_atk_bridge (gpointer p)
 	(dl_init)();
 	g_atexit( jaw_exit_func );
 
+	if (jaw_debug) {
+		printf("ATK Bridge has been loaded successfully\n");
+	}
+
 	g_cond_signal(atk_bridge_cond);
 	g_mutex_unlock(atk_bridge_mutex);
 
@@ -146,6 +152,11 @@ JNIEXPORT void JNICALL Java_org_GNOME_Accessibility_AtkWrapper_initNativeLibrary
 	// Hook up g_idle_dispatch
 	origin_g_idle_dispatch = g_idle_funcs.dispatch;
 	g_idle_funcs.dispatch = jaw_idle_dispatch;
+
+	const gchar* debug_env = g_getenv("JAW_DEBUG");
+	if (g_strcmp0(debug_env, "1") == 0) {
+		jaw_debug = TRUE;
+	}
 	
 	// Java app with GTK Look And Feel will load gail
 	// Set NO_GAIL to "1" to prevent gail from executing
diff --git a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
index 1bfd317..d82830b 100644
--- a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
+++ b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
@@ -41,7 +41,9 @@ public class AtkWrapper {
 				}
 			}
 			
-		} catch (Exception e) { }
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
 	}
 
 	final WindowAdapter winAdapter = new WindowAdapter() {
@@ -138,7 +140,9 @@ public class AtkWrapper {
 				try {
 					System.loadLibrary("atk-wrapper");
 					AtkWrapper.initNativeLibrary();
-				} catch (Exception ex) {}
+				} catch (Exception ex) {
+					ex.printStackTrace();
+				}
 			}
 
 			if( e instanceof WindowEvent ) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]