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>
#
# Generic options:
#
MKDIR = cdir
AS = objasm
CC = cc
CP = copy
LD = link
RM = remove
WIPE = -wipe
DFLAGS =
include StdTools
#DFLAGS = -Ddebugfile="\"RAM::0.$.out\""
AFLAGS = -depend !Depend -Stamp -quit
CFLAGS = -c -depend !Depend -ffah ${INCLUDES} ${DFLAGS}
CFLAGS = -c -throwback -depend !Depend -ffah ${INCLUDES} ${DFLAGS}
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
......@@ -130,12 +124,12 @@ install_rom: ${TARGET}
@echo ${COMPONENT}: rom module installed
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} oa.* ${WFLAGS}
${WIPE} app.* ${WFLAGS}
${WIPE} rm.* ${WFLAGS}
${WIPE} linked.* ${WFLAGS}
${WIPE} map.* ${WFLAGS}
${XWIPE} o.* ${WFLAGS}
${XWIPE} oa.* ${WFLAGS}
${XWIPE} app.* ${WFLAGS}
${XWIPE} rm.* ${WFLAGS}
${XWIPE} linked.* ${WFLAGS}
${XWIPE} map.* ${WFLAGS}
${RM} ${TARGET}
${RM} s.ModuleWrap
@echo ${COMPONENT}: cleaned
......
No preview for this file type
......@@ -82,13 +82,16 @@ S:Slower
77:Stamp
78:Check
79:continue the operation
80:Paused
80a32/80a36/80a41/80a46/80a51/80a56/80a62/80a67/80a82:Paused %c%s
81:There is a %s operation in progress.
82:Writing
84:Found
85:Finished
86:%d locked item(s) not deleted
87:Disc full
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
89:Filer Action Window
90:Options
......
No preview for this file type
......@@ -14,3 +14,4 @@
|
Set FilerAct$Path Resources:Resources.FilerAct.
UnSet Alias$Filer_Action
UnSet Alias$Filer_Action2
......@@ -13,4 +13,5 @@
| limitations under the License.
|
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
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.48"
Module_Version SETA 48
Module_MajorVersion SETS "0.54"
Module_Version SETA 54
Module_MinorVersion SETS ""
Module_Date SETS "11 Jun 2009"
Module_ApplicationDate SETS "11-Jun-09"
Module_Date SETS "23 Oct 2011"
Module_ApplicationDate SETS "23-Oct-11"
Module_ComponentName SETS "FilerAct"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/FilerAct"
Module_FullVersion SETS "0.48"
Module_HelpVersion SETS "0.48 (11 Jun 2009)"
Module_FullVersion SETS "0.54"
Module_HelpVersion SETS "0.54 (23 Oct 2011)"
END
/* (0.48)
/* (0.54)
*
* This file is automatically maintained by srccommit, do not edit manually.
* 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_Date_CMHG 11 Jun 2009
#define Module_Date_CMHG 23 Oct 2011
#define Module_MajorVersion "0.48"
#define Module_Version 48
#define Module_MajorVersion "0.54"
#define Module_Version 54
#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_ComponentPath "castle/RiscOS/Sources/Desktop/FilerAct"
#define Module_FullVersion "0.48"
#define Module_HelpVersion "0.48 (11 Jun 2009)"
#define Module_LibraryVersionInfo "0:48"
#define Module_FullVersion "0.54"
#define Module_HelpVersion "0.54 (23 Oct 2011)"
#define Module_LibraryVersionInfo "0:54"
......@@ -12,8 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if 0
#define debugbut
#define debugbut(k) dprintf k
#else
#define debugbut(k) /* Disabled */
#endif
#include <stdio.h>
......@@ -21,6 +24,7 @@
#include <string.h>
#include <stdint.h>
#include <ctype.h>
#include <time.h>
#include "os.h"
#include "wimp.h"
......@@ -45,7 +49,7 @@
static void null_activity( action_environment * );
static void pause_operation( action_environment * );
static void continue_operation( action_environment * );
#ifdef UseFasterButton
#ifdef USE_FASTER_BUTTON
static void faster_operation( action_environment * );
#endif
static void skip_file( action_environment * );
......@@ -65,7 +69,7 @@ const button_set abort_pause_buttons =
null_activity,
null_activity,
pause_operation,
#ifdef UseFasterButton
#ifdef USE_FASTER_BUTTON
faster_operation,
#else
null_activity,
......@@ -75,7 +79,7 @@ const button_set abort_pause_buttons =
"",
"",
"4",
#ifdef UseFasterButton
#ifdef USE_FASTER_BUTTON
"FS"
#else
""
......@@ -87,7 +91,7 @@ const button_set abort_pause_buttons =
NULL,
NULL,
"6",
#ifdef UseFasterButton
#ifdef USE_FASTER_BUTTON
"F"
#else
NULL
......@@ -280,146 +284,148 @@ const button_set open_buttons =
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 )
{
/*
Ensure button exists before setting field
*/
wimp_set_icon_state( dbox_handle, button, 0, wimp_IDELETED | wimp_IREDRAW );
dbox_setfield( env->status_box, button, msgs_lookup((char *)text) );
}
else
{
wimp_redrawstr r;
wimp_icon icondata;
os_error *err;
if ( text != NULL )
{
/*
Ensure button exists before setting field
*/
wimp_iconflags flags = (wimp_iconflags) 0;
wimp_iconflags mask = (wimp_iconflags) (wimp_IDELETED | wimp_IREDRAW);
wimp_set_icon_state( dbox_handle, button, flags, mask );
dbox_setfield( env->status_box, button, msgs_lookup((char *)text) );
}
else
{
wimp_redrawstr r;
wimp_icon icondata;
os_error *err;
/*
delete button
*/
err = wimp_get_icon_info( dbox_handle, button, &icondata );
/*
delete button
*/
err = wimp_get_icon_info( dbox_handle, button, &icondata );
if ( !err )
{
wimp_set_icon_state( dbox_handle, button, wimp_IDELETED | wimp_IREDRAW, wimp_IDELETED | wimp_IREDRAW );
if ( !err )
{
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.box = icondata.box;
r.w = dbox_handle;
r.box = icondata.box;
wimp_force_redraw( &r );
}
wimp_force_redraw( &r );
}
}
}
static void set_all_buttons( action_environment *env, const button_texts *texts )
{
set_button( env, Abort_Button, texts->abort_text );
set_button( env, No_Skip_Button, texts->no_skip_text );
set_button( env, Yes_Retry_Button, texts->yes_retry_text );
set_button( env, Misc_Button, texts->misc_text );
set_button( env, Skip_Button, texts->skip_text );
set_button( env, Abort_Button, texts->abort_text );
set_button( env, No_Skip_Button, texts->no_skip_text );
set_button( env, Yes_Retry_Button, texts->yes_retry_text );
set_button( env, Misc_Button, texts->misc_text );
set_button( env, Skip_Button, texts->skip_text );
}
void switch_buttons( action_environment *env, const button_set *new_buttons )
{
env->button_actions = new_buttons->actions;
set_all_buttons( env, &new_buttons->texts );
env->button_actions = new_buttons->actions;
set_all_buttons( env, &new_buttons->texts );
if ( new_buttons->actions.requires_interaction )
{
/*
Pop up the dialogue box and turn off NULL events
*/
dbox_showstatic( env->status_box );
if ( new_buttons->actions.requires_interaction )
{
/*
Pop up the dialogue box and turn off NULL events
*/
dbox_showstatic( env->status_box );
show_faster_stuff( env );
show_faster_stuff( env );
event_setmask( wimp_EMNULL | wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG );
}
else
wimp_emask mask = (wimp_emask) (wimp_EMNULL | wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG);
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
*/
read_next_node_parameters( env->test_search );
/*
Things might have changed, so update ourselves
*/
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
/* Ensure we get the buttons we really need */
if ( new_buttons == &abort_pause_buttons )
{
set_faster_state( env );
}
#endif
event_setmask( mask );
}
#ifdef USE_FASTER_BUTTON
/* Ensure we get the buttons we really need */
if ( new_buttons == &abort_pause_buttons )
{
set_faster_state( env );
}
#endif
}
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 )
{
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");
strcat(info_buffer, env->current_info_token);
sprintf(info_buffer, msgs_lookup(info_buffer), tolower(env->current_info[0]), &env->current_info[1]);
dbox_showstatic( env->status_box );
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;
dbox_showstatic( env->status_box );
event_setmask( wimp_EMNULL | wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG );
event_setmask( mask );
}
#ifdef UseFasterButton
#ifdef USE_FASTER_BUTTON
/* JRF: Calls the same thing as the menu option */
static void faster_operation( action_environment *env )
{
toggle_faster( env );
toggle_faster( env );
}
void set_faster_state( action_environment *env )
{
if ( !env->button_actions.requires_interaction )
{
if ( env->faster )
if ( !env->button_actions.requires_interaction )
{
if ( env->faster )
set_button( env, Skip_Button, "S" );
else
else
set_button( env, Skip_Button, "F" );
}
}
}
#endif
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 )
{
env = env; /* keep the compiler quiet */
IGNORE(env);
}
/*
......@@ -427,7 +433,7 @@ static void null_activity( 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 )
*/
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 )
*/
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 )
*/
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 );
}
else
{
switch ( env->operation )
{
case Action_Copying:
case Action_CopyMoving:
case Action_CopyLocal:
if ( env->action == Check_Full_Reading )
{
skip_file_read();
switch_to_reading( env );
}
else if ( env->action == Check_Empty_Writing )
{
skip_file_write();
switch_to_writing( env );
}
else
{
env->action = Next_File;
}
break;
case Action_Moving:
case Action_Deleting:
case Action_Setting_Access:
case Action_Setting_Type:
case Action_Counting:
case Action_Stamping:
case Action_Finding:
env->action = Next_File;
break;
}
case Action_Copying:
case Action_CopyMoving:
case Action_CopyLocal:
if ( env->action == Check_Full_Reading )
{
skip_file_read();
switch_to_reading( env );
}
else if ( env->action == Check_Empty_Writing )
{
skip_file_write();
switch_to_writing( env );
}
else
{
env->action = Next_File;
}
break;
case Action_Moving:
case Action_Deleting:
case Action_Setting_Access:
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 )
{
char *filename;
char *command;
os_error *err;
char *filename;
char *command;
os_error *err;
err = next_nodename( env->test_search, &filename );
err = next_nodename( env->test_search, &filename );
if ( err )
{
wimpt_complain( err );
return;
}
if ( err )
{
wimpt_complain( err );
return;
}
command = overflowing_malloc( strlen( "Filer_Run " ) + strlen( filename ) + 1 );
command = overflowing_malloc( strlen( "Filer_Run " ) + strlen( filename ) + 1 );
if ( !command )
{
wimpt_complain( error( mb_malloc_failed ) );
return;
}
if ( !command )
{
wimpt_complain( error( mb_malloc_failed ) );
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 )
{
wimp_msgstr m;
char *filename;
os_error *err;
err = next_nodename( env->test_search, &filename );
if ( err )
{
wimpt_complain( err );
return;
}
/*
strrchr is guaranteed to work correctly due to the nature of the
filename.
*/
*strrchr( filename, '.' ) = '\0';
m.hdr.size = 256;
m.hdr.your_ref = 0;
m.hdr.action = wimp_FilerOpenDir;
m.data.words[ 0 ] = 0;
m.data.words[ 1 ] = 0;
strcpy( (char *)&m.data.words[2], filename );
overflowing_free( filename );
wimpt_complain( wimp_sendmessage( wimp_ESEND, &m, 0 ));
wimp_msgstr m;
char *filename;
os_error *err;
err = next_nodename( env->test_search, &filename );
if ( err )
{
wimpt_complain( err );
return;
}
/*
strrchr is guaranteed to work correctly due to the nature of the
filename.
*/
*strrchr( filename, '.' ) = '\0';
m.hdr.size = 256;
m.hdr.your_ref = 0;
m.hdr.action = wimp_FilerOpenDir;
m.data.words[ 0 ] = 0;
m.data.words[ 1 ] = 0;
strcpy( (char *)&m.data.words[2], filename );
overflowing_free( filename );
wimpt_complain( wimp_sendmessage( wimp_ESEND, &m, 0 ));
}
/*
......@@ -567,16 +573,14 @@ static void view_object( action_environment *env )
*/
static void restart_operation( action_environment *env )
{
#ifdef debugbut
dprintf( "restart_operation: env=&%8X\n", (int)env );
#endif
if ( env->action == Check_Full_Reading )
restart_file_read();
debugbut(( "restart_operation: env=&%8X\n", (int)env ));
if ( env->action == Check_Full_Reading )
restart_file_read();
if ( env->action == Check_Empty_Writing )
restart_file_write();
if ( env->action == Check_Empty_Writing )
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 )
*/
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 )
*/
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 ))
{
case Abort_Button:
env->button_actions.abort_action( env );
break;
switch( dbox_get( env->status_box ))
{
case Abort_Button:
env->button_actions.abort_action( env );
break;
case No_Skip_Button:
env->button_actions.no_skip_action( env );
break;
case No_Skip_Button:
env->button_actions.no_skip_action( env );
break;
case Yes_Retry_Button:
env->button_actions.yes_retry_action( env );
break;
case Yes_Retry_Button:
env->button_actions.yes_retry_action( env );
break;
case Misc_Button:
env->button_actions.misc_action( env );
break;
case Misc_Button:
env->button_actions.misc_action( env );
break;
case Skip_Button:
env->button_actions.skip_action( env );
break;
case Skip_Button:
env->button_actions.skip_action( env );
break;
default:
/* do nothing on other fields */
break;
}
default:
/* do nothing on other fields */
break;
}
}
......@@ -16,16 +16,10 @@
Chain manipulation routines.
*/
#if 0
#define debugchain
#endif
#include <stdio.h>
#include "debug.h"
#ifndef __chains_h
#include "chains.h"
#endif
void chain_remove_link( chain_link *link )
{
......
......@@ -12,14 +12,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if 0
#define debuginit
#define debuginit(k) dprintf k
#else
#define debuginit(k) /* Disabled */
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <locale.h>
#include <time.h>
#include "os.h"
#include "wimp.h"
......@@ -33,7 +37,7 @@
#include "msgs.h"
#include "menu.h"
#include "Options.h"
#include "allerrs.h"
#include "malloc+.h"
#include "listfiles.h"
......@@ -60,32 +64,32 @@ os_error errbuf = { 0, "" };
*/
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 )
{
template *tplt = template_find( window_name );
wimp_mousestr ptr;
os_error *err;
int x_offset;
int y_offset;
err = wimp_get_point_info( &ptr );
if ( !err )
{
x_offset = (ptr.x - Window_Title_Height - Character_Height) -
tplt->window.box.x0;
y_offset = (ptr.y - Window_Title_Height - Character_Height) -
tplt->window.box.y1;
tplt->window.box.x0 += x_offset;
tplt->window.box.x1 += x_offset;
tplt->window.box.y0 += y_offset;
tplt->window.box.y1 += y_offset;
}
{
template *tplt = template_find( window_name );
wimp_mousestr ptr;
os_error *err;
int x_offset;
int y_offset;
err = wimp_get_point_info( &ptr );
if ( !err )
{
x_offset = (ptr.x - Window_Title_Height - Character_Height) -
tplt->window.box.x0;
y_offset = (ptr.y - Window_Title_Height - Character_Height) -
tplt->window.box.y1;
tplt->window.box.x0 += x_offset;
tplt->window.box.x1 += x_offset;
tplt->window.box.y0 += y_offset;
tplt->window.box.y1 += y_offset;
}
}
......@@ -105,121 +109,126 @@ static wimp_msgaction Messages[] = {
wimp_MFilerAddSelection,
wimp_MFilerAction,
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 *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;
argc = argc; /* keep the compiler quiet */
argv = 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();
#ifdef debuginit
/* Test errors. */
{ os_error *err;
err = error( mb_slotsize_too_small );
dprintf("%d: %s\n", err->errnum, err->errmess);
err = error( mb_malloc_failed );
dprintf("%d: %s\n", err->errnum, err->errmess);
err = error( mb_unexpected_state );
dprintf("%d: %s\n", err->errnum, err->errmess);
err = error( mb_broken_templates );
dprintf("%d: %s\n", err->errnum, err->errmess);
}
#endif
/*
Get the memmanagement onto the right footing
*/
err = init_memmanagement();
if ( err )
return err;
/*
re-position the window near the mouse
*/
near_mouse_position_window( Main_Window );
/*
start up the dbox wimplib stuff
*/
dbox_init();
/*
Add event processor here, so that deactivate_myself can cleanly
remove it
*/
win_add_unknown_event_processor( message_event_handler, env );
atexit( remove_processor );
/*
create a window for ourselved
*/
env->status_box = dbox_new( Main_Window );
if ( env->status_box == NULL )
return error( mb_broken_templates );
/*
Attach the button event handler
*/
dbox_eventhandler( env->status_box, button_event_handler, env );
/*
Give ourselves a menu
*/
env->option_menu = menu_new( msgs_lookup( "90" ), msgs_lookup( "91" ));
if ( env->option_menu == NULL )
return error( mb_malloc_failed );
event_attachmenu( dbox_syshandle( env->status_box ), env->option_menu, (event_menu_proc)option_menu_handler, env );
/*
Attach idle event handler to dialogue box
*/
dbox_raw_eventhandler( env->status_box, idle_event_handler, env );
/*
Direct idle events at the dialogue box
*/
win_claim_idle_events( dbox_syshandle( env->status_box ));
/*
Enable only those events we're interested in
*/
event_setmask( wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG );
/*
Initialise an empty search context and boxchange information.
Also initialise memory flexing state.
*/
create_search_context( &env->test_search );
env->boxchange_direction = 0;
env->flex_memory = No;
env->disable_flex = No;
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;
err = error( mb_slotsize_too_small );
debuginit(( "%d: %s\n", err->errnum, err->errmess ));
err = error( mb_malloc_failed );
debuginit(( "%d: %s\n", err->errnum, err->errmess ));
err = error( mb_unexpected_state );
debuginit(( "%d: %s\n", err->errnum, err->errmess ));
err = error( mb_broken_templates );
debuginit(( "%d: %s\n", err->errnum, err->errmess ));
}
#endif
/*
Get the memmanagement onto the right footing
*/
err = init_memmanagement();
if ( err )
return err;
/*
re-position the window near the mouse
*/
near_mouse_position_window( MAIN_TEMPLATE_NAME );
/*
start up the dbox wimplib stuff
*/
dbox_init();
/*
Add event processor here, so that deactivate_myself can cleanly
remove it
*/
win_add_unknown_event_processor( message_event_handler, env );
atexit( remove_processor );
/*
create a window for ourself
*/
env->status_box = dbox_new( MAIN_TEMPLATE_NAME );
if ( env->status_box == NULL )
return error( mb_broken_templates );
env->window_handle = dbox_syshandle( env->status_box );
/*
Attach the button event handler
*/
dbox_eventhandler( env->status_box, button_event_handler, env );
/*
Give ourself a menu
*/
env->option_menu = menu_new( msgs_lookup( "90" ), msgs_lookup( "91" ));
if ( env->option_menu == NULL )
return error( mb_malloc_failed );
event_attachmenu( dbox_syshandle( env->status_box ), env->option_menu, (event_menu_proc)option_menu_handler, env );
/*
Attach idle event handler to dialogue box
*/
dbox_raw_eventhandler( env->status_box, idle_event_handler, env );
/*
Direct idle events at the dialogue box
*/
win_claim_idle_events( dbox_syshandle( env->status_box ));
/*
Enable only those events we're interested in
*/
event_setmask( (wimp_emask)(wimp_EMPTRLEAVE | wimp_EMPTRENTER | wimp_EMUSERDRAG) );
/*
Initialise an empty search context and boxchange information.
Also initialise memory flexing state.
*/
create_search_context( &env->test_search );
env->boxchange_direction = 0;
env->flex_memory = No;
env->disable_flex = No;
env->in_error = No;
#ifdef USE_PROGRESS_BAR
env->progress = 0;
#endif
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 @@
/*
Header file for initialise.c
*/
#define wimp_MFilerSelectionDirectory 0x403
#define wimp_MFilerAddSelection 0x404
#define wimp_MFilerAction 0x405
#define wimp_MFilerControlAction 0x406
#define wimp_MSETSLOT 0x400c5
#define wimp_MFilerSelectionDirectory ((wimp_msgaction)0x403)
#define wimp_MFilerAddSelection ((wimp_msgaction)0x404)
#define wimp_MFilerAction ((wimp_msgaction)0x405)
#define wimp_MFilerControlAction ((wimp_msgaction)0x406)
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.