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



commit 940489a937c4f068cfde84546c4d0a0dd806591b
Author: Ke Wang <ke wang sun com>
Date:   Thu Jan 14 23:21:07 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 d152ebd..7036c0d 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -45,6 +45,8 @@ struct _DummyDispatch
 	GDestroyNotify destroy;
 };
 
+gboolean jaw_debug = FALSE;
+
 GMutex *atk_bridge_mutex = NULL;
 GCond *atk_bridge_cond = NULL;
 
@@ -118,6 +120,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);
 
@@ -136,6 +142,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]