home *** CD-ROM | disk | FTP | other *** search
- #include <string.h>
-
- #include "DeskLib:Event.h"
-
- #include "Shell.TextRect.h"
- #include "Shell.SafeAlloc.h"
- #include "Shell.Printf.h"
- #include "Shell.Label.h"
- #include "Shell.PlainRect.h"
-
- #include "StartApp.h"
- #include "Redraw.h"
- #include "AddsRedraw.h"
- #include "AppMenu.h"
- #include "AddStep.h"
- #include "StatDispl.h"
-
-
- #define ADDRESSESXSIZE (12*Shell_TEXTXSIZE)
- #define HEAP_WIDTH 128
- #define INIT_WORDS_PER_OS 8
-
-
-
-
- app_block *StartApp( const char *filename, apps_anchorblock *apps)
- {
- app_block *app;
- int y = 0;
-
-
-
- app = Shell_SafeMalloc( sizeof( app_block));
- LinkList_AddToTail( &apps->anchor, &app->header);
-
- app->filename = Shell_SafeMalloc( 1+strlen( filename));
- strcpy( app->filename, filename);
-
- app->wind = Shell_OpenWindow();
-
- app->heaprect
- = Shell_AddRectangle3( app->wind, ADDRESSESXSIZE, 0, HEAP_WIDTH, 0, HeapRedrawer, app);
-
- app->addressesrect
- = Shell_AddRectangle3( app->wind, 0, 0, ADDRESSESXSIZE, 0, AddsRedrawer, app);
-
- app->plainrect
- = Shell_AddPlainRect( app->wind, 0 , 0, ADDRESSESXSIZE + HEAP_WIDTH, 0);
-
-
- y-=Shell_TEXTYSIZE;
-
- app->numblocks = Shell_Label( app->wind, 0, y, colour_BLACK, colour_GREY1, "");
- y-=Shell_TEXTYSIZE*3/2;
-
- app->total = Shell_Label( app->wind, 0, y, colour_BLACK, colour_GREY1, "");
- y-=Shell_TEXTYSIZE*3/2;
-
- app->totalmem = Shell_Label( app->wind, 0, y, colour_BLACK, colour_GREY1, "");
- y-=Shell_TEXTYSIZE*3/2;
-
- app->percentageused = Shell_Label( app->wind, 0, y, colour_BLACK, colour_GREY1, "");
- y-=Shell_TEXTYSIZE*3/2;
-
- app->maxrect = Shell_Label( app->wind, 0, y, colour_BLACK, colour_GREY1, "");
- y-=Shell_TEXTYSIZE*3/2;
-
- app->minrect = Shell_Label( app->wind, 0, y, colour_BLACK, colour_GREY1, "");
- y-=2*Shell_TEXTYSIZE;
-
- app->textrect = Shell_AddTextRect( app->wind, 0, y, colour_BLACK, colour_GREY1);
-
-
-
- Shell_TextRectPrintf( app->textrect, "PipeFS filename '%s'\n", app->filename);
-
- app->num_blocksalloced = app->num_blocks = 0;
- app->blocks= NULL;
-
- app->max_mem = 0;
- app->min_mem = 0;
-
- app->stats.total = 0;
-
- app->words_per_os = INIT_WORDS_PER_OS;
- GetBestAddressStep( app);
-
- Event_Claim( event_CLICK, app->wind->window, event_ANY, AppWindowClickHandler, app);
-
- UpdateAppStatsDisplay( app);
-
- return app;
- }
-