Archive-Unzip-Burst

 view release on metacpan or  search on metacpan

unzip-6.0/macos/source/macscreen.c  view on Meta::CPAN

/*
  Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.

  See the accompanying file LICENSE, version 2000-Apr-09 or later
  (the contents of which are also included in unzip.h) for terms of use.
  If, for some reason, all these files are missing, the Info-ZIP license
  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
*/
/*---------------------------------------------------------------------------

  macscreen.c
  This file is only linked into the standalone version (not SIOUX) of unzip.
  Macintosh-GUI routines.

  ---------------------------------------------------------------------------*/


/*****************************************************************************/
/*  Includes                                                                 */
/*****************************************************************************/

#include <QuickDraw.h>

#include <stdio.h>
#include <stdarg.h>
#include <string.h>


/*****************************************************************************/
/*  Macros, typedefs                                                         */
/*****************************************************************************/

#define bufferSize      4096

#define screenWindow    128

#define pauseOption     0x0001
#define scrollOption    0x0002


/*****************************************************************************/
/*  Module level Vars                                                        */
/*****************************************************************************/

static Rect scrollRect, pauseRect;
static WindowPtr theWindow;
static RgnHandle scrollRgn;

static short fontHeight, fontWidth, screenHeight, screenWidth;
static short currentPosition, maxPosition, pausePosition;

static short *screenLength, startLine, endLine;
static char *screenImage, **screenLine;

static int screenOptions;



/*****************************************************************************/
/*  Prototypes                                                               */
/*****************************************************************************/

void screenOpen(char *);
void screenControl(char *, int);
void screenClose(void);
void screenUpdate(WindowPtr);
void screenDisplay(char *);
void screenDump(char *, long);

char *macfgets(char *, int, FILE *);
int  macfprintf(FILE *, char *, ...);
int  macprintf(char *, ...);
int  macgetch(void);


/*****************************************************************************/
/*  Functions                                                                */
/*****************************************************************************/

void screenOpen(char *Title) {
    FontInfo fontInfo;
    int n;
    short       fontFamID;

    theWindow = GetNewWindow(screenWindow, nil, (WindowPtr)(-1));

    if ((Title != NULL) && (*Title != '\0')) {
        c2pstr(Title);
        SetWTitle(theWindow, (StringPtr)Title);
        p2cstr((StringPtr)Title);



( run in 2.523 seconds using v1.01-cache-2.11-cpan-5735350b133 )