Removed dependency to cflib,

call EvntWindom only one time per sec. when active flag is set. 

svn path=/trunk/netsurf/; revision=12443
This commit is contained in:
Ole Loots 2011-05-24 21:44:20 +00:00
parent 381588bece
commit 2f6520e8b4
9 changed files with 1334 additions and 21 deletions

View File

@ -5,10 +5,8 @@
$(eval $(call feature_enabled,MNG,-DWITH_MNG,-lmng,PNG/MNG/JNG (libmng)))
$(eval $(call feature_enabled,PNG,-DWITH_PNG,-lpng,PNG (libpng) ))
LDFLAGS += -lcflib
CFLAGS += -DATARI_USE_FREETYPE $(shell freetype-config --cflags)
LDFLAGS += $(shell freetype-config --libs)
LDFLAGS += -lfreetype
# define additional CFLAGS and LDFLAGS requirements for pkg-configed libs here
NETSURF_FEATURE_RSVG_CFLAGS := -DWITH_RSVG
@ -16,10 +14,11 @@ NETSURF_FEATURE_HUBBUB_CFLAGS := -DWITH_HUBBUB
NETSURF_FEATURE_BMP_CFLAGS := -DWITH_BMP
NETSURF_FEATURE_GIF_CFLAGS := -DWITH_GIF
#LDFLAGS += -lnsbmp -lnsgif
$(eval $(call pkg_config_find_and_add,BMP,libnsbmp,BMP))
$(eval $(call pkg_config_find_and_add,GIF,libnsgif,GIF))
CFLAGS += -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \
CFLAGS += -U__STRICT_ANSI__ -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \
-D_BSD_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
@ -27,9 +26,10 @@ CFLAGS += -std=c99 -I. -Dsmall $(WARNFLAGS) -Dnsatari \
$(shell xml2-config --cflags) \
$(shell curl-config --cflags)
LDFLAGS += $(shell curl-config --libs)
LDFLAGS += $(shell $(PKG_CONFIG) --libs libhubbub openssl libcss)
LDFLAGS += -L/usr/lib/ -lxml2 -lz -lHermes -liconv -L/usr/lib -lwindom -lgem -lm
LDFLAGS += -lcurl
LDFLAGS += -lhubbub -lcss -lparserutils -lwapcaplet
LDFLAGS += -lssl -lcrypto
LDFLAGS += -lxml2 -lz -liconv -lHermes -lwindom -lgem -lm
# S_ATARI are sources purely for the Atari FreeMiNT build
@ -39,7 +39,8 @@ S_ATARI := gui.c findfile.c filetype.c misc.c bitmap.c schedule.c \
plot.c plot/plotter.c plot/plotter_vdi.c plot/eddi.s \
plot/font_vdi.c plot/font_freetype.c plot/font_internal.c \
browser_win.c toolbar.c statusbar.c browser.c \
global_evnt.c osspec.c dragdrop.c system_colour.c
global_evnt.c osspec.c dragdrop.c system_colour.c \
nkccgc.c nkcc.s
S_ATARI := $(addprefix atari/,$(S_ATARI))

View File

@ -24,7 +24,6 @@
#include <stdbool.h>
#include <assert.h>
#include <windom.h>
#include <cflib.h>
#include "desktop/gui.h"
#include "desktop/netsurf.h"
@ -44,6 +43,7 @@
#include "atari/plot/plotter.h"
#include "atari/plot.h"
#include "atari/font.h"
#include "atari/nkcc.h"
extern browser_mouse_state bmstate;
extern int mouse_click_time[3];
@ -908,9 +908,14 @@ static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff )
));
current_redraw_browser = b->bw;
struct rect a;
a.x0 = b->redraw.area.x0;
a.y0 = b->redraw.area.y0;
a.x1 = b->redraw.area.x1;
a.y1 = b->redraw.area.y1;
browser_window_redraw( b->bw, -b->scroll.current.x,
-b->scroll.current.y, &b->redraw.area );
-b->scroll.current.y, &a );
current_redraw_browser = NULL;
}
@ -1092,4 +1097,4 @@ static void __CDECL browser_evnt_redraw( COMPONENT * c, long buff[8], void * dat
}
return;
}
}

View File

@ -24,7 +24,6 @@
#include <stdbool.h>
#include <assert.h>
#include <windom.h>
#include <cflib.h>
#include "desktop/gui.h"
#include "desktop/netsurf.h"
@ -46,6 +45,7 @@
#include "atari/res/netsurf.rsh"
#include "atari/search.h"
#include "atari/options.h"
#include "atari/nkcc.h"
extern const char * cfg_homepage_url;
extern struct gui_window *input_window;

View File

@ -29,7 +29,6 @@
#include <string.h>
#include <stdbool.h>
#include <windom.h>
#include <cflib.h>
#include <hubbub/hubbub.h>
#include "content/urldb.h"
@ -75,6 +74,7 @@
#include "atari/clipboard.h"
#include "atari/osspec.h"
#include "atari/search.h"
#include "atari/nkcc.h"
#define TODO() (0)/*printf("%s Unimplemented!\n", __FUNCTION__)*/
@ -93,6 +93,7 @@ int mouse_click_time[3] = { INT_MAX, INT_MAX, INT_MAX };
int mouse_hold_start[3];
short last_drag_x;
short last_drag_y;
long next_poll;
browser_mouse_state bmstate;
/* Comandline / Options: */
@ -121,15 +122,13 @@ void gui_poll(bool active)
short aestop;
evnt.timer = schedule_run();
if ( active || browser_reformat_pending )
evnt.timer = 0;
wind_get( 0, WF_TOP, &aestop, &winloc[1], &winloc[2], &winloc[3]);
if( winloc[1] != _AESapid ){
aestop = 0;
}
if(aestop > 0) {
if( (aestop > 0) && !active ) {
flags |= MU_M1;
wind_get( aestop, WF_WORKXYWH, &winloc[0],
&winloc[1], &winloc[2], &winloc[3] );
@ -152,10 +151,18 @@ void gui_poll(bool active)
/*printf("time: %d, active: %d, pending: %d\n", evnt.timer,
active, browser_reformat_pending );*/
if( evnt.timer > 0 ) {
if( active ) {
if( clock() >= next_poll ) {
evnt.timer = 0;
flags |= MU_TIMER;
EvntWindom( flags );
next_poll = clock() + CLOCKS_PER_SEC;
}
} else {
flags |= MU_TIMER;
EvntWindom( flags );
EvntWindom( flags );
}
struct gui_window * g;
for( g = window_list; g != NULL; g=g->next ) {
if( browser_redraw_required( g ) ){

185
atari/nkcc.h Executable file
View File

@ -0,0 +1,185 @@
/*
* $Id: nkcc.h,v 1.4 2010/10/16 21:21:51 hek Exp $
*
* XaAES - XaAES Ain't the AES (c) 1992 - 1998 C.Graham
* 1999 - 2003 H.Robbers
* 2004 F.Naumann & O.Skancke
*
* A multitasking AES replacement for FreeMiNT
*
* This file is part of XaAES.
*
* XaAES is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* XaAES is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XaAES; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* Project name : NORMALIZED KEY CODE CONVERTER (NKCC)
* Module name : Global definitions
* Symbol prefix: nkc
*
* Author : Harald Siegmund (HS)
* Co-Authors : Henk Robbers (Reductions for use in XaAES)
* Write access : HS
*/
#ifndef _nkcc_h
#define _nkcc_h
/* flags for NKCC initialization */
#define NKI_BUTHND 0x00000001UL /* install button event handler */
#define NKI_BHTOS 0x00000002UL /* additional flag: only if TOS has */
/* mouse click bug */
#define NKI_NO200HZ 0x00000004UL /* don't install 200 Hz clock interrupt */
/* (this flag is ignored if the button */
/* event handler is being activated) */
/* flag combinations for compatibility with old versions of NKCC */
#define BE_ON NKI_BUTHND
#define BE_OFF 0
#define BE_TOS (NKI_BUTHND | NKI_BHTOS)
/* flags for special key code handling */
#define NKS_ALTNUM 0x00000001UL /* Alt + numeric pad -> ASCII */
#define NKS_CTRL 0x00000002UL /* Control key emulation */
/* deadkey management: */
#define NKS_D_CIRCUM 0x00010000UL /* ^ accent circumflex */
#define NKS_D_TILDE 0x00020000UL /* ~ accent tilde */
#define NKS_D_AGUI 0x00040000UL /* ' accent agui */
#define NKS_D_GRAVE 0x00080000UL /* ` accent grave */
#define NKS_D_UMLAUT 0x00100000UL /* ¹ umlaut */
#define NKS_D_QUOTE 0x00200000UL /* " quote, synonym for umlaut */
#define NKS_D_SMOERE 0x00400000UL /* ø smoerebroed */
#define NKS_D_CEDIL 0x00800000UL /* , cedil */
#define NKS_D_SLASH 0x01000000UL /* / slash, for scandinavian characters */
#define NKS_DEADKEY 0xffff0000UL /* all deadkeys */
/* NKCC key code flags */
#define NKF_FUNC 0x8000 /* function */
#define NKF_RESVD 0x4000 /* resvd, ignore it! */
#define NKF_NUM 0x2000 /* numeric pad */
#define NKF_CAPS 0x1000 /* CapsLock */
#define NKF_ALT 0x0800 /* Alternate */
#define NKF_CTRL 0x0400 /* Control */
#define NKF_SHIFT 0x0300 /* any Shift key */
#define NKF_LSH 0x0200 /* left Shift key */
#define NKF_RSH 0x0100 /* right Shift key */
#define NKF_IGNUM NKF_RESVD /* special flag for nkc_cmp() */
/* special key codes for keys performing a function */
#define NK_INVALID 0x00 /* invalid key code */
#define NK_UP 0x01 /* cursor up */
#define NK_DOWN 0x02 /* cursor down */
#define NK_RIGHT 0x03 /* cursor right */
#define NK_LEFT 0x04 /* cursor left */
#define NK_M_PGUP 0x05 /* MAC Page up */
#define NK_M_PGDOWN 0x06 /* MAC Page down */
#define NK_M_END 0x07 /* reserved! */
#define NK_BS 0x08 /* Backspace */
#define NK_TAB 0x09 /* Tab */
#define NK_ENTER 0x0a /* Enter */
#define NK_INS 0x0b /* Insert */
#define NK_CLRHOME 0x0c /* Clr/Home */
#define NK_HOME 0x0c /* Clr/Home */
#define NK_RET 0x0d /* Return */
#define NK_HELP 0x0e /* Help */
#define NK_UNDO 0x0f /* Undo */
#define NK_F1 0x10 /* function key #1 */
#define NK_F2 0x11 /* function key #2 */
#define NK_F3 0x12 /* function key #3 */
#define NK_F4 0x13 /* function key #4 */
#define NK_F5 0x14 /* function key #5 */
#define NK_F6 0x15 /* function key #6 */
#define NK_F7 0x16 /* function key #7 */
#define NK_F8 0x17 /* function key #8 */
#define NK_F9 0x18 /* function key #9 */
#define NK_F10 0x19 /* function key #10 */
#define NK_RVD1A 0x1a /* reserved! */
#define NK_ESC 0x1b /* Esc */
#define NK_RVD1C 0x1c /* reserved! */
#define NK_RVD1D 0x1d /* reserved! */
#define NK_RVD1E 0x1e /* reserved! */
#define NK_DEL 0x1f /* Delete */
/* terminator for key code tables */
#define NK_TERM ((int)(NKF_FUNC | NK_INVALID))
/* ASCII codes less than 32 */
#define NUL 0x00 /* Null */
#define SOH 0x01 /* Start Of Header */
#define STX 0x02 /* Start Of Text */
#define ETX 0x03 /* End Of Text */
#define EOT 0x04 /* End Of Transmission */
#define ENQ 0x05 /* Enquiry */
#define ACK 0x06 /* positive Acknowledgement */
#define BEL 0x07 /* Bell */
#define BS 0x08 /* BackSpace */
#define HT 0x09 /* Horizontal Tab */
#define LF 0x0a /* Line Feed */
#define VT 0x0b /* Vertical Tab */
#define FF 0x0c /* Form Feed */
#define CR 0x0d /* Carriage Return */
#define SO 0x0e /* Shift Out */
#define SI 0x0f /* Shift In */
#define DLE 0x10 /* Data Link Escape */
#define DC1 0x11 /* Device Control 1 */
#define XON 0x11 /* same as DC1 */
#define DC2 0x12 /* Device Control 2 */
#define DC3 0x13 /* Device Control 3 */
#define XOFF 0x13 /* same as DC3 */
#define DC4 0x14 /* Device Control 4 */
#define NAK 0x15 /* Negative Acknowledgement */
#define SYN 0x16 /* Synchronize */
#define ETB 0x17 /* End of Transmission Block */
#define CAN 0x18 /* Cancel */
#define EM 0x19 /* End of Medium */
#define SUB 0x1a /* Substitute */
#define ESC 0x1b /* Escape */
#define FS 0x1c /* Form Separator */
#define GS 0x1d /* Group Separator */
#define RS 0x1e /* Record Separator */
#define US 0x1f /* Unit Separator */
/* XBRA vector link/unlink modes */
#define NKXM_NUM 0 /* by vector number */
#define NKXM_ADR 1 /* by vector address */
/* additional flag in event mask */
#define MU_XTIMER 0x100
/* deinstall NKCC */
int nkc_exit(void);
/* from cflib */
short nkc_init(void);
unsigned short nkc_tos2n(long toskey);
unsigned short gem_to_norm(short ks, short kr);
/* XaAES used names */
#define nkc_tconv nkc_tos2n
#define normkey gem_to_norm
#endif /* _nkcc_h */

1067
atari/nkcc.s Executable file

File diff suppressed because it is too large Load Diff

48
atari/nkccgc.c Executable file
View File

@ -0,0 +1,48 @@
/*
* $Id: nkcc.c,v 1.4 2010/10/16 21:21:51 hek Exp $
*
* XaAES - XaAES Ain't the AES (c) 1992 - 1998 C.Graham
* 1999 - 2003 H.Robbers
* 2004 F.Naumann & O.Skancke
*
* A multitasking AES replacement for FreeMiNT
*
* This file is part of XaAES.
*
* XaAES is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* XaAES is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XaAES; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "atari/nkcc.h"
//#include "nkcc.h"
unsigned short
gem_to_norm (short ks, short kr)
{
unsigned short knorm;
knorm = nkc_tos2n (((long) (kr & 0xff) | /* ascii Bits 0-7 */
(((long) kr & 0x0000ff00L) << 8L) | /* scan Bits 16-23 */
((long) (ks & 0xff) << 24L))); /* kstate Bits 24-31 */
return knorm;
}
int
nkc_exit(void)
{
/* dummy */
return 0;
}

View File

@ -25,7 +25,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <windom.h>
#include <cflib.h>
#include <assert.h>
#include <math.h>
@ -44,6 +43,7 @@
#include "atari/clipboard.h"
#include "atari/misc.h"
#include "atari/global_evnt.h"
#include "atari/nkcc.h"
#include "atari/res/netsurf.rsh"
#include "atari/plot/plotter.h"

View File

@ -22,7 +22,6 @@
#include <string.h>
#include <time.h>
#include <windom.h>
#include <cflib.h>
#include "content/urldb.h"
#include "desktop/browser.h"
@ -38,6 +37,7 @@
#include "atari/treeview.h"
#include "atari/plot.h"
#include "atari/misc.h"
#include "atari/nkcc.h"
extern int mouse_hold_start[3];
extern browser_mouse_state bmstate;