summaryrefslogtreecommitdiff
path: root/atari/toolbar.c
diff options
context:
space:
mode:
Diffstat (limited to 'atari/toolbar.c')
-rwxr-xr-xatari/toolbar.c395
1 files changed, 198 insertions, 197 deletions
diff --git a/atari/toolbar.c b/atari/toolbar.c
index 75f726515..1e0af87ef 100755
--- a/atari/toolbar.c
+++ b/atari/toolbar.c
@@ -33,8 +33,8 @@
#include "desktop/history_core.h"
#include "desktop/netsurf.h"
#include "desktop/browser.h"
-#include "desktop/mouse.h"
-#include "desktop/plot_style.h"
+#include "desktop/mouse.h"
+#include "desktop/plot_style.h"
#include "desktop/plotters.h"
#include "atari/clipboard.h"
#include "atari/gui.h"
@@ -44,25 +44,25 @@
#include "atari/clipboard.h"
#include "atari/misc.h"
#include "atari/global_evnt.h"
-#include "atari/plot.h"
+#include "atari/plot.h"
#include "cflib.h"
#include "atari/res/netsurf.rsh"
-#include "atari/plot/plotter.h"
-
-
+#include "atari/plot/plotter.h"
+
+
extern char * cfg_homepage_url;
extern short vdih;
-extern void * h_gem_rsrc;
-extern GEM_PLOTTER plotter;
-static OBJECT * throbber_form = NULL;
-
-static const plot_font_style_t font_style_url = {
- .family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = TOOLBAR_URL_TEXT_SIZE_PT*FONT_SIZE_SCALE,
- .weight = 400,
- .flags = FONTF_NONE,
- .background = 0xffffff,
- .foreground = 0x0
+extern void * h_gem_rsrc;
+extern GEM_PLOTTER plotter;
+static OBJECT * throbber_form = NULL;
+
+static const plot_font_style_t font_style_url = {
+ .family = PLOT_FONT_FAMILY_SANS_SERIF,
+ .size = TOOLBAR_URL_TEXT_SIZE_PT*FONT_SIZE_SCALE,
+ .weight = 400,
+ .flags = FONTF_NONE,
+ .background = 0xffffff,
+ .foreground = 0x0
};
/* prototypes & order for button widgets: */
@@ -74,24 +74,24 @@ static struct s_tb_button tb_buttons[] =
{ TOOLBAR_BT_RELOAD, tb_reload_click, NULL },
{ TOOLBAR_BT_STOP, tb_stop_click, NULL },
{ 0, NULL, NULL }
-};
-
+};
+
static void tb_txt_request_redraw(void *data, int x, int y, int w, int h);
static void __CDECL button_redraw( COMPONENT *c, long buff[8])
{
OBJECT *tree = (OBJECT*)mt_CompDataSearch( &app, c, CDT_OBJECT );
struct gui_window * gw = mt_CompDataSearch( &app, c, CDT_OWNER );
- LGRECT work,clip;
+ LGRECT work,clip;
GRECT todo,crect;
short pxy[4];
mt_CompGetLGrect(&app, c, WF_WORKXYWH, &work);
- clip = work;
+ clip = work;
/* return if component and redraw region does not intersect: */
if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) {
return;
- }
+ }
/* clip contains intersecting part: */
pxy[0] = clip.g_x;
pxy[1] = clip.g_y;
@@ -112,23 +112,23 @@ static void __CDECL button_redraw( COMPONENT *c, long buff[8])
pxy[3] = MIN( (short)buff[5] + buff[7], work.g_y + work.g_h - 2);
vswr_mode( vdih, MD_REPLACE);
v_bar( vdih, (short*)&pxy );
-
- /* go through the rectangle list, using classic AES methods. */
- /* Windom ComGetLGrect is buggy for WF_FIRST/NEXTXYWH */
- crect.g_x = clip.g_x;
- crect.g_y = clip.g_y;
- crect.g_w = clip.g_w;
- crect.g_h = clip.g_h;
+
+ /* go through the rectangle list, using classic AES methods. */
+ /* Windom ComGetLGrect is buggy for WF_FIRST/NEXTXYWH */
+ crect.g_x = clip.g_x;
+ crect.g_y = clip.g_y;
+ crect.g_w = clip.g_w;
+ crect.g_h = clip.g_h;
wind_get(gw->root->handle->handle, WF_FIRSTXYWH,
- &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
- while( (todo.g_w > 0) && (todo.g_h > 0) ){
-
- if( rc_intersect(&crect, &todo) ){
- objc_draw( tree, 0, 0, todo.g_x, todo.g_y, todo.g_w, todo.g_h );
- }
+ &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
+ while( (todo.g_w > 0) && (todo.g_h > 0) ){
+
+ if( rc_intersect(&crect, &todo) ){
+ objc_draw( tree, 0, 0, todo.g_x, todo.g_y, todo.g_w, todo.g_h );
+ }
wind_get(gw->root->handle->handle, WF_NEXTXYWH,
- &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
- }
+ &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
+ }
if( gw->root->toolbar->buttons[0].comp == c && work.g_x == buff[4] ){
vsl_color( vdih, LWHITE );
@@ -231,67 +231,67 @@ void __CDECL evnt_throbber_redraw( COMPONENT *c, long buff[8])
static
void __CDECL evnt_url_redraw( COMPONENT *c, long buff[8] )
-{
+{
LGRECT work, clip;
- struct gui_window * gw;
+ struct gui_window * gw;
short pxy[10];
- gw = (struct gui_window *)mt_CompDataSearch(&app, c, CDT_OWNER);
+ gw = (struct gui_window *)mt_CompDataSearch(&app, c, CDT_OWNER);
if( gw == NULL )
return;
- CMP_TOOLBAR tb = gw->root->toolbar;
- mt_CompGetLGrect(&app, tb->url.comp, WF_WORKXYWH, &work);
-
- // this last pixel is drawn by the root component of the toolbar:
- // it's the black border, so we leave it out:
+ CMP_TOOLBAR tb = gw->root->toolbar;
+ mt_CompGetLGrect(&app, tb->url.comp, WF_WORKXYWH, &work);
+
+ // this last pixel is drawn by the root component of the toolbar:
+ // it's the black border, so we leave it out:
work.g_h--;
clip = work;
- if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) return;
-
+ if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) return;
+
pxy[0] = clip.g_x;
pxy[1] = clip.g_y;
- pxy[2] = clip.g_w + clip.g_x-1;
+ pxy[2] = clip.g_w + clip.g_x-1;
pxy[3] = clip.g_h + clip.g_y-1;
- vs_clip( vdih, 1, (short*)&pxy );
+ vs_clip( vdih, 1, (short*)&pxy );
vsf_perimeter( vdih, 0 );
vsf_interior( vdih , 1 );
- vsf_color( vdih, LWHITE );
-
- //left margin:
+ vsf_color( vdih, LWHITE );
+
+ //left margin:
pxy[0] = work.g_x;
pxy[1] = work.g_y;
pxy[2] = work.g_x + TOOLBAR_URL_MARGIN_LEFT-1;
- pxy[3] = work.g_y + work.g_h-1;
- v_bar( vdih, pxy );
-
- // right margin:
+ pxy[3] = work.g_y + work.g_h-1;
+ v_bar( vdih, pxy );
+
+ // right margin:
pxy[0] = work.g_x+work.g_w-TOOLBAR_URL_MARGIN_RIGHT;
pxy[1] = work.g_y;
pxy[2] = work.g_x+work.g_w-1;
- pxy[3] = work.g_y+work.g_h-1;
- v_bar( vdih, pxy );
-
- // top margin:
+ pxy[3] = work.g_y+work.g_h-1;
+ v_bar( vdih, pxy );
+
+ // top margin:
pxy[0] = work.g_x;
pxy[1] = work.g_y;
pxy[2] = work.g_x+work.g_w-1;
- pxy[3] = work.g_y+TOOLBAR_URL_MARGIN_TOP-1;
- v_bar( vdih, pxy );
-
- // bottom margin:
+ pxy[3] = work.g_y+TOOLBAR_URL_MARGIN_TOP-1;
+ v_bar( vdih, pxy );
+
+ // bottom margin:
pxy[0] = work.g_x;
pxy[1] = work.g_y+work.g_h-TOOLBAR_URL_MARGIN_BOTTOM;
pxy[2] = work.g_x+work.g_w-1;
- pxy[3] = work.g_y+work.g_h-1;
- v_bar( vdih, pxy );
-
- vs_clip( vdih, 0, (short*)&pxy );
-
- // TBD: request redraw of textarea for specific region.
- clip.g_x -= work.g_x+TOOLBAR_URL_MARGIN_LEFT;
- clip.g_y -= work.g_y+TOOLBAR_URL_MARGIN_TOP;
- tb_txt_request_redraw( tb, clip.g_x, clip.g_y, clip.g_w, clip.g_h );
+ pxy[3] = work.g_y+work.g_h-1;
+ v_bar( vdih, pxy );
+
+ vs_clip( vdih, 0, (short*)&pxy );
+
+ // TBD: request redraw of textarea for specific region.
+ clip.g_x -= work.g_x+TOOLBAR_URL_MARGIN_LEFT;
+ clip.g_y -= work.g_y+TOOLBAR_URL_MARGIN_TOP;
+ tb_txt_request_redraw( tb, clip.g_x, clip.g_y, clip.g_w, clip.g_h );
}
static
@@ -312,34 +312,34 @@ void __CDECL evnt_url_click( COMPONENT *c, long buff[8] )
/* TODO: reset mouse state of browser window? */
/* select whole text when newly focused, otherwise set caret to end of text */
if( !window_url_widget_has_focus(gw) ) {
- window_set_focus( gw, URL_WIDGET, (void*)&tb->url );
+ window_set_focus( gw, URL_WIDGET, (void*)&tb->url );
} else {
if( mb & 1 ) {
- textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_DRAG_1,
- mx, my );
- short prev_x = mx;
- short prev_y = my;
- do{
- if( abs(prev_x-mx) > 5 || abs(prev_y-my) > 5 ){
- textarea_mouse_action( tb->url.textarea,
- BROWSER_MOUSE_HOLDING_1, mx, my );
- prev_x = mx;
- prev_y = my;
- if( tb->url.redraw ){
- tb_url_redraw( gw );
- }
- }
- graf_mkstate( &mx, &my, &mb, &kstat );
+ textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_DRAG_1,
+ mx, my );
+ short prev_x = mx;
+ short prev_y = my;
+ do{
+ if( abs(prev_x-mx) > 5 || abs(prev_y-my) > 5 ){
+ textarea_mouse_action( tb->url.textarea,
+ BROWSER_MOUSE_HOLDING_1, mx, my );
+ prev_x = mx;
+ prev_y = my;
+ if( tb->url.redraw ){
+ tb_url_redraw( gw );
+ }
+ }
+ graf_mkstate( &mx, &my, &mb, &kstat );
mx = mx - (work.g_x + TOOLBAR_URL_MARGIN_LEFT);
- my = my - (work.g_y + TOOLBAR_URL_MARGIN_TOP);
- }while( mb & 1 );
- textarea_drag_end( tb->url.textarea, 0, mx, my );
+ my = my - (work.g_y + TOOLBAR_URL_MARGIN_TOP);
+ }while( mb & 1 );
+ textarea_drag_end( tb->url.textarea, 0, mx, my );
} else {
- /* TODO: recognize click + shift key */
- int mstate = BROWSER_MOUSE_PRESS_1;
- if( (kstat & (K_LSHIFT|K_RSHIFT)) != 0 )
+ /* TODO: recognize click + shift key */
+ int mstate = BROWSER_MOUSE_PRESS_1;
+ if( (kstat & (K_LSHIFT|K_RSHIFT)) != 0 )
mstate = BROWSER_MOUSE_MOD_1;
- textarea_mouse_action( tb->url.textarea,
+ textarea_mouse_action( tb->url.textarea,
BROWSER_MOUSE_PRESS_1, mx, my );
}
}
@@ -347,21 +347,21 @@ void __CDECL evnt_url_click( COMPONENT *c, long buff[8] )
ApplWrite( _AESapid, WM_REDRAW, gw->root->handle->handle,
work.g_x, work.g_y, work.g_w, work.g_h );
-}
-
-void tb_adjust_size( struct gui_window * gw )
-{
- LGRECT work;
- CMP_TOOLBAR t = gw->root->toolbar;
-
- mt_CompGetLGrect( &app, t->url.comp, WF_WORKXYWH, &work);
- work.g_w -= (TOOLBAR_URL_MARGIN_LEFT + TOOLBAR_URL_MARGIN_RIGHT);
- /* do not overwrite the black border, because of that, add 1 */
- work.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM+1);
- textarea_set_dimensions( t->url.textarea, work.g_w, work.g_h );
- tb_txt_request_redraw( t, 0,0, work.g_w-1, work.g_h-1);
}
-
+
+void tb_adjust_size( struct gui_window * gw )
+{
+ LGRECT work;
+ CMP_TOOLBAR t = gw->root->toolbar;
+
+ mt_CompGetLGrect( &app, t->url.comp, WF_WORKXYWH, &work);
+ work.g_w -= (TOOLBAR_URL_MARGIN_LEFT + TOOLBAR_URL_MARGIN_RIGHT);
+ /* do not overwrite the black border, because of that, add 1 */
+ work.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM+1);
+ textarea_set_dimensions( t->url.textarea, work.g_w, work.g_h );
+ tb_txt_request_redraw( t, 0,0, work.g_w-1, work.g_h-1);
+}
+
static void __CDECL evnt_toolbar_redraw( COMPONENT *c, long buff[8], void *data )
{
LGRECT work, clip;
@@ -381,15 +381,15 @@ static void __CDECL evnt_toolbar_redraw( COMPONENT *c, long buff[8], void *data
pxy[1] = pxy[3] = work.g_y + work.g_h-1 ;
pxy[2] = clip.g_x + clip.g_w;
v_pline( vdih, 2, (short*)&pxy );
-}
-
-
-static void tb_txt_request_redraw(void *data, int x, int y, int w, int h)
-{
- LGRECT work;
- if( data == NULL )
- return;
- CMP_TOOLBAR t = data;
+}
+
+
+static void tb_txt_request_redraw(void *data, int x, int y, int w, int h)
+{
+ LGRECT work;
+ if( data == NULL )
+ return;
+ CMP_TOOLBAR t = data;
if( t->url.redraw == false ){
t->url.redraw = true;
t->url.rdw_area.g_x = x;
@@ -404,41 +404,42 @@ static void tb_txt_request_redraw(void *data, int x, int y, int w, int h)
int oldy1 = t->url.rdw_area.g_y + t->url.rdw_area.g_h;
t->url.rdw_area.g_x = MIN(t->url.rdw_area.g_x, x);
t->url.rdw_area.g_y = MIN(t->url.rdw_area.g_y, y);
- t->url.rdw_area.g_w = ( oldx1 > newx1 ) ?
+ t->url.rdw_area.g_w = ( oldx1 > newx1 ) ?
oldx1 - t->url.rdw_area.g_x : newx1 - t->url.rdw_area.g_x;
- t->url.rdw_area.g_h = ( oldy1 > newy1 ) ?
+ t->url.rdw_area.g_h = ( oldy1 > newy1 ) ?
oldy1 - t->url.rdw_area.g_y : newy1 - t->url.rdw_area.g_y;
- }
-}
-
-void tb_url_redraw( struct gui_window * gw )
-{
- CMP_TOOLBAR t = gw->root->toolbar;
+ }
+}
+
+void tb_url_redraw( struct gui_window * gw )
+{
+ CMP_TOOLBAR t = gw->root->toolbar;
if (t != NULL) {
if( t->url.redraw && ((plotter->flags & PLOT_FLAG_OFFSCREEN) == 0) ) {
const struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &atari_plotters
};
short todo[4];
- LGRECT work;
-
+ LGRECT work;
+
mt_CompGetLGrect(&app, gw->root->toolbar->url.comp, WF_WORKXYWH, &work);
- work.g_x += TOOLBAR_URL_MARGIN_RIGHT;
- work.g_y += TOOLBAR_URL_MARGIN_LEFT;
- work.g_w -= TOOLBAR_URL_MARGIN_RIGHT;
- work.g_h -= TOOLBAR_URL_MARGIN_BOTTOM;
+ work.g_x += TOOLBAR_URL_MARGIN_RIGHT;
+ work.g_y += TOOLBAR_URL_MARGIN_LEFT;
+ work.g_w -= TOOLBAR_URL_MARGIN_RIGHT;
+ work.g_h -= TOOLBAR_URL_MARGIN_BOTTOM;
plotter->resize(plotter, work.g_w, work.g_h );
- plotter->move(plotter, work.g_x, work.g_y );
- if( plotter->lock( plotter ) == 0 )
+ plotter->move(plotter, work.g_x, work.g_y );
+ if( plotter->lock( plotter ) == 0 )
return;
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;
+ todo[3] = todo[1] + work.g_h-1;
vs_clip(plotter->vdi_handle, 1, (short*)&todo );
if( wind_get(gw->root->handle->handle, WF_FIRSTXYWH,
@@ -457,12 +458,12 @@ void tb_url_redraw( struct gui_window * gw )
todo[1] = 0;
}
- if (rc_intersect(&t->url.rdw_area,(GRECT *)&todo)) {
- struct rect clip = {
- .x0 = todo[0],
- .y0 = todo[1],
- .x1 = todo[0]+todo[2],
- .y1 = todo[1]+todo[3]
+ if (rc_intersect(&t->url.rdw_area,(GRECT *)&todo)) {
+ struct rect clip = {
+ .x0 = todo[0],
+ .y0 = todo[1],
+ .x1 = todo[0]+todo[2],
+ .y1 = todo[1]+todo[3]
};
textarea_redraw( t->url.textarea, 0, 0, &clip, &ctx );
}
@@ -471,10 +472,10 @@ void tb_url_redraw( struct gui_window * gw )
break;
}
}
- } else {
+ } else {
plotter->unlock( plotter );
return;
- }
+ }
plotter->unlock( plotter );
vs_clip(plotter->vdi_handle, 0, (short*)&todo);
t->url.redraw = false;
@@ -485,9 +486,9 @@ void tb_url_redraw( struct gui_window * gw )
} else {
/* just copy stuff from the offscreen buffer */
}
- }
+ }
}
-
+
CMP_TOOLBAR tb_create( struct gui_window * gw )
{
int i;
@@ -497,7 +498,7 @@ CMP_TOOLBAR tb_create( struct gui_window * gw )
if( t == NULL )
return( NULL );
- t->owner = gw;
+ t->owner = gw;
/* create the root component: */
t->comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, TOOLBAR_HEIGHT, 0);
@@ -528,12 +529,12 @@ CMP_TOOLBAR tb_create( struct gui_window * gw )
}
/* create the url widget: */
- t->url.textarea = textarea_create( 300, TOOLBAR_TEXTAREA_HEIGHT, 0,
- &font_style_url, tb_txt_request_redraw,
- t );
- if( t->url.textarea != NULL ){
- textarea_set_text(t->url.textarea, "http://");
- }
+ t->url.textarea = textarea_create( 300, TOOLBAR_TEXTAREA_HEIGHT, 0,
+ &font_style_url, tb_txt_request_redraw,
+ t );
+ if( t->url.textarea != NULL ){
+ textarea_set_text(t->url.textarea, "http://");
+ }
t->url.comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, TOOLBAR_HEIGHT, 1);
mt_CompEvntAttach( &app, t->url.comp, WM_REDRAW, evnt_url_redraw );
@@ -570,7 +571,7 @@ void tb_destroy( CMP_TOOLBAR tb )
mt_ObjcFree( &app, (OBJECT*)mt_CompDataSearch(&app, tb->buttons[i].comp, CDT_OBJECT) );
i++;
}
- free( tb->buttons );
+ free( tb->buttons );
textarea_destroy( tb->url.textarea );
mt_CompDelete( &app, tb->comp);
free( tb );
@@ -646,20 +647,20 @@ void tb_url_set( struct gui_window * gw, char * text )
if( gw->browser->attached == false )
return;
- struct s_url_widget * url = &gw->root->toolbar->url;
-
+ struct s_url_widget * url = &gw->root->toolbar->url;
+
assert( gw != NULL );
assert( gw->browser != NULL );
assert( gw->root != NULL );
- assert( gw->browser->bw != NULL );
-
- textarea_set_text(url->textarea, text);
-
- mt_CompGetLGrect( &app, gw->root->toolbar->url.comp, WF_WORKXYWH, &work);
- work.g_w -= (TOOLBAR_URL_MARGIN_LEFT + TOOLBAR_URL_MARGIN_RIGHT);
- /* do not overwrite the black border, because of that, add 1 */
- work.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM+1);
- tb_txt_request_redraw( gw->root->toolbar, 0,0,work.g_w,work.g_h );
+ assert( gw->browser->bw != NULL );
+
+ textarea_set_text(url->textarea, text);
+
+ mt_CompGetLGrect( &app, gw->root->toolbar->url.comp, WF_WORKXYWH, &work);
+ work.g_w -= (TOOLBAR_URL_MARGIN_LEFT + TOOLBAR_URL_MARGIN_RIGHT);
+ /* do not overwrite the black border, because of that, add 1 */
+ work.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM+1);
+ tb_txt_request_redraw( gw->root->toolbar, 0,0,work.g_w,work.g_h );
return;
}
@@ -673,41 +674,41 @@ bool tb_url_input( struct gui_window * gw, short nkc )
CMP_TOOLBAR tb = gw->root->toolbar;
assert(tb!=NULL);
LGRECT work;
- bool ret = false;
-
- assert( gw != NULL );
-
- long ucs4;
- long ik = nkc_to_input_key( nkc, &ucs4 );
-
- if( ik == 0 ){
+ bool ret = false;
+
+ assert( gw != NULL );
+
+ long ucs4;
+ long ik = nkc_to_input_key( nkc, &ucs4 );
+
+ if( ik == 0 ){
if ( (nkc&0xFF) >= 9 ) {
ret = textarea_keypress( tb->url.textarea, ucs4 );
- }
- }
- else if( ik == KEY_CR || ik == KEY_NL ){
- char tmp_url[PATH_MAX];
- if( textarea_get_text( tb->url.textarea, tmp_url, PATH_MAX) > 0 ) {
+ }
+ }
+ else if( ik == KEY_CR || ik == KEY_NL ){
+ char tmp_url[PATH_MAX];
+ if( textarea_get_text( tb->url.textarea, tmp_url, PATH_MAX) > 0 ) {
window_set_focus( gw, BROWSER, gw->browser);
- browser_window_go(gw->browser->bw, (const char*)&tmp_url, 0, true);
- ret = true;
- }
- }
- else if( ik == KEY_COPY_SELECTION ){
- // copy whole text
- char * text;
- int len;
- len = textarea_get_text( tb->url.textarea, NULL, 0 );
- text = malloc( len+1 );
- if( text ){
- textarea_get_text( tb->url.textarea, text, len+1 );
- scrap_txt_write( &app, text );
- free( text );
- }
- }
- else {
- ret = textarea_keypress( tb->url.textarea, ik );
- }
+ browser_window_go(gw->browser->bw, (const char*)&tmp_url, 0, true);
+ ret = true;
+ }
+ }
+ else if( ik == KEY_COPY_SELECTION ){
+ // copy whole text
+ char * text;
+ int len;
+ len = textarea_get_text( tb->url.textarea, NULL, 0 );
+ text = malloc( len+1 );
+ if( text ){
+ textarea_get_text( tb->url.textarea, text, len+1 );
+ scrap_txt_write( &app, text );
+ free( text );
+ }
+ }
+ else {
+ ret = textarea_keypress( tb->url.textarea, ik );
+ }
return( ret );
}