summaryrefslogtreecommitdiffstats
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/android/lcd-android.c26
-rw-r--r--firmware/target/hosted/sdl/lcd-sdl.c6
2 files changed, 32 insertions, 0 deletions
diff --git a/firmware/target/hosted/android/lcd-android.c b/firmware/target/hosted/android/lcd-android.c
index 78b1f12f7f..f4ef7b5e75 100644
--- a/firmware/target/hosted/android/lcd-android.c
+++ b/firmware/target/hosted/android/lcd-android.c
@@ -35,6 +35,8 @@ static jmethodID java_lcd_update;
static jmethodID java_lcd_update_rect;
static bool display_on;
+static int dpi;
+static int scroll_threshold;
void lcd_init_device(void)
{
@@ -77,6 +79,20 @@ void lcd_init_device(void)
RockboxFramebuffer_class,
"java_lcd_update_rect",
"(IIII)V");
+
+ jmethodID get_dpi = e->GetMethodID(env_ptr,
+ RockboxFramebuffer_class,
+ "getDpi", "()I");
+
+ jmethodID get_scroll_threshold
+ = e->GetMethodID(env_ptr,
+ RockboxFramebuffer_class,
+ "getScrollThreshold", "()I");
+
+ dpi = e->CallIntMethod(env_ptr, RockboxFramebuffer_instance,
+ get_dpi);
+ scroll_threshold = e->CallIntMethod(env_ptr, RockboxFramebuffer_instance,
+ get_scroll_threshold);
display_on = true;
}
@@ -101,6 +117,16 @@ bool lcd_active(void)
return display_on;
}
+int lcd_get_dpi(void)
+{
+ return dpi;
+}
+
+int touchscreen_get_scroll_threshold(void)
+{
+ return scroll_threshold;
+}
+
/*
* (un)block lcd updates.
*
diff --git a/firmware/target/hosted/sdl/lcd-sdl.c b/firmware/target/hosted/sdl/lcd-sdl.c
index 15e4ba95c3..96b1a04aa6 100644
--- a/firmware/target/hosted/sdl/lcd-sdl.c
+++ b/firmware/target/hosted/sdl/lcd-sdl.c
@@ -111,3 +111,9 @@ void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end,
SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, steps);
}
+int lcd_get_dpi(void)
+{
+ /* TODO: find a way to query it from the OS, SDL doesn't support it
+ * directly; for now assume the more or less standard 96 */
+ return 96;
+}