📄 links-2.1pre19-xynth.diff
字号:
diff -U 3 -H -d -r -N links-2.1pre19/Makefile.am links-2.1pre19-xynth/Makefile.am--- links-2.1pre19/Makefile.am 2005-01-18 20:21:52.000000000 +0200+++ links-2.1pre19-xynth/Makefile.am 2005-12-02 13:54:15.000000000 +0200@@ -13,7 +13,7 @@ else endif -links_SOURCES=af_unix.c auth.c beos.c bfu.c block.c bookmarks.c builtin.c cache.c charsets.c connect.c context.c cookies.c default.c dip.c directfb.c directfb_cursors.h dither.c dns.c drivers.c error.c file.c finger.c font_include.c framebuffer.c ftp.c gif.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c ipret.c javascr.c javascript.c jpeg.c jsint.c kbd.c language.c links_icon.c listedit.c lru.c mailto.c main.c md5.c md5hl.c menu.c memory.c ns.c objreq.c os_dep.c pmshell.c png.c pomocny.c sched.c sdl.c select.c session.c smb.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c win32.c x.c xbm.c links.h cfg.h os_dep.h os_depx.h setup.h codepage.h language.h codepage.inc entity.inc uni_7b.inc language.inc arrow.inc md5.h ns.h struct.h tree.h typy.h ipret.h javascript.h builtin.h builtin_keys.h bits.h sdl_data.inc+links_SOURCES=af_unix.c auth.c beos.c bfu.c block.c bookmarks.c builtin.c cache.c charsets.c connect.c context.c cookies.c default.c dip.c directfb.c directfb_cursors.h dither.c dns.c drivers.c error.c file.c finger.c font_include.c framebuffer.c ftp.c gif.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c ipret.c javascr.c javascript.c jpeg.c jsint.c kbd.c language.c links_icon.c listedit.c lru.c mailto.c main.c md5.c md5hl.c menu.c memory.c ns.c objreq.c os_dep.c pmshell.c png.c pomocny.c sched.c sdl.c select.c session.c smb.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c win32.c x.c xbm.c xynth.c links.h cfg.h os_dep.h os_depx.h setup.h codepage.h language.h codepage.inc entity.inc uni_7b.inc language.inc arrow.inc md5.h ns.h struct.h tree.h typy.h ipret.h javascript.h builtin.h builtin_keys.h bits.h sdl_data.inc dist-hook: #remove the symlinka:diff -U 3 -H -d -r -N links-2.1pre19/Makefile.in links-2.1pre19-xynth/Makefile.in--- links-2.1pre19/Makefile.in 2005-10-05 17:31:59.000000000 +0300+++ links-2.1pre19-xynth/Makefile.in 2005-12-02 13:54:15.000000000 +0200@@ -77,7 +77,7 @@ @ATHEOS_GR_TRUE@links_LDADD = atheos.o -links_SOURCES = af_unix.c auth.c beos.c bfu.c block.c bookmarks.c builtin.c cache.c charsets.c connect.c context.c cookies.c default.c dip.c directfb.c directfb_cursors.h dither.c dns.c drivers.c error.c file.c finger.c font_include.c framebuffer.c ftp.c gif.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c ipret.c javascr.c javascript.c jpeg.c jsint.c kbd.c language.c links_icon.c listedit.c lru.c mailto.c main.c md5.c md5hl.c menu.c memory.c ns.c objreq.c os_dep.c pmshell.c png.c pomocny.c sched.c sdl.c select.c session.c smb.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c win32.c x.c xbm.c links.h cfg.h os_dep.h os_depx.h setup.h codepage.h language.h codepage.inc entity.inc uni_7b.inc language.inc arrow.inc md5.h ns.h struct.h tree.h typy.h ipret.h javascript.h builtin.h builtin_keys.h bits.h sdl_data.inc+links_SOURCES = af_unix.c auth.c beos.c bfu.c block.c bookmarks.c builtin.c cache.c charsets.c connect.c context.c cookies.c default.c dip.c directfb.c directfb_cursors.h dither.c dns.c drivers.c error.c file.c finger.c font_include.c framebuffer.c ftp.c gif.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c ipret.c javascr.c javascript.c jpeg.c jsint.c kbd.c language.c links_icon.c listedit.c lru.c mailto.c main.c md5.c md5hl.c menu.c memory.c ns.c objreq.c os_dep.c pmshell.c png.c pomocny.c sched.c sdl.c select.c session.c smb.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c win32.c x.c xbm.c xynth.c links.h cfg.h os_dep.h os_depx.h setup.h codepage.h language.h codepage.inc entity.inc uni_7b.inc language.inc arrow.inc md5.h ns.h struct.h tree.h typy.h ipret.h javascript.h builtin.h builtin_keys.h bits.h sdl_data.inc CXXFLAGS = @CXXFLAGS@ @@ -102,7 +102,7 @@ lru.o mailto.o main.o md5.o md5hl.o menu.o memory.o ns.o objreq.o \ os_dep.o pmshell.o png.o pomocny.o sched.o sdl.o select.o session.o \ smb.o svgalib.o terminal.o tiff.o types.o url.o view.o view_gr.o \-win32.o x.o xbm.o+win32.o x.o xbm.o xynth.o @ATHEOS_GR_TRUE@links_DEPENDENCIES = atheos.o links_LDFLAGS = CFLAGS = @CFLAGS@diff -U 3 -H -d -r -N links-2.1pre19/acconfig.h links-2.1pre19-xynth/acconfig.h--- links-2.1pre19/acconfig.h 2005-01-27 22:24:02.000000000 +0200+++ links-2.1pre19-xynth/acconfig.h 2005-12-02 13:54:15.000000000 +0200@@ -83,6 +83,9 @@ #undef GRDRV_SVGALIB /* */+#undef GRDRV_XYNTH++/* */ #undef GRDRV_FB /* */diff -U 3 -H -d -r -N links-2.1pre19/config.h.in links-2.1pre19-xynth/config.h.in--- links-2.1pre19/config.h.in 2005-10-05 17:31:56.000000000 +0300+++ links-2.1pre19-xynth/config.h.in 2005-12-02 13:54:15.000000000 +0200@@ -448,6 +448,9 @@ #undef GRDRV_SVGALIB /* */+#undef GRDRV_XYNTH++/* */ #undef GRDRV_FB /* */diff -U 3 -H -d -r -N links-2.1pre19/configure links-2.1pre19-xynth/configure--- links-2.1pre19/configure 2005-10-05 17:23:53.000000000 +0300+++ links-2.1pre19-xynth/configure 2005-12-02 13:54:15.000000000 +0200@@ -30,6 +30,8 @@ ac_help="$ac_help --without-svgalib compile without svgalib graphics driver" ac_help="$ac_help+ --without-xynth compile without Xynth Window System graphics driver"+ac_help="$ac_help --without-x compile without X Window System graphics driver" ac_help="$ac_help --without-fb compile without Linux Framebuffer graphics driver"@@ -5329,6 +5331,12 @@ if test "$withval" = no; then disable_svgalib=yes; else disable_svgalib=no; fi fi +# Check whether --with-xynth or --without-xynth was given.+if test "${with_xynth+set}" = set; then+ withval="$with_xynth"+ if test "$withval" = no; then disable_xynth=yes; else disable_xynth=no; fi+fi;+ # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x"@@ -5410,6 +5418,48 @@ fi fi +if test "$disable_xynth" != yes ; then+ echo $ac_n "checking for xynth""... $ac_c" 1>&6+echo "configure:5266: checking for xynth" >&5+if eval "test \"`echo '$''{'ac_cv_have_xynth'+set}'`\" = set"; then+ echo $ac_n "(cached) $ac_c" 1>&6+else+ LIBS_X="$LIBS"+ LIBS="-lxynth $LIBS"+ cat > conftest.$ac_ext <<EOF+#line 5241 "configure"+#include "confdefs.h"+#include <xynth.h>+int main() {+s_window_t *w;+s_client_init(&w)+; return 0; }+EOF+if { (eval echo configure:5241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then+ rm -rf conftest*+ ac_cv_have_xynth=yes+else+ echo "configure: failed program was:" >&5+ cat conftest.$ac_ext >&5+ rm -rf conftest*+ ac_cv_have_xynth=no+fi+rm -f conftest*+ LIBS="$LIBS_X"+ +fi++echo "$ac_t""$ac_cv_have_xynth" 1>&6++ if test "$ac_cv_have_xynth" = yes; then+ cat >> confdefs.h <<\EOF+#define GRDRV_XYNTH 1+EOF++ LIBS="-lxynth $LIBS"+ drivers="$drivers XYNTH"+ fi+fi if test "$disable_fb" != yes ; then for ac_hdr in linux/fb.hdiff -U 3 -H -d -r -N links-2.1pre19/configure.in links-2.1pre19-xynth/configure.in--- links-2.1pre19/configure.in 2005-10-05 17:12:26.000000000 +0300+++ links-2.1pre19-xynth/configure.in 2005-12-02 13:54:15.000000000 +0200@@ -340,6 +340,7 @@ # CPPFLAGS="$CPPFLAGS -I/usr/local/include" # LDFLAGS="$LDFLAGS -L/usr/local/lib" AC_ARG_WITH(svgalib, [ --without-svgalib compile without svgalib graphics driver],[if test "$withval" = no; then disable_svgalib=yes; else disable_svgalib=no; fi])+AC_ARG_WITH(xynth, [ --without-xynth compile without Xynth Window System graphics driver],[if test "$withval" = no; then disable_xynth=yes; else disable_xynth=no; fi]) AC_ARG_WITH(x, [ --without-x compile without X Window System graphics driver],[if test "$withval" = no; then disable_x=yes; else disable_x=no; fi]) AC_ARG_WITH(fb, [ --without-fb compile without Linux Framebuffer graphics driver],[if test "$withval" = no; then disable_fb=yes; else disable_fb=no; fi]) AC_ARG_WITH(directfb, [ --without-directfb compile without DirectFB graphics driver],[if test "$withval" = no; then disable_directfb=yes; else disable_directfb=no; fi])@@ -364,6 +365,25 @@ fi fi +if test "$disable_xynth" != yes ; then+ AC_CACHE_CHECK([for xynth], ac_cv_have_xynth,+ LIBS_X="$LIBS"+ LIBS="$LIBS -lxynth"+ CFLAGS_X="$CFLAGS"+ CFLAGS="$CFLAGS `freetype-config --cflags`"+ AC_TRY_LINK([#include <xynth.h>], [s_client_init((s_client_t **) NULL)], ac_cv_have_xynth=yes, ac_cv_have_xynth=no)+ LIBS="$LIBS_X"+ CFLAGS="$CFLAGS_X"+ )++ if test "$ac_cv_have_xynth" = yes; then+ AC_DEFINE(GRDRV_XYNTH)+ LIBS="$LIBS -lxynth"+ CFLAGS="$CFLAGS `freetype-config --cflags`"+ drivers="$drivers XYNTH"+ fi+fi+ dnl braine, tohle jsem predelal dnl AC_CACHE_CHECK([for framebuffer], ac_cv_have_fb, dnl AC_TRY_RUN([#include <stdio.h>diff -U 3 -H -d -r -N links-2.1pre19/drivers.c links-2.1pre19-xynth/drivers.c--- links-2.1pre19/drivers.c 2005-01-02 20:45:16.000000000 +0200+++ links-2.1pre19-xynth/drivers.c 2005-12-02 13:54:15.000000000 +0200@@ -19,6 +19,9 @@ #ifdef GRDRV_SVGALIB extern struct graphics_driver svga_driver; #endif+#ifdef GRDRV_XYNTH+extern struct graphics_driver xynth_driver;+#endif #ifdef GRDRV_FB extern struct graphics_driver fb_driver; #endif@@ -54,6 +57,9 @@ #ifdef GRDRV_SVGALIB &svga_driver, #endif+#ifdef GRDRV_XYNTH+ &xynth_driver,+#endif #ifdef GRDRV_SDL &sdl_driver, #endifdiff -U 3 -H -d -r -N links-2.1pre19/xynth.c links-2.1pre19-xynth/xynth.c--- links-2.1pre19/xynth.c 1970-01-01 02:00:00.000000000 +0200+++ links-2.1pre19-xynth/xynth.c 2005-10-04 22:20:24.000000000 +0300@@ -0,0 +1,840 @@++#include "cfg.h"++#ifdef GRDRV_XYNTH++#include "links.h"+#include "bits.h"++#include <ctype.h>+#include <xynth.h>++//#define DEBUGF printf+#define DEBUGF++#define MIN(a, b) ((a) < (b) ? (a) : (b))+#define MAX(a, b) ((a) > (b) ? (a) : (b))++extern struct graphics_driver xynth_driver;++typedef struct lxynth_device_s {+ char *title;+ s_rect_t update;+ s_surface_t *surface;+} lxynth_device_t;++typedef struct lxynth_eventq_s {+ s_list_t *list;+ s_thread_mutex_t *mut;+} lxynth_eventq_t;++typedef struct lxynth_gd_s {+ s_list_t *list;+ s_thread_mutex_t *mut;+ struct graphics_device *active;+} lxynth_gd_t;++typedef struct lxynth_root_s {+ int timerid;+ int running;+ s_thread_t *tid;+ s_window_t *window;+ lxynth_eventq_t *eventq;+ lxynth_gd_t *gd;+} lxynth_root_t;++static lxynth_root_t *lxynth_root = NULL;+static void lxynth_set_title (struct graphics_device *dev, unsigned char *title);++static void lxynth_surface_register_update (void *dev)+{+ lxynth_device_t *wd;+ if (lxynth_root->running == 0) return;+ s_thread_mutex_lock(lxynth_root->gd->mut);+ if (lxynth_root->gd->active != dev) {+ s_thread_mutex_unlock(lxynth_root->gd->mut);+ return;+ }+ wd = (lxynth_device_t *) ((struct graphics_device *) dev)->driver_data;+ s_putboxpart(lxynth_root->window->surface, wd->update.x, wd->update.y, wd->update.w, wd->update.h, wd->surface->width, wd->surface->height, wd->surface->vbuf, wd->update.x, wd->update.y);+ wd->update = (s_rect_t) {-1, -1, -1, -1};+ s_thread_mutex_unlock(lxynth_root->gd->mut);+}++static void lxynth_surface_update (struct graphics_device *dev, int x, int y, int w, int h)+{+ s_rect_t rect;+ lxynth_device_t *wd;+ wd = (lxynth_device_t *) dev->driver_data;+ rect = wd->update;+ if (rect.x >= 0) { wd->update.x = MIN(rect.x, x); } else { wd->update.x = x; }+ if (rect.y >= 0) { wd->update.y = MIN(rect.y, y); } else { wd->update.y = y; }+ if (rect.w >= 0) { wd->update.w = MAX(rect.x + rect.w, x + w) - wd->update.x; } else { wd->update.w = w; }+ if (rect.h >= 0) { wd->update.h = MAX(rect.y + rect.h, y + h) - wd->update.y; } else { wd->update.h = h; }+ register_bottom_half(lxynth_surface_register_update, dev);+}++static void lxynth_event_parse_mouse (s_event_t *event)+{+ int x;+ int y;+ int flag = 0;++ x = event->mouse->x - lxynth_root->window->surface->buf.x;+ y = event->mouse->y - lxynth_root->window->surface->buf.y;+ if ((x < 0) || (x > lxynth_root->window->surface->buf.w) ||+ (y < 0) || (y > lxynth_root->window->surface->buf.h)) {+ return;+ }+ switch (event->mouse->b) {+ case 1: flag = B_RIGHT; break;+ case 2: flag = B_MIDDLE; break;+ case 4: flag = B_LEFT; break;+ }+ if (event->type & MOUSE_PRESSED) {+ flag |= B_DOWN;+ if (event->mouse->b == MOUSE_WHEELXBUTTON_U) {+ flag = B_MOVE | B_WHEELUP;+ } else if (event->mouse->b == MOUSE_WHEELXBUTTON_D) {+ flag = B_MOVE | B_WHEELDOWN;+ } else if (event->mouse->b == MOUSE_WHEELYBUTTON_U) {+ flag = B_MOVE | B_WHEELLEFT;+ } else if (event->mouse->b == MOUSE_WHEELYBUTTON_D) {+ flag = B_MOVE | B_WHEELRIGHT;+ }+ } else if (event->type & (MOUSE_RELEASED | MOUSE_CLICKED)) {+ flag |= B_UP;+ } else {+ if (event->mouse->buttons) {+ flag |= B_DRAG;+ } else {+ flag |= B_MOVE;+ }+ }+ lxynth_root->gd->active->mouse_handler(lxynth_root->gd->active, x, y, flag);+}++static void lxynth_event_parse_keybd (s_event_t *event)+{+ int k = 0;+ int flag = 0;++ if (!(event->type & KEYBD_PRESSED)) {+ return;+ }+ switch (event->keybd->keycode) {+ case S_KEYCODE_RETURN: k = KBD_ENTER; break;+ case S_KEYCODE_DELETE: k = KBD_BS; break;+ case S_KEYCODE_TAB: k = KBD_TAB; break;+ case S_KEYCODE_ESCAPE: k = KBD_ESC; break;+ case S_KEYCODE_UP: k = KBD_UP; break;+ case S_KEYCODE_DOWN: k = KBD_DOWN; break;+ case S_KEYCODE_LEFT: k = KBD_LEFT; break;+ case S_KEYCODE_RIGHT: k = KBD_RIGHT; break;+ case S_KEYCODE_INSERT: k = KBD_INS; break;+ case S_KEYCODE_REMOVE: k = KBD_DEL; break;+ case S_KEYCODE_HOME: k = KBD_HOME; break;+ case S_KEYCODE_END: k = KBD_END; break;+ case S_KEYCODE_PAGEUP: k = KBD_PAGE_UP;break;+ case S_KEYCODE_PAGEDOWN:k = KBD_PAGE_DOWN;break;+ case S_KEYCODE_F1: k = KBD_F1; break;+ case S_KEYCODE_F2: k = KBD_F2; break;+ case S_KEYCODE_F3: k = KBD_F3; break;+ case S_KEYCODE_F4: k = KBD_F4; break;+ case S_KEYCODE_F5: k = KBD_F5; break;+ case S_KEYCODE_F6: k = KBD_F6; break;+ case S_KEYCODE_F7: k = KBD_F7; break;+ case S_KEYCODE_F8: k = KBD_F8; break;+ case S_KEYCODE_F9: k = KBD_F9; break;+ case S_KEYCODE_F10: k = KBD_F10; break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -