#include <linux/input.h>
#include "io.h"
-
-#define RC_DEVICE "/dev/input/nevis_ir"
+#include "rc_device.h"
extern int instance;
struct input_event ev;
int InitRC(void)
{
- rc = open(RC_DEVICE, O_RDONLY);
+ rc = open(RC_DEVICE, O_RDONLY | O_CLOEXEC);
+ if(rc == -1)
+ rc = open(RC_DEVICE_FALLBACK, O_RDONLY | O_CLOEXEC);
if(rc == -1)
{
- perror("msgbox <open remote control>");
+ perror("logomask <open remote control>");
exit(1);
}
fcntl(rc, F_SETFL, O_NONBLOCK | O_SYNC);
#define __IO_H__
-#define RC_DEVICE "/dev/input/nevis_ir"
-
int InitRC(void);
int CloseRC(void);
int RCKeyPressed(void);
+int GetRCCode();
#endif
extern int FSIZE_MED;
extern int FSIZE_SMALL;
-#define NCF_FILE "/var/tuxbox/config/neutrino.conf"
-#define CFG_FILE "/var/tuxbox/config/logomask.conf"
-#define CL_VERSION "1.2"
+#define CL_VERSION "1.3"
#define MAX_MASK 16
// TRANSP, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, TURQUOISE,
tv=3;
--tv;
- fb = open(FB_DEVICE, O_RDWR);
+ /* open Framebuffer */
+ fb=open(FB_DEVICE, O_RDWR);
+ if (fb < 0)
+ fb=open(FB_DEVICE_FALLBACK, O_RDWR);
+
+ if (fb < 0) {
+ perror("logomask <open framebuffer>");
+ exit(1);
+ }
if(ioctl(fb, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1)
{
#include <sys/socket.h>
#include <sys/un.h>
+#ifndef FB_DEVICE
+#define FB_DEVICE "/dev/fb/0"
+#endif
+#ifndef FB_DEVICE_FALLBACK
+#define FB_DEVICE_FALLBACK "/dev/fb0"
+#endif
+#ifndef CONFIGDIR
+#define CONFIGDIR "/var/tuxbox/config"
+#endif
+
+#define NCF_FILE CONFIGDIR "/neutrino.conf"
+#define CFG_FILE CONFIGDIR "/logomask.conf"
+
+#define BUFSIZE 4096
+
// rc codes
#undef KEY_EPG
struct fb_fix_screeninfo fix_screeninfo;
struct fb_var_screeninfo var_screeninfo;
-#define FB_DEVICE "/dev/fb/0"
-
-#define BUFSIZE 4096
-
#endif
extern int FSIZE_MED;
extern int FSIZE_SMALL;
-static unsigned char NCF_FILE[]="/var/tuxbox/config/neutrino.conf";
-static unsigned char CFG_FILE[]="/var/tuxbox/config/logomask.conf";
-static unsigned char AST_FILE[]="/var/etc/init.d/S9L_logomask";
-static unsigned char AST_TEXT[]="#!/bin/sh\n(sleep 20; logomask) &\n";
-unsigned char FONT[64]= "/share/fonts/pakenham.ttf";
+static unsigned char NCF_FILE[] = CONFIGDIR "/neutrino.conf";
+static unsigned char CFG_FILE[] = CONFIGDIR "/logomask.conf";
+static unsigned char AST_FILE[] = "/var/etc/init.d/S9L_logomask";
+static unsigned char AST_TEXT[] = "#!/bin/sh\n(sleep 20; logomask) &\n";
+unsigned char FONT[64] = FONTDIR "/pakenham.ttf";
-#define CL_VERSION "1.2a"
+#define CL_VERSION "1.3a"
#define MAX_MASK 16
// TRANSP, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, TURQUOISE,
#include FT_CACHE_H
#include FT_CACHE_SMALL_BITMAPS_H
+#ifndef FB_DEVICE
+#define FB_DEVICE "/dev/fb/0"
+#endif
+#ifndef FB_DEVICE_FALLBACK
+#define FB_DEVICE_FALLBACK "/dev/fb0"
+#endif
+#ifndef CONFIGDIR
+#define CONFIGDIR "/var/tuxbox/config"
+#endif
+#ifndef FONTDIR
+#define FONTDIR "/share/fonts"
+#endif
+
+#define BUFSIZE 4096
+
// rc codes
#undef KEY_EPG
struct fb_fix_screeninfo fix_screeninfo;
struct fb_var_screeninfo var_screeninfo;
-#define FB_DEVICE "/dev/fb/0"
-
-#define BUFSIZE 4096
-
#endif
--- /dev/null
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if HAVE_COOL_HARDWARE
+#define RC_DEVICE "/dev/input/nevis_ir"
+#define RC_DEVICE_FALLBACK "/dev/input/event0"
+
+#elif HAVE_SPARK_HARDWARE
+#define RC_DEVICE "/dev/input/nevis_ir"
+#define RC_DEVICE_FALLBACK "/dev/input/event1"
+
+#elif HAVE_DUCKBOX_HARDWARE
+#define RC_DEVICE "/dev/input/event0"
+#define RC_DEVICE_FALLBACK "/dev/input/event1"
+#else
+#define RC_DEVICE "/dev/input/event1"
+#define RC_DEVICE_FALLBACK "/dev/input/event0"
+
+#endif
+
#include <plugin.h>
#define SCRIPT "logomask"
-int main(void)
+void main(void)
{
int ret, pid, status;
pid=fork();
fprintf(stderr, "[%s.so] forked, executing %s\n", SCRIPT, SCRIPT);
for (ret=3 ; ret < 255; ret++)
close (ret);
- ret = system("/bin/logomask.sh");
+ ret = system("logomask.sh");
if (ret)
fprintf(stderr, "[%s.so] script return code: %d (%m)\n", SCRIPT, ret);
else
fprintf(stderr, "[%s.so] parent, waitpid() returned..\n", SCRIPT);
if (WIFEXITED(status))
fprintf(stderr, "[%s.so] child returned with status %d\n", SCRIPT, WEXITSTATUS(status));
- return 0;
}