summaryrefslogtreecommitdiff
path: root/gs/psi/dmmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'gs/psi/dmmain.c')
-rw-r--r--gs/psi/dmmain.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/gs/psi/dmmain.c b/gs/psi/dmmain.c
index 445c5a049..206db9135 100644
--- a/gs/psi/dmmain.c
+++ b/gs/psi/dmmain.c
@@ -1,6 +1,6 @@
/* Copyright (C) 2001-2006 Artifex Software, Inc.
All Rights Reserved.
-
+
This software is provided AS-IS with no warranty, either express or
implied.
@@ -81,13 +81,13 @@ static int GSDLLCALL gsdll_poll(void *handle);
static int display_open(void *handle, void *device);
static int display_preclose(void *handle, void *device);
static int display_close(void *handle, void *device);
-static int display_presize(void *handle, void *device, int width, int height,
+static int display_presize(void *handle, void *device, int width, int height,
int raster, unsigned int format);
-static int display_size(void *handle, void *device, int width, int height,
+static int display_size(void *handle, void *device, int width, int height,
int raster, unsigned int format, unsigned char *pimage);
static int display_sync(void *handle, void *device);
static int display_page(void *handle, void *device, int copies, int flush);
-static int display_update(void *handle, void *device,
+static int display_update(void *handle, void *device,
int x, int y, int w, int h);
static size_t get_input(void *ptr, size_t size);
@@ -212,7 +212,7 @@ static int display_close(void *handle, void *device)
/* Device is about to be resized. */
/* Resize will only occur if this function returns 0. */
-static int display_presize(void *handle, void *device, int width, int height,
+static int display_presize(void *handle, void *device, int width, int height,
int raster, unsigned int format)
{
/* Check for correct format (32-bit RGB), fatal error if not */
@@ -225,10 +225,10 @@ static int display_presize(void *handle, void *device, int width, int height,
return 0;
}
-
+
/* Device has been resized. */
/* New pointer to raster returned in pimage */
-static int display_size(void *handle, void *device, int width, int height,
+static int display_size(void *handle, void *device, int width, int height,
int raster, unsigned int format, unsigned char *pimage)
{
PixMapPtr pixmap;
@@ -270,7 +270,7 @@ static int display_size(void *handle, void *device, int width, int height,
window_invalidate(img->windowRef);
return gsdll_poll(handle);
}
-
+
/* flushpage */
static int display_sync(void *handle, void *device)
{
@@ -293,7 +293,7 @@ static int display_page(void *handle, void *device, int copies, int flush)
/* Poll the caller for cooperative multitasking. */
/* If this function is NULL, polling is not needed */
-static int display_update(void *handle, void *device,
+static int display_update(void *handle, void *device,
int x, int y, int w, int h)
{
UInt64 t1;
@@ -329,7 +329,7 @@ static int display_update(void *handle, void *device,
return gsdll_poll(handle);
}
-display_callback display = {
+display_callback display = {
sizeof(display_callback),
DISPLAY_VERSION_MAJOR,
DISPLAY_VERSION_MINOR,
@@ -420,7 +420,7 @@ static size_t get_input(void *ptr, size_t size)
stdin_bufsize = charswaiting;
memcpy(stdin_buf, text, stdin_bufsize);
SIOUXselstart += charswaiting;
-
+
text = stdin_buf;
while (text = memchr(text, '\r', charswaiting - (text - stdin_buf)))
*text = '\n';
@@ -604,7 +604,7 @@ void main(void)
0L,false) != noErr)
ExitToShell();
- gActionFunctionScrollUPP = NewControlActionUPP(&actionFunctionScroll);
+ gActionFunctionScrollUPP = NewControlActionUPP(&actionFunctionScroll);
Gestalt(gestaltMenuMgrAttr,&response);
if(response & gestaltMenuMgrAquaLayoutMask)
@@ -642,7 +642,7 @@ void main(void)
argv[1] = ddevice;
argv[2] = dformat;
- sprintf(ddevice, "-sDEVICE=display");
+ sprintf(ddevice, "-sDEVICE=display");
sprintf(dformat, "-dDisplayFormat=%d", display_format);
/* Run Ghostscript */
@@ -664,13 +664,13 @@ void main(void)
code = gsapi_init_with_args(instance, argc, argv);
if (code == 0)
code = gsapi_run_string(instance, start_string, 0, &exit_code);
- else
+ else
{
printf("Failed to initialize. Error %d.\n", code);
fflush(stdout);
}
code = gsapi_exit(instance);
- if (code != 0)
+ if (code != 0)
{
printf("Failed to terminate. Error %d.\n", code);
fflush(stdout);
@@ -708,7 +708,7 @@ void main(void)
void doEvents(EventRecord *eventStrucPtr)
{
WindowRef windowRef;
-
+
if (eventStrucPtr->what == mouseDown &&
FindWindow(eventStrucPtr->where,&windowRef) == inMenuBar)
SelectWindow(SIOUXTextWindow->window);
@@ -817,7 +817,7 @@ void doUpdate(EventRecord *eventStrucPtr)
WindowRef windowRef;
windowRef = (WindowRef) eventStrucPtr->message;
-
+
window_adjust_scrollbars(windowRef);
BeginUpdate(windowRef);
@@ -836,7 +836,7 @@ void doUpdateWindow(EventRecord *eventStrucPtr)
PixMapHandle srcPixmapHdl, destPixmapHdl;
RGBColor grayColour = { 0xC000,0xC000,0xC000 };
SInt32 hScroll, vScroll;
-
+
windowRef = (WindowRef) eventStrucPtr->message;
img = (IMAGE*)GetWRefCon(windowRef);
srcPixmapHdl = img->pixmapHdl;
@@ -873,13 +873,13 @@ void doUpdateWindow(EventRecord *eventStrucPtr)
destRect.bottom = pixmap->bounds.bottom;
}
DisposePixPat(hdlPixPat);
-
+
srcRect = destRect;
srcRect.left += hScroll;
srcRect.right += hScroll;
srcRect.top += vScroll;
srcRect.bottom += vScroll;
-
+
CopyBits((BitMap*)*srcPixmapHdl, (BitMap*)*destPixmapHdl,
&srcRect, &destRect, srcCopy, NULL);
}
@@ -961,7 +961,7 @@ pascal void actionFunctionScroll(ControlRef controlRef,ControlPartCode controlPa
oldControlValue = controlValue;
controlMax = GetControl32BitMaximum(controlRef);
controlValue = oldControlValue - scrollDistance;
-
+
if(controlValue < 0)
controlValue = 0;
else if(controlValue > controlMax)
@@ -994,4 +994,3 @@ OSErr quitAppEventHandler(AppleEvent *appEvent,AppleEvent *reply,SInt32 handlerR
}
/*********************************************************************/
-