summaryrefslogtreecommitdiffstats
path: root/minuitwrp
diff options
context:
space:
mode:
Diffstat (limited to 'minuitwrp')
-rw-r--r--minuitwrp/Android.mk9
-rw-r--r--minuitwrp/events.c46
-rw-r--r--minuitwrp/minui.h2
-rw-r--r--minuitwrp/resources.c2
4 files changed, 22 insertions, 37 deletions
diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk
index 0a760de9a..e1bf76ef1 100644
--- a/minuitwrp/Android.mk
+++ b/minuitwrp/Android.mk
@@ -13,7 +13,8 @@ endif
LOCAL_C_INCLUDES += \
external/libpng \
external/zlib \
- system/core/include
+ system/core/include \
+ external/jpeg
LOCAL_C_INCLUDES += \
bootable/recovery/libjpegtwrp
@@ -57,9 +58,9 @@ endif
ifneq ($(BOARD_USE_CUSTOM_RECOVERY_FONT),)
LOCAL_CFLAGS += -DBOARD_USE_CUSTOM_RECOVERY_FONT=$(BOARD_USE_CUSTOM_RECOVERY_FONT)
endif
-LOCAL_SHARED_LIBRARIES += libz libc libcutils
-LOCAL_STATIC_LIBRARIES += libpng libjpegtwrp libpixelflinger_static
+LOCAL_SHARED_LIBRARIES += libz libc libcutils libjpeg
+LOCAL_STATIC_LIBRARIES += libpng libpixelflinger_static
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := libminuitwrp
-include $(BUILD_SHARED_LIBRARY) \ No newline at end of file
+include $(BUILD_SHARED_LIBRARY)
diff --git a/minuitwrp/events.c b/minuitwrp/events.c
index e73371193..2653d18d4 100644
--- a/minuitwrp/events.c
+++ b/minuitwrp/events.c
@@ -288,7 +288,7 @@ static int vk_inside_display(__s32 value, struct input_absinfo *info, int screen
return (screen_pos >= 0 && screen_pos < screen_size);
}
-static int vk_tp_to_screen(struct position *p, int *x, int *y)
+static int vk_tp_to_screen(struct position *p, int *x, int *y, int *screen_width, int *screen_height)
{
if (p->xi.minimum == p->xi.maximum || p->yi.minimum == p->yi.maximum)
{
@@ -298,17 +298,16 @@ static int vk_tp_to_screen(struct position *p, int *x, int *y)
return 0;
}
-#ifdef _EVENT_LOGGING
- printf("EV: p->x=%d x-range=%d,%d fb-width=%d\n", p->x, p->xi.minimum, p->xi.maximum, gr_fb_width());
-#endif
-
#ifndef RECOVERY_TOUCHSCREEN_SWAP_XY
- int fb_width = gr_fb_width();
- int fb_height = gr_fb_height();
+ int fb_width = *screen_width;
+ int fb_height = *screen_height;
#else
// We need to swap the scaling sizes, too
- int fb_width = gr_fb_height();
- int fb_height = gr_fb_width();
+ int fb_width = *screen_height;
+ int fb_height = *screen_width;
+#endif
+#ifdef _EVENT_LOGGING
+ printf("EV: p->x=%d x-range=%d,%d fb-width=%d\n", p->x, p->xi.minimum, p->xi.maximum, *screen_width);
#endif
*x = (p->x - p->xi.minimum) * (fb_width - 1) / (p->xi.maximum - p->xi.minimum);
@@ -325,7 +324,7 @@ static int vk_tp_to_screen(struct position *p, int *x, int *y)
/* Translate a virtual key in to a real key event, if needed */
/* Returns non-zero when the event should be consumed */
-static int vk_modify(struct ev *e, struct input_event *ev)
+static int vk_modify(struct ev *e, struct input_event *ev, int *screen_width, int *screen_height)
{
static int downX = -1, downY = -1;
static int discard = 0;
@@ -435,33 +434,18 @@ static int vk_modify(struct ev *e, struct input_event *ev)
break;
case ABS_MT_TOUCH_MINOR: //31
- if (ev->value == 0) {
- e->mt_p.x = 0;
- e->mt_p.y = 0;
- touchReleaseOnNextSynReport = 1;
- }
#ifdef _EVENT_LOGGING
printf("EV: %s => EV_ABS ABS_MT_TOUCH_MINOR %d\n", e->deviceName, ev->value);
#endif
break;
case ABS_MT_WIDTH_MAJOR: //32
- if (ev->value == 0) {
- e->mt_p.x = 0;
- e->mt_p.y = 0;
- touchReleaseOnNextSynReport = 1;
- }
#ifdef _EVENT_LOGGING
printf("EV: %s => EV_ABS ABS_MT_WIDTH_MAJOR %d\n", e->deviceName, ev->value);
#endif
break;
case ABS_MT_WIDTH_MINOR: //33
- if (ev->value == 0) {
- e->mt_p.x = 0;
- e->mt_p.y = 0;
- touchReleaseOnNextSynReport = 1;
- }
#ifdef _EVENT_LOGGING
printf("EV: %s => EV_ABS ABS_MT_WIDTH_MINOR %d\n", e->deviceName, ev->value);
#endif
@@ -560,11 +544,11 @@ static int vk_modify(struct ev *e, struct input_event *ev)
// Retrieve where the x,y position is
if (e->p.synced & 0x03)
{
- vk_tp_to_screen(&e->p, &x, &y);
+ vk_tp_to_screen(&e->p, &x, &y, screen_width, screen_height);
}
else if (e->mt_p.synced & 0x03)
{
- vk_tp_to_screen(&e->mt_p, &x, &y);
+ vk_tp_to_screen(&e->mt_p, &x, &y, screen_width, screen_height);
}
else
{
@@ -578,10 +562,10 @@ static int vk_modify(struct ev *e, struct input_event *ev)
x ^= y;
#endif
#ifdef RECOVERY_TOUCHSCREEN_FLIP_X
- x = gr_fb_width() - x;
+ x = *screen_width - x;
#endif
#ifdef RECOVERY_TOUCHSCREEN_FLIP_Y
- y = gr_fb_height() - y;
+ y = *screen_height - y;
#endif
#ifdef _EVENT_LOGGING
@@ -636,7 +620,7 @@ static int vk_modify(struct ev *e, struct input_event *ev)
return 0;
}
-int ev_get(struct input_event *ev, unsigned dont_wait)
+int ev_get(struct input_event *ev, unsigned dont_wait, int *screen_width, int *screen_height)
{
int r;
unsigned n;
@@ -649,7 +633,7 @@ int ev_get(struct input_event *ev, unsigned dont_wait)
if(ev_fds[n].revents & POLLIN) {
r = read(ev_fds[n].fd, ev, sizeof(*ev));
if(r == sizeof(*ev)) {
- if (!vk_modify(&evs[n], ev))
+ if (!vk_modify(&evs[n], ev, screen_width, screen_height))
return 0;
}
}
diff --git a/minuitwrp/minui.h b/minuitwrp/minui.h
index 03e15bb81..66e7f4f47 100644
--- a/minuitwrp/minui.h
+++ b/minuitwrp/minui.h
@@ -57,7 +57,7 @@ struct input_event;
int ev_init(void);
void ev_exit(void);
-int ev_get(struct input_event *ev, unsigned dont_wait);
+int ev_get(struct input_event *ev, unsigned dont_wait, int *screen_width, int *screen_height);
// Resources
diff --git a/minuitwrp/resources.c b/minuitwrp/resources.c
index 4c8d8a93f..c589c9d8a 100644
--- a/minuitwrp/resources.c
+++ b/minuitwrp/resources.c
@@ -30,7 +30,7 @@
#include <pixelflinger/pixelflinger.h>
#include <png.h>
-#include "../libjpegtwrp/jpeglib.h"
+#include "jpeglib.h"
#include "minui.h"