[Libreoffice-commits] .: Branch 'feature/android' - 2 commits - sal/android vcl/android

Tor Lillqvist tml at kemper.freedesktop.org
Thu Jan 26 11:35:10 PST 2012


 sal/android/android_native_app_glue.c |    2 +-
 vcl/android/androidinst.cxx           |   28 +++++++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit d396ec82510f8a871d9d7310a4ce53180278fa37
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Thu Jan 26 21:32:48 2012 +0200

    Add APP_CMD_FOO symbolic printout

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 9791dbf..5adc357 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -155,9 +155,35 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow *pWindow)
     mbQueueReDraw = false;
 }
 
+static const char *app_cmd_name(int cmd)
+{
+    switch (cmd) {
+    case APP_CMD_INPUT_CHANGED: return "INPUT_CHANGED";
+    case APP_CMD_INIT_WINDOW: return "INIT_WINDOW";
+    case APP_CMD_TERM_WINDOW: return "TERM_WINDOW";
+    case APP_CMD_WINDOW_RESIZED: return "WINDOW_RESIZED";
+    case APP_CMD_WINDOW_REDRAW_NEEDED: return "WINDOW_REDRAW_NEEDED";
+    case APP_CMD_CONTENT_RECT_CHANGED: return "CONTENT_RECT_CHANGED";
+    case APP_CMD_GAINED_FOCUS: return "GAINED_FOCUS";
+    case APP_CMD_LOST_FOCUS: return "LOST_FOCUS";
+    case APP_CMD_CONFIG_CHANGED: return "CONFIG_CHANGED";
+    case APP_CMD_LOW_MEMORY: return "LOW_MEMORY";
+    case APP_CMD_START: return "START";
+    case APP_CMD_RESUME: return "RESUME";
+    case APP_CMD_SAVE_STATE: return "SAVE_STATE";
+    case APP_CMD_PAUSE: return "PAUSE";
+    case APP_CMD_STOP: return "STOP";
+    case APP_CMD_DESTROY: return "DESTROY";
+    default:
+        static char buf[10];
+        sprintf(buf, "%d", cmd);
+        return buf;
+    }
+}
+
 void AndroidSalInstance::onAppCmd (struct android_app* app, int32_t cmd)
 {
-        fprintf (stderr, "app cmd for app %p, cmd %d\n", app, cmd);
+        fprintf (stderr, "app cmd for app %p: %s\n", app, app_cmd_name(cmd));
         ANativeWindow *pWindow = mpApp->window;
         switch (cmd) {
         case APP_CMD_INIT_WINDOW:
commit 04fbc6be65cce5f91f753eabb1a74877a2e6ebf8
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Thu Jan 26 21:25:06 2012 +0200

    Use lo-bootstrap as the log tag

diff --git a/sal/android/android_native_app_glue.c b/sal/android/android_native_app_glue.c
index cf5d8e8..cacc3bb 100644
--- a/sal/android/android_native_app_glue.c
+++ b/sal/android/android_native_app_glue.c
@@ -25,7 +25,7 @@
 #include "osl/detail/android_native_app_glue.h"
 #include <android/log.h>
 
-#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "threaded_app", __VA_ARGS__))
+#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "lo-bootstrap", __VA_ARGS__))
 
 static void free_saved_state(struct android_app* android_app) {
     pthread_mutex_lock(&android_app->mutex);


More information about the Libreoffice-commits mailing list