diff options
author | ehaupt <ehaupt@FreeBSD.org> | 2009-09-02 19:50:05 +0800 |
---|---|---|
committer | ehaupt <ehaupt@FreeBSD.org> | 2009-09-02 19:50:05 +0800 |
commit | c0ed87785232e410d401969fc6e8dbe68988e247 (patch) | |
tree | e55366c7a7f9d97750595c49ee3ace23d6d1bbe4 /x11 | |
parent | 3e7b5db151b423297093284a1949012c3de2d1a7 (diff) | |
download | freebsd-ports-gnome-c0ed87785232e410d401969fc6e8dbe68988e247.tar.gz freebsd-ports-gnome-c0ed87785232e410d401969fc6e8dbe68988e247.tar.zst freebsd-ports-gnome-c0ed87785232e410d401969fc6e8dbe68988e247.zip |
- Update to 1.8
- Implement HOME/END/LEFT/RIGHT keys
Submitted by: gahr
Diffstat (limited to 'x11')
-rw-r--r-- | x11/thinglaunch/Makefile | 5 | ||||
-rw-r--r-- | x11/thinglaunch/distinfo | 6 | ||||
-rw-r--r-- | x11/thinglaunch/files/patch-thinglaunch.c | 107 |
3 files changed, 109 insertions, 9 deletions
diff --git a/x11/thinglaunch/Makefile b/x11/thinglaunch/Makefile index 1a6b278f87e2..849813130204 100644 --- a/x11/thinglaunch/Makefile +++ b/x11/thinglaunch/Makefile @@ -6,15 +6,14 @@ # PORTNAME= thinglaunch -PORTVERSION= 1.03 -PORTREVISION= 3 +PORTVERSION= 1.8 CATEGORIES= x11 MASTER_SITES= CRITICAL MAINTAINER= ehaupt@FreeBSD.org COMMENT= A very fast launcher program for X -USE_XORG= x11 +USE_XORG= x11 xproto MAKE_JOBS_SAFE= yes CPPFLAGS= -I${LOCALBASE}/include -lX11 diff --git a/x11/thinglaunch/distinfo b/x11/thinglaunch/distinfo index 2a7205df1ae8..77c36b58ad18 100644 --- a/x11/thinglaunch/distinfo +++ b/x11/thinglaunch/distinfo @@ -1,3 +1,3 @@ -MD5 (thinglaunch-1.03.tar.gz) = 3442545e91ba18e43e46638c0a3b485a -SHA256 (thinglaunch-1.03.tar.gz) = cc2bad6eca5c86ce8d8cb5adfa4f6e18cc262e3cebfefe1fab93936eab5301ec -SIZE (thinglaunch-1.03.tar.gz) = 3315 +MD5 (thinglaunch-1.8.tar.gz) = 4aec300bba5c2f2b8ad22eab3b3df44a +SHA256 (thinglaunch-1.8.tar.gz) = 675ebfb65aabe5dc620e1594a9f500812d3327e4761e3bd947dc4a474c758fd1 +SIZE (thinglaunch-1.8.tar.gz) = 3303 diff --git a/x11/thinglaunch/files/patch-thinglaunch.c b/x11/thinglaunch/files/patch-thinglaunch.c index b4adcfae8184..917c3b6cdf2e 100644 --- a/x11/thinglaunch/files/patch-thinglaunch.c +++ b/x11/thinglaunch/files/patch-thinglaunch.c @@ -1,10 +1,111 @@ ---- ./thinglaunch.c.orig 2008-07-02 14:47:23.000000000 +0200 -+++ ./thinglaunch.c 2008-07-02 14:47:30.000000000 +0200 -@@ -23,6 +23,7 @@ +--- thinglaunch.c.orig 2004-09-20 16:27:56.000000000 +0200 ++++ thinglaunch.c 2009-09-01 22:11:10.000000000 +0200 +@@ -19,10 +19,14 @@ + */ + #include <X11/Xlib.h> + #include <X11/Xutil.h> ++#include <X11/keysymdef.h> + #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> ++#ifdef __FreeBSD__ +#include <libgen.h> ++#endif static void createWindow(); static void setupGC(); +@@ -50,10 +54,13 @@ + + /* the actual commandline */ + char command[MAXCMD+1]; ++size_t cursor_pos; + + int main(int argc, char ** argv) { + + command[0] = 0x0; ++ cursor_pos = 0; ++ + createWindow(); + + setupGC(); +@@ -209,15 +216,15 @@ + + int font_height; + int textwidth; +- ++ + font_height = font_info->ascent + font_info->descent; +- textwidth = XTextWidth(font_info, command, strlen(command)); ++ textwidth = XTextWidth(font_info, command, cursor_pos); + + XFillRectangle(display, win, rectgc, 0, 0, WINWIDTH, WINHEIGHT); + XDrawRectangle(display, win, gc, 0, 0, WINWIDTH-1, WINHEIGHT-1); + XDrawString(display, win, gc, 2, font_height+2, command, strlen(command)); +- XDrawLine(display, win, gc, 2 + textwidth, font_height + 2, +- 2 + textwidth + 10, font_height+2); ++ XDrawLine(display, win, gc, 2 + textwidth, font_height + 4, ++ 2 + textwidth + 10, font_height+4); + + XFlush(display); + +@@ -229,22 +236,36 @@ + #define KEYBUFLEN 20 + char buffer[KEYBUFLEN+1]; + KeySym key_symbol; +- int len; ++ int len, tmp_pos; + + len = XLookupString(keyevent, buffer, 1, &key_symbol, NULL); + buffer[len] = 0x0; ++ len = strlen(command); + + switch(key_symbol) { +- case 0xff1b: /* this is escape */ ++ case XK_Escape: + exit(0); + break; +- case 0xff08: /* backspace */ +- len = strlen(command); +- if (len > 0) { +- command[len-1] = 0x0; +- } ++ case XK_BackSpace: ++ if (cursor_pos) ++ for (tmp_pos = --cursor_pos; tmp_pos <= len; tmp_pos++) ++ command[tmp_pos] = command[tmp_pos+1]; ++ break; ++ case XK_Left: ++ if (cursor_pos) ++ cursor_pos--; ++ break; ++ case XK_Right: ++ if (cursor_pos < len) ++ cursor_pos++; ++ break; ++ case XK_Home: ++ cursor_pos = 0; ++ break; ++ case XK_End: ++ cursor_pos = len; + break; +- case 0xff0d: /* enter */ ++ case XK_Return: + execcmd(); + break; + default: +@@ -253,10 +274,11 @@ + + /* normal printable chars */ + if (key_symbol >= 0x20 && key_symbol <= 0x7e) { +- len = strlen(command); + if (len < MAXCMD) { +- command[len] = buffer[0]; +- command[len+1] = 0x0; ++ if (cursor_pos != len) ++ for (tmp_pos = len; tmp_pos > cursor_pos; tmp_pos--) ++ command[tmp_pos] = command[tmp_pos-1]; ++ command[cursor_pos++] = buffer[0]; + } + } + redraw(); |