r13172 mono - /trunk/netsurf/atari/plot/plotter.c
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 16:34:38 2011
New Revision: 13172
URL: http://source.netsurf-browser.org?rev=13172&view=rev
Log:
Properly redraw the rectangle outline
Modified:
trunk/netsurf/atari/plot/plotter.c
Modified: trunk/netsurf/atari/plot/plotter.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/plot/plotter.c?rev=...
==============================================================================
--- trunk/netsurf/atari/plot/plotter.c (original)
+++ trunk/netsurf/atari/plot/plotter.c Wed Nov 23 16:34:38 2011
@@ -32,6 +32,7 @@
#include "atari/plot/eddi.h"
#include "atari/plot/plotter.h"
#include "atari/plot/plotter_vdi.h"
+#include "atari/plot/plotter_nvdi.h"
#include "atari/plot/font_vdi.h"
#include "atari/plot/font_internal.h"
#include "atari/plot/font_freetype.h"
@@ -85,8 +86,7 @@
struct s_driver_table_entry screen_driver_table[] =
{
{(char*)"vdi", ctor_plotter_vdi, 0, 32},
- {(char*)"screen.ldg", ctor_plotter_vdi, PLOT_FLAG_OFFSCREEN, 32 },
- {(char*)"vdi_offscreen", ctor_plotter_vdi, PLOT_FLAG_OFFSCREEN, 32},
+/* {(char*)"nvdi", ctor_plotter_vdi, PLOT_FLAG_OFFSCREEN, 32},*/
{(char*)NULL, NULL, 0, 0 }
};
@@ -229,7 +229,7 @@
/*
- lookup an plotter ID by name
+ lookup an plotter ID by name
*/
static int drvrname_idx( char * name )
{
@@ -246,8 +246,8 @@
}
}
-/*
- lookup of font plotter ID by name
+/*
+ lookup of font plotter ID by name
*/
static int font_drvrname_idx( char * name )
{
@@ -264,7 +264,7 @@
}
}
-/*
+/*
Get an plotter info entry, the entry contains an pointer to ctor
*/
struct s_driver_table_entry * get_screen_driver_entry( char * name )
@@ -276,8 +276,8 @@
return( &screen_driver_table[idx] );
}
-/*
- Get an font plotter info entry, the entry contains an pointer to ctor.
+/*
+ Get an font plotter info entry, the entry contains an pointer to ctor.
*/
struct s_font_driver_table_entry * get_font_driver_entry( char * name )
{
@@ -289,8 +289,8 @@
}
-/*
- Create an new text plotter object
+/*
+ Create an new text plotter object
*/
FONT_PLOTTER new_font_plotter( int vdihandle, char * name, unsigned long flags, int * error)
{
@@ -334,8 +334,8 @@
static bool init=false;
static int inst=0;
-/*
- Create an new plotter object
+/*
+ Create an new plotter object
*/
GEM_PLOTTER new_plotter(int vdihandle, char * name, GRECT * loc_size,
int virt_bpp, unsigned long flags, FONT_PLOTTER fplotter, int * error )
@@ -343,7 +343,7 @@
int res = 0-ERR_PLOTTER_NOT_AVAILABLE;
int i;
assert( fplotter != NULL );
-
+
GEM_PLOTTER gemplotter = (GEM_PLOTTER)malloc( sizeof(struct s_gem_plotter) );
if( !gemplotter ) {
*error = 0-ERR_NO_MEM;
@@ -410,7 +410,7 @@
p = NULL;
inst--;
if( inst == 0 ){
-
+
}
}
else
@@ -444,7 +444,7 @@
return( (x * (bpp >> 3)) * y );
}
-/*
+/*
x - x coord
y - y coord
stride - stride in bytes
@@ -485,7 +485,7 @@
CURFB(p).vis_h = common.g_h;
if( CURFB(p).x < screen.g_x )
CURFB(p).vis_x = frame.g_w - common.g_w;
- else
+ else
CURFB(p).vis_x = 0;
if( CURFB(p).y <screen.g_y )
CURFB(p).vis_y = frame.g_h - common.g_h;
@@ -494,7 +494,7 @@
} else {
CURFB(p).vis_w = CURFB(p).vis_h = 0;
CURFB(p).vis_x = CURFB(p).vis_y = 0;
- }
+ }
}
/*
@@ -607,8 +607,8 @@
static short web_std_colors[6] = {0, 51, 102, 153, 204, 255};
-/*
- Convert an RGB color into an index into the 216 colors web pallette
+/*
+ Convert an RGB color into an index into the 216 colors web pallette
*/
short rgb_to_666_index(unsigned char r, unsigned char g, unsigned char b)
{
@@ -632,14 +632,17 @@
return( tval[2]*36+tval[1]*6+tval[0] );
}
-
+/*
+ bpp: bits per pixel,
+
+*/
int init_mfdb(int bpp, int w, int h, uint32_t flags, MFDB * out )
{
int dststride;
dststride = MFDB_STRIDE( w );
- int size = MFDB_SIZE( bpp, dststride, h );
- if( bpp > 0 ) {
- if( (flags & MFDB_FLAG_NOALLOC) == 0 ) {
+ int size = MFDB_SIZE( bpp, dststride, h );
+ if( bpp > 0 ) {
+ if( (flags & MFDB_FLAG_NOALLOC) == 0 ) {
out->fd_addr = malloc( size );
if( out->fd_addr == NULL ){
return( 0 );
@@ -714,7 +717,7 @@
newclip[3] = MIN(CURFB(self).y+CURFB(self).h, newclip[1] + (c->y1 - c->y0) )-1;
vs_clip( self->vdi_handle, 1, (short*)&newclip );
} else {
- vs_clip( self->vdi_handle, 1, (short *)&prev_vdi_clip );
- }
-}
-
+ vs_clip( self->vdi_handle, 1, (short *)&prev_vdi_clip );
+ }
+}
+
11 years, 4 months
r13171 mono - /trunk/netsurf/atari/plot/plotter_vdi.h
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 16:33:02 2011
New Revision: 13171
URL: http://source.netsurf-browser.org?rev=13171&view=rev
Log:
Comment's...
Modified:
trunk/netsurf/atari/plot/plotter_vdi.h
Modified: trunk/netsurf/atari/plot/plotter_vdi.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/plot/plotter_vdi.h?...
==============================================================================
--- trunk/netsurf/atari/plot/plotter_vdi.h (original)
+++ trunk/netsurf/atari/plot/plotter_vdi.h Wed Nov 23 16:33:02 2011
@@ -22,21 +22,34 @@
#include <Hermes/Hermes.h>
struct s_vdi_priv_data {
- short bufops;
- void * buf_packed; /* temp buffer for bitmap conversion */
- int size_buf_packed;
- void * buf_planar; /* temp buffer for bitmap conversion */
+ short bufops;
+ /* temp buffer for bitmap conversion: */
+ void * buf_packed;
+ int size_buf_packed;
+
+ /* temp buffer for bitmap conversion: */
+ void * buf_planar;
int size_buf_planar;
- MFDB buf_scr; /* buffer for plot operations that require device format */
- int size_buf_scr;
- struct bitmap * buf_scr_compat;
- HermesFormat vfmt; /* framebuffer format */
- /* no screen format here, hermes may not suitable for it */
- HermesFormat nsfmt; /* netsurf bitmap format */
+
+ /* buffer for plot operations that require device format, */
+ /* currently used for transparent mfdb blits: */
+ MFDB buf_scr;
+ int size_buf_scr;
+ struct bitmap * buf_scr_compat;
+
+ /* intermediate bitmap format */
+ HermesFormat vfmt;
+
+ /* no screen format here, hermes may not suitable for it */
+
+ /* netsurf source bitmap format */
+ HermesFormat nsfmt;
};
-
-#define CONV_KEEP_LIMIT 512000 /* how much memory should be kept allocated for temp. conversion bitmaps? */
-#define CONV_BLOCK_SIZE 32000 /* how much memory to allocate if some is needed */
+
+/* how much memory should be kept allocated for temp. conversion bitmaps: */
+#define CONV_KEEP_LIMIT 512000
+/* how much memory to allocate if some is needed: */
+#define CONV_BLOCK_SIZE 32000
/* this is an shortcut cast to access the members of the s_vdi_priv_data */
#define DUMMY_PRIV(self) ((struct s_vdi_priv_data*)self->priv_data)
@@ -51,9 +64,9 @@
* param y absolute screen coords
* param w width
* param h height
-*
-* This creates an snapshot in RGBA format (NetSurf's native format)
-*
+*
+* This creates an snapshot in RGBA format (NetSurf's native format)
+*
*/
static struct bitmap * snapshot_create(GEM_PLOTTER self, int x, int y, int w, int h);
11 years, 4 months
r13169 mono - /trunk/netsurf/atari/treeview.c
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 16:25:22 2011
New Revision: 13169
URL: http://source.netsurf-browser.org?rev=13169&view=rev
Log:
Use new function nkc_to_input_key
Modified:
trunk/netsurf/atari/treeview.c
Modified: trunk/netsurf/atari/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/treeview.c?rev=1316...
==============================================================================
--- trunk/netsurf/atari/treeview.c (original)
+++ trunk/netsurf/atari/treeview.c Wed Nov 23 16:25:22 2011
@@ -61,52 +61,25 @@
bool r=false;
long kstate = 0;
long kcode = 0;
+ long ucs4;
+ long ik;
unsigned short nkc = 0;
unsigned short nks = 0;
unsigned char ascii;
- NSTREEVIEW tv = (NSTREEVIEW) data;
+
+ NSTREEVIEW tv = (NSTREEVIEW) data;
kstate = evnt.mkstate;
kcode = evnt.keybd;
- nkc= gem_to_norm( (short)kstate, (short)kcode );
+ nkc= gem_to_norm( (short)kstate, (short)kcode );
ascii = (nkc & 0xFF);
- nkc = (nkc & (NKF_CTRL|NKF_SHIFT|0xFF));
- if( (nkc & (NKF_SHIFT|NKF_CTRL) ) == 0 ) {
- switch( ascii ) {
- case NK_BS:
- r = tree_keypress( tv->tree, KEY_DELETE_LEFT);
- break;
-
- case NK_DEL:
- r = tree_keypress( tv->tree, KEY_DELETE_RIGHT);
- break;
-
- case NK_ENTER:
- r = tree_keypress( tv->tree, KEY_NL);
- break;
-
- case NK_RET:
- r = tree_keypress( tv->tree, KEY_CR);
- break;
-
- case NK_ESC:
- r = tree_keypress( tv->tree, KEY_ESCAPE);
- break;
-
- case NK_RIGHT:
- r = tree_keypress( tv->tree, KEY_RIGHT );
- break;
-
- case NK_LEFT:
- r = tree_keypress( tv->tree, KEY_LEFT );
- break;
-
- default:
- break;
- }
- }
- if ( r == false && ( (nkc & NKF_CTRL)==0) ) {
- int ucs4 = atari_to_ucs4(ascii);
- tree_keypress( tv->tree, ucs4 );
+ ik = nkc_to_input_key( nkc, &ucs4 );
+
+ if( ik == 0 ){
+ if (ascii >= 9 ) {
+ r = tree_keypress( tv->tree, ucs4 );
+ }
+ } else {
+ r = tree_keypress( tv->tree, ik );
}
}
11 years, 4 months
r13168 mono - /trunk/netsurf/atari/doc/faq.txt
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 14:13:07 2011
New Revision: 13168
URL: http://source.netsurf-browser.org?rev=13168&view=rev
Log:
Removed FAQ entry for problems caused by stack overflow within mintlibs regex module.
Modified:
trunk/netsurf/atari/doc/faq.txt
Modified: trunk/netsurf/atari/doc/faq.txt
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/doc/faq.txt?rev=131...
==============================================================================
--- trunk/netsurf/atari/doc/faq.txt (original)
+++ trunk/netsurf/atari/doc/faq.txt Wed Nov 23 14:13:07 2011
@@ -1,5 +1,5 @@
-NETSURF ATARI FAQ
+NETSURF ATARI FAQ
Date: 15.02.2011
@@ -8,22 +8,22 @@
03.) WHEN I WANT TO RUN NETSURF IT SAYS: "SOCKET NOT CONNECTED".
04.) I'M GETTING "INSUFFICENT MEMORY" MESSAGES WHEN RUNNING NETSURF.
05.) A PAGE CRASHES - WHAT CAN I DO?
-06.) SSL DOES NOT WORK - WHAT'S WRONG?
+06.) SSL DOES NOT WORK - WHAT'S WRONG?
1.) Question:
CAN NETSURF ALSO BE RUN WITHIN AN TOS ENVIRONMENT?
- Answer:
+ Answer:
Yes NS can run on classic TOS. More or less.
- It is intended to run within the FreeMint environment.
+ It is intended to run within the FreeMint environment.
However there is no support for networking
- right now. Networking support for FireTOS is maybe possible
+ right now. Networking support for FireTOS is maybe possible
in the future.
NS also has problems with Path conversions on all FileSystems
running under TOS. Try setting full paths within the Choices file.
-2.) Question:
+2.) Question:
I DON'T HAVE AN 15 BIT GRAPHICS CARD, HOW TO RUN NETSURF ANYWAY?
Answer:
@@ -39,12 +39,12 @@
3.) Question:
WHEN I WANT TO RUN NETSURF IT SAYS: "SOCKET NOT CONNECTED"
- Answer:
- Take a look at the system requirements! I statet NetSurf needs
+ Answer:
+ Take a look at the system requirements! I statet NetSurf needs
the latest FreeMiNT 1.17 RELEASE. There was a bug within previous
- Versions. Please update your kernel. OR install polipo proxy
- provided as RPM within sparemint distribution. This is an
- workaround, it should work out of the box. But if you want to
+ Versions. Please update your kernel. OR install polipo proxy
+ provided as RPM within sparemint distribution. This is an
+ workaround, it should work out of the box. But if you want to
use the polipo disk-cache you should edit the config file.
4.) Question:
@@ -54,20 +54,9 @@
Try to increase the TPA_INITIALMEM Configuration value within MINT.CNF
5.) Question:
- A PAGE CRASHES - WHAT CAN I DO?
-
- Answer:
- Try to increase the stack memory for netsurf with the stack tool,
- example:
- stack -S 3000k ./ns.prg
-
- If this results in "insufficent memory" messages - look for the
- FAQ entry.
-
-
-6.) Question:
SSL DOES NOT WORK - WHAT TO DO?
Answer:
Try to move the shipped cabundle.crt file to the path where NetSurf
- looks for the SSL certificates (Displayed within statusbar).
+ looks for the SSL certificates (Displayed within statusbar and also
+ verbose log).
11 years, 4 months
r13167 mono - /trunk/netsurf/atari/download.c
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 14:01:47 2011
New Revision: 13167
URL: http://source.netsurf-browser.org?rev=13167&view=rev
Log:
Checkbox "Close on finish" becomes close button when download finished.
Modified:
trunk/netsurf/atari/download.c
Modified: trunk/netsurf/atari/download.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/download.c?rev=1316...
==============================================================================
--- trunk/netsurf/atari/download.c (original)
+++ trunk/netsurf/atari/download.c Wed Nov 23 14:01:47 2011
@@ -54,10 +54,10 @@
static void __CDECL evnt_bt_abort_click
(
- WINDOW *win,
- int index,
- int unused,
- void * data
+ WINDOW *win,
+ int index,
+ int unused,
+ void * data
)
{
struct gui_download_window * dw = (struct gui_download_window *)data;
@@ -69,23 +69,26 @@
}
static void __CDECL evnt_cbrdy_click
-(
- WINDOW *win,
- int index,
- int unused,
+(
+ WINDOW *win,
+ int index,
+ int unused,
void * data
)
{
struct gui_download_window * dw = (struct gui_download_window *)data;
- assert( dw != NULL );
-}
-
-static void __CDECL evnt_close( WINDOW *win, short buff[8], void * data)
+ assert( dw != NULL );
+ if( dw->status == NSATARI_DOWNLOAD_COMPLETE ){
+ ApplWrite( _AESapid, WM_CLOSED, win->handle, 0,0,0,0);
+ }
+}
+
+static void __CDECL evnt_close( WINDOW *win, short buff[8], void * data)
{
struct gui_download_window * dw = (struct gui_download_window *)data;
assert( dw != NULL );
gui_download_window_destroy( dw );
- ApplWrite( _AESapid, WM_DESTROY, win->handle, 0,0,0,0);
+ ApplWrite( _AESapid, WM_DESTROY, win->handle, 0,0,0,0);
}
static void gui_download_window_destroy( struct gui_download_window * gdw )
@@ -97,7 +100,7 @@
download_context_destroy( gdw->ctx );
if( gdw->form != NULL ){
/* first destroy the form, so that it won't acces the gdw members */
- ApplWrite( _AESapid, WM_DESTROY, gdw->form->handle, 0,0,0,0);
+ ApplWrite( _AESapid, WM_DESTROY, gdw->form->handle, 0,0,0,0);
EvntWindom( MU_MESAG );
}
if( gdw->destination ) {
@@ -114,7 +117,7 @@
gdw->fd = NULL;
}
if( gdw->fbuf != NULL ){
- free( gdw->fbuf );
+ free( gdw->fbuf );
}
free( gdw );
@@ -137,14 +140,14 @@
OBJECT * tree = get_tree(DOWNLOAD);
if( tree == NULL )
- return( NULL );
- gdw = calloc( 1, sizeof(struct gui_download_window) );
+ return( NULL );
+ gdw = calloc( 1, sizeof(struct gui_download_window) );
if( gdw == NULL )
return( NULL );
gdw->ctx = ctx;
gdw->abort = false;
gdw->start = clock() / CLOCKS_PER_SEC;
- gdw->lastrdw = 0;
+ gdw->lastrdw = 0;
gdw->status = NSATARI_DOWNLOAD_WORKING;
gdw->parent = parent;
gdw->fbufsize = MAX(BUFSIZ, 48000);
@@ -176,7 +179,7 @@
}
char * tpath = alloca(strlen(filename) + strlen(path) + 2 );
- char * tpath2 = alloca(PATH_MAX);
+ char * tpath2 = alloca(PATH_MAX);
strcpy( tpath, path );
if( path[strlen(path)-1] != '/' && path[strlen(path)-1] != '\\' ) {
strcat( tpath, "/");
@@ -193,10 +196,10 @@
}
gdw->fbuf = malloc( gdw->fbufsize+1 );
if( gdw->fbuf != NULL ){
- setvbuf( gdw->fd, gdw->fbuf, _IOFBF, gdw->fbufsize );
+ setvbuf( gdw->fd, gdw->fbuf, _IOFBF, gdw->fbufsize );
}
gdw->form = mt_FormCreate( &app, tree, WAT_FORM,
- NULL, (char*)"Download",
+ NULL, (char*)"Download",
NULL, true, true );
if( gdw->form == NULL || gdw->fd == NULL ){
free( filename );
@@ -205,11 +208,11 @@
}
tree = ObjcTree(OC_FORM, gdw->form );
- ObjcAttachFormFunc( gdw->form, DOWNLOAD_BT_ABORT,
- evnt_bt_abort_click, gdw
+ ObjcAttachFormFunc( gdw->form, DOWNLOAD_BT_ABORT,
+ evnt_bt_abort_click, gdw
);
- ObjcAttachFormFunc( gdw->form, DOWNLOAD_CB_CLOSE_RDY,
- evnt_cbrdy_click, gdw
+ ObjcAttachFormFunc( gdw->form, DOWNLOAD_CB_CLOSE_RDY,
+ evnt_cbrdy_click, gdw
);
EvntDataAdd( gdw->form, WM_CLOSED, evnt_close, gdw, EV_TOP);
strncpy((char*)&gdw->lbl_file, filename, MAX_SLEN_LBL_FILE-1);
@@ -226,7 +229,7 @@
return gdw;
}
-nserror gui_download_window_data(struct gui_download_window *dw,
+nserror gui_download_window_data(struct gui_download_window *dw,
const char *data, unsigned int size)
{
uint32_t p = 0;
@@ -257,19 +260,19 @@
}
speed = dw->size_downloaded / sdiff;
tree[DOWNLOAD_PROGRESS_DONE].ob_width = MAX( MIN( p*(DOWNLOAD_BAR_MAX/100), DOWNLOAD_BAR_MAX ), 1);
- if( dw->size_total > 0 ){
- snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
- "%lu%s", p, "%"
+ if( dw->size_total > 0 ){
+ snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
+ "%lu%s", p, "%"
);
} else {
- snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
+ snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
"%s", "?%"
);
}
- snprintf( (char*)&dw->lbl_speed, MAX_SLEN_LBL_SPEED, "%s/s",
+ snprintf( (char*)&dw->lbl_speed, MAX_SLEN_LBL_SPEED, "%s/s",
human_friendly_bytesize(speed)
);
- snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
+ snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
human_friendly_bytesize(dw->size_downloaded),
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : "?"
);
@@ -300,10 +303,10 @@
}
OBJECT * tree = ObjcTree(OC_FORM, dw->form );
tree[DOWNLOAD_PROGRESS_DONE].ob_width = DOWNLOAD_BAR_MAX;
- snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
- "%lu%s", 100, "%"
+ snprintf( (char*)&dw->lbl_percent, MAX_SLEN_LBL_PERCENT,
+ "%lu%s", 100, "%"
);
- snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
+ snprintf( (char*)&dw->lbl_done, MAX_SLEN_LBL_DONE, "%s / %s",
human_friendly_bytesize(dw->size_downloaded),
(dw->size_total>0) ? human_friendly_bytesize(dw->size_total) : human_friendly_bytesize(dw->size_downloaded)
);
@@ -312,6 +315,6 @@
ObjcChange( OC_FORM, dw->form, DOWNLOAD_BT_ABORT, DISABLED, FALSE);
snd_rdw( dw->form );
if( (tree[DOWNLOAD_CB_CLOSE_RDY].ob_state & SELECTED) != 0 ) {
- ApplWrite( _AESapid, WM_CLOSED, dw->form->handle, 0,0,0,0);
- }
-}
+ ApplWrite( _AESapid, WM_CLOSED, dw->form->handle, 0,0,0,0);
+ }
+}
11 years, 4 months
r13166 mono - in /trunk/netsurf/atari: statusbar.c statusbar.h
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 13:59:24 2011
New Revision: 13166
URL: http://source.netsurf-browser.org?rev=13166&view=rev
Log:
Removed resize widget from statusbar ( Not needed anymore, window has native widgets now)
Modified:
trunk/netsurf/atari/statusbar.c
trunk/netsurf/atari/statusbar.h
Modified: trunk/netsurf/atari/statusbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/statusbar.c?rev=131...
==============================================================================
--- trunk/netsurf/atari/statusbar.c (original)
+++ trunk/netsurf/atari/statusbar.c Wed Nov 23 13:59:24 2011
@@ -74,14 +74,14 @@
vsl_type( vdih, 1);
vsl_width( vdih, 1 );
vst_color(vdih, BLACK);
- //vst_point( vdih, 9, &pxy[0], &pxy[1], &pxy[2], &pxy[3] );
- vst_height( vdih, atari_sysinfo.medium_sfont_pxh, &pxy[0], &pxy[1], &pxy[2], &pxy[3] );
+
+ vst_height( vdih, atari_sysinfo.medium_sfont_pxh, &pxy[0], &pxy[1], &pxy[2], &pxy[3] );
vst_alignment(vdih, 0, 5, &d, &d );
vst_effects( vdih, 0 );
pxyclip[0] = lclip.g_x;
pxyclip[1] = lclip.g_y;
- pxyclip[2] = lclip.g_x + lclip.g_w;
- pxyclip[3] = lclip.g_y + lclip.g_h;
+ pxyclip[2] = lclip.g_x + lclip.g_w-1;
+ pxyclip[3] = lclip.g_y + lclip.g_h-1;
vs_clip(vdih, 1, (short*)&pxyclip );
vswr_mode( vdih, MD_REPLACE );
@@ -102,7 +102,7 @@
pxy[0] = work.g_x;
pxy[1] = work.g_y+1;
- pxy[2] = work.g_x + work.g_w;
+ pxy[2] = work.g_x + work.g_w-1;
pxy[3] = work.g_y + work.g_h-1;
v_bar( vdih, pxy );
@@ -132,19 +132,12 @@
break;
}
}
- vswr_mode( vdih, MD_REPLACE );
-
- pxy[0] = work.g_x + work.g_w - MOVER_WH;
- pxy[1] = work.g_y + 1;
- pxy[2] = work.g_x + work.g_w;
- pxy[3] = work.g_y + work.g_h-1;
- v_bar( vdih, pxy );
-
- pxy[0] = work.g_x + work.g_w - MOVER_WH;
- pxy[1] = work.g_y + work.g_h;
- pxy[2] = work.g_x + work.g_w - MOVER_WH;
- pxy[3] = work.g_y + work.g_h - MOVER_WH;
- v_pline( vdih, 2, (short*)&pxy );
+ vswr_mode( vdih, MD_REPLACE );
+ pxy[0] = work.g_x + work.g_w;
+ pxy[1] = work.g_y + work.g_h;
+ pxy[2] = work.g_x + work.g_w;
+ pxy[3] = work.g_y + work.g_h-work.g_h;
+ v_pline( vdih, 2, (short*)&pxy );
vs_clip(vdih, 0, (short*)&pxyclip );
return;
@@ -156,35 +149,15 @@
short sbuff[8], mx, my;
LGRECT work;
mt_CompGetLGrect(&app, c, WF_WORKXYWH, &work);
- if( evnt.mx >= work.g_x + (work.g_w - MOVER_WH) && evnt.mx <= work.g_x + work.g_w &&
- evnt.my >= work.g_y + (work.g_h - MOVER_WH) && evnt.my <= work.g_y + work.g_h ) {
- /* click into the resizer region */
- struct gui_window * g;
- for( g = window_list; g; g=g->next ) {
- if( g->root->statusbar->comp == c ) {
- if( g->root->statusbar->resize_init == true ){
- g->root->statusbar->resize_init = false;
- g->root->statusbar->resize_delta_x = g->root->loc.g_x+g->root->loc.g_w - evnt.mx;
- g->root->statusbar->resize_delta_y = g->root->loc.g_y+g->root->loc.g_h - evnt.my;
- }
- sbuff[0] = WM_SIZED;
- sbuff[1] = (short)buff[0];
- sbuff[2] = 0;
- sbuff[3] = g->root->handle->handle;
- sbuff[4] = g->root->loc.g_x;
- sbuff[5] = g->root->loc.g_y;
- sbuff[6] = evnt.mx - sbuff[4] + g->root->statusbar->resize_delta_x;
- sbuff[7] = evnt.my - sbuff[5] + g->root->statusbar->resize_delta_y;
- evnt_window_resize( g->root->handle, sbuff, g );
- }
- }
+ if( evnt.mx >= work.g_x + (work.g_w) && evnt.mx <= work.g_x + work.g_w &&
+ evnt.my >= work.g_y + (work.g_h) && evnt.my <= work.g_y + work.g_h ) {
+ // click within sb button
}
}
CMP_STATUSBAR sb_create( struct gui_window * gw )
{
CMP_STATUSBAR s = malloc( sizeof(struct s_statusbar) );
- s->resize_init = true;
s->attached = false;
s->comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, STATUSBAR_HEIGHT, 0);
s->comp->rect.g_h = STATUSBAR_HEIGHT;
Modified: trunk/netsurf/atari/statusbar.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/statusbar.h?rev=131...
==============================================================================
--- trunk/netsurf/atari/statusbar.h (original)
+++ trunk/netsurf/atari/statusbar.h Wed Nov 23 13:59:24 2011
@@ -21,7 +21,6 @@
#define STATUSBAR_HEIGHT 16
#define STATUSBAR_MAX_SLEN 255
-#define MOVER_WH 16
struct s_statusbar
{
@@ -29,9 +28,6 @@
char text[STATUSBAR_MAX_SLEN+1];
size_t textlen;
bool attached;
- bool resize_init;
- short resize_delta_x;
- short resize_delta_y;
};
11 years, 4 months
r13165 mono - in /trunk/netsurf/atari: misc.c misc.h
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 13:56:20 2011
New Revision: 13165
URL: http://source.netsurf-browser.org?rev=13165&view=rev
Log:
Add global function to resolve Netsurf input key.
Modified:
trunk/netsurf/atari/misc.c
trunk/netsurf/atari/misc.h
Modified: trunk/netsurf/atari/misc.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/misc.c?rev=13165&r1...
==============================================================================
--- trunk/netsurf/atari/misc.c (original)
+++ trunk/netsurf/atari/misc.c Wed Nov 23 13:56:20 2011
@@ -34,7 +34,8 @@
#include "atari/gui.h"
#include "atari/toolbar.h"
#include "atari/browser.h"
-#include "atari/misc.h"
+#include "atari/misc.h"
+#include "cflib.h"
extern void * h_gem_rsrc;
@@ -50,7 +51,6 @@
void die(const char *error)
{
printf("%s\n", error);
- sleep( 3 );
exit(1);
}
@@ -154,7 +154,7 @@
void gem_set_cursor( MFORM_EX * cursor )
{
static unsigned char flags = 255;
- static int number = 255;
+ static int number = 255;
if( flags == cursor->flags && number == cursor->number )
return;
if( cursor->flags & MFORM_EX_FLAG_USERFORM ) {
@@ -164,25 +164,157 @@
}
number = cursor->number;
flags = cursor->flags;
-}
+}
+
+long nkc_to_input_key(short nkc, long * ucs4_out)
+{
+ unsigned char ascii = (nkc & 0xFF);
+ nkc = (nkc & (NKF_CTRL|NKF_SHIFT|0xFF));
+ long ik = 0;
+ *ucs4_out = 0;
+
+ /* shift + cntrl key: */
+ if( ((nkc & NKF_CTRL) == NKF_CTRL) && ((nkc & (NKF_SHIFT))!=0) ) {
+
+ }
+ /* cntrl key only: */
+ else if( (nkc & NKF_CTRL) == NKF_CTRL ) {
+ switch ( ascii ) {
+ case 'A':
+ ik = KEY_SELECT_ALL;
+ break;
+
+ case 'C':
+ ik = KEY_COPY_SELECTION;
+ break;
+
+ case 'X':
+ ik = KEY_CUT_SELECTION;
+ break;
+
+ case 'V':
+ ik = KEY_PASTE;
+ break;
+
+ default:
+ break;
+ }
+ }
+ /* shift key only: */
+ else if( (nkc & NKF_SHIFT) != 0 ) {
+ switch( ascii ) {
+ case NK_TAB:
+ ik = KEY_SHIFT_TAB;
+ break;
+
+ case NK_LEFT:
+ ik = KEY_LINE_START;
+ break;
+
+ case NK_RIGHT:
+ ik = KEY_LINE_END;
+ break;
+
+ case NK_UP:
+ ik = KEY_PAGE_UP;
+ break;
+
+ case NK_DOWN:
+ ik = KEY_PAGE_DOWN;
+ break;
+
+ default:
+ break;
+ }
+ }
+ /* No modifier keys: */
+ else {
+ switch( ascii ) {
+ case NK_BS:
+ ik = KEY_DELETE_LEFT;
+ break;
+
+ case NK_DEL:
+ ik = KEY_DELETE_RIGHT;
+ break;
+
+ case NK_TAB:
+ ik = KEY_TAB;
+ break;
+
+
+ case NK_ENTER:
+ ik = KEY_NL;
+ break;
+
+ case NK_RET:
+ ik = KEY_CR;
+ break;
+
+ case NK_ESC:
+ ik = KEY_ESCAPE;
+ break;
+
+ case NK_CLRHOME:
+ ik = KEY_TEXT_START;
+ break;
+
+ case NK_RIGHT:
+ ik = KEY_RIGHT;
+ break;
+
+ case NK_LEFT:
+ ik = KEY_LEFT;
+ break;
+
+ case NK_UP:
+ ik = KEY_UP;
+ break;
+
+ case NK_DOWN:
+ ik = KEY_DOWN;
+ break;
+
+ case NK_M_PGUP:
+ ik = KEY_PAGE_UP;
+ break;
+
+ case NK_M_PGDOWN:
+ ik = KEY_PAGE_DOWN;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if( ik == 0 && ( (nkc & NKF_CTRL)==0) ) {
+ if (ascii >= 9 ) {
+ *ucs4_out = atari_to_ucs4(ascii);
+ printf("ucs4: %lu\n", ucs4_out);
+ }
+ }
+ return ( ik );
+}
+
void dbg_lgrect( char * str, LGRECT * r )
{
- printf("%s: x: %d, y: %d, w: %d, h: %d\n", str,
+ printf("%s: x: %d, y: %d, w: %d, h: %d\n", str,
r->g_x, r->g_y, r->g_w, r->g_h );
}
void dbg_grect( char * str, GRECT * r )
{
- printf("%s: x: %d, y: %d, w: %d, h: %d\n", str,
+ printf("%s: x: %d, y: %d, w: %d, h: %d\n", str,
r->g_x, r->g_y, r->g_w, r->g_h );
-}
+}
void dbg_pxy( char * str, short * pxy )
{
- printf("%s: x: %d, y: %d, w: %d, h: %d\n", str,
+ printf("%s: x: %d, y: %d, w: %d, h: %d\n", str,
pxy[0], pxy[1], pxy[2], pxy[3] );
-}
+}
/* some LDG functions here to reduce dependencies */
void * ldg_open( char * name, short * global )
@@ -195,7 +327,7 @@
return( NULL );
}
-int ldg_close( void * ldg, short * global )
+int ldg_close( void * ldg, short * global )
{
return( 0 );
-}
+}
Modified: trunk/netsurf/atari/misc.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/misc.h?rev=13165&r1...
==============================================================================
--- trunk/netsurf/atari/misc.h (original)
+++ trunk/netsurf/atari/misc.h Wed Nov 23 13:56:20 2011
@@ -17,7 +17,10 @@
*/
#ifndef NS_ATARI_MISC_H
-#define NS_ATARI_MISC_H
+#define NS_ATARI_MISC_H
+
+#include "cflib.h"
+#include "desktop/textinput.h"
#define SBUF8_TO_LBUF8(sbuf,lbuf)\
lbuf[0] = (long)sbuf[0];\
@@ -38,5 +41,6 @@
void dbg_grect( char * str, GRECT * r );
void * ldg_open( char * name, short * global );
void * ldg_find( char * name, short * ldg );
-int ldg_close( void * ldg, short * global );
+int ldg_close( void * ldg, short * global );
+long nkc_to_input_key(short nkc, long * ucs4_out);
#endif
11 years, 4 months
r13164 mono - /trunk/netsurf/atari/treeview.c
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 13:55:03 2011
New Revision: 13164
URL: http://source.netsurf-browser.org?rev=13164&view=rev
Log:
Lock plotter during treeview redraw.
Modified:
trunk/netsurf/atari/treeview.c
Modified: trunk/netsurf/atari/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/treeview.c?rev=1316...
==============================================================================
--- trunk/netsurf/atari/treeview.c (original)
+++ trunk/netsurf/atari/treeview.c Wed Nov 23 13:55:03 2011
@@ -89,12 +89,12 @@
break;
case NK_ESC:
- r = tree_keypress( tv->tree, KEY_ESCAPE);
+ r = tree_keypress( tv->tree, KEY_ESCAPE);
break;
case NK_RIGHT:
r = tree_keypress( tv->tree, KEY_RIGHT );
- break;
+ break;
case NK_LEFT:
r = tree_keypress( tv->tree, KEY_LEFT );
@@ -107,7 +107,7 @@
if ( r == false && ( (nkc & NKF_CTRL)==0) ) {
int ucs4 = atari_to_ucs4(ascii);
tree_keypress( tv->tree, ucs4 );
- }
+ }
}
@@ -130,8 +130,8 @@
clip.g_h = work.g_h + clip.g_y;
clip.g_y = 0;
}
- if( clip.g_h > 0 && clip.g_w > 0 ) {
- atari_treeview_request_redraw( win->xpos*win->w_u + clip.g_x, win->ypos*win->h_u + clip.g_y,
+ if( clip.g_h > 0 && clip.g_w > 0 ) {
+ atari_treeview_request_redraw( win->xpos*win->w_u + clip.g_x, win->ypos*win->h_u + clip.g_y,
clip.g_w, clip.g_h, tv
);
}
@@ -191,8 +191,8 @@
gem_set_cursor(&gem_cursors.cross);
} else {
/* todo: add more isual indication (grafbox?) */
- ignore = true;
- gem_set_cursor(&gem_cursors.cross);
+ ignore = true;
+ gem_set_cursor(&gem_cursors.cross);
}
} else {
if( bmstate & BROWSER_MOUSE_DRAG_ON ){
@@ -201,7 +201,7 @@
gem_set_cursor(&gem_cursors.arrow);
ignore = true;
} else {
- bmstate = BROWSER_MOUSE_CLICK_1;
+ bmstate = BROWSER_MOUSE_CLICK_1;
mouse_hold_start[0] = 0;
}
}
@@ -210,7 +210,7 @@
tree_mouse_action(tv->tree, bmstate, rx, ry );
}
bmstate &= ~(BROWSER_MOUSE_DOUBLE_CLICK | BROWSER_MOUSE_CLICK_1 );
- }
+ }
}
static void __CDECL evnt_tv_m1( WINDOW *win, short buff[8], void * data)
@@ -232,10 +232,10 @@
tree_drag_end(tv->tree, bmstate, tv->startdrag.x, tv->startdrag.y, rx, ry);
gem_set_cursor(&gem_cursors.arrow);
}
- }
-}
-
-NSTREEVIEW atari_treeview_create( uint32_t flags, WINDOW *win )
+ }
+}
+
+NSTREEVIEW atari_treeview_create( uint32_t flags, WINDOW *win )
{
if( win == NULL )
return( NULL );
@@ -252,7 +252,7 @@
win->w_u = 16;
win->h_u = 16;
-
+
EvntDataAdd( new->window, WM_XBUTTON, evnt_tv_mbutton, new, EV_BOT );
EvntDataAttach( new->window, WM_REDRAW, evnt_tv_redraw, new );
EvntDataAttach( new->window, WM_XKEYBD, evnt_tv_keybd, new );
@@ -275,7 +275,7 @@
}
}
-void atari_treeview_destroy( NSTREEVIEW tv )
+void atari_treeview_destroy( NSTREEVIEW tv )
{
if( tv != NULL ){
tv->disposing = true;
@@ -318,18 +318,19 @@
};
plotter->resize(plotter, work.g_w, work.g_h);
- plotter->move(plotter, work.g_x, work.g_y );
+ plotter->move(plotter, work.g_x, work.g_y );
+ plotter->lock( plotter );
todo[0] = work.g_x;
todo[1] = work.g_y;
todo[2] = todo[0] + work.g_w-1;
todo[3] = todo[1] + work.g_h-1;
vs_clip(plotter->vdi_handle, 1, (short*)&todo );
-
- if( wind_get(tv->window->handle, WF_FIRSTXYWH,
+
+ if( wind_get(tv->window->handle, WF_FIRSTXYWH,
&todo[0], &todo[1], &todo[2], &todo[3] )!=0 ) {
while (todo[2] && todo[3]) {
-
+
/* convert screen to treeview coords: */
todo[0] = todo[0] - work.g_x + tv->window->xpos*tv->window->w_u;
todo[1] = todo[1] - work.g_y + tv->window->ypos*tv->window->h_u;
@@ -343,18 +344,20 @@
}
if (rc_intersect((GRECT *)&tv->rdw_area,(GRECT *)&todo)) {
- tree_draw(tv->tree, -tv->window->xpos*16, -tv->window->ypos*16,
+ tree_draw(tv->tree, -tv->window->xpos*16, -tv->window->ypos*16,
todo[0], todo[1], todo[2], todo[3], &ctx
);
}
- if (wind_get(tv->window->handle, WF_NEXTXYWH,
+ if (wind_get(tv->window->handle, WF_NEXTXYWH,
&todo[0], &todo[1], &todo[2], &todo[3])==0) {
break;
}
}
- } else {
+ } else {
+ plotter->unlock( plotter );
return;
- }
+ }
+ plotter->unlock( plotter );
vs_clip(plotter->vdi_handle, 0, (short*)&todo);
tv->redraw = false;
tv->rdw_area.g_x = 65000;
@@ -395,7 +398,7 @@
int oldy1 = tv->rdw_area.g_y + tv->rdw_area.g_h;
tv->rdw_area.g_x = MIN(tv->rdw_area.g_x, x);
tv->rdw_area.g_y = MIN(tv->rdw_area.g_y, y);
- tv->rdw_area.g_w = ( oldx1 > newx1 ) ? oldx1 - tv->rdw_area.g_x : newx1 - tv->rdw_area.g_x;
+ tv->rdw_area.g_w = ( oldx1 > newx1 ) ? oldx1 - tv->rdw_area.g_x : newx1 - tv->rdw_area.g_x;
tv->rdw_area.g_h = ( oldy1 > newy1 ) ? oldy1 - tv->rdw_area.g_y : newy1 - tv->rdw_area.g_y;
}
}
11 years, 4 months
r13163 mono - in /trunk/netsurf/atari: dragdrop.c dragdrop.h
by netsurf@semichrome.net
Author: mono
Date: Wed Nov 23 13:53:54 2011
New Revision: 13163
URL: http://source.netsurf-browser.org?rev=13163&view=rev
Log:
Remove drag n' drop constants, already defined by cflib.h
Modified:
trunk/netsurf/atari/dragdrop.c
trunk/netsurf/atari/dragdrop.h
Modified: trunk/netsurf/atari/dragdrop.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/dragdrop.c?rev=1316...
==============================================================================
--- trunk/netsurf/atari/dragdrop.c (original)
+++ trunk/netsurf/atari/dragdrop.c Wed Nov 23 13:53:54 2011
@@ -20,6 +20,7 @@
#include "windom.h"
#include "dragdrop.h"
+#include "cflib.h"
#ifndef EACCDN
#define EACCDN (-36)
@@ -79,10 +80,10 @@
return(-1);
*pipe = (pipename[17] << 8) | pipename[18];
-
+
/* Signalhandler konfigurieren */
-
+
ddgetsig(&pipesig);
@@ -121,7 +122,7 @@
/* AES-Message define and post */
-
+
msg[0] = AP_DRAGDROP;
msg[1] = _AESapid;
msg[2] = 0;
@@ -141,20 +142,20 @@
/* receiver reaction */
-
+
fd_mask = (1L << fd);
i = Fselect(DD_TIMEOUT, &fd_mask, 0L, 0L);
if (!i || !fd_mask)
{
/* Timeout eingetreten */
-
+
ddclose(fd);
return(-2);
}
/* le recepteur refuse (lecture du pipe) */
-
+
if (Fread(fd, 1L, &c) != 1L)
{
ddclose(fd);
@@ -166,7 +167,7 @@
ddclose(fd);
return(-1);
}
-
+
return(1);
}
@@ -227,10 +228,10 @@
{
char c;
short hdrlen, i;
-
+
/* 4 Bytes fr "ext", 4 Bytes fr "size",
2 Bytes fr Stringendnullen */
-
+
hdrlen = (short) (4 + 4 + strlen(text)+1 + strlen(name)+1);
@@ -249,7 +250,7 @@
/* auf die Antwort warten */
-
+
if (Fread(fd, 1L, &c) != 1L)
return(DD_NAK);
@@ -267,10 +268,10 @@
void ddclose(short fd)
{
/* Signalhandler restaurieren */
-
+
ddsetsig(pipesig);
-
-
+
+
Fclose(fd);
}
@@ -346,10 +347,10 @@
/* Signalhandler konfigurieren */
-
+
ddgetsig(&pipesig);
-
-
+
+
if (Fwrite((short) fd, 1L, &ddmsg) != 1L)
{
ddclose((short) fd);
@@ -426,7 +427,7 @@
if (Fread(fd, 2L, &hdrlen) != 2L)
return(-1);
-
+
if (hdrlen < 9) /* il reste au minimum 11 - 2 = 9 octets a lire */
{
@@ -434,31 +435,31 @@
return(-1); /* erreur taille incorrecte */
}
-
+
if (Fread(fd, 4L, whichext) != 4L) /* lecture de l'extension */
return(-1);
-
+
if (Fread(fd, 4L, size) != 4L) /* lecture de la longueurs des donnes */
return(-1);
-
+
hdrlen -= 8; /* on a lu 8 octets */
-
+
if (hdrlen > DD_NAMEMAX*2)
i = DD_NAMEMAX*2;
else
i = hdrlen;
len = i;
-
+
if (Fread(fd, (long) i, buf) != (long) i)
return(-1);
-
+
hdrlen -= i;
-
+
strncpy(name, buf, DD_NAMEMAX);
-
+
i = (short) strlen(name) + 1;
-
+
if (len - i > 0)
strncpy(file, buf + i, DD_NAMEMAX);
else
@@ -466,15 +467,15 @@
/* weitere Bytes im Header in den Mll */
-
+
while (hdrlen > DD_NAMEMAX*2)
{
if (Fread(fd, DD_NAMEMAX*2, buf) != DD_NAMEMAX*2)
return(-1);
-
+
hdrlen -= DD_NAMEMAX*2;
}
-
+
if (hdrlen > 0)
{
if (Fread(fd, (long) hdrlen, buf) != (long) hdrlen)
@@ -487,7 +488,7 @@
/*
-* Sendet der Senderapplikation eine 1 Byte Antwort
+* Sendet der Senderapplikation eine 1 Byte Antwort
*
* Eingabeparameter:
* fd - Filehandle der Pipe (von ddopen())
@@ -508,7 +509,7 @@
ddclose(fd);
return(-1);
}
-
+
return(1);
}
Modified: trunk/netsurf/atari/dragdrop.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/dragdrop.h?rev=1316...
==============================================================================
--- trunk/netsurf/atari/dragdrop.h (original)
+++ trunk/netsurf/atari/dragdrop.h Wed Nov 23 13:53:54 2011
@@ -2,40 +2,8 @@
* MultiTOS Drag&Drop Header file
*/
-/* Rckgabewerte von ddstry() etc. */
-
-#define DD_OK 0
-#define DD_NAK 1
-#define DD_EXT 2
-#define DD_LEN 3
-#define DD_TRASH 4
-#define DD_PRINTER 5
-#define DD_CLIPBOARD 6
-
-
-/* Timeout in Millisekunden (4 sek.) */
-
-#define DD_TIMEOUT 4000
-
-
-/* Anzahl der Extensionen/Bytes der "bevorzugten Extensionen" */
-
-#define DD_NUMEXTS 8
-#define DD_EXTSIZE 32L
-
-
-/* Max. Lnge des Drag&Drop name/file */
-
-#define DD_NAMEMAX 128
-
-
-/* Max. Lnge des Drag&Drop Header */
-
-#define DD_HDRMAX (8+DD_NAMEMAX+DD_NAMEMAX)
-
-
/*
-* Funktionsdeklarationen
+* Declarations
*/
short ddcreate(short *pipe);
11 years, 4 months