Source
...
Target
Commits (7)
  • Rik Griffin's avatar
    Redesigned window to show more of path. · 84527cc0
    Rik Griffin authored
    Added progress bar.
    Performance improvements, especially in 'slower' mode.
    Fixed 'count summary' bug.
    Fixed various compiler warnings.
    
    Version 0.49. Tagged as 'FilerAct-0_49'
    84527cc0
  • Rik Griffin's avatar
    Fixed progress bar bug in Filer Action. · 3d773e26
    Rik Griffin authored
    Progress bar was wrong during a CopyMove operation that required more
    memory than the available wimp slot.
    
    Version 0.50. Tagged as 'FilerAct-0_50'
    3d773e26
  • Robert Sprowson's avatar
    Didn't compile with PROGRESS_BAR turned off. · 62c87e72
    Robert Sprowson authored
    Rationalised all the switches a bit.
    Not tagged.
    62c87e72
  • Robert Sprowson's avatar
    Fix display of bytes-to-go when there are > 2G left. · b5fe2ebd
    Robert Sprowson authored
    Was doing a widening cast of a signed number to 64 bits, so showed 16 trillion bytes remaining.
    Fix templates to not say "stuff" by default in the name, as this was left on screen if an error occured before processing began.
    Things that read from clock() now use clock_t.
    Uncurled some "} else {" to match all the other files.
    Deleted the USE_LONG_LONG switch, it's been needed ever since harddiscs got bigger than 4G anyway.
    Anything assigned 'Yes' or 'No' changed to type BOOL.
    Variable 'source_of_finished_file' was signalling that a directory had been copied by setting the length to a -ve number. This has been refactored to use a BOOL instead, so files can have top bit set sizes.
    Fix bug in stack grab in count_objects_in_dir(), was grabbing an array of 2048 pointers (=8k) not 2048 bytes.
    Functions bytes_left_to_read() and bytes_left_to_write() reprototyped to return uint32_t not signed numbers.
    Still falls over copying files > 2G, but at least it gets the display right!
    
    Version 0.51. Tagged as 'FilerAct-0_51'
    b5fe2ebd
  • Robert Sprowson's avatar
    More BOOLs and things changed to C99 types. · 161f0f24
    Robert Sprowson authored
    Basically the same as version 0.51 otherwise.
    
    Version 0.52. Tagged as 'FilerAct-0_52'
    161f0f24
  • Robert Sprowson's avatar
    Swap magic constants for defines from headers. · 4b9400d5
    Robert Sprowson authored
    OS_FSControl, OS_File, OS_GBPB, OS_Args, OS_Find now use HighFSI.h.
    Indentation made more consistent.
    Variety of DEBUG macros changed to allow them to be enabled and disabled on a per-file basis.
    Put USE_RED_ERROR box switch into options.h (undefined though).
    Functionally equivalent to 0.52, but lots of diffs.
    
    Version 0.53. Tagged as 'FilerAct-0_53'
    4b9400d5
  • Robert Sprowson's avatar
    Fix to work with files > 2G. · 743fa9c2
    Robert Sprowson authored
    A good rake over the code to change filesizes to be uint32_t not ints.
    Change makefile to use StdTools.
    Shuffle icon clipping in the templates to allow for maximal numbers by moving the text a bit to the right, still fits even in system font.
    A couple more ints swapped for BOOLs.
    The memmanage code is largely unchanged and makes extensive use of signed numbers, partly because the wimpslot setting API does. This will all fall over in a big mess if the wimpslot ever gets >2G, but then the API would need changing for that to happen anyway.
    Function count_objects_in_dir swapped to use os_gbpb.
    Structure search_nest_level gains a 'counted' flag rather than signalling counting is needed by setting the filesize to -1.
    Should now be good for up to 4 billion files each of 4 billion bytes.
    
    Version 0.54. Tagged as 'FilerAct-0_54'
    743fa9c2
...@@ -30,17 +30,11 @@ EXP_HDR = <export$dir> ...@@ -30,17 +30,11 @@ EXP_HDR = <export$dir>
# #
# Generic options: # Generic options:
# #
MKDIR = cdir include StdTools
AS = objasm
CC = cc #DFLAGS = -Ddebugfile="\"RAM::0.$.out\""
CP = copy
LD = link
RM = remove
WIPE = -wipe
DFLAGS =
AFLAGS = -depend !Depend -Stamp -quit AFLAGS = -depend !Depend -Stamp -quit
CFLAGS = -c -depend !Depend -ffah ${INCLUDES} ${DFLAGS} CFLAGS = -c -throwback -depend !Depend -ffah ${INCLUDES} ${DFLAGS}
CPFLAGS = ~cfr~v CPFLAGS = ~cfr~v
WFLAGS = ~c~v WFLAGS = ~c~v
...@@ -130,12 +124,12 @@ install_rom: ${TARGET} ...@@ -130,12 +124,12 @@ install_rom: ${TARGET}
@echo ${COMPONENT}: rom module installed @echo ${COMPONENT}: rom module installed
clean: clean:
${WIPE} o.* ${WFLAGS} ${XWIPE} o.* ${WFLAGS}
${WIPE} oa.* ${WFLAGS} ${XWIPE} oa.* ${WFLAGS}
${WIPE} app.* ${WFLAGS} ${XWIPE} app.* ${WFLAGS}
${WIPE} rm.* ${WFLAGS} ${XWIPE} rm.* ${WFLAGS}
${WIPE} linked.* ${WFLAGS} ${XWIPE} linked.* ${WFLAGS}
${WIPE} map.* ${WFLAGS} ${XWIPE} map.* ${WFLAGS}
${RM} ${TARGET} ${RM} ${TARGET}
${RM} s.ModuleWrap ${RM} s.ModuleWrap
@echo ${COMPONENT}: cleaned @echo ${COMPONENT}: cleaned
......
No preview for this file type
...@@ -82,13 +82,16 @@ S:Slower ...@@ -82,13 +82,16 @@ S:Slower
77:Stamp 77:Stamp
78:Check 78:Check
79:continue the operation 79:continue the operation
80:Paused
80a32/80a36/80a41/80a46/80a51/80a56/80a62/80a67/80a82:Paused %c%s 80a32/80a36/80a41/80a46/80a51/80a56/80a62/80a67/80a82:Paused %c%s
81:There is a %s operation in progress. 81:There is a %s operation in progress.
82:Writing 82:Writing
84:Found 84:Found
85:Finished 85:Finished
86:%d locked item(s) not deleted 86:%d locked item(s) not deleted
87:Disc full
87a32/87a36/87a41/87a46/87a51/87a56/87a62/87a67/87a82:Disc full when %c%s 87a32/87a36/87a41/87a46/87a51/87a56/87a62/87a67/87a82:Disc full when %c%s
88:Error
88a32/88a36/88a41/88a46/88a51/88a56/88a62/88a67/88a82:Error when %c%s 88a32/88a36/88a41/88a46/88a51/88a56/88a62/88a67/88a82:Error when %c%s
89:Filer Action Window 89:Filer Action Window
90:Options 90:Options
......
No preview for this file type
...@@ -14,3 +14,4 @@ ...@@ -14,3 +14,4 @@
| |
Set FilerAct$Path Resources:Resources.FilerAct. Set FilerAct$Path Resources:Resources.FilerAct.
UnSet Alias$Filer_Action UnSet Alias$Filer_Action
UnSet Alias$Filer_Action2
...@@ -13,4 +13,5 @@ ...@@ -13,4 +13,5 @@
| limitations under the License. | limitations under the License.
| |
Set FilerAct$Path <Obey$Dir>.^.Resources.<Locale>. Set FilerAct$Path <Obey$Dir>.^.Resources.<Locale>.
Set Alias$Filer_Action2 <Obey$Dir>.^.app.FilerAct %%*0
Set Alias$Filer_Action <Obey$Dir>.^.app.FilerAct %%*0 Set Alias$Filer_Action <Obey$Dir>.^.app.FilerAct %%*0
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "0.48" Module_MajorVersion SETS "0.54"
Module_Version SETA 48 Module_Version SETA 54
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "11 Jun 2009" Module_Date SETS "23 Oct 2011"
Module_ApplicationDate SETS "11-Jun-09" Module_ApplicationDate SETS "23-Oct-11"
Module_ComponentName SETS "FilerAct" Module_ComponentName SETS "FilerAct"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/FilerAct" Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/FilerAct"
Module_FullVersion SETS "0.48" Module_FullVersion SETS "0.54"
Module_HelpVersion SETS "0.48 (11 Jun 2009)" Module_HelpVersion SETS "0.54 (23 Oct 2011)"
END END
/* (0.48) /* (0.54)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.48 #define Module_MajorVersion_CMHG 0.54
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Jun 2009 #define Module_Date_CMHG 23 Oct 2011
#define Module_MajorVersion "0.48" #define Module_MajorVersion "0.54"
#define Module_Version 48 #define Module_Version 54
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "11 Jun 2009" #define Module_Date "23 Oct 2011"
#define Module_ApplicationDate "11-Jun-09" #define Module_ApplicationDate "23-Oct-11"
#define Module_ComponentName "FilerAct" #define Module_ComponentName "FilerAct"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/FilerAct" #define Module_ComponentPath "castle/RiscOS/Sources/Desktop/FilerAct"
#define Module_FullVersion "0.48" #define Module_FullVersion "0.54"
#define Module_HelpVersion "0.48 (11 Jun 2009)" #define Module_HelpVersion "0.54 (23 Oct 2011)"
#define Module_LibraryVersionInfo "0:48" #define Module_LibraryVersionInfo "0:54"
...@@ -12,8 +12,11 @@ ...@@ -12,8 +12,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#if 0 #if 0
#define debugbut #define debugbut(k) dprintf k
#else
#define debugbut(k) /* Disabled */
#endif #endif
#include <stdio.h> #include <stdio.h>
...@@ -21,6 +24,7 @@ ...@@ -21,6 +24,7 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include <ctype.h> #include <ctype.h>
#include <time.h>
#include "os.h" #include "os.h"
#include "wimp.h" #include "wimp.h"
...@@ -45,7 +49,7 @@ ...@@ -45,7 +49,7 @@
static void null_activity( action_environment * ); static void null_activity( action_environment * );
static void pause_operation( action_environment * ); static void pause_operation( action_environment * );
static void continue_operation( action_environment * ); static void continue_operation( action_environment * );
#ifdef UseFasterButton #ifdef USE_FASTER_BUTTON
static void faster_operation( action_environment * ); static void faster_operation( action_environment * );
#endif #endif
static void skip_file( action_environment * ); static void skip_file( action_environment * );
...@@ -65,7 +69,7 @@ const button_set abort_pause_buttons = ...@@ -65,7 +69,7 @@ const button_set abort_pause_buttons =
null_activity, null_activity,
null_activity, null_activity,
pause_operation, pause_operation,
#ifdef UseFasterButton #ifdef USE_FASTER_BUTTON
faster_operation, faster_operation,
#else #else
null_activity, null_activity,
...@@ -75,7 +79,7 @@ const button_set abort_pause_buttons = ...@@ -75,7 +79,7 @@ const button_set abort_pause_buttons =
"", "",
"", "",
"4", "4",
#ifdef UseFasterButton #ifdef USE_FASTER_BUTTON
"FS" "FS"
#else #else
"" ""
...@@ -87,7 +91,7 @@ const button_set abort_pause_buttons = ...@@ -87,7 +91,7 @@ const button_set abort_pause_buttons =
NULL, NULL,
NULL, NULL,
"6", "6",
#ifdef UseFasterButton #ifdef USE_FASTER_BUTTON
"F" "F"
#else #else
NULL NULL
...@@ -280,146 +284,148 @@ const button_set open_buttons = ...@@ -280,146 +284,148 @@ const button_set open_buttons =
static void set_button( action_environment *env, int button, const char *text ) static void set_button( action_environment *env, int button, const char *text )
{ {
int dbox_handle = dbox_syshandle( env->status_box ); int dbox_handle = dbox_syshandle( env->status_box );
if ( text != NULL ) if ( text != NULL )
{ {
/* /*
Ensure button exists before setting field Ensure button exists before setting field
*/ */
wimp_set_icon_state( dbox_handle, button, 0, wimp_IDELETED | wimp_IREDRAW ); wimp_iconflags flags = (wimp_iconflags) 0;
dbox_setfield( env->status_box, button, msgs_lookup((char *)text) ); wimp_iconflags mask = (wimp_iconflags) (wimp_IDELETED | wimp_IREDRAW);
} wimp_set_icon_state( dbox_handle, button, flags, mask );
else dbox_setfield( env->status_box, button, msgs_lookup((char *)text) );
{ }
wimp_redrawstr r; else
wimp_icon icondata; {
os_error *err; wimp_redrawstr r;
wimp_icon icondata;
os_error *err;
/* /*
delete button delete button
*/ */
err = wimp_get_icon_info( dbox_handle, button, &icondata ); err = wimp_get_icon_info( dbox_handle, button, &icondata );
if ( !err ) if ( !err )
{ {
wimp_set_icon_state( dbox_handle, button, wimp_IDELETED | wimp_IREDRAW, wimp_IDELETED | wimp_IREDRAW ); wimp_iconflags flags = (wimp_iconflags) (wimp_IDELETED | wimp_IREDRAW);
wimp_iconflags mask = flags;
wimp_set_icon_state( dbox_handle, button, flags, mask );
r.w = dbox_handle; r.w = dbox_handle;
r.box = icondata.box; r.box = icondata.box;
wimp_force_redraw( &r ); wimp_force_redraw( &r );
}
} }
}
} }
static void set_all_buttons( action_environment *env, const button_texts *texts ) static void set_all_buttons( action_environment *env, const button_texts *texts )
{ {
set_button( env, Abort_Button, texts->abort_text ); set_button( env, Abort_Button, texts->abort_text );
set_button( env, No_Skip_Button, texts->no_skip_text ); set_button( env, No_Skip_Button, texts->no_skip_text );
set_button( env, Yes_Retry_Button, texts->yes_retry_text ); set_button( env, Yes_Retry_Button, texts->yes_retry_text );
set_button( env, Misc_Button, texts->misc_text ); set_button( env, Misc_Button, texts->misc_text );
set_button( env, Skip_Button, texts->skip_text ); set_button( env, Skip_Button, texts->skip_text );
} }
void switch_buttons( action_environment *env, const button_set *new_buttons ) void switch_buttons( action_environment *env, const button_set *new_buttons )
{ {
env->button_actions = new_buttons->actions; env->button_actions = new_buttons->actions;
set_all_buttons( env, &new_buttons->texts ); set_all_buttons( env, &new_buttons->texts );
if ( new_buttons->actions.requires_interaction ) if ( new_buttons->actions.requires_interaction )
{ {
/* /*
Pop up the dialogue box and turn off NULL events Pop up the dialogue box and turn off NULL events
*/ */
dbox_showstatic( env->status_box ); dbox_showstatic( env->status_box );
show_faster_stuff( env ); show_faster_stuff( env );
event_setmask( wimp_EMNULL | wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG ); wimp_emask mask = (wimp_emask) (wimp_EMNULL | wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG);
}
else event_setmask( mask );
}
else
{
if ( !env->verbose )
{ {
if ( !env->verbose ) switch_dbox_on_off( env, -1, Remove_Delay );
{ }
switch_dbox_on_off( env, -1, Remove_Delay );
}
/* /*
Things might have changed, so update ourselves Things might have changed, so update ourselves
*/ */
read_next_node_parameters( env->test_search ); read_next_node_parameters( env->test_search );
event_setmask( wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG ); wimp_emask mask = (wimp_emask) (wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG);
}
#ifdef UseFasterButton event_setmask( mask );
/* Ensure we get the buttons we really need */ }
if ( new_buttons == &abort_pause_buttons )
{ #ifdef USE_FASTER_BUTTON
set_faster_state( env ); /* Ensure we get the buttons we really need */
} if ( new_buttons == &abort_pause_buttons )
#endif {
set_faster_state( env );
}
#endif
} }
void abort_operation( action_environment *env ) void abort_operation( action_environment *env )
{ {
dispose_search_context( env->test_search ); dispose_search_context( env->test_search );
exit( 0 ); exit( 0 );
} }
static void pause_operation( action_environment *env ) static void pause_operation( action_environment *env )
{ {
char info_buffer[ Info_Field_Length + 10 ]; set_button( env, Misc_Button, "26" );
set_button( env, Misc_Button, "26" ); env->button_actions.button_helps[ Misc_Button - Abort_Button ] = "79";
env->button_actions.button_helps[ Misc_Button - Abort_Button ] = "79"; env->button_actions.misc_action = continue_operation;
env->button_actions.misc_action = continue_operation; set_top_info_field_with_current_info(env, "80a", "80");
strcpy(info_buffer, "80a"); dbox_showstatic( env->status_box );
strcat(info_buffer, env->current_info_token);
sprintf(info_buffer, msgs_lookup(info_buffer), tolower(env->current_info[0]), &env->current_info[1]);
dbox_setfield( env->status_box, Top_Info_Field, info_buffer ); wimp_emask mask = (wimp_emask) (wimp_EMNULL | wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG );
last_top_info_field = info_buffer; event_setmask( mask );
dbox_showstatic( env->status_box );
event_setmask( wimp_EMNULL | wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG );
} }
#ifdef UseFasterButton #ifdef USE_FASTER_BUTTON
/* JRF: Calls the same thing as the menu option */ /* JRF: Calls the same thing as the menu option */
static void faster_operation( action_environment *env ) static void faster_operation( action_environment *env )
{ {
toggle_faster( env ); toggle_faster( env );
} }
void set_faster_state( action_environment *env ) void set_faster_state( action_environment *env )
{ {
if ( !env->button_actions.requires_interaction ) if ( !env->button_actions.requires_interaction )
{ {
if ( env->faster ) if ( env->faster )
set_button( env, Skip_Button, "S" ); set_button( env, Skip_Button, "S" );
else else
set_button( env, Skip_Button, "F" ); set_button( env, Skip_Button, "F" );
} }
} }
#endif #endif
static void continue_operation( action_environment *env ) static void continue_operation( action_environment *env )
{ {
switch_buttons( env, &abort_pause_buttons ); switch_buttons( env, &abort_pause_buttons );
} }
static void null_activity( action_environment *env ) static void null_activity( action_environment *env )
{ {
env = env; /* keep the compiler quiet */ IGNORE(env);
} }
/* /*
...@@ -427,7 +433,7 @@ static void null_activity( action_environment *env ) ...@@ -427,7 +433,7 @@ static void null_activity( action_environment *env )
*/ */
static void operate_on_file( action_environment *env ) static void operate_on_file( action_environment *env )
{ {
switch_buttons( env, &abort_pause_buttons ); switch_buttons( env, &abort_pause_buttons );
} }
/* /*
...@@ -435,9 +441,9 @@ static void operate_on_file( action_environment *env ) ...@@ -435,9 +441,9 @@ static void operate_on_file( action_environment *env )
*/ */
static void to_end_of_list( action_environment *env ) static void to_end_of_list( action_environment *env )
{ {
switch_buttons( env, &abort_pause_buttons ); switch_buttons( env, &abort_pause_buttons );
env->confirm = No; env->confirm = No;
} }
/* /*
...@@ -445,11 +451,11 @@ static void to_end_of_list( action_environment *env ) ...@@ -445,11 +451,11 @@ static void to_end_of_list( action_environment *env )
*/ */
static void skip_file( action_environment *env ) static void skip_file( action_environment *env )
{ {
env->action = Next_File; env->action = Next_File;
skip_list_file( env->test_search ); skip_list_file( env->test_search );
switch_buttons( env, &abort_pause_buttons ); switch_buttons( env, &abort_pause_buttons );
} }
/* /*
...@@ -457,109 +463,109 @@ static void skip_file( action_environment *env ) ...@@ -457,109 +463,109 @@ static void skip_file( action_environment *env )
*/ */
static void skip_operation( action_environment *env ) static void skip_operation( action_environment *env )
{ {
if ( env->action == Next_File ) if ( env->action == Next_File )
{
skip_failed_selection( env->test_search );
}
else
{
switch ( env->operation )
{ {
skip_failed_selection( env->test_search ); case Action_Copying:
} case Action_CopyMoving:
else case Action_CopyLocal:
{ if ( env->action == Check_Full_Reading )
switch ( env->operation ) {
{ skip_file_read();
case Action_Copying: switch_to_reading( env );
case Action_CopyMoving: }
case Action_CopyLocal: else if ( env->action == Check_Empty_Writing )
if ( env->action == Check_Full_Reading ) {
{ skip_file_write();
skip_file_read(); switch_to_writing( env );
switch_to_reading( env ); }
} else
else if ( env->action == Check_Empty_Writing ) {
{ env->action = Next_File;
skip_file_write(); }
switch_to_writing( env ); break;
}
else case Action_Moving:
{ case Action_Deleting:
env->action = Next_File; case Action_Setting_Access:
} case Action_Setting_Type:
break; case Action_Counting:
case Action_Stamping:
case Action_Moving: case Action_Finding:
case Action_Deleting: env->action = Next_File;
case Action_Setting_Access: break;
case Action_Setting_Type:
case Action_Counting:
case Action_Stamping:
case Action_Finding:
env->action = Next_File;
break;
}
} }
}
switch_buttons( env, &abort_pause_buttons ); switch_buttons( env, &abort_pause_buttons );
} }
static void run_object( action_environment *env ) static void run_object( action_environment *env )
{ {
char *filename; char *filename;
char *command; char *command;
os_error *err; os_error *err;
err = next_nodename( env->test_search, &filename ); err = next_nodename( env->test_search, &filename );
if ( err ) if ( err )
{ {
wimpt_complain( err ); wimpt_complain( err );
return; return;
} }
command = overflowing_malloc( strlen( "Filer_Run " ) + strlen( filename ) + 1 ); command = overflowing_malloc( strlen( "Filer_Run " ) + strlen( filename ) + 1 );
if ( !command ) if ( !command )
{ {
wimpt_complain( error( mb_malloc_failed ) ); wimpt_complain( error( mb_malloc_failed ) );
return; return;
} }
sprintf( command, "Filer_Run %s", filename ); sprintf( command, "Filer_Run %s", filename );
overflowing_free( filename ); overflowing_free( filename );
wimpt_complain( os_cli( command )); wimpt_complain( os_cli( command ));
overflowing_free( command ); overflowing_free( command );
} }
static void view_object( action_environment *env ) static void view_object( action_environment *env )
{ {
wimp_msgstr m; wimp_msgstr m;
char *filename; char *filename;
os_error *err; os_error *err;
err = next_nodename( env->test_search, &filename ); err = next_nodename( env->test_search, &filename );
if ( err ) if ( err )
{ {
wimpt_complain( err ); wimpt_complain( err );
return; return;
} }
/* /*
strrchr is guaranteed to work correctly due to the nature of the strrchr is guaranteed to work correctly due to the nature of the
filename. filename.
*/ */
*strrchr( filename, '.' ) = '\0'; *strrchr( filename, '.' ) = '\0';
m.hdr.size = 256; m.hdr.size = 256;
m.hdr.your_ref = 0; m.hdr.your_ref = 0;
m.hdr.action = wimp_FilerOpenDir; m.hdr.action = wimp_FilerOpenDir;
m.data.words[ 0 ] = 0; m.data.words[ 0 ] = 0;
m.data.words[ 1 ] = 0; m.data.words[ 1 ] = 0;
strcpy( (char *)&m.data.words[2], filename ); strcpy( (char *)&m.data.words[2], filename );
overflowing_free( filename ); overflowing_free( filename );
wimpt_complain( wimp_sendmessage( wimp_ESEND, &m, 0 )); wimpt_complain( wimp_sendmessage( wimp_ESEND, &m, 0 ));
} }
/* /*
...@@ -567,16 +573,14 @@ static void view_object( action_environment *env ) ...@@ -567,16 +573,14 @@ static void view_object( action_environment *env )
*/ */
static void restart_operation( action_environment *env ) static void restart_operation( action_environment *env )
{ {
#ifdef debugbut debugbut(( "restart_operation: env=&%8X\n", (int)env ));
dprintf( "restart_operation: env=&%8X\n", (int)env ); if ( env->action == Check_Full_Reading )
#endif restart_file_read();
if ( env->action == Check_Full_Reading )
restart_file_read();
if ( env->action == Check_Empty_Writing ) if ( env->action == Check_Empty_Writing )
restart_file_write(); restart_file_write();
switch_buttons( env, &abort_pause_buttons ); switch_buttons( env, &abort_pause_buttons );
} }
/* /*
...@@ -584,7 +588,7 @@ static void restart_operation( action_environment *env ) ...@@ -584,7 +588,7 @@ static void restart_operation( action_environment *env )
*/ */
static void retry_operation( action_environment *env ) static void retry_operation( action_environment *env )
{ {
switch_buttons( env, &abort_pause_buttons ); switch_buttons( env, &abort_pause_buttons );
} }
/* /*
...@@ -592,34 +596,34 @@ static void retry_operation( action_environment *env ) ...@@ -592,34 +596,34 @@ static void retry_operation( action_environment *env )
*/ */
void button_event_handler( dbox db, void *handle ) void button_event_handler( dbox db, void *handle )
{ {
action_environment *env = handle; action_environment *env = handle;
db = db; /* keep the compiler quiet */ IGNORE(db);
switch( dbox_get( env->status_box )) switch( dbox_get( env->status_box ))
{ {
case Abort_Button: case Abort_Button:
env->button_actions.abort_action( env ); env->button_actions.abort_action( env );
break; break;
case No_Skip_Button: case No_Skip_Button:
env->button_actions.no_skip_action( env ); env->button_actions.no_skip_action( env );
break; break;
case Yes_Retry_Button: case Yes_Retry_Button:
env->button_actions.yes_retry_action( env ); env->button_actions.yes_retry_action( env );
break; break;
case Misc_Button: case Misc_Button:
env->button_actions.misc_action( env ); env->button_actions.misc_action( env );
break; break;
case Skip_Button: case Skip_Button:
env->button_actions.skip_action( env ); env->button_actions.skip_action( env );
break; break;
default: default:
/* do nothing on other fields */ /* do nothing on other fields */
break; break;
} }
} }
...@@ -16,16 +16,10 @@ ...@@ -16,16 +16,10 @@
Chain manipulation routines. Chain manipulation routines.
*/ */
#if 0
#define debugchain
#endif
#include <stdio.h> #include <stdio.h>
#include "debug.h" #include "debug.h"
#ifndef __chains_h
#include "chains.h" #include "chains.h"
#endif
void chain_remove_link( chain_link *link ) void chain_remove_link( chain_link *link )
{ {
......
...@@ -12,14 +12,18 @@ ...@@ -12,14 +12,18 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#if 0 #if 0
#define debuginit #define debuginit(k) dprintf k
#else
#define debuginit(k) /* Disabled */
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include <locale.h> #include <locale.h>
#include <time.h>
#include "os.h" #include "os.h"
#include "wimp.h" #include "wimp.h"
...@@ -33,7 +37,7 @@ ...@@ -33,7 +37,7 @@
#include "msgs.h" #include "msgs.h"
#include "menu.h" #include "menu.h"
#include "Options.h"
#include "allerrs.h" #include "allerrs.h"
#include "malloc+.h" #include "malloc+.h"
#include "listfiles.h" #include "listfiles.h"
...@@ -60,32 +64,32 @@ os_error errbuf = { 0, "" }; ...@@ -60,32 +64,32 @@ os_error errbuf = { 0, "" };
*/ */
static void remove_processor( void ) static void remove_processor( void )
{ {
win_remove_unknown_event_processor( message_event_handler, &env ); win_remove_unknown_event_processor( message_event_handler, &env );
closedown_memmanagement(); closedown_memmanagement();
} }
static void near_mouse_position_window( char *window_name ) static void near_mouse_position_window( char *window_name )
{ {
template *tplt = template_find( window_name ); template *tplt = template_find( window_name );
wimp_mousestr ptr; wimp_mousestr ptr;
os_error *err; os_error *err;
int x_offset; int x_offset;
int y_offset; int y_offset;
err = wimp_get_point_info( &ptr ); err = wimp_get_point_info( &ptr );
if ( !err ) if ( !err )
{ {
x_offset = (ptr.x - Window_Title_Height - Character_Height) - x_offset = (ptr.x - Window_Title_Height - Character_Height) -
tplt->window.box.x0; tplt->window.box.x0;
y_offset = (ptr.y - Window_Title_Height - Character_Height) - y_offset = (ptr.y - Window_Title_Height - Character_Height) -
tplt->window.box.y1; tplt->window.box.y1;
tplt->window.box.x0 += x_offset; tplt->window.box.x0 += x_offset;
tplt->window.box.x1 += x_offset; tplt->window.box.x1 += x_offset;
tplt->window.box.y0 += y_offset; tplt->window.box.y0 += y_offset;
tplt->window.box.y1 += y_offset; tplt->window.box.y1 += y_offset;
} }
} }
...@@ -105,121 +109,126 @@ static wimp_msgaction Messages[] = { ...@@ -105,121 +109,126 @@ static wimp_msgaction Messages[] = {
wimp_MFilerAddSelection, wimp_MFilerAddSelection,
wimp_MFilerAction, wimp_MFilerAction,
wimp_MFilerControlAction, wimp_MFilerControlAction,
0 wimp_MCLOSEDOWN /* list terminator (0, but with the right type) */
}; };
os_error *initialise( action_environment *env, int argc, char *argv[] ) os_error *initialise( action_environment *env, int argc, char *argv[] )
{ {
os_error *err;
IGNORE(argc); /* keep the compiler quiet */
IGNORE(argv); /* keep the compiler quiet */
overflowing_initialise();
/*
Pull in some resources
*/
res_init("FilerAct");
msgs_init();
wimpt_messages(Messages);
wimpt_init(msgs_lookup("89"));
template_init();
debuginit(( "Resources initialised\n" ));
#ifdef debug
/* Test errors. */
{
os_error *err; os_error *err;
err = error( mb_slotsize_too_small );
argc = argc; /* keep the compiler quiet */ debuginit(( "%d: %s\n", err->errnum, err->errmess ));
argv = argv; /* keep the compiler quiet */ err = error( mb_malloc_failed );
debuginit(( "%d: %s\n", err->errnum, err->errmess ));
overflowing_initialise(); err = error( mb_unexpected_state );
debuginit(( "%d: %s\n", err->errnum, err->errmess ));
/* err = error( mb_broken_templates );
Pull in some resources debuginit(( "%d: %s\n", err->errnum, err->errmess ));
*/ }
res_init("FilerAct"); #endif
msgs_init();
wimpt_messages(Messages); /*
wimpt_init(msgs_lookup("89")); Get the memmanagement onto the right footing
template_init(); */
err = init_memmanagement();
#ifdef debuginit if ( err )
/* Test errors. */ return err;
{ os_error *err;
err = error( mb_slotsize_too_small ); /*
dprintf("%d: %s\n", err->errnum, err->errmess); re-position the window near the mouse
err = error( mb_malloc_failed ); */
dprintf("%d: %s\n", err->errnum, err->errmess); near_mouse_position_window( MAIN_TEMPLATE_NAME );
err = error( mb_unexpected_state );
dprintf("%d: %s\n", err->errnum, err->errmess); /*
err = error( mb_broken_templates ); start up the dbox wimplib stuff
dprintf("%d: %s\n", err->errnum, err->errmess); */
} dbox_init();
#endif
/*
/* Add event processor here, so that deactivate_myself can cleanly
Get the memmanagement onto the right footing remove it
*/ */
err = init_memmanagement(); win_add_unknown_event_processor( message_event_handler, env );
if ( err ) atexit( remove_processor );
return err;
/*
/* create a window for ourself
re-position the window near the mouse */
*/ env->status_box = dbox_new( MAIN_TEMPLATE_NAME );
near_mouse_position_window( Main_Window ); if ( env->status_box == NULL )
return error( mb_broken_templates );
/* env->window_handle = dbox_syshandle( env->status_box );
start up the dbox wimplib stuff
*/ /*
dbox_init(); Attach the button event handler
*/
/* dbox_eventhandler( env->status_box, button_event_handler, env );
Add event processor here, so that deactivate_myself can cleanly
remove it /*
*/ Give ourself a menu
win_add_unknown_event_processor( message_event_handler, env ); */
atexit( remove_processor ); env->option_menu = menu_new( msgs_lookup( "90" ), msgs_lookup( "91" ));
if ( env->option_menu == NULL )
/* return error( mb_malloc_failed );
create a window for ourselved event_attachmenu( dbox_syshandle( env->status_box ), env->option_menu, (event_menu_proc)option_menu_handler, env );
*/
env->status_box = dbox_new( Main_Window ); /*
if ( env->status_box == NULL ) Attach idle event handler to dialogue box
return error( mb_broken_templates ); */
dbox_raw_eventhandler( env->status_box, idle_event_handler, env );
/*
Attach the button event handler /*
*/ Direct idle events at the dialogue box
dbox_eventhandler( env->status_box, button_event_handler, env ); */
win_claim_idle_events( dbox_syshandle( env->status_box ));
/*
Give ourselves a menu /*
*/ Enable only those events we're interested in
env->option_menu = menu_new( msgs_lookup( "90" ), msgs_lookup( "91" )); */
if ( env->option_menu == NULL ) event_setmask( (wimp_emask)(wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG) );
return error( mb_malloc_failed );
event_attachmenu( dbox_syshandle( env->status_box ), env->option_menu, (event_menu_proc)option_menu_handler, env ); /*
Initialise an empty search context and boxchange information.
/* Also initialise memory flexing state.
Attach idle event handler to dialogue box */
*/ create_search_context( &env->test_search );
dbox_raw_eventhandler( env->status_box, idle_event_handler, env ); env->boxchange_direction = 0;
env->flex_memory = No;
/* env->disable_flex = No;
Direct idle events at the dialogue box env->in_error = No;
*/ #ifdef USE_PROGRESS_BAR
win_claim_idle_events( dbox_syshandle( env->status_box )); env->progress = 0;
#endif
/*
Enable only those events we're interested in last_top_info_field = NULL;
*/
event_setmask( wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG ); /*
Make sure we don't go away when the window's closed
/* */
Initialise an empty search context and boxchange information. win_activeinc();
Also initialise memory flexing state.
*/ dboxquery( 0 );
create_search_context( &env->test_search );
env->boxchange_direction = 0; setlocale( LC_ALL, "" );
env->flex_memory = No;
env->disable_flex = No; return NULL;
env->in_error = No;
last_top_info_field = NULL;
/*
Make sure we don't go away when the window's closed
*/
win_activeinc();
dboxquery( 0 );
setlocale( LC_ALL, "" );
return NULL;
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -15,11 +15,9 @@ ...@@ -15,11 +15,9 @@
/* /*
Header file for initialise.c Header file for initialise.c
*/ */
#define wimp_MFilerSelectionDirectory 0x403 #define wimp_MFilerSelectionDirectory ((wimp_msgaction)0x403)
#define wimp_MFilerAddSelection 0x404 #define wimp_MFilerAddSelection ((wimp_msgaction)0x404)
#define wimp_MFilerAction 0x405 #define wimp_MFilerAction ((wimp_msgaction)0x405)
#define wimp_MFilerControlAction 0x406 #define wimp_MFilerControlAction ((wimp_msgaction)0x406)
#define wimp_MSETSLOT 0x400c5
os_error *initialise( action_environment *env, int argc, char *argv[] ); os_error *initialise( action_environment *env, int argc, char *argv[] );
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.