summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2013-08-18 07:58:29 +0000
committerphintuka <phintuka>2013-08-18 07:58:29 +0000
commit474fd6ff97d28a6954eedda61e4e824e3a82000c (patch)
treed1ff0f3fb9357ba503096754ea2a0c36d978c6da
parent791c6a7a963f3d1c72b38b580f8ad0e92d31138c (diff)
downloadxineliboutput-474fd6ff97d28a6954eedda61e4e824e3a82000c.tar.gz
xineliboutput-474fd6ff97d28a6954eedda61e4e824e3a82000c.tar.bz2
vdr-sxfe: added simple touchscreen remote controller
-rw-r--r--frontend_local.c4
-rw-r--r--xine_fbfe_frontend.c4
-rw-r--r--xine_frontend_main.c16
-rw-r--r--xine_sxfe_frontend.c39
4 files changed, 52 insertions, 11 deletions
diff --git a/frontend_local.c b/frontend_local.c
index 1f871247..39ae4458 100644
--- a/frontend_local.c
+++ b/frontend_local.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_local.c,v 1.60 2012-03-19 11:57:18 phintuka Exp $
+ * $Id: frontend_local.c,v 1.61 2013-08-18 07:58:29 phintuka Exp $
*
*/
@@ -354,7 +354,7 @@ void cXinelibLocal::Action(void)
xc.hud_osd,
xc.opengl,
xc.modeswitch, xc.modeline, xc.display_aspect,
- 0/*no_x_kbd*/, 0/*gui_hotkeys*/,
+ 0/*no_x_kbd*/, 0/*gui_hotkeys*/, 0/*touchscreen*/,
xc.video_port,
xc.scale_video,
NULL,
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c
index 72ea5ed7..3727a0a3 100644
--- a/xine_fbfe_frontend.c
+++ b/xine_fbfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_fbfe_frontend.c,v 1.50 2012-03-19 11:51:22 phintuka Exp $
+ * $Id: xine_fbfe_frontend.c,v 1.51 2013-08-18 07:58:29 phintuka Exp $
*
*/
@@ -120,7 +120,7 @@ static int fbfe_display_open(frontend_t *this_gen,
int xpos, int ypos,
int width, int height, int fullscreen, int hud, int opengl,
int modeswitch, const char *modeline, int aspect,
- int no_x_kbd, int gui_hotkeys,
+ int no_x_kbd, int gui_hotkeys, int touchscreen,
const char *video_port, int scale_video,
const char *aspect_controller, int window_id)
{
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index 5d283350..5e843a99 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_main.c,v 1.103 2012-03-19 11:51:21 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.104 2013-08-18 07:58:29 phintuka Exp $
*
*/
@@ -152,6 +152,7 @@ static const char help_str[] =
" -x, --noxkbd Disable X11 keyboard input\n"
#endif
" -o, --hotkeys Enable frontend GUI hotkeys\n"
+ " -U, --touch Enable touch screen remote controller\n"
" -p, --shutdown=MIN[:CMD] Shutdown after MIN minutes of inactivity\n"
" Use CMD to perform shutdown (default: /sbin/shutdown)\n"
" -T, --terminal=dev Controlling TTY\n"
@@ -166,7 +167,7 @@ static const char help_str[] =
" are tried in following order:\n"
" local pipe, rtp, udp, tcp\n\n";
-static const char short_options[] = "HA:V:d:W:a:fg:Dw:h:B:nP:L:C:T:p:vsxlkobSRtur";
+static const char short_options[] = "HA:V:d:W:a:fg:Dw:h:B:nP:L:C:T:p:vsxlkoObSRtuUr";
static const struct option long_options[] = {
{ "help", no_argument, NULL, 'H' },
@@ -204,6 +205,7 @@ static const struct option long_options[] = {
{ "nokbd", no_argument, NULL, 'k' },
{ "noxkbd", no_argument, NULL, 'x' },
{ "hotkeys", no_argument, NULL, 'o' },
+ { "touch", no_argument, NULL, 'U' },
{ "daemon", no_argument, NULL, 'b' },
{ "slave", no_argument, NULL, 'S' },
@@ -225,6 +227,7 @@ int main(int argc, char *argv[])
int scale_video = 1, aspect = 1, modeswitch = 0;
int daemon_mode = 0, nokbd = 0, noxkbd = 0, slave_mode = 0;
int repeat_emu = 0;
+ int touchscreen = 0;
int window_id = WINDOW_ID_NONE;
int xmajor, xminor, xsub;
int c;
@@ -434,6 +437,13 @@ int main(int argc, char *argv[])
" LIRC PowerOff -> power off\n"
" LIRC Quit -> exit\n");
break;
+ case 'U': touchscreen = 1;
+ PRINTF("Touchscreen input enabled\n");
+ PRINTF("Display is divided to 4x3 buttons:\n");
+ PRINTF(" Menu Up Back Ok \n");
+ PRINTF(" Left Down Right \n");
+ PRINTF(" Red Green Yellow Blue\n");
+ break;
case 'b': nokbd = daemon_mode = 1;
PRINTF("Keyboard input disabled\n");
break;
@@ -550,7 +560,7 @@ int main(int argc, char *argv[])
/* Initialize display */
if (!fe->fe_display_open(fe, xpos, ypos, width, height, fullscreen, hud, opengl, modeswitch,
- "", aspect, noxkbd, gui_hotkeys,
+ "", aspect, noxkbd, gui_hotkeys, touchscreen,
video_port, scale_video,
aspect_controller, window_id)) {
fprintf(stderr, "Error opening display\n");
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index 9e7b27fd..7c55046f 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_sxfe_frontend.c,v 1.204 2012-03-19 11:51:21 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.205 2013-08-18 07:58:29 phintuka Exp $
*
*/
@@ -121,6 +121,9 @@ typedef struct sxfe_s {
#endif
Time prev_click_time; /* time of previous mouse button click (grab double clicks) */
int mousecursor_timeout;
+#ifdef HAVE_MCE_DBUS_NAMES
+ int mce_blank_prevent_timer;
+#endif
#ifdef HAVE_XDPMS
BOOL dpms_state;
#endif
@@ -159,6 +162,7 @@ typedef struct sxfe_s {
uint8_t dragging : 1;
uint8_t gui_hotkeys : 1;
uint8_t no_x_kbd : 1;
+ uint8_t touchscreen : 1;
/* OSD Video Window */
pthread_mutex_t video_win_mutex;
@@ -2238,7 +2242,7 @@ static int sxfe_display_open(frontend_t *this_gen,
int xpos, int ypos,
int width, int height, int fullscreen, int hud, int opengl,
int modeswitch, const char *modeline, int aspect,
- int no_x_kbd, int gui_hotkeys,
+ int no_x_kbd, int gui_hotkeys, int touchscreen,
const char *video_port, int scale_video,
const char *aspect_controller, int window_id)
{
@@ -2321,8 +2325,9 @@ static int sxfe_display_open(frontend_t *this_gen,
this->xinerama_screen = -1;
- this->gui_hotkeys = gui_hotkeys;
- this->no_x_kbd = no_x_kbd ? 1 : 0;
+ this->gui_hotkeys = !!gui_hotkeys;
+ this->no_x_kbd = !!no_x_kbd;
+ this->touchscreen = !!touchscreen;
/*
* init x11 stuff
@@ -2787,6 +2792,22 @@ static void XButtonEvent_handler(sxfe_t *this, XButtonEvent *bev)
{
switch(bev->button) {
case Button1:
+
+ if (this->touchscreen) {
+ int x = bev->x * 4 / this->x.width;
+ int y = bev->y * 3 / this->x.height;
+ static const char * const map[3][4] = {
+ {"Menu", "Up", "Back", "Ok"},
+ {"Left", "Down", "Right", "Ok"},
+ {"Red", "Green", "Yellow", "Blue"}};
+ if (map[y][x]) {
+ char tmp[128];
+ sprintf(tmp, "KEY %s", map[y][x]);
+ this->x.fe.send_event((frontend_t*)this, tmp);
+ }
+ return;
+ }
+
/* Double-click toggles between fullscreen and windowed mode */
if(bev->time - this->prev_click_time < DOUBLECLICK_TIME) {
/* Toggle fullscreen */
@@ -2861,6 +2882,16 @@ static int sxfe_run(frontend_t *this_gen)
poll_time = time_ms();
}
+#ifdef HAVE_MCE_DBUS_NAMES
+# ifdef HAVE_DBUS_GLIB_1
+ /* Disable MCE screensaver */
+ if (++this->mce_blank_prevent_timer > 100) {
+ gnome_screensaver_control(0);
+ this->mce_blank_prevent_timer = 0;
+ }
+# endif
+#endif
+
if (poll(&pfd, 1, poll_timeout) < 1 || !(pfd.revents & POLLIN)) {
if (this->mousecursor_timeout > 0) {