diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2011-01-02 02:07:27 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2011-01-02 02:07:27 +0100 |
commit | 0a95e15cdc87de0136734e784d487f9b03170bbb (patch) | |
tree | adae83e51ba5b78869f51aa43cfe8ebfb762ec41 /libnsfb/patches | |
download | nanonote-ports-0a95e15cdc87de0136734e784d487f9b03170bbb.tar.gz |
initial checkin of my nanonote ports feed, including a small README.
Diffstat (limited to 'libnsfb/patches')
-rw-r--r-- | libnsfb/patches/010-flags.patch | 11 | ||||
-rw-r--r-- | libnsfb/patches/020-no-cast-align-warn.patch | 11 | ||||
-rw-r--r-- | libnsfb/patches/030-remove-unused-frontends.patch | 18 | ||||
-rw-r--r-- | libnsfb/patches/200-sdl-kbdmouse.patch | 163 |
4 files changed, 203 insertions, 0 deletions
diff --git a/libnsfb/patches/010-flags.patch b/libnsfb/patches/010-flags.patch new file mode 100644 index 0000000..6dad1ac --- /dev/null +++ b/libnsfb/patches/010-flags.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2010-10-10 05:26:39.439706253 +0200 ++++ b/Makefile 2010-10-10 05:27:16.699713741 +0200 +@@ -16,7 +16,7 @@ + -Wmissing-declarations -Wnested-externs -Werror -pedantic \ + -Wno-overlength-strings # For nsglobe.c + CFLAGS := -g -std=c99 -D_BSD_SOURCE -I$(CURDIR)/include/ \ +- -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) ++ -I$(CURDIR)/src $(WARNFLAGS) $(CFLAGS) $(CPPFLAGS) + + # TODO: probably want to retrieve SDL from pkg-config + TESTLDFLAGS = -Wl,--whole-archive -l$(COMPONENT) -Wl,--no-whole-archive -lSDL -lxcb-icccm -lxcb -lxcb-image -lxcb-keysyms diff --git a/libnsfb/patches/020-no-cast-align-warn.patch b/libnsfb/patches/020-no-cast-align-warn.patch new file mode 100644 index 0000000..1ecaecd --- /dev/null +++ b/libnsfb/patches/020-no-cast-align-warn.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2010-10-10 05:53:28.609713613 +0200 ++++ b/Makefile 2010-10-10 05:53:42.499719955 +0200 +@@ -11,7 +11,7 @@ + TESTRUNNER = test/runtest.sh $(BUILDDIR) $(EXEEXT) + + # Toolchain flags +-WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align \ ++WARNFLAGS := -Wall -Wextra -Wundef -Wpointer-arith \ + -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ + -Wmissing-declarations -Wnested-externs -Werror -pedantic \ + -Wno-overlength-strings # For nsglobe.c diff --git a/libnsfb/patches/030-remove-unused-frontends.patch b/libnsfb/patches/030-remove-unused-frontends.patch new file mode 100644 index 0000000..7bf811d --- /dev/null +++ b/libnsfb/patches/030-remove-unused-frontends.patch @@ -0,0 +1,18 @@ +--- a/src/surface/Makefile 2010-10-10 06:21:54.469717609 +0200 ++++ b/src/surface/Makefile 2010-10-10 06:22:20.259716132 +0200 +@@ -1,4 +1,4 @@ + # Sources +-DIR_SOURCES := surface.c sdl.c vnc.c able.c ram.c linux.c x.c ++DIR_SOURCES := surface.c sdl.c ram.c linux.c + + include build/makefiles/Makefile.subdir +--- a/libnsfb.pc.in 2010-10-10 19:08:10.649146014 +0200 ++++ b/libnsfb.pc.in 2010-10-10 19:08:22.077902040 +0200 +@@ -6,6 +6,6 @@ + Name: libnsfb + Description: Provides framebuffer access for netsurf. + Version: VERSION +-Requires: sdl xcb xcb-icccm xcb-image xcb-keysyms ++Requires: sdl + Libs: -L${libdir} -lnsfb + Cflags: -I${includedir} diff --git a/libnsfb/patches/200-sdl-kbdmouse.patch b/libnsfb/patches/200-sdl-kbdmouse.patch new file mode 100644 index 0000000..660e220 --- /dev/null +++ b/libnsfb/patches/200-sdl-kbdmouse.patch @@ -0,0 +1,163 @@ +--- a/src/surface/sdl.c 2010-04-29 01:26:13.521908000 +0200 ++++ b/src/surface/sdl.c 2010-10-13 03:06:18.945784735 +0200 +@@ -6,6 +6,10 @@ + * http://www.opensource.org/licenses/mit-license.php + */ + ++#define _POSIX_SOURCE ++#include <sys/types.h> ++#include <unistd.h> ++#include <signal.h> + #include <stdbool.h> + #include <stdlib.h> + #include <SDL/SDL.h> +@@ -20,6 +24,10 @@ + #include "plot.h" + #include "cursor.h" + ++#ifdef KBDMOUSE ++#include KBDMOUSE ++#endif ++ + enum nsfb_key_code_e sdl_nsfb_map[] = { + NSFB_KEY_UNKNOWN, + NSFB_KEY_UNKNOWN, +@@ -470,7 +478,11 @@ + nsfb->linelen = sdl_screen->pitch; + + SDL_ShowCursor(SDL_DISABLE); ++#ifdef KBDMOUSE ++ SDL_EnableKeyRepeat(KBDMOUSE_REPEAT_DELAY, KBDMOUSE_REPEAT_INTERVAL); ++#else + SDL_EnableKeyRepeat(300, 50); ++#endif + + return 0; + } +@@ -497,6 +509,116 @@ + return 0; + } + ++#ifdef KBDMOUSE ++ ++static int keyboard_mouse(SDL_Event *event) ++{ ++ static int enabled = 1; ++ ++ SDL_Event new; ++ int x, y; ++ ++ if ((int)event->key.keysym.sym == KBDMOUSE_TOGGLE) { ++ if (event->type == SDL_KEYUP) ++ enabled = !enabled; ++ return 0; ++ } ++ ++ if (!enabled) ++ return -1; ++ ++ switch (event->type) { ++ case SDL_KEYDOWN: ++ switch ((int)event->key.keysym.sym) { ++ case KBDMOUSE_LEFT_CLICK: ++ case KBDMOUSE_RIGHT_CLICK: ++ SDL_GetMouseState(&x, &y); ++ ++ new.type = SDL_MOUSEBUTTONDOWN; ++ new.button.type = SDL_MOUSEBUTTONDOWN; ++ new.button.which = 0; ++ new.button.state = SDL_PRESSED; ++ new.button.x = (Uint16)x; ++ new.button.y = (Uint16)y; ++ ++ switch ((int)event->key.keysym.sym) { ++ case KBDMOUSE_LEFT_CLICK: new.button.button = SDL_BUTTON_LEFT; break; ++ case KBDMOUSE_RIGHT_CLICK: new.button.button = SDL_BUTTON_RIGHT; break; ++ } ++ ++ SDL_PushEvent(&new); ++ return 0; ++ ++ case KBDMOUSE_UP: ++ case KBDMOUSE_DOWN: ++ case KBDMOUSE_LEFT: ++ case KBDMOUSE_RIGHT: ++ SDL_GetMouseState(&x, &y); ++ ++ switch ((int)event->key.keysym.sym) { ++ case KBDMOUSE_UP: y -= KBDMOUSE_STEP; break; ++ case KBDMOUSE_DOWN: y += KBDMOUSE_STEP; break; ++ case KBDMOUSE_RIGHT: x += KBDMOUSE_STEP; break; ++ case KBDMOUSE_LEFT: x -= KBDMOUSE_STEP; break; ++ } ++ ++ SDL_WarpMouse((Uint16)x, (Uint16)y); ++ return 0; ++ ++ case KBDMOUSE_QUIT_HACK: ++ return 0; ++ } ++ break; ++ ++ case SDL_KEYUP: ++ switch ((int)event->key.keysym.sym) { ++ case KBDMOUSE_LEFT_CLICK: ++ case KBDMOUSE_RIGHT_CLICK: ++ SDL_GetMouseState(&x, &y); ++ ++ new.type = SDL_MOUSEBUTTONUP; ++ new.button.type = SDL_MOUSEBUTTONUP; ++ new.button.which = 0; ++ new.button.state = SDL_RELEASED; ++ new.button.x = (Uint16)x; ++ new.button.y = (Uint16)y; ++ ++ switch ((int)event->key.keysym.sym) { ++ case KBDMOUSE_LEFT_CLICK: new.button.button = SDL_BUTTON_LEFT; break; ++ case KBDMOUSE_RIGHT_CLICK: new.button.button = SDL_BUTTON_RIGHT; break; ++ } ++ ++ SDL_PushEvent(&new); ++ return 0; ++ ++ case KBDMOUSE_UP: ++ case KBDMOUSE_DOWN: ++ case KBDMOUSE_LEFT: ++ case KBDMOUSE_RIGHT: ++ return 0; ++ ++ case KBDMOUSE_QUIT_HACK: ++ kill(getpid(), SIGTERM); ++ return 0; ++ } ++ break; ++ ++ default: ++ break; ++ } ++ ++ return -1; ++} ++ ++#else ++ ++static int keyboard_mouse(SDL_Event *event __attribute__((unused))) ++{ ++ return -1; ++} ++ ++#endif ++ + static bool sdl_input(nsfb_t *nsfb, nsfb_event_t *event, int timeout) + { + int got_event; +@@ -526,6 +648,9 @@ + if (got_event == 0) + return false; + ++ if (!keyboard_mouse(&sdlevent)) ++ return false; ++ + event->type = NSFB_EVENT_NONE; + + switch (sdlevent.type) { |