Updates for 0.9.19 release. Added authorization code to permit Fontconfig files to be installed on first launch from a non-admin account. Fixed possible lockups in fullscreen mode when attempting to print.
This commit is contained in:
parent
3c062cd1e1
commit
04506fa385
10 changed files with 264 additions and 118 deletions
|
|
@ -17,13 +17,13 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.9.18</string>
|
||||
<string>0.9.19</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>0.9.18, Copyright 2007, Tux Paint Development Team</string>
|
||||
<string>0.9.19, Copyright 2008, Tux Paint Development Team</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>TXPT</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2007-12-17</string>
|
||||
<string>2008-02-05</string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>SDLMain</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ This Tux Paint project file is located in a folder titled "macosx", which should
|
|||
|
||||
This XCode project has been configured under the assumption that you have certain libraries and files installed in particular locations under Mac OS X. This documentation indicates what you must install, and where these items go. Some of the libraries can be installed via the MacPorts <www.macports.org> or Fink <fink.sourceforge.net> package managers. At the time of writing, MacPorts can install one additional required library (SDL Pango) that is not available in Fink, so I have written this document with MacPorts in mind. Several libraries are either misconfigured (with regards to building Tux Paint) or unavailable in MacPorts and Fink, and need to be configured, compiled, and installed manually. You will also need to create the following "sandbox" directory where you will build and store these libraries: /Users/Shared/tuxpaint
|
||||
|
||||
If all this configuration and compilation sounds daunting, you may also download precompiled versions of the libraries from the Tux Paint ftp server.
|
||||
|
||||
|
||||
-- SDL --
|
||||
|
||||
You must have the following frameworks installed in /Library/Frameworks:
|
||||
|
|
@ -17,6 +20,14 @@ SDL_ttf.framework
|
|||
You can obtain the frameworks from the SDL website <www.libsdl.org> These frameworks contain both header files and libraries, and are copied into the Frameworks directory of the Tux Paint application bundle.
|
||||
|
||||
|
||||
-- Installing Precompiled Libraries --
|
||||
|
||||
Universal, pre-compiled versions of all required libraries and header files, excluding SDL, are available for download here:
|
||||
ftp://ftp.tuxpaint.org/unix/x/tuxpaint/source/libs/macosx/
|
||||
|
||||
After unzipping the package, you will have a folder named "tuxpaint" which should be placed in /Users/Shared. You may now skip the following steps and begin building Tux Paint right away.
|
||||
|
||||
|
||||
-- Installing Libraries via MacPorts --
|
||||
|
||||
The following libraries can be installed via MacPorts.
|
||||
|
|
@ -122,7 +133,7 @@ Assuming you place the sources in /Users/Shared/tuxpaint/src/libsvg-cairo, you c
|
|||
|
||||
-- Universal and Cross Development --
|
||||
|
||||
Tux Paint can be built for PowerPC, Intel, or both (as a universal binary). Since Tux Paint depends on a number of libraries, these libraries must also be built for the same platform(s) for which you wish to build Tux Paint. The latest versions of the SDL frameworks are universal binary and work fine regardless what platform(s) you want to build for. On the other hand, the libraries installed via MacPorts are built only for the platform you are currently using (MacPorts offers a universal build option, but in practise this fails for most libraries). If you want to build a universal binary of Tux Paint, you will need to manually compile these libraries as universal binaries (see http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html for further information) and update the library paths (click on a library in Archives and choose File > Get Info).
|
||||
Tux Paint can be built for PowerPC, Intel, or both (as a universal binary). Since Tux Paint depends on a number of libraries, these libraries must also be built for the same platform(s) for which you wish to build Tux Paint. The latest versions of the SDL frameworks are universal binary and work fine regardless what platform(s) you want to build for. On the other hand, the libraries installed via MacPorts are built only for the platform you are currently using (MacPorts offers a universal build option via the +universal variant, but this does not work for all libraries). If you want to build a universal binary of Tux Paint, you will need to manually compile these libraries as universal binaries (see http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html for further information) and update the library paths (click on a library in Archives and choose File > Get Info).
|
||||
|
||||
To set the target platform for your build:
|
||||
1) Choose Project > Edit Active Target 'Tux Paint'
|
||||
|
|
|
|||
137
macosx/SDLMain.m
137
macosx/SDLMain.m
|
|
@ -10,6 +10,10 @@
|
|||
#import <sys/param.h> /* for MAXPATHLEN */
|
||||
#import <unistd.h>
|
||||
|
||||
#include <Security/Authorization.h>
|
||||
#include <Security/AuthorizationTags.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#import "macosx_print.h"
|
||||
#import "message.h"
|
||||
#import "wrapperdata.h"
|
||||
|
|
@ -72,11 +76,6 @@ static NSString *getApplicationName(void)
|
|||
@end
|
||||
#endif
|
||||
|
||||
/* Category for NSFileManager */
|
||||
@interface NSFileManager (CreateDirectoryRecursively)
|
||||
- (BOOL)createDirectoryRecursively:(NSString *)path attributes:(NSDictionary *)attributes;
|
||||
@end
|
||||
|
||||
@interface SDLApplication : NSApplication
|
||||
@end
|
||||
|
||||
|
|
@ -481,35 +480,94 @@ static void CustomApplicationMain (argc, argv)
|
|||
[bridge preferencesPath];
|
||||
}
|
||||
|
||||
/* Install any required files from app bundle to destination */
|
||||
- (void) installFiles
|
||||
- (BOOL) installFontconfigFiles
|
||||
{
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
BOOL fileExists = NO;
|
||||
NSString *executable = [bundle pathForAuxiliaryExecutable:@"fcinstaller"];
|
||||
NSString *arguments = [NSString stringWithCString:(macosx.globalPreferencesPath)];
|
||||
|
||||
char command[4096];
|
||||
sprintf(command, "\"%s\" \"%s\"", [executable cStringUsingEncoding:NSASCIIStringEncoding], [arguments cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
|
||||
//displayMessage(MSG_FONT_CACHE);
|
||||
int result = system(command);
|
||||
//hideMessage();
|
||||
|
||||
return (BOOL)result;
|
||||
}
|
||||
|
||||
- (OSStatus) installFontconfigFilesWithAuthorization
|
||||
{
|
||||
OSStatus status;
|
||||
AuthorizationFlags flags = kAuthorizationFlagDefaults;
|
||||
AuthorizationRef authorizationRef;
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
|
||||
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, flags, &authorizationRef);
|
||||
if (status != errAuthorizationSuccess)
|
||||
return status;
|
||||
|
||||
AuthorizationItem items = {kAuthorizationRightExecute, 0, NULL, 0};
|
||||
AuthorizationRights rights = {1, &items};
|
||||
|
||||
flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagPreAuthorize | kAuthorizationFlagExtendRights;
|
||||
status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL);
|
||||
|
||||
if (status == errAuthorizationSuccess)
|
||||
|
||||
{
|
||||
NSString *fcInstallerPath = [bundle pathForAuxiliaryExecutable:@"fcinstaller"];
|
||||
|
||||
char executable[2048];
|
||||
char *arguments[] = { "/Library/Application Support/TuxPaint", NULL };
|
||||
FILE *communicationsPipe = NULL;
|
||||
|
||||
strcpy(executable, [fcInstallerPath cStringUsingEncoding:NSASCIIStringEncoding]);
|
||||
|
||||
flags = kAuthorizationFlagDefaults;
|
||||
//displayMessage(MSG_FONT_CACHE);
|
||||
status = AuthorizationExecuteWithPrivileges(authorizationRef, executable, flags, arguments, &communicationsPipe);
|
||||
//hideMessage();
|
||||
}
|
||||
|
||||
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
|
||||
return status;
|
||||
}
|
||||
|
||||
- (BOOL) fontconfigFilesAreInstalled
|
||||
{
|
||||
NSString *globalPreferencesPath = [NSString stringWithCString:(macosx.globalPreferencesPath)];
|
||||
NSString *fontsPath = [globalPreferencesPath stringByAppendingString:@"/fontconfig/fonts"];
|
||||
NSString *cachePath = [globalPreferencesPath stringByAppendingString:@"/fontconfig/cache"];
|
||||
NSString *fontsConfInstalledPath = [fontsPath stringByAppendingString:@"/fonts.conf"];
|
||||
NSString *fontsDtdInstalledPath = [fontsPath stringByAppendingString:@"/fonts.dtd"];
|
||||
NSString *fontsConfBundlePath = [bundle pathForResource:@"fonts" ofType:@"conf"];
|
||||
NSString *fontsDtdBundlePath = [bundle pathForResource:@"fonts" ofType:@"dtd"];
|
||||
BOOL filesExist = TRUE;
|
||||
|
||||
fileExists = [fileManager fileExistsAtPath:fontsConfInstalledPath];
|
||||
if (!fileExists) {
|
||||
[fileManager createDirectoryRecursively:fontsPath attributes:nil];
|
||||
[fileManager copyPath:fontsConfBundlePath toPath:fontsConfInstalledPath handler:nil];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
filesExist = [fileManager fileExistsAtPath:fontsConfInstalledPath] && [fileManager fileExistsAtPath:fontsDtdInstalledPath];
|
||||
return filesExist;
|
||||
}
|
||||
|
||||
fileExists = [fileManager fileExistsAtPath:fontsDtdInstalledPath];
|
||||
if (!fileExists) {
|
||||
[fileManager createDirectoryRecursively:fontsPath attributes:nil];
|
||||
[fileManager copyPath:fontsDtdBundlePath toPath:fontsDtdInstalledPath handler:nil];
|
||||
/* Install files required by Fontconfig */
|
||||
- (void) installFontconfig
|
||||
{
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
BOOL filesExist = TRUE;
|
||||
|
||||
filesExist = [self fontconfigFilesAreInstalled];
|
||||
if (!filesExist)
|
||||
{
|
||||
[self installFontconfigFiles];
|
||||
filesExist = [self fontconfigFilesAreInstalled];
|
||||
if (!filesExist)
|
||||
{
|
||||
[self installFontconfigFilesWithAuthorization];
|
||||
}
|
||||
}
|
||||
|
||||
fileExists = [fileManager fileExistsAtPath:cachePath];
|
||||
if (fileExists)
|
||||
NSString *globalPreferencesPath = [NSString stringWithCString:(macosx.globalPreferencesPath)];
|
||||
NSString *globalCachePath = [globalPreferencesPath stringByAppendingString:@"/fontconfig/cache"];
|
||||
NSString *userCachePath = [[NSString stringWithString:@"~/.fontconfig"] stringByExpandingTildeInPath];
|
||||
if ([fileManager fileExistsAtPath:globalCachePath] || [fileManager fileExistsAtPath:userCachePath])
|
||||
macosx.buildingFontCache = 0;
|
||||
else
|
||||
macosx.buildingFontCache = 1;
|
||||
|
|
@ -581,8 +639,8 @@ static void CustomApplicationMain (argc, argv)
|
|||
/* Set up Cocoa to SDL bridge */
|
||||
[self setupBridge];
|
||||
|
||||
/* Install any required files */
|
||||
[self installFiles];
|
||||
/* Install any files required by fontconfig */
|
||||
[self installFontconfig];
|
||||
|
||||
/* Set the working directory to the .app's parent directory */
|
||||
[self setupWorkingDirectory:gFinderLaunch];
|
||||
|
|
@ -642,41 +700,10 @@ static void CustomApplicationMain (argc, argv)
|
|||
|
||||
@end
|
||||
|
||||
@implementation NSFileManager (CreateDirectoryRecursively)
|
||||
|
||||
- (BOOL)createDirectoryRecursively:(NSString *)path attributes:(NSDictionary *)attributes
|
||||
{
|
||||
BOOL isDir = TRUE;
|
||||
BOOL fileExists;
|
||||
|
||||
fileExists = [self fileExistsAtPath:path isDirectory:&isDir];
|
||||
if (isDir) {
|
||||
if (fileExists) {
|
||||
/* directory exists */
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create directory */
|
||||
NSString *parentDirectory = [path stringByDeletingLastPathComponent];
|
||||
[self createDirectoryRecursively:parentDirectory attributes:attributes];
|
||||
return [self createDirectoryAtPath:path attributes:attributes];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* desired directory path is blocked by a file */
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#ifdef main
|
||||
# undef main
|
||||
#endif
|
||||
|
||||
|
||||
/* Main entry point to executable - should *not* be SDL_main! */
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
|
|
|
|||
109
macosx/fcinstaller.m
Normal file
109
macosx/fcinstaller.m
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
//
|
||||
// fcinstaller.m
|
||||
// TuxPaint
|
||||
//
|
||||
// Created by Martin Fuhrer on 03/02/08.
|
||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
// (See COPYING.txt)
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <fontconfig/fontconfig.h>
|
||||
|
||||
/* Category for NSFileManager */
|
||||
@interface NSFileManager (CreateDirectoryRecursively)
|
||||
- (BOOL)createDirectoryRecursively:(NSString *)path attributes:(NSDictionary *)attributes;
|
||||
@end
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
NSString *bundlePath = [bundle bundlePath];
|
||||
|
||||
BOOL success = TRUE;
|
||||
BOOL fileExists = TRUE;
|
||||
|
||||
if( argc < 2 )
|
||||
return -1;
|
||||
|
||||
NSString *globalPreferencesPath = [NSString stringWithCString:(argv[1])];
|
||||
NSString *fontsPath = [globalPreferencesPath stringByAppendingString:@"/fontconfig/fonts"];
|
||||
NSString *fontsConfInstalledPath = [fontsPath stringByAppendingString:@"/fonts.conf"];
|
||||
NSString *fontsDtdInstalledPath = [fontsPath stringByAppendingString:@"/fonts.dtd"];
|
||||
NSString *fontsConfBundlePath = [bundle pathForResource:@"fonts" ofType:@"conf"];
|
||||
NSString *fontsDtdBundlePath = [bundle pathForResource:@"fonts" ofType:@"dtd"];
|
||||
|
||||
fileExists = [fileManager fileExistsAtPath:fontsConfInstalledPath];
|
||||
if (!fileExists) {
|
||||
success = ([fileManager createDirectoryRecursively:fontsPath attributes:nil] && success);
|
||||
success = ([fileManager copyPath:fontsConfBundlePath toPath:fontsConfInstalledPath handler:nil] && success);
|
||||
}
|
||||
|
||||
fileExists = [fileManager fileExistsAtPath:fontsDtdInstalledPath];
|
||||
if (!fileExists) {
|
||||
success = ([fileManager createDirectoryRecursively:fontsPath attributes:nil] && success);
|
||||
success = ([fileManager copyPath:fontsDtdBundlePath toPath:fontsDtdInstalledPath handler:nil] && success);
|
||||
}
|
||||
|
||||
/*
|
||||
NSString *globalCachePath = [globalPreferencesPath stringByAppendingString:@"/fontconfig/cache"];
|
||||
NSString *userCachePath = [[NSString stringWithString:@"~/.fontconfig"] stringByExpandingTildeInPath];
|
||||
fileExists = ([fileManager fileExistsAtPath:globalCachePath] || [fileManager fileExistsAtPath:userCachePath]);
|
||||
if (!fileExists)
|
||||
{
|
||||
FcBool initSuccess = FcInit();
|
||||
if( initSuccess == FcFalse )
|
||||
success = FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
[pool release];
|
||||
|
||||
return (int)(!success);
|
||||
}
|
||||
|
||||
@implementation NSFileManager (CreateDirectoryRecursively)
|
||||
|
||||
- (BOOL)createDirectoryRecursively:(NSString *)path attributes:(NSDictionary *)attributes
|
||||
{
|
||||
BOOL isDir = TRUE;
|
||||
BOOL fileExists;
|
||||
|
||||
fileExists = [self fileExistsAtPath:path isDirectory:&isDir];
|
||||
if (isDir) {
|
||||
if (fileExists) {
|
||||
/* directory exists */
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* create directory */
|
||||
NSString *parentDirectory = [path stringByDeletingLastPathComponent];
|
||||
[self createDirectoryRecursively:parentDirectory attributes:attributes];
|
||||
return [self createDirectoryAtPath:path attributes:attributes];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* desired directory path is blocked by a file */
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
void speak_string(const wchar_t *widecharString)
|
||||
{
|
||||
#ifndef __APPLE_10_2_8__
|
||||
char multibyteString[1024];
|
||||
NSString *string = [NSString string];
|
||||
|
||||
|
|
@ -48,4 +49,5 @@ void speak_string(const wchar_t *widecharString)
|
|||
[synthesizer setVoice:[voices objectAtIndex:rand()%[voices count]]];
|
||||
[synthesizer startSpeakingString:string];
|
||||
[synthesizer release];
|
||||
#endif // !__APPLE_10_2_8__
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ struct WrapperDataStruct
|
|||
char preferencesPath[2048]; // path to the user's Tux Paint preferences folder
|
||||
char globalPreferencesPath[2048]; // path to all users' Tux Paint preferences folder
|
||||
char fontsPath[2048]; // path to the user's fonts folder
|
||||
int buildingFontCache; // is the FontConfig font cache currently being built?
|
||||
int buildingFontCache; // is fontconfig cache being built?
|
||||
int foundSDL; // was SDL.framework found?
|
||||
int foundSDL_image; // was SDL_image.framework found?
|
||||
int foundSDL_mixer; // was SDL_mixer.framework found?
|
||||
|
|
|
|||
6
src/im.c
6
src/im.c
|
|
@ -40,7 +40,13 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef __APPLE_10_2_8__
|
||||
#include <wchar.h>
|
||||
#else
|
||||
#define wchar_t char
|
||||
#endif
|
||||
|
||||
#include "im.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -83,13 +83,10 @@ NSData* printData = nil;
|
|||
- (BOOL) wait
|
||||
{
|
||||
while (!_complete) {
|
||||
|
||||
NSEvent *event;
|
||||
|
||||
event = [ NSApp nextEventMatchingMask:NSAnyEventMask
|
||||
untilDate:[ NSDate distantFuture ]
|
||||
inMode: NSDefaultRunLoopMode dequeue:YES ];
|
||||
|
||||
[ NSApp sendEvent:event ];
|
||||
}
|
||||
|
||||
|
|
@ -204,14 +201,10 @@ NSPrintInfo* LoadPrintInfo( const SDL_Surface *surface )
|
|||
standardUserDefaults = [ NSUserDefaults standardUserDefaults ];
|
||||
|
||||
if( standardUserDefaults )
|
||||
{
|
||||
printData = [ standardUserDefaults dataForKey:@"PrintInfo" ];
|
||||
}
|
||||
|
||||
if( printData )
|
||||
{
|
||||
printInfo = (NSPrintInfo*)[ NSUnarchiver unarchiveObjectWithData:printData ];
|
||||
}
|
||||
else
|
||||
{
|
||||
printInfo = [ NSPrintInfo sharedPrintInfo ];
|
||||
|
|
@ -234,10 +227,8 @@ void SavePrintInfo( NSPrintInfo* printInfo )
|
|||
standardUserDefaults = [ NSUserDefaults standardUserDefaults ];
|
||||
|
||||
if( standardUserDefaults )
|
||||
{
|
||||
[ standardUserDefaults setObject:printData forKey:@"PrintInfo" ];
|
||||
}
|
||||
}
|
||||
|
||||
int DisplayPageSetup( const SDL_Surface * surface )
|
||||
{
|
||||
|
|
@ -275,12 +266,16 @@ const char* SurfacePrint( SDL_Surface *surface, int showDialog )
|
|||
NSPrintInfo* printInfo;
|
||||
ModalDelegate* delegate;
|
||||
BOOL ok = YES;
|
||||
const char* error = NULL;
|
||||
|
||||
// check if printers are available
|
||||
NSArray* printerNames = [NSPrinter printerNames];
|
||||
if( [printerNames count] == 0 && !showDialog)
|
||||
return "No printer is available. Run Tux Paint in window mode (not fullscreen), and select File > Print... to choose a printer.";
|
||||
|
||||
// create image for surface
|
||||
image = CreateImage( surface );
|
||||
if( image == nil )
|
||||
return "Could not create image";
|
||||
return "Could not create a print image.";
|
||||
|
||||
// create print control objects
|
||||
printInfo = LoadPrintInfo( surface );
|
||||
|
|
@ -299,18 +294,15 @@ const char* SurfacePrint( SDL_Surface *surface, int showDialog )
|
|||
|
||||
NSSize imageSize = pageSize;
|
||||
if( pageRatio > surfaceRatio ) // wide page
|
||||
{
|
||||
imageSize.width = surface->w * pageSize.height / surface->h;
|
||||
}
|
||||
else // tall page
|
||||
{
|
||||
imageSize.height = surface->h * pageSize.width / surface->w;
|
||||
}
|
||||
|
||||
// create print view
|
||||
printView = [ [ [ ImageView alloc ] initWithFrame: NSMakeRect( 0, 0, imageSize.width, imageSize.height ) ] autorelease ];
|
||||
if (printView == nil)
|
||||
return "Could not create print view";
|
||||
return "Could not create a print view.";
|
||||
|
||||
[ image setSize:imageSize ];
|
||||
[ printView setImage:image ];
|
||||
|
||||
|
|
@ -324,14 +316,12 @@ const char* SurfacePrint( SDL_Surface *surface, int showDialog )
|
|||
delegate:delegate didRunSelector:@selector(printDidRun:success:contextInfo:) contextInfo:nil ];
|
||||
|
||||
ok = [ delegate wait ];
|
||||
if (!ok)
|
||||
error = "Canceled or error when printing";
|
||||
|
||||
macosx.cocoaKeystrokes = 0;
|
||||
|
||||
SavePrintInfo( printInfo );
|
||||
[ image release ];
|
||||
|
||||
return error;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1010,7 +1010,7 @@ static SDL_Surface *render_text(TuxPaint_Font * restrict font,
|
|||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (macosx.buildingFontCache = 1)
|
||||
if (macosx.buildingFontCache == 1)
|
||||
{
|
||||
macosx.buildingFontCache = 0;
|
||||
hideMessage();
|
||||
|
|
@ -2211,7 +2211,7 @@ static void mainloop(void)
|
|||
cursor_y = min(cursor_y + font_height, canvas->h - font_height);
|
||||
|
||||
playsound(screen, 0, SND_RETURN, 1, SNDPOS_RIGHT, SNDDIST_NEAR);
|
||||
#ifndef NOSOUND
|
||||
#ifdef SPEECH
|
||||
#ifdef __APPLE__
|
||||
if (use_sound)
|
||||
speak_string(texttool_str);
|
||||
|
|
@ -2229,7 +2229,7 @@ static void mainloop(void)
|
|||
texttool_len = 0;
|
||||
cursor_textwidth = 0;
|
||||
}
|
||||
#ifndef NOSOUND
|
||||
#ifdef SPEECH
|
||||
#ifdef __APPLE__
|
||||
if (use_sound)
|
||||
speak_string(texttool_str);
|
||||
|
|
@ -15054,12 +15054,13 @@ void do_print(void)
|
|||
int show = ( ( want_alt_printcommand || macosx.menuAction ) && !fullscreen);
|
||||
|
||||
const char *error = SurfacePrint(canvas, show);
|
||||
/*
|
||||
|
||||
if (error)
|
||||
{
|
||||
fprintf(stderr, "Cannot print: %s\n", error);
|
||||
else
|
||||
do_prompt_snd(PROMPT_PRINT_TXT, PROMPT_PRINT_YES, "", SND_TUXOK);
|
||||
*/
|
||||
do_prompt_snd(error, PROMPT_PRINT_YES, "", SND_TUXOK, 0, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue