GNUstepWrapper-0.1.0/0000755000175000017500000000000010106156372015561 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/Launcher/0000755000175000017500000000000010106156371017321 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/Launcher/main.m0000644000175000017500000000224310105723273020424 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: main.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/Launcher/main.m $ */ #include #include #include "WrapperDelegate.h" int main(int argc, const char *argv[]) { [NSApplication sharedApplication]; [NSApp setDelegate: [[WrapperDelegate alloc] init]]; return NSApplicationMain(argc, argv); } GNUstepWrapper-0.1.0/Launcher/GNUmakefile0000644000175000017500000000300710105723273021373 0ustar rherzogrherzog00000000000000# Copyright (C) 2004 Raffael Herzog # # 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. # # $Id: GNUmakefile 103 2004-08-09 16:30:51Z rherzog $ # $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/Launcher/GNUmakefile $ include $(GNUSTEP_MAKEFILES)/common.make include ../Directories.make GNUSTEP_INSTALLATION_DIR=$(GNUSTEP_SYSTEM_ROOT) OBJC_PROGRAM_NAME=GSWrapper_Launcher GSWrapper_Launcher_OBJC_FILES=main.m GSWrapper_Launcher_OBJC_LIBS += -lGSWrapper -lgnustep-base -lgnustep-gui GSWrapper_Launcher_INCLUDE_DIRS += -I../libGSWrapper GSWrapper_Launcher_LIB_DIRS += -L../libGSWrapper/$(OBJ_DIR) GSWrapper_Launcher_COPY_INTO_LOCAL_BUNDLE = ../$(APP_DIR)/Resources/$(ARCH_DIR) -include GNUmakefile.preamble ifeq ($(GSWrapper_Development),yes) include ../GNUmakefile.development endif include $(GNUSTEP_MAKEFILES)/objc.make -include GNUmakefile.postamble GNUstepWrapper-0.1.0/Launcher/GNUmakefile.postamble0000644000175000017500000000001210105704770023352 0ustar rherzogrherzog00000000000000install:: GNUstepWrapper-0.1.0/libGSWrapper/0000755000175000017500000000000010106156371020121 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/libGSWrapper/WrapperDelegate.h0000644000175000017500000000312610105723273023347 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: WrapperDelegate.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/WrapperDelegate.h $ */ #ifndef GSWrapper_libGSWrapper_WrapperDelegate_H #define GSWrapper_libGSWrapper_WrapperDelegate_H #include #include "Actions.h" @interface WrapperDelegate : NSObject { BOOL appDidFinishLaunching; NSArray *startupFiles; NSDictionary *properties; id mainAction; id openAction; } - (id)init; - (void)applicationDidFinishLaunching: (NSNotification*) not; - (BOOL)application: (NSApplication*)app openFile: (NSString*)file; - (BOOL)application: (NSApplication*)app openFiles: (NSArray*)files; - (void)unixAppExited: (NSNotification*)not; - (id)actionForMessage: (NSString *)msg; @end #endif GNUstepWrapper-0.1.0/libGSWrapper/Actions.h0000644000175000017500000000342510105723273021676 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: Actions.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/Actions.h $ */ #ifndef GSWrapper_Actions_H #define GSWrapper_Actions_H #include @protocol Action - (BOOL)execute; - (BOOL)executeWithFiles: (NSArray *)files; - (NSString *)name; - (NSTask *)task; @end @interface AbstractAction : NSObject { NSString *actionName; NSDictionary *properties; } - (id)initWithActionName: (NSString *)name properties: (NSDictionary *)props; - (BOOL)execute; - (BOOL)executeWithFiles: (NSArray *)files; - (NSString *)name; - (NSTask *)task; - (NSDictionary *)properties; @end @interface ErrorDialogAction : AbstractAction { } - (BOOL)executeWithFiles: (NSArray *)files; @end @interface IgnoreAction : AbstractAction { } - (BOOL)executeWithFiles: (NSArray *)files; @end @interface RunScriptAction : AbstractAction { NSTask *task; } - (BOOL)executeWithFiles: (NSArray *)files; @end #endif GNUstepWrapper-0.1.0/libGSWrapper/WrapperDelegate.m0000644000175000017500000001224710105723273023360 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: WrapperDelegate.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/WrapperDelegate.m $ */ #include #include "WrapperDelegate.h" #include "NSApplication+AppName.h" @implementation WrapperDelegate /* * application delegate */ - (id)init { self = [super init]; appDidFinishLaunching = NO; startupFiles = nil; return self; } - (void)applicationWillFinishLaunching: (NSNotification*)not { } - (void)applicationDidFinishLaunching: (NSNotification*)not { appDidFinishLaunching = YES; NSString *path = [[NSBundle mainBundle] pathForResource: @"GSWrapper" ofType: @"plist"]; properties = RETAIN([NSDictionary dictionaryWithContentsOfFile: path]); if ( startupFiles ) { mainAction = [self actionForMessage: @"StartOpen"]; } else { mainAction = [self actionForMessage: @"Start"]; } [mainAction executeWithFiles: startupFiles]; if ( !mainAction ) { [NSApp terminate: self]; return; } if ( ![mainAction task] ) { NSLog(@"Main action has no task assigned - exiting"); [NSApp terminate: self]; return; } [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(unixAppExited:) name: (NSTaskDidTerminateNotification) object: [mainAction task]]; } - (BOOL)application: (NSApplication*)app openFile: (NSString*)file { return [self application: app openFiles: [NSArray arrayWithObject: file]]; } - (BOOL)application: (NSApplication*)app openFiles: (NSArray*)files { NSLog(@"Open files: %@", files); if ( ! appDidFinishLaunching ) { startupFiles = RETAIN(files); return YES; } else { if ( !openAction ) { openAction = [self actionForMessage: @"Open"]; } if ( !openAction ) { return NO; } BOOL retval = [openAction executeWithFiles: files]; NSTask *task = [openAction task]; if ( !task ) { return retval; } else { [task waitUntilExit]; if ( [task terminationStatus] ) { NSRunCriticalAlertPanel([NSApp applicationName], [NSString stringWithFormat: @"Script exited with exit code %d", [task terminationStatus]], @"OK", nil, nil); return NO; } else { return YES; } } } } /* * task notification */ - (void)unixAppExited: (NSNotification*)not { int status = [[not object] terminationStatus]; NSLog(@"UNIX application exited with code %d", status); if ( status ) { NSRunCriticalAlertPanel([NSApp applicationName], [NSString stringWithFormat: @"UNIX appliation exited with exit code %d", status], @"OK", nil, nil); } [NSApp terminate: self]; } /* * initializing actions */ - (id)actionForMessage: (NSString *)msg { NSDictionary *actionProps = [properties objectForKey: msg]; if ( !actionProps ) { actionProps = AUTORELEASE([[NSDictionary alloc] init]); } NSString *actionName = [actionProps objectForKey: @"Action"]; if ( ! actionName ) { NSLog(@"Warning: No type specified for message %@ - defaulting to RunScript", msg); actionName = @"RunScript"; } if ( [actionName isEqualToString: @"RunScript"] ) { return [[RunScriptAction alloc] initWithActionName: msg properties: actionProps]; } else if ( [actionName isEqualToString: @"Fail"] ) { return [[ErrorDialogAction alloc] initWithActionName: msg properties: actionProps]; } else if ( [actionName isEqualToString: @"Ignore"] ) { return [[IgnoreAction alloc] initWithActionName: msg properties: actionProps]; } else { NSRunCriticalAlertPanel([NSApp applicationName], [NSString stringWithFormat: @"Unknown action %@ specified for message %@", actionName, msg], @"OK", nil, nil); return nil; } } @end GNUstepWrapper-0.1.0/libGSWrapper/NSApplication+SuppressAppIcon.h0000644000175000017500000000226110105723273026071 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: NSApplication+SuppressAppIcon.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/NSApplication+SuppressAppIcon.h $ */ #ifndef _GSWrapper_libGSWRapper_NSApplication_SuppressAppIcon_H #define _GSWrapper_libGSWRapper_NSApplication_SuppressAppIcon_H #include @interface NSApplication (SuppressAppIcon) - _appIconInit; @end #endif GNUstepWrapper-0.1.0/libGSWrapper/GNUmakefile0000644000175000017500000000256210105723273022200 0ustar rherzogrherzog00000000000000# Copyright (C) 2004 Raffael Herzog # # 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. # # $Id: GNUmakefile 103 2004-08-09 16:30:51Z rherzog $ # $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/GNUmakefile $ include $(GNUSTEP_MAKEFILES)/common.make GNUSTEP_INSTALLATION_DIR=$(GNUSTEP_SYSTEM_ROOT) LIBRARY_NAME=libGSWrapper libGSWrapper_OBJC_FILES = WrapperDelegate.m \ Actions.m \ NSApplication+SuppressAppIcon.m \ NSApplication+AppName.m \ libGSWrapper_LIBRARIES_DEPEND_UPON = -lgnustep-base -lgnustep-gui ifeq ($(GSWrapper_Development),yes) include ../GNUmakefile.development endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make -include GNUmakefile.postamble GNUstepWrapper-0.1.0/libGSWrapper/Actions.m0000644000175000017500000000737710105723273021715 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: Actions.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/Actions.m $ */ #include #include "Actions.h" #include "NSApplication+AppName.h" @implementation AbstractAction - (id)initWithActionName: (NSString *)name properties: (NSDictionary *)props { self = [self init]; if ( self ) { actionName = RETAIN(name); properties = RETAIN(props); } return self; } - (BOOL)execute { return [self executeWithFiles: nil]; } - (BOOL)executeWithFiles: (NSArray *)files { [NSException raise: @"NotImplementedException" format: @"- (BOOL)exceptionWithFiles is not implemented in %@", [self class]]; return NO; } - (NSString *)name { return actionName; } - (NSTask *)task { return nil; } - (NSDictionary *)properties { return properties; } @end @implementation ErrorDialogAction : AbstractAction - (BOOL)executeWithFiles: (NSArray *)files { NSRunInformationalAlertPanel([NSApp applicationName], [NSString stringWithFormat: @"The action \'%@\' is not supported", [self name]], @"OK", nil, nil); return NO; } @end @implementation IgnoreAction - (BOOL)executeWithFiles: (NSArray *)files; { NSLog(@"Ignored action %@", [self name]); return NO; } @end @implementation RunScriptAction - (BOOL)executeWithFiles: (NSArray *)files; { NSString *shell; NSString *script; NSArray *args; NSMutableArray *realArgs; int fileCount; int i; if ( files ) { fileCount = [files count]; } else { fileCount = 0; } script = [[NSBundle mainBundle] pathForResource: [self name] ofType: (nil)]; if ( ! script ) { NSRunCriticalAlertPanel([NSApp applicationName], [NSString stringWithFormat: @"Could not find script for action %@", [self name]], @"OK", nil, nil); return NO; } shell = [[self properties] objectForKey: @"Shell"]; if ( ! shell ) { shell = @"/bin/sh"; } args = [[self properties] objectForKey: @"ShellArgs"]; if ( args ) { int argCount = [args count]; realArgs = [NSMutableArray arrayWithCapacity: argCount+fileCount]; for ( i=0; i @interface NSApplication (SuppressAppIcon) - (NSString *)applicationName; @end #endif GNUstepWrapper-0.1.0/libGSWrapper/NSApplication+SuppressAppIcon.m0000644000175000017500000000234410105723273026100 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: NSApplication+SuppressAppIcon.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/NSApplication+SuppressAppIcon.m $ */ #include #include "NSApplication+SuppressAppIcon.h" @implementation NSApplication (SuppressAppIcon) - _appIconInit { NSLog(@"Initialization of AppIcon suppressed"); [self setApplicationIconImage: [NSImage imageNamed: @"AppIcon"]]; return self; } @end GNUstepWrapper-0.1.0/libGSWrapper/NSApplication+AppName.m0000644000175000017500000000225210105723273024321 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: NSApplication+AppName.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/libGSWrapper/NSApplication+AppName.m $ */ #include #include "NSApplication+AppName.h" @implementation NSApplication (AppName) - (NSString *)applicationName { return (NSString *)[[[NSBundle mainBundle] infoDictionary] objectForKey: @"ApplicationName"]; } @end GNUstepWrapper-0.1.0/Directories.make0000644000175000017500000000233510105723273020676 0ustar rherzogrherzog00000000000000# -*- Mode: Makefile -*- # # Copyright (C) 2004 Raffael Herzog # # 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. # # $Id: Directories.make 103 2004-08-09 16:30:51Z rherzog $ # $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/Directories.make $ ifeq ($(debug),yes) APP_DIR=WrapperFactory.debug OBJ_BASE_DIR=shared_debug_obj else APP_DIR=WrapperFactory.app OBJ_BASE_DIR=shared_obj endif ARCH_DIR=$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(LIBRARY_COMBO) ifneq ($(GNUSTEP_FLATTENED),yes) OBJ_DIR=$(OBJ_BASE_DIR)/$(ARCH_DIR) else OBJ_DIR=$(OBJ_BASE_DIR) endif GNUstepWrapper-0.1.0/Version0000644000175000017500000000210210105723273017123 0ustar rherzogrherzog00000000000000# -*- Mode: Makefile -*- # # Copyright (C) 2004 Raffael Herzog # # 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. # # $Id: Version 103 2004-08-09 16:30:51Z rherzog $ # $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/Version $ # The version number of this release. MAJOR_VERSION=0 MINOR_VERSION=1 SUBMINOR_VERSION=0 APP_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} VERSION=${APP_VERSION} GNUstepWrapper-0.1.0/TODO0000644000175000017500000000426410105723273016256 0ustar rherzogrherzog00000000000000* [BUG] Crashes WrapperFactory.app still crashes from time to time, e.g. when opening a wrapped application while WrapperFactory is running already. * [BUG] File Types The file type description is only shown in the table after the window has been resized at least once. * [BUG] Create / Edit wrapper Do not open two WrapperFactory.app windows if WrapperFactory is not running already. * [FEATURE] Icon scaling As of now, icon images larger than 48x48px are stored in their original formats assuming that the window manager will rescale them. However, Window Maker doesn't, so WrapperFactory should rescale. WrapperFactory.app will rescale such icons to 48x48px while creating a new app-wrapper and save both the original icon file and the scaled version in the app-wrapper. * [DOC] Provide the documentation in HelpViewer.app format. * [FEATURE] Freedesktop integration There are many ways of realising this: - import .desktop files to create wrappers - directly use .desktop files ("Use .desktop" action) * [FEATURE] Scriptability For automation of wrapper creation, WrapperFactory should be scriptable. Three possible approaches: - enable WrapperFactory for StepTalk - move wrapper handling out to a library and create a command line tool - both * [FEATURE] File type library Store previously defined file types and icon associations and show said file types when creating and editing an app-wrapper. Could be done with Freedesktop integration. * [FEATURE] Multiple instances Some wrappers, e.g. xpdf or gv, should actually launch several instances of the application to simulate multiple open files. * [FEATURE] More messages Implement more messages like e.g. applicationShouldTerminate. * [FEATURE] Window tracking Try tracking windows opened by a wrapped application to keep control of said windows (hiding, move up in window stack etc.). Maybe in collaboration with Window Maker? * [FEATURE] DE integration Check whether a wrapper could map GNUstep messages to GNOME/KDE messages. $Id: TODO 103 2004-08-09 16:30:51Z rherzog $ $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/TODO $ GNUstepWrapper-0.1.0/GNUmakefile0000644000175000017500000000261510105723273017636 0ustar rherzogrherzog00000000000000# Copyright (C) 2004 Raffael Herzog # # 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. # # $Id: GNUmakefile 103 2004-08-09 16:30:51Z rherzog $ # $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/GNUmakefile $ include $(GNUSTEP_MAKEFILES)/common.make include Directories.make GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) PACKAGE_NAME=GNUstepWrapper include Version GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) #$(GNUSTEP_TARGET_CPU)/$(GNUSTEP_TARGET_OS)/$(LIBRARY_COMBO)/GSWrapper_Launcher SUBPROJECTS = libGSWrapper Launcher WrapperFactory -include GNUmakefile.preamble ifeq ($(GSWrapper_Development),yes) -include GNUmakefile.development endif include $(GNUSTEP_MAKEFILES)/aggregate.make -include GNUmakefile.postamble GNUstepWrapper-0.1.0/AUTHORS0000644000175000017500000000067410105723273016637 0ustar rherzogrherzog00000000000000GSWrapper ========= Copyright (c) 2004, Raffael Herzog Main Programmers: - Raffael Herzog Testers: - Sascha Erni Documentation: - Sascha Erni Special thanks to Patrick Tilp for the icon. $Id: AUTHORS 103 2004-08-09 16:30:51Z rherzog $ $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/AUTHORS $ GNUstepWrapper-0.1.0/WrapperFactory/0000755000175000017500000000000010106156372020531 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/WrapperFactory/Resources/0000755000175000017500000000000010106156371022502 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/WrapperFactory/Resources/LaunchScript.sh0000644000175000017500000001666510022106523025442 0ustar rherzogrherzog00000000000000#!/bin/sh # # executable.template. Generated from executable.template.in by configure. # # Copyright (C) 1999-2002 Free Software Foundation, Inc. # # Author: Adam Fedor # Date: May 1999 # # Author: Nicola Pero # Date: 2001, 2002 # # This file is part of the GNUstep Makefile Package. # # This library 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 is a shell script which attempts to find the GNUstep executable # of the same name based on the current host and library_combo. #-------------------------------------------------------------------------- # Main body #-------------------------------------------------------------------------- if [ -z "$EXEEXT" ]; then EXEEXT= fi if [ -z "$LIBRARY_COMBO" ]; then LIBRARY_COMBO=gnu-gnu-gnu fi # Process arguments app="$0" show_available_platforms=0 show_relative_path=0 show_full_path=0 while true do case "$1" in --script-help) echo usage: `basename "$0"` [--library-combo=...] echo " [--available-platforms][--full-executable-path]" echo " [--relative-executable-path] [arguments...]" echo echo " --library-combo=... specifies a GNUstep backend to use." echo " It overrides the default LIBRARY_COMBO environment variable." echo echo " --available-platforms displays a list of valid exec hosts" echo " --full-executable-path displays full path to executable" echo " --relative-executable-path displays subdirectory path" echo " arguments... are the arguments to the application." exit 0 ;; --library-combo=*) tmp_root="$GNUSTEP_SYSTEM_ROOT" . "$tmp_root/Library/Makefiles/GNUstep-reset.sh" LIBRARY_COMBO=`echo "$1" | sed 's/--library-combo=//'` . "$tmp_root/Library/Makefiles/GNUstep.sh" shift ;; --available-platforms) show_available_platforms=1 exit 0 ;; --full-executable-path) show_full_path=1 break ;; --relative-executable-path) show_relative_path=1 break ;; *) break;; esac done if [ "$LIBRARY_COMBO" = nx ]; then LIBRARY_COMBO=nx-nx-nx elif [ "$LIBRARY_COMBO" = gnu ]; then LIBRARY_COMBO=gnu-gnu-gnu elif [ "$LIBRARY_COMBO" = fd ]; then LIBRARY_COMBO=gnu-fd-gnu elif [ "$LIBRARY_COMBO" = apple ]; then LIBRARY_COMBO=apple-apple-apple fi export LIBRARY_COMBO # Find path to ourself dir="`dirname \"$app\"`" case "$app" in /*) # An absolute path. full_appname="$dir";; */*) # A relative path full_appname="`(cd \"$dir\"; pwd)`";; *) # A path that needs to be searched if [ -n "$GNUSTEP_PATHLIST" ]; then SPATH="$GNUSTEP_PATHLIST" else SPATH="$PATH" fi SPATH=".:$SPATH" IFS=: for path_dir in $SPATH; do if [ -d "$path_dir/$dir" ]; then full_appname="`(cd \"$path_dir/$dir\"; pwd)`" break; fi if [ -d "$path_dir/Applications/$dir" ]; then full_appname="`(cd \"$path_dir/Applications/$dir\"; pwd)`" break; fi done;; esac if [ -z "$full_appname" ]; then echo "Can't find absolute path for $app! Please specify full path when" echo "invoking executable" exit 1 fi # # get base app name # appname= if [ -f "$full_appname/Resources/Info-gnustep.plist" ]; then # -n disable auto-print (for portability reasons) # /^ *NSExecutable *=/ matches every line beginning with # zero or more spaces, followed by 'NSExecutable', followed by zero or # more spaces, followed by '=' # to this line we apply the following commands: # s/"//g; which deletes all " in the line. # s/^ *NSExecutable *= *\([^ ;]*\) *;.*/\1/p; # which replaces 'NSExecutable = Gorm; ' with 'Gorm', then, because # of the 'p' at the end, prints out the result # q; which quits sed since we know there must be only a single line # to replace. appname=`sed -n -e '/^ *NSExecutable *=/ \ {s/"//g; s/^ *NSExecutable *= *\([^ ;]*\) *;.*/\1/p; q;}' \ "$full_appname/Resources/Info-gnustep.plist"` fi if [ -z "$appname" ]; then appname="`basename \"$app\"`" fi appname="$appname$EXEEXT" if [ $show_available_platforms = 1 ]; then cd "$full_appname" #available_platforms exit 0 fi # # Determine the host information # if [ -z "$GNUSTEP_HOST" ]; then GNUSTEP_HOST=`(cd /tmp; $GNUSTEP_SYSTEM_ROOT/Library/Makefiles/config.guess)` GNUSTEP_HOST=`(cd /tmp; $GNUSTEP_SYSTEM_ROOT/Library/Makefiles/config.sub $GNUSTEP_HOST)` export GNUSTEP_HOST fi if [ -z "$GNUSTEP_HOST_CPU" ]; then GNUSTEP_HOST_CPU=`$GNUSTEP_SYSTEM_ROOT/Library/Makefiles/cpu.sh $GNUSTEP_HOST` GNUSTEP_HOST_CPU=`$GNUSTEP_SYSTEM_ROOT/Library/Makefiles/clean_cpu.sh $GNUSTEP_HOST_CPU` export GNUSTEP_HOST_CPU fi if [ -z "$GNUSTEP_HOST_VENDOR" ]; then GNUSTEP_HOST_VENDOR=`$GNUSTEP_SYSTEM_ROOT/Library/Makefiles/vendor.sh $GNUSTEP_HOST` GNUSTEP_HOST_VENDOR=`$GNUSTEP_SYSTEM_ROOT/Library/Makefiles/clean_vendor.sh $GNUSTEP_HOST_VENDOR` export GNUSTEP_HOST_VENDOR fi if [ -z "$GNUSTEP_HOST_OS" ]; then GNUSTEP_HOST_OS=`$GNUSTEP_SYSTEM_ROOT/Library/Makefiles/os.sh $GNUSTEP_HOST` GNUSTEP_HOST_OS=`$GNUSTEP_SYSTEM_ROOT/Library/Makefiles/clean_os.sh $GNUSTEP_HOST_OS` export GNUSTEP_HOST_OS fi # # Make sure the executable is there # if [ -x "$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/$appname" ]; then relative_path="$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/$appname" elif [ -x "$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$appname" ]; then relative_path="$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$appname" elif [ -x "$full_appname/$GNUSTEP_HOST_CPU/$appname" ]; then relative_path="$GNUSTEP_HOST_CPU/$appname" elif [ "$full_appname/$appname" != "$0" -a -x "$full_appname/$appname" ]; then relative_path="$appname" else # Search for a binary for this machine but a different library combo if [ -d "$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS" ]; then tmp_path="`pwd`" cd "$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS"; found=no for lib_combo in * ; do if [ "$lib_combo" != '*' ]; then if [ -x "$lib_combo/$appname" ]; then # Switch LIBRARY_COMBO on the fly tmp_root="$GNUSTEP_SYSTEM_ROOT" . "$tmp_root/Library/Makefiles/GNUstep-reset.sh" LIBRARY_COMBO="$lib_combo" . "$tmp_root/Library/Makefiles/GNUstep.sh" # Use the found executable relative_path="$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/$appname" found=yes break fi fi done cd "$tmp_path" if [ "$found" != yes ]; then echo "$full_appname application does not have a binary for this kind of machine/operating system ($GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS)." exit 1 fi fi fi if [ $show_relative_path = 1 ]; then echo "$relative_path" exit 0 fi if [ $show_full_path = 1 ]; then echo "$full_appname/$relative_path" exit 0 fi if [ "$LIBRARY_COMBO" = nx-nx-nx -a "$GNUSTEP_HOST_OS" = nextstep4 ]; then if [ -f "$full_appname/library_paths.openapp" ]; then additional_library_paths="`cat $full_appname/library_paths.openapp`" fi else if [ -f "$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/library_paths.openapp" ]; then additional_library_paths="`cat \"$full_appname/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO/library_paths.openapp\"`" fi fi # Load up LD_LIBRARY_PATH . "$GNUSTEP_SYSTEM_ROOT/Library/Makefiles/ld_lib_path.sh" exec "$full_appname/$relative_path" "$@" GNUstepWrapper-0.1.0/WrapperFactory/Icons/0000755000175000017500000000000010106156372021604 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/WrapperFactory/Icons/WrapperFactory.tiff0000644000175000017500000002245410105412125025423 0ustar rherzogrherzog00000000000000II*$ H z  io!(-:>>>ɢƙ|NF:N ɜ٥ï٭s] opqЩڤްȲmiiյۯj_Ny  ѭӞۭ߮~вzd _ܥܥܥcR?220ݮϤ}նѧWODtfPثܮԪÚnt aUDΣ9-&! !٪Ѻ{mβ! J)ocOΪڲ !"%)()$$$'$"I?4~dzo{y®ڰn{iOOF9 }k֫oaSwĥԱڮګmbQ#!$%641SI;A<5^P<\M9_O8_O5~rgc`rSz[mX=lYAgXBSI8-,*tͷحҪvogzseyYtUwY|\_vfO(*-D>7saIp^Gm^Fp^Hr`E}uk/04ROIpVllOyfLq`G[O=742zwr±ݴǜxuUxaDnM}\alprnga`yW+,.11/>:5H?6^SFxbv\ugV{yucS=TH951*40.32/31/#""XVTNJyap]BkX?uaE~hLtUamuŪĪyguWvfNG@8''*-,-,-+HHIKMO*-1"%)!$'-,.ơu--./00W" DbVCm]EyfLmQtQwUafjwcpSOH457"(-!&/$(/(+1,01013001,-.)))'''&&''('#ɟp,,*-,+@?o^IlOq`HIA6.,-*-.SNGMHB45<06>;=B<<>;;>8::668456334//1*+-(*,&&*'(*+**611ѧYRG""% %$$lIB7WL@542&*4OON߲ư15;59?=>A==?88;558456012)+.876i`Uwl]QKCC=8ub#$#:";96111GJNQQQкğϨܰϣ:;=?56:KIFLJG)+.?=;l~qʱiC?; 321444KMRgcaսˤܰͣ<=D(-6MKK~_ZS225zixm϶pQLC""$Q ++(EFIMNRvqjzİͥܰuj`kfa9::yeϹХl 7JLQLMSfbatʵžѧ٬ۯɢվƟ߰ݯԽ{mbS%%#dALNRHKQXWYuqkwɵХܮڬ̡ϸni`S42.d $JKOJLQJMR^\[sogs~̶ֿŞʡϥϤͣʢŜԻȱxkuiZTOF11/!";;?STYKMRJLQSTUgb_|tiqy~|wp~hxm]cZNKG?11/%%&%&'##$AABCGEHLKMRFHMGINMLOYXVd`[qjaumb{rdzqcvm^qhZg_RUPGFC>552())#%'%&'))***+&&&[?@DBCGJMPGJNBEK?@E>?D=?A;=@<=>99;559025,.0,-0,-.,-/...---**,&'( "#631>678GJMACGGHMHJMDEIBCF@AD>?B;;=::=789578556233../***%%'RLDzo[63+] !FIIMHIMDEHABE@AC?@C>=@:<=789556122/00...)**c[Nݰư|g-.0|LOSUVZKLQBCG>>@:;<789567445454343334'(,:97Ɲu84-Z CDHTUYNPTGHK@AC<>?;:=9:;88:789789568&(.vǟmeWBRTXRTXJLOEFI?@B<=?<;=;<=;;=;?@>?A=>A58;je^Ӿñz}gd`Z99?@CHJMFHKHINIJOFHMDFJGHJEEI>?C89>247())$ !"i013;<>GGJLMOHILJKM<=>,,-?00$ $%@$%$%(R/home/rb/GSWrapper.tiffCreated with The GIMPHHGNUstepWrapper-0.1.0/WrapperFactory/Icons/DesktopEntry.tiff0000644000175000017500000002253010105411631025102 0ustar rherzogrherzog00000000000000II*$}}BFZBFBB-Zi]Znzi]Znzi]Znzi]ininini]ininininininini]ini]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]ZnzBFBinzi]i]zi]inzi]inz]inz]inzninz]inz]inz]inz]inz]inzi]inzi]i]zi]inzi]-*i]B-Bi]Znzi]Zni]inininzninzninzninzninznininini]ininini]ini]Znzi]Znz-*Znz*FBi]zi]inzi]inzninznznznznznznzninzni]i]zi]-*-*-*i]B-Bi]Znzi]inzninzni}zni}znz}zni}zni}Znzi]Znz-*Znz*FBinzz]inzni]inzi]-*i]B-Bi]inininZni]Znz-*-*-*Znz*FBini]inz]i]i]zi]-*i]B-Bininini}ini]Znz-*Znz}*FBinzz]inzni]inzi]-*-*-*i]B-Bi]inzninini]in-*Znz}*-*ini]inz]i]i]zi]-*i]öz}B-Bi]inininini]Znz-*-*-*Znzò}*-*inzz]inz]i]inzi]-*i]öòöz}*-Bi]inininZni]Znz-*Znzò}*-*i]zi]inzz]i]i]zi]-*-*-*i]öz}**i]Znzi]ininini]ininZnzi]Znzi]Znzi]Znzi]Znzòz}*-*inzi]i]zi]inz]ini]inzi]i]zi]inzi]i]zi]inzi]z}*-*i]Znzi]Znzi]ini]Zni]Zni]Znzi]Znzi]Znzi]Znzz}-*i]zi]i]zi]inzi]inzi]i]zi]i]zi]i]zi]i]zi]i]zi]z}**i]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzz}-*inzi]i]zi]inzi]i]zi]inzi]i]zi]inzi]i]zi]inzi]i]zi]inzi]i]zi]inzi]i]zi]inzi]i]zi]inzi]z}**i]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzzn-i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i]zi]i}z**i]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzi]Znzzn-inz*òi}zni}znöòöznBBinz*òòin-}}}}z}}z}}z}}z}z}z}znz}znz}zznznzzninzzninzzninzz]zinzinzznzinzznzZ]Zöz}inzi]iZ]ZBFZBFBB-BBFBZFiZ]Zi]iZ]ii]iz}Znzz}inzZ]iZ]i*FBB-ZB]ZZ]iz}zBFZ}inzi]zZ]ii]iZ]ii]iZ]ii]zz}zz}ZFZòòòöòBFZZFZbbb}B]Zbbb00$ D$2%@$H%P%(R/home/rherzog/Development/GNUstep/GSWrapper/Icons/DesktopEntry.tiffCreated with The GIMPHHGNUstepWrapper-0.1.0/WrapperFactory/Icons/DefaultAppIcon.tiff0000644000175000017500000000751410000500531025302 0ustar rherzogrherzog00000000000000II*D $h!B &l"F%jXa1ˎ7^ٲ 0a>}&if5)Q hd/!BD,ϱnT3t3[?Qu=ZT"% WJ%#K(ݿL/t3ټ9(/jڼ%aWDz?o{(; >\B1Ry_5)``˲Z8cpa៲S$DK,I%=H!TG75XZ!mlF ?60먫NprbGuF oJ's6\ 0+wGwtӯʑJDzkY' q'У@lH<@USmֶgv;ّwsȩi/SI8ݖCT7dflP|ϯ N>z qBf0643,3]DŖXj^~EjYe5ꮷ~~ķf?(!ǀWH]<#)'r" sԋ q}6q`Pܐa]n׹MFǽx0q1c;G[dD27Au2Ōc#fp=oy{*Q,iiT j򅕭v:O 8Ip08Nb艆tQ,./)\t3$rStB=9K ]Z>sX]z5 /&36щrf'уDV/fx-^sˡ& 7q_?c}05hoghx7dQҊݸ"J.aS4Ti)M2Law\?ۊ\l71>cGWGH'glqIK:T?H2bSTƱin,[Y'Bh N ;+?q[dІ< *Bɨ3TPNH]8V7LBLס77kR)BP#|MW2,G4\}j‹ƱG48w⒀G:FgQ8*\dd!@XOa: ?u;ˀgLj`̢f; `@ͣ |whZ0Q :\*71M$Ŕ4)JnR_4:g_dμ7<`fotcX#!D0  ?1FRRs\YuIudrМL6̥w #AbFc/}+Yt@޳OWg M Z_n h ,!5 9HatnQK2Wxf)p[wzVt9 .9 s.ԋ*`4Ur5 l0TW+)4e(5Lz?HMwHEilzx0W>⑏,^vsgb]6Xw.ZX77vٰO`G# Hjp#m烇@tCyNp+*|IGfrsA^`h# 0^(ׅvG4p8DivY['"iՋ0[wB"Ci :S3@yׇp8P8؍b9YP Pp9 QUfiMhYU<2xG& z)@9"5OEP 4ψ- /S H9 ;y v6a,mwӐxw7~W)qhN_N 5}7t7"PvfFdcZ|'ysLV|0LI$;6➸>dw?h:Gq~GKAJp!qr 0[ (DNT~`|3 be<ʸ?/и@؋4Q EINPscLHw/(v&,b (HD)%,N+@/ m8*VϬ*ou/9T`T"%)0 "!2qjjgH,@+LM|֋"g I.Ŋ1\mS4?K9%SNBr-R'!>0|>+xbITvUV|jpk=koso6UWlf!{F13:/fjn1`s)pihulmko6lG@--  /6-;R/home/andre/GNUstep/Library/icons/GNUstep2.tifcreated with The GIMPGNUstepWrapper-0.1.0/WrapperFactory/main.m0000644000175000017500000000200710105723273021631 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: main.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/main.m $ */ #include int main(int argc, const char **argv) { return NSApplicationMain(argc, argv); } GNUstepWrapper-0.1.0/WrapperFactory/Icon.m0000644000175000017500000000542410105723273021603 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: Icon.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/Icon.m $ */ #include #include "Icon.h" @implementation Icon - (id)init { self = [super init]; if ( self ) { } return self; } - (void)dealloc { TEST_AUTORELEASE(image); } - (id)initWithImage: (NSImage *)i { self = [self init]; if ( self ) { image = RETAIN(i); [i setScalesWhenResized: YES]; originalSize = [i size]; } return self; } + (id)iconWithImage: (NSImage *)i { return AUTORELEASE([[Icon alloc] initWithImage: i]); } - (NSImage *)imageCopy: (BOOL)copy { if ( ! image ) { return nil; } [image setScalesWhenResized: YES]; if ( copy ) { return AUTORELEASE([image copyWithZone: (NSZone *)nil]); } else { return image; } } - (NSImage *)imageForSize: (NSSize)size copy: (BOOL)copy { NSImage *img = [self imageCopy: copy]; if ( (originalSize.width>size.width) || (originalSize.height>size.height) ) { // scale the image down proportionally float ratio = MIN(size.width / originalSize.width, size.height / originalSize.height); size.width = originalSize.width*ratio; size.height = originalSize.height*ratio; [img setSize: size]; } else { [img setSize: originalSize]; } return img; } - (NSData *)scaledTIFFRepresentation: (NSSize)size { NSImage *img = [self imageForSize: size copy: YES]; [img lockFocus]; NSRect rect = NSMakeRect(1, 1, 3, 3); //rect.origin = NSZeroPoint; //rect.size = size; NSBitmapImageRep *newRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: rect]; [img unlockFocus]; NSData *tiff = [newRep TIFFRepresentation]; RELEASE(newRep); return tiff; } - (NSImage *)imageForOriginalSizeCopy: (BOOL)copy { NSImage *img = [self imageCopy: copy]; [img setSize: originalSize]; return img; } @end GNUstepWrapper-0.1.0/WrapperFactory/Type.h0000644000175000017500000000241310105723273021622 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: Type.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/Type.h $ */ #ifndef _GSWrapper_Type_H #define _GSWrapper_Type_H #include #include "Icon.h" @interface Type : NSObject { Icon *icon; NSString *name; NSString *extensions; } - (Icon *)icon; - (void)setIcon: (Icon *)i; - (NSString *)name; - (void)setName: (NSString *)n; - (NSString *)extensions; - (void)setExtensions: (NSString *)e; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/TypeController.m0000644000175000017500000000660210105723273023677 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: TypeController.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/TypeController.m $ */ #include #include "TypeController.h" @implementation TypeController - (Type *)type { return type; } - (void)setType: (Type *)t { ASSIGN(type, t); [iconView setIcon: [type icon]]; [extensionsTextField setStringValue: [type extensions]]; [nameTextField setStringValue: [type name]]; //[rolePopUp selectItemAtIndex: [rolePopUp indexOfItemWithTag: [type role]]]; } /* * UI actions */ /* * NSTextField delegate */ - (void)controlTextDidChange: (NSNotification *)not { id sender = [not object]; if ( !sender ) { NSLog(@"Sender is nil"); return; } if ( !type ) { NSLog(@"No type"); return; } if ( sender == extensionsTextField ) { [type setExtensions: [extensionsTextField stringValue]]; } else if ( sender == nameTextField ) { [type setName: [nameTextField stringValue]]; } else { NSLog(@"Got textDidChange from unknown sender: %@", sender); } } /* * IconView delegate */ - (void)iconViewDidChangeIcon: (NSNotification *)not { if ( [not object] != iconView ) { NSLog(@"Received iconViewDidChangeIcon from unknown object"); } else { if ( !isSettingIcon ) { isSettingIcon = YES; [type setIcon: [iconView icon]]; isSettingIcon = NO; } } } /* * Outlets */ - (IconView *)iconView { return iconView; } - (void)setIconView: (IconView *)icon { if ( isSettingIcon ) { return; } isSettingIcon = YES; if ( iconView) { [[NSNotificationCenter defaultCenter] removeObserver: self name: (IconViewDidChangeIconNotification) object: (self)]; } ASSIGN(iconView, icon); if ( iconView ) { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(iconViewDidChangeIcon:) name: (IconViewDidChangeIconNotification) object: (iconView)]; } isSettingIcon = NO; } - (NSTextField *)extensionsTextField { return extensionsTextField; } - (void)setExtensionsTextField: (NSTextField *)extensions { ASSIGN(extensionsTextField, extensions); } - (NSTextField *)nameTextField { return nameTextField; } - (void)setNameTextField: (NSTextField *)name { ASSIGN(nameTextField, name); } @end GNUstepWrapper-0.1.0/WrapperFactory/GNUmakefile.development.post0000644000175000017500000000204510105723273026110 0ustar rherzogrherzog00000000000000# -*- Mode: Makefile -*- # # 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. # # $Id: GNUmakefile.development.post 103 2004-08-09 16:30:51Z rherzog $ # $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/GNUmakefile.development.post $ # GNUstep-make does not always detect changed resources - so build the app from scratch each time before-all:: rm -rf $(APP_DIR) GNUstepWrapper-0.1.0/WrapperFactory/ApplicationDelegate.h0000644000175000017500000000360510105723273024603 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: ApplicationDelegate.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/ApplicationDelegate.h $ */ #ifndef _GSWrapper_GSWrapper_H #define _GSWrapper_GSWrapper_H #include #include "ServicesProvider.h" @interface ApplicationDelegate : NSObject { IBOutlet NSMenuItem *windowsMenuItem; IBOutlet NSMenuItem *servicesMenuItem; ServicesProvider *servicesProvider; } - (void)awakeFromNib; /* * application delegate */ - (void)applicationDidFinishLaunching: (NSNotification *)not; - (void)applicationDidFinishLaunching: (NSNotification *)not; - (NSApplicationTerminateReply)applicationShouldTerminate: (NSNotification *)not; - (void)applicationWillTerminate: (NSNotification *)not; - (void)application: (NSApplication *)app openFile: (NSString *)file; - (void)application: (NSApplication *)app openFiles: (NSArray *)files; /* * outlets */ - (void)setWindowsMenuItem: (NSMenuItem *)menuItem; //- (NSMenu *)windowsMenu; - (void)setServicesMenuItem: (NSMenuItem *)menuItem; //- (NSMenu *)servicesMenu; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/ServicesProvider.h0000644000175000017500000000260110105723273024176 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: ServicesProvider.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/ServicesProvider.h $ */ #ifndef _GSWrapper_ServiceProvider_H #define _GSWrapper_ServiceProvider_H #include @interface ServicesProvider : NSObject - (void) createWrapperForExecutable: (NSPasteboard *)pboard userData: (NSString *)userData error: (NSString **)error; - (void) editWrapper: (NSPasteboard *)pboard userData: (NSString *)userData error: (NSString **)error; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/GNUmakefile0000644000175000017500000000332310105723273022603 0ustar rherzogrherzog00000000000000# Copyright (C) 2004 Raffael Herzog # # 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. # # $Id: GNUmakefile 103 2004-08-09 16:30:51Z rherzog $ # $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/GNUmakefile $ include $(GNUSTEP_MAKEFILES)/common.make include ../Directories.make APP_NAME=WrapperFactory WrapperFactory_OBJC_FILES = main.m \ ApplicationDelegate.m \ ServicesProvider.m \ WrapperDocument.m \ Type.m \ WrapperDocumentController.m \ Icon.m \ IconView.m \ TypesController.m \ TypeController.m \ WrapperFactory_RESOURCE_FILES = \ Icons/WrapperFactory.tiff \ Icons/DefaultAppIcon.tiff \ Icons/DesktopEntry.tiff \ WrapperFactory_LANGUAGES = English WrapperFactory_LOCALIZED_RESOURCE_FILES = Localizable.strings \ WrapperFactory.gorm \ WrapperDocument.gorm \ -include GNUmakefile.preamble ifeq ($(GSWrapper_Development),yes) include ../GNUmakefile.development endif include $(GNUSTEP_MAKEFILES)/application.make -include GNUmakefile.postamble ifeq ($(GSWrapper_Development),yes) include GNUmakefile.development.post endif GNUstepWrapper-0.1.0/WrapperFactory/ApplicationDelegate.m0000644000175000017500000000626410105723273024614 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: ApplicationDelegate.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/ApplicationDelegate.m $ */ #include #include "ApplicationDelegate.h" #include "WrapperDocument.h" @implementation ApplicationDelegate - (void)awakeFromNib { //documentController = [NSDocumentController sharedController]; } /* * Application delegate */ - (void)applicationWillFinishLaunching: (NSNotification *)not { [NSApp setWindowsMenu: [windowsMenuItem submenu]]; [NSApp setServicesMenu: [servicesMenuItem submenu]]; NSArray *types = [NSArray arrayWithObjects: NSStringPboardType, NSTIFFPboardType, nil]; RETAIN(types); [NSApp registerServicesMenuSendTypes: types returnTypes: (types)]; } - (void)applicationDidFinishLaunching: (NSNotification *)not { servicesProvider = [[ServicesProvider alloc] init]; [NSApp setServicesProvider: servicesProvider]; } - (BOOL)applicationOpenUntitledFile: (NSApplication *)app { [[NSDocumentController sharedDocumentController] openUntitledDocumentOfType: ApplicationType display: (YES)]; return YES; } - (BOOL)applicationShouldOpenUntitledFile: (NSApplication *)app { return YES; } - (NSApplicationTerminateReply)applicationShouldTerminate: (NSNotification *)not { if ( [[NSDocumentController sharedDocumentController] closeAllDocuments] ) { return NSTerminateNow; } else { return NSTerminateCancel; } } - (void)applicationWillTerminate: (NSNotification *)not { } - (void)application: (NSApplication *)app openFile: (NSString *)file { [self application: app openFiles: ([NSArray arrayWithObject: file])]; //openFiles: (AUTORELEASE([NSArray arrayWithObject: file]))]; } - (void)application: (NSApplication *)app openFiles: (NSArray *)files { int i; int count = [files count]; NSDocumentController *documentController = [NSDocumentController sharedDocumentController]; for ( i=0; i #include "ServicesProvider.h" #include "WrapperDocument.h" @implementation ServicesProvider - (void) dealloc { NSLog(@"ServicesProvider dealloced"); } - (void) createWrapperForExecutable: (NSPasteboard *)pboard userData: (NSString *)userData error: (NSString **)error { NSDocumentController *documentController = [NSDocumentController sharedDocumentController]; NSArray *files = [pboard propertyListForType: NSFilenamesPboardType]; NSString *file; NSString *appName; WrapperDocument *doc; NSString *userRoot = [[[NSProcessInfo processInfo] environment] objectForKey: @"GNUSTEP_USER_ROOT"]; int i; int count = [files count]; BOOL shouldCreate = [documentController shouldCreateUI]; [documentController setShouldCreateUI: YES]; [NSApp activateIgnoringOtherApps: YES]; for ( i=0; i #include "WrapperDocument.h" #include "Type.h" #include "TypeController.h" @interface TypesController : NSObject { IBOutlet NSTableView *tableView; IBOutlet TypeController *typeController; IBOutlet WrapperDocument *document; IBOutlet NSBox *typeEditor; NSBox *emptyBox; NSView *typeEditorContents; NSBorderType typeEditorBorderType; NSTitlePosition typeEditorTitlePosition; } /* * initialization */ - (void)awakeFromNib; - (void)setupTable; /* * NSTableView delegate */ - (void)tableViewSelectionDidChange: (NSNotification *)not; /* * UI Actions */ - (IBAction)newType: (id)sender; - (IBAction)deleteType: (id)sender; /* * Outlets */ - (WrapperDocument *)document; - (void)setDocument: (WrapperDocument *)doc; - (NSTableView *)tableView; - (void)setTableView: (NSTableView *)table; - (TypeController *)typeController; - (void)setTypeController: (TypeController *)typec; - (NSBox *)typeEditor; - (void)setTypeEditor: (NSBox *)Editor; /* * NSTableDataSource */ - (int)numberOfRowsInTableView: (NSTableView *)table; - (id)tableView: (NSTableView *)table objectValueForTableColumn: (NSTableColumn *)col row: (int)row; // - (void)tableView: (NSTableView *)table // setObjectValue: (id)value // forTableColumn: (NSTableColumn *)col // row: (int)row; - (void)tableView: (NSTableView *)table sortDescriptorsDidChange: (NSArray *)sortDescriptors; // - (BOOL)tableView: (NSTableView *)table // acceptDrop: (id)info // row: (int)row // dropOperation: (NSTableViewDropOperation *)operation; // - (NSDragOperation)tableView: (NSTableView *)table // validateDrop: (id)info // proposedRow: (int)row // proposedDropOperation: (NSTableViewDropOperation)operation; // - (BOOL)tableView: (NSTableView *)table // writeRows: (NSArray *)rows // toPasteboard: (NSPasteboard *)pboard; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/TypesController.m0000644000175000017500000001552710105723273024070 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: TypesController.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/TypesController.m $ */ #include #include "TypesController.h" static NSString *IconColumnId = @"IconColumn"; static NSString *NameColumnId = @"NameColumn"; @interface TypesController (Private) - (void)showTypeEditor; - (void)hideTypeEditor; @end @implementation TypesController /* * initialization */ - (id)init { self = [super init]; if ( self ) { emptyBox = [[NSBox alloc] init]; [emptyBox setBorderType: NSNoBorder]; [emptyBox setTitlePosition: NSNoTitle]; } [[NSNotificationCenter defaultCenter] addObserver: (self) selector: @selector(documentAggregateDidChange:) name: (WrapperAggregateChangedNotification) object: (nil)]; return self; } - (void)dealloc { TEST_RELEASE(emptyBox); } - (void)awakeFromNib { [self setupTable]; } - (void)setupTable { if ( ! tableView ) { return; } [tableView setAllowsColumnReordering: NO]; [tableView setAllowsColumnResizing: YES]; [tableView setAllowsMultipleSelection: NO]; [tableView setAllowsEmptySelection: NO]; [tableView setAllowsColumnSelection: NO]; NSEnumerator *e = [[tableView tableColumns] objectEnumerator]; NSTableColumn *c; while ( (c=[e nextObject]) ) { [tableView removeTableColumn: c]; } // icon column c = AUTORELEASE([[NSTableColumn alloc] initWithIdentifier: IconColumnId]); [c setWidth: [tableView rowHeight]]; [c setResizable: NO]; [c setDataCell: AUTORELEASE([[NSImageCell alloc] init])]; [tableView addTableColumn: c]; // name column c = AUTORELEASE([[NSTableColumn alloc] initWithIdentifier: NameColumnId]); [c setResizable: YES]; [[c headerCell] setStringValue: _(@"Type Name")]; [tableView addTableColumn: c]; [tableView setAutoresizesAllColumnsToFit: NO]; [tableView deselectAll: self]; [tableView reloadData]; [self hideTypeEditor]; } /* * NSTableView delegate */ - (void)tableViewSelectionDidChange: (NSNotification *)not { if ( [tableView numberOfSelectedRows] ) { [typeController setType: [document typeAtIndex: [tableView selectedRow]]]; [self showTypeEditor]; } else { [self hideTypeEditor]; [typeController setType: nil]; } } /* * WrapperDocument delegate */ - (void)documentAggregateDidChange: (NSNotification *)not { if ( document ) { if ( [document indexOfType: [not object]] >= 0 ) { [tableView reloadData]; } } } /* * UI Actions */ - (IBAction)newType: (id)sender { if ( document && tableView ) { Type *type = AUTORELEASE([[Type alloc] init]); [document addType: type]; [tableView reloadData]; [tableView selectRow: [document typeCount]-1 byExtendingSelection: (NO)]; } } - (IBAction)deleteType: (id)sender { if ( document && tableView ) { int index = [tableView selectedRow]; if ( index >= 0 ) { Type *type = [document typeAtIndex: index]; [tableView deselectRow: index]; [document removeType: type]; [tableView reloadData]; } } } /* * Outlets */ - (WrapperDocument *)document { return document; } - (void)setDocument: (WrapperDocument *)doc { // if ( document ) { // [[NSNotificationCenter defaultCenter] removeObserver: (self) // name: (WrapperAggregateChangedNotification) // object: (document)]; // } ASSIGN(document, doc); // if ( document ) { // //NSLog(@"Setting observer: %@", document); // [[NSNotificationCenter defaultCenter] addObserver: (self) // selector: @selector(documentAggregateDidChange:) // name: (WrapperAggregateChangedNotification) // object: (document)]; // } } - (NSTableView *)tableView { return tableView; } - (void)setTableView: (NSTableView *)table { ASSIGN(tableView, table); } - (TypeController *)typeController { return typeController; } - (void)setTypeController: (TypeController *)typec { ASSIGN(typeController, typec); } - (NSBox *)typeEditor { return typeEditor; } - (void)setTypeEditor: (NSBox *)editor { ASSIGN(typeEditor, editor); } /* * NSTableDataSource */ - (int)numberOfRowsInTableView: (NSTableView *)table; { if ( document ) { return [document typeCount]; } else { return 0; } } - (id)tableView: (NSTableView *)table objectValueForTableColumn: (NSTableColumn *)col row: (int)row { if ( !document || (row>=[document typeCount]) ) { return nil; } Type *type = [document typeAtIndex: row]; if ( [[col identifier] isEqualToString: IconColumnId] ) { return [[type icon] imageCopy: NO]; } else if ( [[col identifier] isEqualToString: NameColumnId] ) { return [type name]; } else { return nil; } } - (void)tableView: (NSTableView *)table sortDescriptorsDidChange: (NSArray *)sortDescriptors { } @end @implementation TypesController (Private) - (void)showTypeEditor { if ( typeEditor && typeEditorContents ) { [typeEditor setContentView: typeEditorContents]; [typeEditor setTitlePosition: typeEditorTitlePosition]; [typeEditor setBorderType: typeEditorBorderType]; ASSIGN(typeEditorContents, nil); } } - (void)hideTypeEditor { if ( typeEditor && !typeEditorContents ) { ASSIGN(typeEditorContents, [typeEditor contentView]); [typeEditor setContentView: emptyBox]; typeEditorTitlePosition = [typeEditor titlePosition]; typeEditorBorderType = [typeEditor borderType]; [typeEditor setTitlePosition: NSNoTitle]; [typeEditor setBorderType: NSNoBorder]; } } @end GNUstepWrapper-0.1.0/WrapperFactory/WrapperDocument.h0000644000175000017500000000766310105723273024034 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: WrapperDocument.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/WrapperDocument.h $ */ #ifndef _GSWrapper_WrapperDocument_H #define _GSWrapper_WrapperDocument_H #include #include "Type.h" extern NSString * const ApplicationType; extern NSString * const WrapperChangedNotification; extern NSString * const WrapperChangedAttributeName; extern NSString * const WrapperChangedAttributeValue; extern NSString * const WrapperAggregateChangedNotification; extern NSString * const WrapperAggregateChangedObject; extern NSString * const WrapperAggregateChangedAttributeName; extern NSString * const WrapperAggregateChangedAttributeValue; typedef enum { NoneRole, ViewerRole, EditorRole } ApplicationRole; typedef enum { RunScriptAction, FailAction, IgnoreAction } ScriptAction; @interface WrapperDocument : NSDocument { NSFileWrapper *fileWrapper; Icon *appIcon; NSString *name; NSString *version; NSString *fullVersion; NSString *description; NSString *url; NSString *authors; ApplicationRole role; NSString *startScript; NSString *startScriptShell; ScriptAction startScriptAction; NSString *startOpenScript; NSString *startOpenScriptShell; ScriptAction startOpenScriptAction; NSString *openScript; NSString *openScriptShell; ScriptAction openScriptAction; NSMutableArray *types; } /* * document */ - (id)init; - (BOOL)loadFileWrapperRepresentation: (NSFileWrapper *)file ofType: (NSString *)type; - (NSFileWrapper *)fileWrapperRepresentationOfType: (NSString *)type; - (NSString *)windowNibName; - (int)runModalSavePanel: (NSSavePanel *)savePanel withAccessoryView: (NSView *)accessoryView; /* * attributes */ - (Icon *)appIcon; - (void)setAppIcon: (Icon *)i; - (NSString *)name; - (void)setName: (NSString *)n; - (NSString *)version; - (void)setVersion: (NSString *)n; - (NSString *)fullVersion; - (void)setFullVersion: (NSString *)n; - (NSString *)description; - (void)setDescription: (NSString *)n; - (NSString *)url; - (void)setUrl: (NSString *)n; - (NSString *)authors; - (void)setAuthors: (NSString *)n; - (ApplicationRole)role; - (void)setRole: (ApplicationRole)r; - (NSString *)startScript; - (void)setStartScript: (NSString *)n; - (NSString *)startScriptShell; - (void)setStartScriptShell: (NSString *)n; - (ScriptAction)startScriptAction; - (void)setStartScriptAction: (ScriptAction)action; - (NSString *)startOpenScript; - (void)setStartOpenScript: (NSString *)n; - (NSString *)startOpenScriptShell; - (void)setStartOpenScriptShell: (NSString *)n; - (ScriptAction)startOpenScriptAction; - (void)setStartOpenScriptAction: (ScriptAction)action; - (NSString *)openScript; - (void)setOpenScript: (NSString *)n; - (NSString *)openScriptShell; - (void)setOpenScriptShell: (NSString *)n; - (ScriptAction)openScriptAction; - (void)setOpenScriptAction: (ScriptAction)action; /* * types */ - (void)addType: (Type *)type; - (void)removeType: (Type *)type; - (int)typeCount; - (Type *)typeAtIndex: (unsigned)index; - (unsigned)indexOfType: (Type *)type; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/IconView.h0000644000175000017500000000347710105723273022437 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: IconView.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/IconView.h $ */ #ifndef _GSWrapper_IconView_H #define _GSWrapper_IconView_H #include #include #include "Icon.h" extern NSString * const IconViewDidChangeIconNotification; #define IconWidth 48.0f #define IconHeight 48.0f @interface IconView : NSView { BOOL registeredForDraggedTypes; Icon *icon; NSImage *draggingImage; float insetsSize; id delegate; BOOL armed; BOOL dndOperation; } - (id)init; - (Icon *)icon; - (void)setIcon: (Icon *)i; - (float)insetsSize; - (void)setInsetsSize: (float)size; - (void)drawRect: (NSRect)rect; - (void)viewDidMoveToSuperview; - (NSDragOperation)draggingEntered: (id)info; - (void)draggingExited: (id)info; - (BOOL)prepareForDragOperation: (id)info; - (BOOL)performDragOperation: (id)info; - (void)concludeDragOperation: (id)info; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/TypeController.h0000644000175000017500000000330610105723273023670 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: TypeController.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/TypeController.h $ */ #ifndef _GSWrapper_TypeController_H #define _GSWrapper_TypeController_H #include #include "Type.h" #include "IconView.h" @interface TypeController : NSObject { Type *type; IBOutlet IconView *iconView; IBOutlet NSTextField *extensionsTextField; IBOutlet NSTextField *nameTextField; IBOutlet NSPopUpButton *rolePopUp; BOOL isSettingIcon; } - (Type *)type; - (void)setType: (Type *)t; /* * NSTextField delegate */ - (void)controlTextDidChange: (NSNotification *)not; /* * Outlets */ - (IconView *)iconView; - (void)setIconView: (IconView *)icon; - (NSTextField *)extensionsTextField; - (void)setExtensionsTextField: (NSTextField *)extensions; - (NSTextField *)nameTextField; - (void)setNameTextField: (NSTextField *)name; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/WrapperDocumentController.h0000644000175000017500000000637010105723273026072 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: WrapperDocumentController.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/WrapperDocumentController.h $ */ #ifndef _GSWrapper_WrapperDocumentController_H #define _GSWrapper_WrapperDocumentController_H #include #include "WrapperDocument.h" #include "IconView.h" #define StartScript 0 #define StartOpenScript 1 #define OpenScript 2 @interface WrapperDocumentController : NSObject { NSCursor *textCursor; NSCursor *defaultCursor; IBOutlet NSWindowController *windowController; IBOutlet WrapperDocument *document; IBOutlet IconView *appIcon; IBOutlet NSTextField *name; IBOutlet NSTextField *version; IBOutlet NSTextField *fullVersion; IBOutlet NSTextField *description; IBOutlet NSTextField *url; IBOutlet NSTextField *authors; IBOutlet NSPopUpButton *rolePopUp; IBOutlet int currentScriptId; IBOutlet NSTextField *currentScriptShell; IBOutlet NSTextView *currentScript; IBOutlet NSPopUpButton *currentScriptActionPopUp; BOOL settingValue; } /* * initialization */ - (id)init; - (void)awakeFromNib; /* * delegate methods */ - (void)controlTextDidChange: (id)sender; - (void)iconViewDidChangeIcon: (NSNotification *)not; /* * actions */ - (IBAction)setCurrentScriptToStart: (id)sender; - (IBAction)setCurrentScriptToStartOpen: (id)sender; - (IBAction)setCurrentScriptToOpen: (id)sender; - (IBAction)setRole: (id)sender; - (IBAction)setCurrentScriptAction: (id)sender; /* * outlets */ - (void)setWindowController: (NSWindowController *)controller; - (void)setDocument: (WrapperDocument *)d; - (void)setAppIcon: (IconView *)i; - (IconView *)appIcon; - (void)setName: (NSTextField *)n; - (NSTextField *)name; - (void)setVersion: (NSTextField *)v; - (NSTextField *)version; - (void)setFullVersion: (NSTextField *)v; - (NSTextField *)fullVersion; - (void)setDescription: (NSTextField *)d; - (NSTextField *)description; - (void)setUrl: (NSTextField *)u; - (NSTextField *)url; - (void)setAuthors: (NSTextField *)a; - (NSTextField *)authors; - (NSPopUpButton *)rolePopUp; - (void)setRolePopUp: (NSPopUpButton *)role; - (void)setCurrentScriptId: (int)i; - (int)currentScriptId; - (void)setCurrentScriptShell: (NSTextField *)s; - (NSTextField *)currentScriptShell; - (void)setCurrentScript: (NSTextView *)s; - (NSTextView *)currentScript; - (void)setCurrentScriptActionPopUp: (NSPopUpButton *)actionPopUp; - (NSPopUpButton *)currentScriptActionPopUp; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/English.lproj/0000755000175000017500000000000010106156372023247 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/WrapperFactory/English.lproj/WrapperDocument.gorm/0000755000175000017500000000000010106156372027331 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/WrapperFactory/English.lproj/WrapperDocument.gorm/data.classes0000644000175000017500000001125210105645701031620 0ustar rherzogrherzog00000000000000{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:", "setCurrentScriptToStart:", "setCurrentScriptToStartOpen:", "setCurrentScriptToOpen:", "newType:", "deleteType:", "controlTextDidChange:", "setRole:", "chooseIcon:", "newAction:" ); Super = NSObject; }; IconView = { Actions = ( "setDelegate:" ); Outlets = ( delegate, icon ); Super = NSView; }; IconView2 = { Actions = ( ); Outlets = ( ); Super = IconView; }; TypeController = { Actions = ( "controlTextDidChange:", "setRole:", "chooseIcon:" ); Outlets = ( iconView, extensionsTextField, nameTextField, rolePopUp ); Super = NSObject; }; TypesController = { Actions = ( "setTableView:", "setTypeController:", "newType:", "deleteType:" ); Outlets = ( tableView, typeController, document, typeEditor ); Super = NSObject; }; WrapperDocumentController = { Actions = ( "setCurrentScriptToStart:", "setCurrentScriptToStartOpen:", "setCurrentScriptToOpen:", "setRole:", "chooseIcon:", "setCurrentScriptAction:" ); Outlets = ( windowController, appIcon, name, version, fullVersion, description, url, authors, currentScriptShell, currentScript, document, rolePopUp, currentScriptActionPopUp ); Super = NSObject; }; }GNUstepWrapper-0.1.0/WrapperFactory/English.lproj/WrapperDocument.gorm/objects.gorm0000644000175000017500000006546310105645701031664 0ustar rherzogrherzog00000000000000GNUstep archive00002a96:0000002b:00000335:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&V01NSString&%TextView01 NSTextView1NSText1NSView1 NSResponder% A  B   B &01 NSMutableArray1 NSArray&01 NSColor0&%NSNamedColorSpace0&%System0 &%textBackgroundColor  K K0 0 & % textColor B K0 & %  TextField100 1 NSTextField1 NSControl% B C B A  B A& 0 &%01NSTextFieldCell1 NSActionCell1NSCell0&%URL01NSFont% A`&&&&&&&&%0 0&%System0&%textBackgroundColor0 0& % textColor0&%TabView01 NSTabView% A A  D C  D C&0 &0% ? ? D C  D C&0 &01 NSPopUpButton1NSButton% C? C CW A  CW A& 0 &%01NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell0&0 %&&&&&&&&0!1NSMenu0"&0# &0$1 NSMenuItem0%&%Start Application0&&&&%0'1NSImage0(& % common_Nibble%0)0*& % Start Application and Open Files&&&%%0+0,&!%!Open Files in Running Application&&&%%%0-&0.&&&&$!%%%%%0/ % A C> B A  B A& 00 &%0102&%Shell&&&&&&&&%03 04&%System05&%textBackgroundColor06 407& % textColor08 % Bl C; D A  D A& 09 &%0:0;&%Text &&&&&&&&%0< 0=&%System0>&%textBackgroundColor0? =0@& % textColor0A % A CW B A  B A& 0B &%0C0D&%Action&&&&&&&&%0E 0F&%System0G&%textBackgroundColor0H F0I& % textColor0J% Bl CU C A  C A& 0K &%0L0M& &&&&&&&&0N0O&0P &0Q0R&%Run Shell Script0S&&&%'%0T0U&%Show Error DialogS&&%%0V0W& % Do Nothing0X&&&%%%0Y&0Z&&&&QN%%%%%0[1 NSScrollView% A A  D C,  D C,&0\ &0]1 NSClipView% A @ D @ C( A  D @ C(&0^ &0_% A  D @ C(  D @ C(&0` &0a 0b&%System0c&%textBackgroundColor  K K0d b0e& % textColor D @ Ka0f1 NSScroller% @ @ A C(  A C(&0g &%0h0i& &&&&&&&&&[2 _doScroll:v12@0:4@8]% A A A A f0j &0k1 NSTabViewItem0l&%Actions0m&%Actions%0n0o&%Types0p&%Types0q% ? ? D C  D C&0r &0s% A B C Cm  C Cm&0t &0u% A A C CS  C CS&0v &0w1 NSTableView%  C C!  C C!&0x &%0y0z& &&&&&&&&0{ &0|1! NSTableColumn0}&%column1 BP A GP0~1"NSTableHeaderCell0&% 0% &&&&&&&&%0 0&%System0&%controlShadowColor0 0&%System0&%windowFrameTextColor00&%neuf &&&&&&&&%0 0&%textBackgroundColor0 0& % textColor0!0&%column2 CS A GP0"0&% &&&&&&&&%00&%nine &&&&&&&&%0 0& % gridColor0 0&%System0&%controlBackgroundColor01#NSTableHeaderView%  C A  C A&0 &01$GSTableCornerView% @ @ A A  A A&0 &%% A @ @@0 0&%controlBackgroundColor0% @ A A CS  A CS&0 &%0z &&&&&&&&&s0% A @ C A  C A&0 &0 0& % controlColoru% A A A A 0% A A  B A  B A&$0 &%00&%New Type &&&&&&&&%0&0&&&&0% CN A  B A  B A&%0 &%00& % Delete Type &&&&&&&&%0&0&&&&01%NSBox% C A  C C  C C&0 &0% @ @ C Cz  C Cz&0 &0 % CO Ch B A  B A& 0 &%00&%Icon&&&&&&&&%0 0&%System0&%textBackgroundColor0 0& % textColor0 % C  B A  B A& 0 &%00& % Extensions&&&&&&&&%0± 0ñ&%System0ı&%textBackgroundColor0ű 0Ʊ& % textColor0DZ % B B A  B A& 0ȱ &%0ɱ0ʱ&%Name&&&&&&&&%0˱ 0̱&%System0ͱ&%textBackgroundColor0α 0ϱ& % textColor0б % B C  C< A  C< A& 0ѱ &%0ұ0ӱ& &&&&&&&&%0Ա 0ձ&%System0ֱ&%textBackgroundColor0ױ 0ر& % textColor0ٱ % B B C< A  C< A& 0ڱ &%0۱0ܱ& &&&&&&&&%0ݱ 0ޱ&%System0߱&%textBackgroundColor0 0& % textColor01& GSCustomView1' GSNibItem0& % IconView2 CO C# B B& 00&%Type &&&&&&&&%0 0&%System0&%windowBackgroundColor0 0&%System0& % textColor @ @%%% %%0& %  TextField110 % C C B A  B A& 0 &%00& % Full Version&&&&&&&&%0 0&%System0&%textBackgroundColor0 0& % textColor0&%Box0& %  TextField120 % C# C׀ Cހ A  Cހ A& 0 &%00& &&&&&&&&%0 0&%System0&%textBackgroundColor0 P& % textColorP& %  TextField13P % C# C Cހ A  Cހ A& P &%PP& &&&&&&&&%P P&%SystemP&%textBackgroundColorP P & % textColorP & %  TextField14P % C# C Cހ A  Cހ A& P &%PP& &&&&&&&&%P P&%SystemP&%textBackgroundColorP P& % textColorP& %  TextField15P % B C B A  B A& P &%PP&%Authors&&&&&&&&%P P&%SystemP&%textBackgroundColorP P& % textColorP& %  TextField16P % C C C A  C A& P! &%P"P#& &&&&&&&&%P$ P%&%SystemP&&%textBackgroundColorP' %P(& % textColorP)& %  TextField17/P*& %  TextField188P+& % TextFieldP, % A C B A  B A& P- &%P.P/&%AppIcon&&&&&&&&%P0 P1&%SystemP2&%textBackgroundColorP3 1P4& % textColorP5& %  TextField19AP6& % NSVisibleP7 &P81(NSWindow%  D D&% C Dh@P9%  D D  D D&P: &,P; % B C B A  B A& P< &%P=P>&%Name&&&&&&&&%P? P@&%SystemPA&%textBackgroundColorPB @PC& % textColorPD % C# C Cހ A  Cހ A& PE % C# C B A  B A&DPF &%PGPH& &&&&&&&&%PI PJ&%SystemPK&%textBackgroundColorPL JPM& % textColorPN &%POPP& &&&&&&&&%PQ PR&%SystemPS&%textBackgroundColorPT RPU& % textColorPV % B C B A  B A& PW &%PXPY& % Description&&&&&&&&%PZ P[&%SystemP\&%textBackgroundColorP] [P^& % textColorP_ % B C B A  B A& P` &%PaPb&%Version&&&&&&&&%Pc Pd&%SystemPe&%textBackgroundColorPf dPg& % textColorE   Ph % C# C Cހ A  Cހ A& Pi &%PjPk& &&&&&&&&%Pl Pm&%SystemPn&%textBackgroundColorPo mPp& % textColorPq % B C̀ B A  B A& Pr &%PsPt& % Copyright&&&&&&&&%Pu Pv&%SystemPw&%textBackgroundColorPx vPy& % textColorPz&P{&%IconView A C B B& P|% C# C B A  B A& P} &%P~P& &&&&&&&&PP&P &PP&%NoneP&&&%'%PP&%Viewer&&%%PP&%Editor&&%%%P&P&&&&%%%%%P % B C B A  B A& P &%PP&%Role&&&&&&&&%P P&%SystemP&%textBackgroundColorP P& % textColorP&%WindowP&%Name - GSWrapper ? A F@ F@%PP&%NSApplicationIconP&%ViewP& %  MenuItem10+P& %  MenuItem11QP& %  MenuItem12TP& %  MenuItem13PP&%NoneP&&&%'%P& %  MenuItem14PP&%Viewer&&%%P& %  MenuItem15PP&%Editor&&%%P& %  MenuItem16VP& %  MenuItem17PP&%NoneP&&&%'%P& %  MenuItem18PP&%Viewer&&%%P& %  MenuItem19PP&%Editor&&%%P&%GormNSTableViewwP& %  TextField20P& %  TextField21P& %  TextField22P& %  TextField23P& %  TextField24P&%WrapperDocumentControllerP'  &P& %  TextField25P&%MenuItemPP&%StartP&&&%'%P&%GormCustomViewP& %  TextField26hP& %  TextField27qP±& %  MenuItem20Pñ& %  MenuItem21Pı&%GormNSPopUpButtonPű% B( B B A  B A&PƱ &%PDZPȱ& &&&&&&&&PɱPʱ&P˱ &P̱Pͱ&%Item 1Pα&&&%'%PϱPб&%Item 2&&%%PѱPұ&%Item 3&&%%%Pӱ&PԱ&&&&ɐ%%%%%Pձ& %  MenuItem22Pֱ&% GormNSPopUpButton1Pױ% C` C C A  C A& Pر &%PٱPڱ& &&&&&&&&P۱Pܱ&Pݱ &PޱP߱&%Start With File&&%%PP& % Open File&&%%%P&P&&&&ې%%%%%P&% GormNSPopUpButton2P% B( CV B A  B A& P &%PP& &&&&&&&&PP&P &PP&%Item 1P&&&%'%PP&%Item 2&&%%PP&%Item 3&&%%%P&P&&&&%%%%%P&%ButtonP&% GormNSPopUpButton3P&% GormNSPopUpButton4JP&% GormNSPopUpButton5|P&% GormCustomView1zP& %  MenuItem1P&%NSOwnerP&%NSWindowControllerP& %  MenuItem2P& %  MenuItem3PP&%StartP&&&%'%P& % ScrollViewP%  D CQ  D CQ&P &P% A @ D @ CM A  D @ CM&P &P% A  D @ CM  D @ CM&P &P P &%SystemP &%textBackgroundColor  K KP  P & % textColor D @ K P% @ @ A CM  A CM&P &%PP& &&&&&&&&&% A A A A P& %  MenuItem4PP&%Start With Files&&%%P& %  TableColumn1P& %  MenuItem5PP& % Open Files&&%%P& %  MenuItem6PP& % Shell ScriptP&&&%'%P& %  MenuItem7PP& % Not Supported&&%%P & %  MenuItem8$P!& %  MenuItem9)P"& %  ScrollView1P#%  C B  C B&P$ &P%% A @ C B A  C B&P& &P'% A  C B  C B&P( &P) P*&%SystemP+&%textBackgroundColor  K KP, *P-& % textColor C K)P.% @ @ A B  A B&P/ &%P0P1& &&&&&&&&&#%% A A A A .P2&% Button1P3& %  ScrollView2P4%  C B  C B&P5 &P6% A @ C B A  C B&P7 &P8% A  C B  C B&P9 &P: P;&%SystemP<&%textBackgroundColor  K KP= ;P>& % textColor C K:P?% @ @ A B  A B&P@ &%PAPB& &&&&&&&&&46% A A A A ?PC& %  ScrollView3[PD& %  ScrollView4sPE& % GormNSWindow8PF& %  TextField1;PG& % TableColumn|PH& %  TextField2DPI& %  TextField3VPJ&%TypesControllerPK'J  &PL& %  TextField4_PM& %  TextField5PN % B B A  B A&PO &%PPPQ&%Mode&&&&&&&&%PR PS&%SystemPT&%textBackgroundColorPU SPV& % textColorPW&%TypeControllerPX'W  &PY& %  TextField6PZ % Cr B A  B A& P[ &%P\P]&%Shell&&&&&&&&%P^ P_&%SystemP`&%textBackgroundColorPa _Pb& % textColorPc& %  TextField7Pd % B( Co D A  D A& Pe &%PfPg&%/bin/sh &&&&&&&&%Ph Pi&%SystemPj&%textBackgroundColorPk iPl& % textColorPm& %  TextView1Pn% A  D @   D @ &Po &Pp Pq&%SystemPr&%textBackgroundColor  K KPs qPt& % textColor D @ KPu& %  TextField8Pv % CX B A  B A& Pw &%PxPy&%Mode&&&&&&&&%Pz P{&%SystemP|&%textBackgroundColorP} {P~& % textColorP& %  TextView2'P& %  TextField9EP& %  TextView38P& %  TextView4P&%GSCustomClassMapP&P& %  TextView5P% A  D @   D @ &P &P P&%SystemP&%textBackgroundColor  K KP P& % textColor D @ KP& %  TextView6_P &P1)NSNibConnectorEP&%NSOwnerP)+P)FP)HP)P)mP)"P)P)3P)P)ĐP)MP)YP)cP)֐P)uP)䐐P1*NSNibOutletConnectorEP&%windowP)P)P)P)IP)LP)P) P)쐐P)P)P) P)P)P)P1+NSNibControlConnectorP&% setCurrentScriptToStart:P+P&% setCurrentScriptToStartOpen:P+P&% setCurrentScriptToOpen:P*HP&%nameP*P&%versionP*P& % fullVersionP*P& % descriptionP*P&%urlP* P±&%authorsPñ*HPı&%delegatePű*PƱ*PDZ*Pȱ*Pɱ* Pʱ*cP˱)P̱)Pͱ*Pα&%delegatePϱ)Pб)Pѱ)Pұ)Pӱ)PԱ)Pձ)Pֱ)Pױ) Pر)!Pٱ)Pڱ))P۱)*Pܱ)5Pݱ)Pޱ)P߱)P)CP)P+ P&%setCurrentScriptToStart:P+!P&%setCurrentScriptToStartOpen:P+P&%setCurrentScriptToOpen:P**P&%delegateP*P&%delegateP*P& % currentScriptP**P&%currentScriptShellP)DP)P)GP)P)P)P)P)P)P)P)2P)P)JP*JP& % dataSourceP*JP&%delegateP+JP&% newType:P+2JP& %  deleteType:P)WP*JWP&%typeControllerP*JP &%documentP )P )P )P )P)P)P)P*JP& % tableViewP*JP& % typeEditorP)P)P)P*WP&%extensionsTextFieldP*WP& % nameTextFieldP+WP&%setRole:P*WP&%delegateP *WP!)P"*P#&%appIconP$)P%*WP&&%iconViewP')P()P))ÐP*)ՐP+)P,+P-&% setRole:P.*P/& % rolePopUpP0*P1&%currentScriptActionPopUpP2*P3&%documentP4+P5&% setCurrentScriptAction:GNUstepWrapper-0.1.0/WrapperFactory/English.lproj/WrapperFactory.gorm/0000755000175000017500000000000010106156372027162 5ustar rherzogrherzog00000000000000GNUstepWrapper-0.1.0/WrapperFactory/English.lproj/WrapperFactory.gorm/objects.gorm0000644000175000017500000001372210105645636031513 0ustar rherzogrherzog00000000000000GNUstep archive00002a96:0000000e:000000eb:00000001:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&001NSString& %  MenuItem1901 NSMenuItem0& % Select All0&%a&&%01NSImage0&%common_2DCheckMark0 0 & % common_2DDash%0 & %  MenuItem300 0 &%Windows0&&&% %01NSMenu 01 NSMutableArray1 NSArray&00&%Arrange In Front0&&&% %00&%Miniaturize Window0&%m&&% %00& % Close Window0&%w&&% %0& %  MenuItem3100&%Hide0&%h&&% %0& %  MenuItem3200 &%Quit0!&%q&&% %0"& %  MenuItem10#& % NSVisible0$ &0%& %  MenuItem20&0'&%Info0(&&&% 2submenuAction:%0)'0* &0+0,& % Info Panel...0-&&&% %0.0/&%Preferences...00&&&% %0102&%Help...03&%?&&% %0405&%WrapperFactory06 &&0708&%Document09&&&% %0:80; &0<0=&%Open...0>&%o&&% %0?0@&%New0A&%n&&% %0B0C&%Save...0D&%s&&% %0E0F& % Save As...0G&%S&&% %0H0I& % Save To...0J&&&% %0K0L&%Save All0M&&&% %0N0O&%revert To Saved0P&&&% %0Q0R&%Close0S&&&% %40T0U&%Edit0V&&&% %0WU0X &0Y0Z&%Cut0[&%x&&% %0\0]&%Copy0^&%c&&% %0_0`&%Paste0a&%v&&% %4 0b0c&%Services0d&&&% %0ec0f &40g& %  MenuItem33 0h& %  MenuItem340i& %  MenuItem3+0j& %  MenuItem350k& %  MenuItem4.0l& %  MenuItem510m&%ApplicationDelegate0n1 GSNibItemm  &0o& %  MenuItem670p&%MenuItem0q& %  MenuItem7<0r& %  MenuItem8?0s& %  MenuItem9B0t& % GormNSMenu)0u& %  MenuItem20 0v& %  MenuItem210w& %  MenuItem220x& %  MenuItem230y& %  MenuItem24b0z& %  MenuItem25&0{& %  MenuItem26+0|& %  MenuItem27.0}& %  MenuItem2810~& %  MenuItem2970& %  GormNSMenu1:0& %  GormNSMenu2W0& %  GormNSMenu30& %  GormNSMenu4e0&%NSServicesMenue0& % NSWindowsMenu0& %  MenuItem10E0&%GSCustomClassMap0&0& %  MenuItem11H0& %  MenuItem12K0& %  MenuItem13N0& %  MenuItem14Q0&%NSMenu40& %  MenuItem15T0& %  MenuItem16Y0&%NSOwner0& % NSApplication0& %  MenuItem17\0& %  MenuItem18_0 &;;01 NSNibConnector0&%NSOwner0 01 NSNibControlConnector0&%NSFirst0&%hide:0 0 0& % terminate:0 %0 %0&%submenuAction:0 t%0 it0 i0&%orderFrontStandardInfoPanel:0 kt0 lt0 l0&%orderFrontHelpPanel:0 o0 o0&%submenuAction:0 o0 q0 q0& % openDocument:0 r0 r0& % newDocument:0 s0 s0& % saveDocument:0 0 0&%saveDocumentAs:0 0 0&%saveDocumentTo:0 0 0&%saveAllDocuments:0 0 0&%revertDocumentToSaved:0 0± 0ñ&%close:0ı 0ű 0Ʊ&%submenuAction:0DZ 0ȱ 0ɱ 0ʱ&%cut:0˱ 0̱ 0ͱ&%copy:0α 0ϱ 0б&%paste:0ѱ 0ұ 0ӱ& % selectAll:0Ա u0ձ u0ֱ&%submenuAction:0ױ u0ر v0ٱ v0ڱ&%arrangeInFront:0۱ w0ܱ w0ݱ&%performMiniaturize:0ޱ x0߱ x0& % performClose:0 y0 y0&%submenuAction:0 y0 m01NSNibOutletConnectormy0&%servicesMenuItem0mu0&%windowsMenuItem0m0&%delegateGNUstepWrapper-0.1.0/WrapperFactory/English.lproj/WrapperFactory.gorm/data.classes0000644000175000017500000000662610105723273031463 0ustar rherzogrherzog00000000000000{ ApplicationDelegate = { Actions = ( ); Outlets = ( windowsMenuItem, servicesMenuItem ); Super = NSObject; }; FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "open:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontHelpPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; }GNUstepWrapper-0.1.0/WrapperFactory/English.lproj/Localizable.strings0000644000175000017500000000221010105723273027075 0ustar rherzogrherzog00000000000000/* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: Localizable.strings 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/English.lproj/Localizable.strings $ */ "Untitled.app" = "Untitled.app"; "A wrapped application" = "A wrapped application"; "Failed to open file:\n%@" = "Failed to open file:\n%@"; "Failed to open files:\n%@" = "Failed to open files:\n%@"; GNUstepWrapper-0.1.0/WrapperFactory/WrapperDocument.m0000644000175000017500000010745010105723273024034 0ustar rherzogrherzog00000000000000 /* Copyright (C) 2004 Raffael Herzog * * 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. * * $Id: WrapperDocument.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/WrapperDocument.m $ */ #include #include #include #include "WrapperDocument.h" #include "IconView.h" static const int currentVersion = 1; NSString * const ApplicationType = @"Application"; NSString * const WrapperChangedNotification = @"WrapperChangedNotification"; NSString * const WrapperChangedAttributeName = @"AttributeName"; NSString * const WrapperChangedAttributeValue = @"AttributeValue"; NSString * const WrapperAggregateChangedNotification = @"WrapperAggregateChangedNotification"; NSString * const WrapperAggregateChangedObject = @"Object"; NSString * const WrapperAggregateChangedAttributeName = @"AttributeName"; NSString * const WrapperAggregateChangedAttributeValue = @"AttributeValue"; static NSString *emptyString = @""; static NSString *launcherName = @"GSWrapper_Launcher"; static NSString *FreedesktopApplicationType = @"Freedesktop Application"; static NSString *actionRunScript = @"RunScript"; static NSString *actionFail = @"Fail"; static NSString *actionIgnore = @"Ignore"; /* * AppFileWrapper */ @interface AppFileWrapper : NSFileWrapper { BOOL flattened; NSData *script; NSData *executable; NSString *executablePath; } - (void)setFlattened: (BOOL)f; - (BOOL)flattened; - (void)setScript: (NSData *)s; - (NSData *)script; - (void)setExecutable: (NSData *)exe; - (NSData *)executable; - (void)setExecutablePath: (NSString *)exep; - (NSString *)executablePath; - (BOOL)writeToFile: (NSString *)path atomically:(BOOL)atomicFlag updateFilenames:(BOOL)updateNamesFlag; @end @implementation AppFileWrapper - (void)dealloc { TEST_RELEASE(script); TEST_RELEASE(executable); TEST_RELEASE(executablePath); } - (void)setFlattened: (BOOL)f { flattened = f; } - (BOOL)flattened { return flattened; } - (void)setScript: (NSData *)s { ASSIGN(script, s); } - (NSData *)script { return script; } - (void)setExecutable: (NSData *)exe { ASSIGN(executable, exe); } - (NSData *)executable { return executable; } - (void)setExecutablePath: (NSString *)exep { ASSIGN(executablePath, exep); } - (NSString *)executablePath { return executablePath; } - (BOOL)writeToFile: (NSString *)path atomically: (BOOL)atomicFlag updateFilenames: (BOOL)updateNamesFlag { BOOL result = [super writeToFile: path atomically: (atomicFlag) updateFilenames: (updateNamesFlag)]; if ( result ) { NSString *basename = [[path lastPathComponent] stringByDeletingPathExtension]; NSString *p = [path stringByAppendingPathComponent: basename]; if ( flattened ) { [executable writeToFile: p atomically: NO]; } else { [script writeToFile: p atomically: NO]; } NSFileManager *fm = [NSFileManager defaultManager]; NSDictionary *attrs = [fm fileAttributesAtPath: p traverseLink: NO]; NSNumber *perms = [attrs objectForKey: NSFilePosixPermissions]; perms = [NSNumber numberWithInt: [perms intValue]|0111]; attrs = [NSDictionary dictionaryWithObject: perms forKey: NSFilePosixPermissions]; [fm changeFileAttributes: attrs atPath: p]; if ( !flattened ) { NSString *exe = [path stringByAppendingPathComponent: [executablePath stringByAppendingPathComponent: basename]]; [executable writeToFile: exe atomically: YES]; [fm changeFileAttributes: attrs atPath: exe]; } } return result; } @end /* * WrapperDocument */ @interface WrapperDocument (Private) - (void)attributeChangedName: (NSString *)n value: (id)v; - (void)documentChanged; - (void)aggregateChanged: (NSNotification *)not; - (NSArray *)arrayFromCommaSeparatedString: (NSString *)string; - (BOOL)loadWrapper: (NSFileWrapper *)file; - (NSFileWrapper *)saveWrapper; - (BOOL)loadFreedesktopApplication: (NSFileWrapper *)file; - (NSFileWrapper *)saveFreedesktopApplication; + (ScriptAction)stringToScriptAction: (NSString *)str; + (NSString *)scriptActionToString: (ScriptAction)action; @end @implementation WrapperDocument /* * document */ - (id)init { self = [super init]; if ( self ) { NSImage *img = [[NSImage alloc] initByReferencingFile: [[NSBundle mainBundle] pathForImageResource: @"DefaultAppIcon"]]; appIcon = RETAIN([Icon iconWithImage: img]); name = _(@"Untitled.app"); version = @"1.0"; fullVersion = @"1.0/1.0"; description = _(@"A wrapped application"); url = emptyString; authors = emptyString; role = NoneRole; startScript = emptyString; startScriptShell = @"/bin/sh"; startScriptAction = RunScriptAction; startOpenScript = emptyString; startOpenScriptShell = startScriptShell; startOpenScriptAction = RunScriptAction; openScript = emptyString; openScriptShell = startScriptShell; openScriptAction = IgnoreAction; types = [[NSMutableArray alloc] init]; } return self; } - (void)dealloc { RELEASE(types); } - (BOOL)loadFileWrapperRepresentation: (NSFileWrapper *)file ofType: (NSString *)type { NSLog(@"Loading wrapper: %@", [file filename]); if ( [type isEqualToString: ApplicationType] ) { return [self loadWrapper: file]; } #ifdef FREEDESKTOP else if ( [type isEqualToString: FreedesktopApplicationType] ) { if ( [self loadFreedesktopApplication: file] ) { [self setFileType: ApplicationType]; [self setFileName: nil]; return YES; } else { return NO; } } #endif else { NSLog(@"Type %@ of %@ is not known", type, [file filename]); return NO; } } - (NSFileWrapper *)fileWrapperRepresentationOfType: (NSString *)type { if ( [type isEqualToString: ApplicationType] ) { return [self saveWrapper]; } else { NSLog(@"Type %@ is not known", type); return nil; } } - (NSString *)windowNibName { return @"WrapperDocument"; } - (int)runModalSavePanel: (NSSavePanel *)savePanel withAccessoryView: (NSView *)accessoryView { NSString *directory; NSString *file; if ([self fileName]) { directory = [savePanel directory]; file = [[[self fileName] lastPathComponent] stringByDeletingPathExtension]; } else { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationDirectory, NSUserDomainMask, YES); if ( [paths count] > 0 ) { directory = [paths objectAtIndex: 0]; } else { directory = [[NSDocumentController sharedDocumentController] currentDirectory]; } file = [self name]; if ( [[file pathExtension] isEqualToString: [savePanel requiredFileType]] ) { file = [file stringByDeletingPathExtension]; } } [savePanel setAccessoryView: accessoryView]; return [savePanel runModalForDirectory: directory file: file]; } /* * attributes */ - (Icon *)appIcon { return appIcon; } - (void)setAppIcon: (Icon *)i { ASSIGN(appIcon, i); [self attributeChangedName: @"appIcon" value: i]; } - (NSString *)name { return name; } - (void)setName: (NSString *)n { ASSIGN(name, n); [self attributeChangedName: @"name" value: n]; } - (NSString *)version { return version; } - (void)setVersion: (NSString *)v { ASSIGN(version, v); [self attributeChangedName: @"version" value: v]; } - (NSString *)fullVersion { return fullVersion; } - (void)setFullVersion: (NSString *)v { ASSIGN(fullVersion, v); [self attributeChangedName: @"fullVersion" value: v]; } - (NSString *)description { return description; } - (void)setDescription: (NSString *)d { ASSIGN(description, d); [self attributeChangedName: @"description" value: d]; } - (NSString *)url { return url; } - (void)setUrl: (NSString *)u { ASSIGN(url, u); [self attributeChangedName: @"url" value: u]; } - (NSString *)authors { return authors; } - (void)setAuthors: (NSString *)a { ASSIGN(authors, a); [self attributeChangedName: @"authors" value: a]; } - (ApplicationRole)role { return role; } - (void)setRole: (ApplicationRole)r { role = r; [self attributeChangedName: @"role" value: [NSNumber numberWithInt: r]]; } - (NSString *)startScript { return startScript; } - (void)setStartScript: (NSString *)s { ASSIGN(startScript, s); [self attributeChangedName: @"startScript" value: s]; } - (NSString *)startScriptShell { return startScriptShell; } - (void)setStartScriptShell: (NSString *)s { ASSIGN(startScriptShell, s); [self attributeChangedName: @"startScriptShell" value: s]; } - (ScriptAction)startScriptAction { return startScriptAction; } - (void)setStartScriptAction: (ScriptAction)action { startScriptAction = action; [self attributeChangedName: @"startScriptAction" value: [NSNumber numberWithInt: action]]; } - (NSString *)startOpenScript { return startOpenScript; } - (void)setStartOpenScript: (NSString *)s { ASSIGN(startOpenScript, s); [self attributeChangedName: @"startOpenScript" value: s]; } - (NSString *)startOpenScriptShell { return startOpenScriptShell; } - (void)setStartOpenScriptShell: (NSString *)s { ASSIGN(startOpenScriptShell, s); [self attributeChangedName: @"startOpenScriptShell" value: s]; } - (ScriptAction)startOpenScriptAction { return startOpenScriptAction; } - (void)setStartOpenScriptAction: (ScriptAction)action { startOpenScriptAction = action; [self attributeChangedName: @"startOpenScriptAction" value: [NSNumber numberWithInt: action]]; } - (NSString *)openScript { return openScript; } - (void)setOpenScript: (NSString *)s { ASSIGN(openScript, s); [self attributeChangedName: @"openScript" value: s]; } - (NSString *)openScriptShell { return openScriptShell; } - (void)setOpenScriptShell: (NSString *)s { ASSIGN(openScriptShell, s); [self attributeChangedName: @"openScriptShell" value: s]; } - (ScriptAction)openScriptAction { return openScriptAction; } - (void)setOpenScriptAction: (ScriptAction)action { openScriptAction = action; [self attributeChangedName: @"openScriptAction" value: [NSNumber numberWithInt: action]]; } /* * types */ - (void)addType: (Type *)type { if ( ! [types containsObject: type] ) { [types addObject: type]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(aggregateChanged:) name: (WrapperAggregateChangedNotification) object: (type)]; [self documentChanged]; } else { NSLog(@"Type %@ already in document, not added", type); } } - (void)removeType: (Type *)type { if ( [types containsObject: type] ) { [types removeObject: type]; [[NSNotificationCenter defaultCenter] removeObserver: self name: (WrapperAggregateChangedNotification) object: (type)]; [self documentChanged]; } else { NSLog(@"Type %@ not in document, not removed", type); } } - (int)typeCount { return [types count]; } - (Type *)typeAtIndex: (unsigned)index { return [types objectAtIndex: index]; } - (unsigned)indexOfType: (Type *)type { return [types indexOfObject: type]; } @end /* * category Private */ @implementation WrapperDocument (Private) - (void)attributeChangedName: (NSString *)n value: (id)v; { NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: n, WrapperChangedAttributeName, v, WrapperChangedAttributeValue, nil]; [[NSNotificationCenter defaultCenter] postNotificationName: WrapperChangedNotification object: (self) userInfo: (userInfo)]; [self documentChanged]; } - (void)documentChanged { if ( ! [self isDocumentEdited] ) { [self updateChangeCount: NSChangeDone]; } } - (void)aggregateChanged: (NSNotification *)not { //NSLog(@"Aggregate changed: %@", not); [self documentChanged]; } - (NSArray *)arrayFromCommaSeparatedString: (NSString *)string { NSArray *array = [string componentsSeparatedByString: @","]; int count = [array count]; if ( count <= 0 ) { return nil; } NSMutableArray *result = [NSMutableArray arrayWithCapacity: [array count]]; NSString *element; int i; for ( i=0; i 0 ) { [result addObject: element]; } } if ( [result count] > 0 ) { return result; } else { return nil; } } - (BOOL)loadWrapper: (NSFileWrapper *)file { if ( [file isRegularFile] ) { NSLog(@"%@ is a regular file -> not an application wrapper", [file filename]); return NO; } NS_DURING { NSString *value; NSDictionary *dict; NSFileWrapper *resourcesFile = [[file fileWrappers] objectForKey: @"Resources"]; if ( !resourcesFile ) { NSLog(@"Resources directory not found"); return NO; } NSDictionary *resources = [resourcesFile fileWrappers]; NSFileWrapper *infoFile = [resources objectForKey: @"Info-gnustep.plist"]; if ( !infoFile ) { NSLog(@"Resources/Info-gnustep.plist not found"); return NO; } // Load GSWrapper.plist NSFileWrapper *gsWrapperInfoFile = [resources objectForKey: @"GSWrapper.plist"]; if ( !gsWrapperInfoFile ) { NSLog(@"Resources/GSWrapper.plist not found"); return NO; } NSDictionary *gsWrapperInfo = [NSDictionary dictionaryWithContentsOfFile: [gsWrapperInfoFile filename]]; NSNumber *v = [gsWrapperInfo objectForKey: @"Version"]; if ( [v intValue] > currentVersion ) { NSLog(@"Version %d too new, don't know how to load this", [v intValue]); return NO; } dict = [gsWrapperInfo objectForKey: @"Start"]; if ( dict ) { value = [dict objectForKey: @"Shell"]; if ( value ) { [self setStartScriptShell: value]; } else { NSLog(@"No shell for Start script set"); } value = [dict objectForKey: @"Action"]; if ( value ) { [self setStartScriptAction: [WrapperDocument stringToScriptAction: value]]; } else { NSLog(@"No action for Start script set"); [self setStartScriptAction: RunScriptAction]; } } else { NSLog(@"No info for Start script"); } dict = [gsWrapperInfo objectForKey: @"StartOpen"]; if ( dict ) { value = [dict objectForKey: @"Shell"]; if ( value ) { [self setStartOpenScriptShell: value]; } else { NSLog(@"No shell for StartOpen script set"); } value = [dict objectForKey: @"Action"]; if ( value ) { [self setStartOpenScriptAction: [WrapperDocument stringToScriptAction: value]]; } else { NSLog(@"No action for StartOpen script set"); [self setStartOpenScriptAction: RunScriptAction]; } } else { NSLog(@"No info for StartOpen script"); } dict = [gsWrapperInfo objectForKey: @"Open"]; if ( dict ) { value = [dict objectForKey: @"Shell"]; if ( value ) { [self setOpenScriptShell: value]; } else { NSLog(@"No shell for Open script set"); } value = [dict objectForKey: @"Action"]; if ( value ) { [self setOpenScriptAction: [WrapperDocument stringToScriptAction: value]]; } else { NSLog(@"No action for Open script set"); [self setOpenScriptAction: RunScriptAction]; } } else { NSLog(@"No info for Open script"); } // Load Info-gnustep.plist NSDictionary *info = [NSDictionary dictionaryWithContentsOfFile: [infoFile filename]]; value = [info objectForKey: @"ApplicationName"]; if ( value ) { [self setName: value]; } else { NSLog(@"ApplicationName not set"); } value = [info objectForKey: @"ApplicationRelease"]; if ( value ) { [self setVersion: value]; } else { NSLog(@"ApplicationRelease not set"); } value = [info objectForKey: @"FullVersionID"]; if ( value ) { [self setFullVersion: value]; } else { NSLog(@"FullVersionID not set"); } value = [info objectForKey: @"ApplicationDescription"]; if ( value ) { [self setDescription: value]; } else { NSLog(@"ApplicationDescription not set"); } value = [info objectForKey: @"ApplicationURL"]; if ( value ) { [self setUrl: value]; } else { NSLog(@"ApplicationURL not set"); } NSArray *authorsArray = [info objectForKey: @"Authors"]; if ( authorsArray ) { [self setAuthors: [authorsArray componentsJoinedByString: @", "]]; } else { NSLog(@"Authors not set"); } // types NSArray *typeDicts = [info objectForKey: @"NSTypes"]; if ( typeDicts ) { int typeCount = [typeDicts count]; int i; for ( i=0; i=0; i-- ) { //dir = [[NSFileWrapper alloc] initWithPath: ];app if ( exedir ) { exedir = [[NSFileWrapper alloc] initDirectoryWithFileWrappers: [NSDictionary dictionaryWithObjectsAndKeys: exedir, [exedir preferredFilename], nil]]; } else { exedir = [[NSFileWrapper alloc] initDirectoryWithFileWrappers: [NSDictionary dictionary]]; } [exedir setPreferredFilename: [exePathComponents objectAtIndex: i]]; AUTORELEASE(exedir); } AppFileWrapper *app = [[AppFileWrapper alloc] initDirectoryWithFileWrappers: [NSDictionary dictionaryWithObjectsAndKeys: exedir, [exedir preferredFilename], resources, [resources preferredFilename], nil]]; AUTORELEASE(app); [app setFlattened: flattened]; [app setScript: script]; [app setExecutable: exe]; [app setExecutablePath: [NSString pathWithComponents: exePathComponents]]; return app; } - (BOOL)loadFreedesktopApplication: (NSFileWrapper *)file { if ( ![file isRegularFile] ) { NSLog(@"%@ is not a regular file"); return NO; } NSString *fdentry = [[NSString alloc] initWithData: [file regularFileContents] encoding: NSUTF8StringEncoding]; AUTORELEASE(fdentry); NSArray *lines = [fdentry componentsSeparatedByString: @"\n"]; int lineCount = [lines count]; int i; NSString *exec = nil; NSString *path = nil; NSString *section = nil; for ( i=0; i Terminal.app? } else { NSLog(@"Ignoring entry in section %@: %@=%@", section, key, value); } } else { NSLog(@"Ignoring entry in section %@: %@=%@", section, key, value); } } } if ( exec == nil ) { NSLog(@"No executable specified"); return NO; } if ( path ) { path = [NSString stringWithFormat: @"cd \"%@\"\n", path]; } else { path = @""; } // FIXME: actions [self setStartScript: [NSString stringWithFormat: @"%@exec \"%@\"\n", path, exec]]; [self setStartOpenScript: [NSString stringWithFormat: @"%@exec \"%@\" \"$@\"\n", path, exec]]; [self setOpenScript: @"exit 1\n"]; return YES; } - (NSFileWrapper *)saveFreedesktopApplication { NSLog(@"Saving freedesktop desktop entries not supported yet"); return nil; } + (ScriptAction)stringToScriptAction: (NSString *)str { if ( [str isEqualToString: actionRunScript] ) { return RunScriptAction; } else if ( [str isEqualToString: actionFail] ) { return FailAction; } else if ( [str isEqualToString: actionIgnore] ) { return IgnoreAction; } else { NSLog(@"Invalid action string: %@; defaulting to %@", str, actionRunScript); return RunScriptAction; } } + (NSString *)scriptActionToString: (ScriptAction)action { switch ( action ) { case RunScriptAction: return actionRunScript; case FailAction: return actionFail; case IgnoreAction: return actionIgnore; default: NSLog(@"Invalid action constant: %d; defaulting to 0 (RunScript)", action); return actionRunScript; } } @end GNUstepWrapper-0.1.0/WrapperFactory/IconView.m0000644000175000017500000002723410105723273022441 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: IconView.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/IconView.m $ */ #include #include "IconView.h" @interface IconView (Private) - (void)setArmed: (BOOL)a; - (BOOL)armed; @end @interface PopUpIconView : IconView { NSWindow *win; IconView *current; BOOL armedForDrag; } - (id)init; - (void)dealloc; - (void)attachTo: (IconView *)iconView; - (IconView *)current; - (void)notifyDealloc: (IconView *)iconView; - (void)hidePopUp; @end NSString * const IconViewDidChangeIconNotification = @"IconViewDidChangeIconNotification"; static NSString * const IconViewPopUpPositionDefault = @"IconViewPopUp_Position"; static PopUpIconView *popUpIconView; @implementation PopUpIconView - (id)init { self = [super init]; if ( self ) { win = nil; current = nil; armedForDrag = NO; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(iconViewDidChangeIcon:) name: (IconViewDidChangeIconNotification) object: (nil)]; } return self; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; if ( win ) { [win close]; RELEASE(win); } [super dealloc]; } - (void)attachTo: (IconView *)iconView { if ( ! win ) { NSRect rect = NSMakeRect(0, 0, 64, 64); NSString *positionString = [[NSUserDefaults standardUserDefaults] stringForKey: IconViewPopUpPositionDefault]; if ( positionString ) { rect.origin = NSPointFromString(positionString); } else { NSRect winFrame = [[iconView window] frame]; NSPoint origin = [[[iconView window] contentView] convertPoint: NSMakePoint(0,0) fromView: iconView]; NSLog(@"%@", NSStringFromPoint(origin)); rect.origin.x = winFrame.origin.x+origin.x+rect.size.height/2; rect.origin.y = winFrame.origin.y+origin.y-rect.size.height/2; } win = [[NSWindow alloc] initWithContentRect: rect styleMask: (NSBorderlessWindowMask) backing: (NSBackingStoreRetained) defer: (YES)]; [win setReleasedWhenClosed: NO]; [win setLevel: NSPopUpMenuWindowLevel]; [win setTitle: @"IconView PopUp"]; [win setContentView: self]; } [self setIcon: [iconView icon]]; [self setInsetsSize: [iconView insetsSize]]; current = iconView; [win orderFront: self]; } - (IconView *)current { return current; } - (void)notifyDealloc: (IconView *)iconView { if ( iconView == current ) { [self hidePopUp]; } } - (void)iconViewDidChangeIcon: (NSNotification *)not { if ( current && ([not object]==current) ) { [self setIcon: [current icon]]; } } - (void)concludeDragOperation: (id)info { if ( current ) { [current setIcon: [self icon]]; } NSRect originalFrame = [win frame]; NSRect frame = originalFrame; float min = (1+[self insetsSize])*2; for(;;) { frame = NSInsetRect(frame, 2, 2); if ( (frame.size.width<=min || (frame.size.height<=min)) ) { break; } [win setFrame: frame display: YES]; [self display]; [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]]; } [self hidePopUp]; [win setFrame: originalFrame display: NO]; } - (BOOL)acceptsFirstMouse: (NSEvent *)evt; { return YES; } - (void)hidePopUp { [win close]; current = nil; } /* * mouse events */ - (void)mouseDown: (NSEvent *)evt { [super mouseDown: evt]; armedForDrag = YES; } - (void)mouseUp: (NSEvent *)evt { if ( [self armed] ) { [self hidePopUp]; } [self setArmed: NO]; } - (void)mouseDragged: (NSEvent *)evt { if ( [self armed] ) { [self setArmed: NO]; } if ( !armedForDrag ) { return; } BOOL done = NO; [NSEvent startPeriodicEventsAfterDelay: 0.02 withPeriod: 0.02]; NSPoint location; NSPoint lastLocation = [evt locationInWindow]; unsigned eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSPeriodicMask | NSOtherMouseUpMask | NSRightMouseUpMask; NSDate *theDistantFuture = [NSDate distantFuture]; while ( !done ) { evt = [NSApp nextEventMatchingMask: eventMask untilDate: (theDistantFuture) inMode: (NSEventTrackingRunLoopMode) dequeue: (YES)]; switch ([evt type]) { case NSRightMouseUp: case NSOtherMouseUp: case NSLeftMouseUp: // any mouse up means we're done done = YES; break; case NSPeriodic: location = [win mouseLocationOutsideOfEventStream]; if (NSEqualPoints(location, lastLocation) == NO) { NSPoint origin = [win frame].origin; origin.x += (location.x - lastLocation.x); origin.y += (location.y - lastLocation.y); [win setFrameOrigin: origin]; } break; default: break; } } armedForDrag = NO; [[NSUserDefaults standardUserDefaults] setObject: NSStringFromPoint([win frame].origin) forKey: (IconViewPopUpPositionDefault)]; [NSEvent stopPeriodicEvents]; } @end @implementation IconView + (void)initialize { popUpIconView = [[PopUpIconView alloc] init]; } - (id)init { self = [super init]; if ( self ) { [self awakeFromNib]; } return self; } - (void)awakeFromNib { insetsSize = 8; } - (void)dealloc { [popUpIconView notifyDealloc: self]; TEST_AUTORELEASE(icon); TEST_AUTORELEASE(draggingImage); TEST_AUTORELEASE(delegate); [super dealloc]; } - (float)insetsSize { return insetsSize; } - (void)setInsetsSize: (float)s { insetsSize = s; [self setNeedsDisplay: YES]; } - (Icon *)icon { return icon; } - (void)setIcon: (Icon *)i { if ( i != icon ) { ASSIGN(icon, i); [self setNeedsDisplay: YES]; NSNotification *not = [NSNotification notificationWithName: IconViewDidChangeIconNotification object: (self)]; [[NSNotificationCenter defaultCenter] postNotification: not]; } } - (void)drawRect: (NSRect)rect { if ( NSIsEmptyRect(rect) ) { return; } // draw border if ( [self armed] ) { NSDrawLightBezel(rect, NSZeroRect); } else { NSDrawGroove(rect, NSZeroRect); } // done, if there's no image if ( !icon ) { return; } // draw the image NSRect interior = NSInsetRect(rect, insetsSize, insetsSize); NSImage *image = [icon imageForSize: interior.size copy: (NO)]; NSSize size = [image size]; NSPoint position = interior.origin; // center the image position.x += (interior.size.width-size.width)/2; position.y += (interior.size.height-size.height)/2; [image compositeToPoint: position operation: NSCompositeSourceOver]; } - (void)viewDidMoveToSuperview { [super viewDidMoveToSuperview]; if ( [self superview] && !registeredForDraggedTypes ) { [self registerForDraggedTypes: [NSArray arrayWithObjects: NSTIFFPboardType, NSFilenamesPboardType, nil]]; registeredForDraggedTypes = YES; } else if ( registeredForDraggedTypes ) { [self unregisterDraggedTypes]; registeredForDraggedTypes = NO; } } - (NSDragOperation)draggingEntered: (id)info { NSPasteboard *pboard = [info draggingPasteboard]; NSArray *types = [pboard types]; if ( [types count] != 1 ) { return NSDragOperationNone; } else { draggingImage = RETAIN([[NSImage alloc] initWithPasteboard: pboard]); if ( draggingImage ) { return NSDragOperationCopy; } else { return NSDragOperationNone; } } } - (void)draggingExited: (id)info { TEST_RELEASE(draggingImage); draggingImage = nil; } - (BOOL)prepareForDragOperation: (id)info { if ( draggingImage ) { return YES; } else { return NO; } } - (BOOL)performDragOperation: (id)info { if ( draggingImage ) { [self setIcon: [Icon iconWithImage: draggingImage]]; RELEASE(draggingImage); draggingImage = nil; return YES; } else { return NO; } } - (void)concludeDragOperation: (id)info { } /* * mouse events */ - (void)mouseDown: (NSEvent *)evt { [self setArmed: YES]; } - (void)mouseUp: (NSEvent *)evt { if ( [self armed] ) { if ( [popUpIconView current] == self ) { [popUpIconView hidePopUp]; } else { [popUpIconView attachTo: self]; } } [self setArmed: NO]; } - (void)mouseDragged: (NSEvent *)evt { [self setArmed: NO]; if ( !dndOperation ) { NSImage *img = [[self icon] imageCopy: NO]; NSRect interior = NSInsetRect([self bounds], insetsSize, insetsSize); NSImage *dragImage = [icon imageForSize: interior.size copy: (YES)]; NSSize size = [dragImage size]; NSPoint position = interior.origin; // center the image position.x += (interior.size.width-size.width)/2; position.y += (interior.size.height-size.height)/2; NSPasteboard *pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; [pboard declareTypes: [NSArray arrayWithObject: NSTIFFPboardType] owner: self]; [pboard setData: [img TIFFRepresentation] forType: NSTIFFPboardType]; [self dragImage: dragImage at: (position) offset: (NSMakeSize(0, 0)) event: (evt) pasteboard: (pboard) source: (self) slideBack: (YES)]; dndOperation = YES; } } - (void)draggedImage: (NSImage *)img endetAt: (NSPoint *)where operation: (NSDragOperation *)operation { NSLog(@"DND operation end"); dndOperation = NO; } - (unsigned int)draggingSourceOperationMaskForLocal: (BOOL)isLocal { return NSDragOperationCopy; } - (BOOL)ignoreModifierKeysWhileDragging { return YES; } @end @implementation IconView (Private) - (void)setArmed: (BOOL)a { armed = a; [self setNeedsDisplay: YES]; } - (BOOL)armed { return armed; } @end /* This is a workaround... Gorm for some reason doesn't like it if I * use two times the same class for CustomViews - or maybe something's * wrong with the implementation of IconView? I don't know, have to * ask gnustep-discuss about this. * * For now, it works like this. */ @interface IconView2 : IconView @end @implementation IconView2 @end GNUstepWrapper-0.1.0/WrapperFactory/Type.m0000644000175000017500000000512510105723273021632 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: Type.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/Type.m $ */ #include #include "Type.h" #include "WrapperDocument.h" @interface Type (Private) - (void)typeChangedAttribute: (NSString *)attr value: (id)value; @end @implementation Type - (id)init { self = [super init]; if ( self ) { NSImage *img = [[NSImage alloc] initByReferencingFile: [[NSBundle mainBundle] pathForImageResource: @"DefaultAppIcon"]]; icon = RETAIN([Icon iconWithImage: img]); name = _(@"Unnamed"); extensions = @""; } return self; } - (Icon *)icon { return icon; } - (void)setIcon: (Icon *)i { ASSIGN(icon, i); [self typeChangedAttribute: @"icon" value: (i)]; } - (NSString *)name { return name; } - (void)setName: (NSString *)n { ASSIGN(name, n); [self typeChangedAttribute: @"name" value: (n)]; } - (NSString *)extensions { return extensions; } - (void)setExtensions: (NSString *)e { ASSIGN(extensions, e); [self typeChangedAttribute: @"extensions" value: (e)]; } @end @implementation Type (Private) - (void)typeChangedAttribute: (NSString *)attr value: (id)value { [[NSNotificationCenter defaultCenter] postNotificationName: WrapperAggregateChangedNotification object: (self) userInfo: [NSDictionary dictionaryWithObjectsAndKeys: attr, WrapperAggregateChangedAttributeName, value, WrapperAggregateChangedAttributeValue, nil]]; } @end GNUstepWrapper-0.1.0/WrapperFactory/Icon.h0000644000175000017500000000256410105723273021600 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: Icon.h 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/Icon.h $ */ #ifndef _GSWrapper_Icon_H #define _GSWrapper_Icon_H #include @interface Icon : NSObject { NSImage *image; NSSize originalSize; } - (id)init; - (id)initWithImage: (NSImage *)i; + (id)iconWithImage: (NSImage *)i; - (NSImage *)imageCopy: (BOOL)copy; - (NSImage *)imageForSize: (NSSize)size copy: (BOOL)copy; - (NSData *)scaledTIFFRepresentation: (NSSize)size; - (NSImage *)imageForOriginalSizeCopy: (BOOL)copy; @end #endif GNUstepWrapper-0.1.0/WrapperFactory/WrapperFactoryInfo.plist0000644000175000017500000000243310105704770025374 0ustar rherzogrherzog00000000000000{ ApplicationDescription = "Graphically create UNIX application wrappers for GNUstep."; ApplicationName = "WrapperFactory.app"; ApplicationRelease = "0.1.0"; ApplicationURL = "http://www.raffael.ch/"; Authors = ("Raffael Herzog "); Copyright = "Copyright (C) 2004 Raffael Herzog."; CopyrightDescription = "Released under the GNU General Public License 2.0"; FullVersionID = "0.1.0"; NSIcon = "WrapperFactory.tiff"; NSMainNibFile = "WrapperFactory.gorm"; NSTypes = ( { NSName = "Application"; NSUnixExtensions = ( "app" ); NSDocumentClass = "WrapperDocument"; NSRole = Editor; }, { NSName = "Freedesktop Application"; NSUnixExtensions = ( "desktop" ); NSDocumentClass = "WrapperDocument"; NSIcon = "DesktopEntry.tiff"; NSRole = Viewer; } ); NSServices = ( { NSPortName = WrapperFactory; NSMessage = createWrapperForExecutable; NSSendTypes = (NSFilenamesPboardType); NSMenuItem = { default = "WrapperFactory/Create Wrapper..."; }; }, { NSPortName = WrapperFactory; NSMessage = editWrapper; NSSendTypes = (NSFilenamesPboardType); NSMenuItem = { default = "WrapperFactory/Edit Wrapper..."; }; } ); } GNUstepWrapper-0.1.0/WrapperFactory/WrapperDocumentController.m0000644000175000017500000003435010105723273026076 0ustar rherzogrherzog00000000000000/* Copyright (C) 2003 Raffael Herzog * * 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. * * $Id: WrapperDocumentController.m 103 2004-08-09 16:30:51Z rherzog $ * $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/WrapperFactory/WrapperDocumentController.m $ */ #include #include "WrapperDocumentController.h" #include "WrapperDocument.h" #include "Icon.h" static NSString *emptyString = @""; @interface WrapperDocumentController (Notifications) - (void)wrapperDocumentChangedNotification: (NSNotification *)not; @end @implementation WrapperDocumentController - (id)init { self = [super init]; if ( self ) { // textCursor = [NSCursor IBeamCursor]; // defaultCursor = [NSCursor arrowCursor]; // [textCursor setOnMouseEntered: YES]; // [defaultCursor setOnMouseExited: YES]; settingValue = NO; } return self; } - (void)awakeFromNib { // if ( currentScript ) { // NSLog(@"Setting cursor"); // [currentScript addCursorRect: [currentScript bounds] // cursor: (textCursor)]; // [currentScript addCursorRect: [currentScript bounds] // cursor: (defaultCursor)]; // } // [self setCurrentScriptId: StartScript]; } /* * delegate methods */ - (void)controlTextDidChange: (NSNotification *)not { [self textDidChange: not]; } - (void)textDidChange: (NSNotification *)not { if ( settingValue ) { return; } id src = [not object]; settingValue = YES; if ( src == name ) { [document setName: AUTORELEASE([[name stringValue] copyWithZone: NSDefaultMallocZone()])]; } else if ( src == version ) { [document setVersion: AUTORELEASE([[version stringValue] copyWithZone: NSDefaultMallocZone()])]; } else if ( src == fullVersion ) { [document setFullVersion: AUTORELEASE([[fullVersion stringValue] copyWithZone: NSDefaultMallocZone()])]; } else if ( src == description ) { [document setDescription: AUTORELEASE([[description stringValue] copyWithZone: NSDefaultMallocZone()])]; } else if ( src == url ) { [document setUrl: AUTORELEASE([[url stringValue] copyWithZone: NSDefaultMallocZone()])]; } else if ( src == authors ) { [document setAuthors: AUTORELEASE([[authors stringValue] copyWithZone: NSDefaultMallocZone()])]; } else if ( src == currentScriptShell ) { NSString *shell = AUTORELEASE([[currentScriptShell stringValue] copyWithZone: NSDefaultMallocZone()]); switch ( currentScriptId ) { case StartScript: [document setStartScriptShell: shell]; break; case StartOpenScript: [document setStartOpenScriptShell: shell]; break; case OpenScript: [document setOpenScriptShell: shell]; break; default: NSLog(@"Unknown script ID: %d", currentScriptId); } } else if ( src == currentScript ) { NSString *script = AUTORELEASE([[currentScript string] copyWithZone: NSDefaultMallocZone()]); switch ( currentScriptId ) { case StartScript: [document setStartScript: script]; break; case StartOpenScript: [document setStartOpenScript: script]; break; case OpenScript: [document setOpenScript: script]; break; default: NSLog(@"Unknown script ID: %d", currentScriptId); } } else { NSLog(@"Received textDidChange notification from unknown control: %@", src); } settingValue = NO; } - (void)iconViewDidChangeIcon: (NSNotification *)not { if ( settingValue ) { return; } settingValue = YES; if ( [not object] == appIcon ) { [document setAppIcon: [(IconView *)[not object] icon]]; } else { NSLog(@"Received iconViewImageChanged notification from unknown ImageView: %@", [not object]); } settingValue = NO; } /* * actions */ - (IBAction)setCurrentScriptToStart: (id)sender { [self setCurrentScriptId: StartScript]; } - (IBAction)setCurrentScriptToStartOpen: (id)sender { [self setCurrentScriptId: StartOpenScript]; } - (IBAction)setCurrentScriptToOpen: (id)sender { [self setCurrentScriptId: OpenScript]; } - (IBAction)setRole: (id)sender { int tag = [[sender selectedItem] tag]; settingValue = YES; switch ( tag ) { case NoneRole: [document setRole: NoneRole]; break; case ViewerRole: [document setRole: ViewerRole]; break; case EditorRole: [document setRole: EditorRole]; break; default: NSLog(@"Unknown role: %d", tag); } settingValue = NO; } - (IBAction)setCurrentScriptAction: (id)sender { int tag = [[sender selectedItem] tag]; settingValue = YES; switch ( currentScriptId ) { case StartScript: [document setStartScriptAction: tag]; break; case StartOpenScript: [document setStartOpenScriptAction: tag]; break; case OpenScript: [document setOpenScriptAction: tag]; break; } } /* * outlets */ - (void)setWindowController: (NSWindowController *)controller { windowController = controller; [self setDocument: [controller document]]; } - (void)setDocument: (WrapperDocument *)d { if ( document ) { [[NSNotificationCenter defaultCenter] removeObserver: self name: (WrapperChangedNotification) object: (document)]; } document = d; settingValue = YES; if ( ! d ) { NSLog(@"Document set to null"); } if ( appIcon ) { [appIcon setIcon: [d appIcon]]; } else { NSLog(@"No appIcon image view"); } if ( name ) { [name setStringValue: d ? [d name] : emptyString]; } else { NSLog(@"No name text field"); } if ( version ) { [version setStringValue: d ? [d version] : emptyString]; } else { NSLog(@"No version text field"); } if ( fullVersion ) { [fullVersion setStringValue: d ? [d fullVersion] : emptyString]; } else { NSLog(@"No fullVersion text field"); } if ( description ) { [description setStringValue: d ? [d description] : emptyString]; } else { NSLog(@"No description text field"); } if ( url ) { [url setStringValue: d ? [d url] : emptyString]; } else { NSLog(@"No url text field"); } if ( authors ) { [authors setStringValue: d ? [d authors] : emptyString]; } else { NSLog(@"No authors text field"); } [self setCurrentScriptId: currentScriptId]; settingValue = NO; if ( document ) { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(wrapperDocumentChangedNotification:) name: (WrapperChangedNotification) object: (document)]; } } - (void)setAppIcon: (IconView *)i { if ( appIcon) { [[NSNotificationCenter defaultCenter] removeObserver: self name: (IconViewDidChangeIconNotification) object: (self)]; } appIcon = i; if ( appIcon ) { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(iconViewDidChangeIcon:) name: (IconViewDidChangeIconNotification) object: (appIcon)]; } } - (IconView *)appIcon { return appIcon; } - (void)setName: (NSTextField *)n { name = n; } - (NSTextField *)name { return name; } - (void)setVersion: (NSTextField *)v { version = v; } - (NSTextField *)version { return version; } - (void)setFullVersion: (NSTextField *)v { fullVersion = v; } - (NSTextField *)fullVersion { return fullVersion; } - (void)setDescription: (NSTextField *)d { description = d; } - (NSTextField *)description { return description; } - (void)setUrl: (NSTextField *)u { url = u; } - (NSTextField *)url { return url; } - (void)setAuthors: (NSTextField *)a { authors = a; } - (NSTextField *)authors { return authors; } - (NSPopUpButton *)rolePopUp { return rolePopUp; } - (void)setRolePopUp: (NSPopUpButton *)role { ASSIGN(rolePopUp, role); } - (NSPopUpButton *)currentScriptActionPopUp { return currentScriptActionPopUp; } - (void)setCurrentScriptActionPopUp: (NSPopUpButton *)actionPopUp; { ASSIGN(currentScriptActionPopUp, actionPopUp); } - (void)setCurrentScriptId: (int)i { NSString *shell; NSString *script; int action; switch ( i ) { case StartScript: shell = [document startScriptShell]; script = [document startScript]; action = [document startScriptAction]; break; case StartOpenScript: shell = [document startOpenScriptShell]; script = [document startOpenScript]; action = [document startOpenScriptAction]; break; case OpenScript: shell = [document openScriptShell]; script = [document openScript]; action = [document openScriptAction]; break; default: NSLog(@"Unknown script ID: %d", currentScriptId); return; } [currentScriptActionPopUp selectItemAtIndex: [currentScriptActionPopUp indexOfItemWithTag: action]]; currentScriptId = i; if ( !script ) { script = @""; } if ( !shell ) { shell = @"/bin/sh"; } if ( currentScriptShell ) { [currentScriptShell setStringValue: shell]; } if ( currentScript ) { [currentScript setString: script]; } } - (int)currentScriptId { return currentScriptId; } - (void)setCurrentScriptShell: (NSTextField *)s { currentScriptShell = s; } - (NSTextField *)currentScriptShell { return currentScriptShell; } - (void)setCurrentScript: (NSTextView *)s { currentScript = s; } - (NSTextView *)currentScript { return currentScript; } @end @implementation WrapperDocumentController (Notifications) - (void)wrapperDocumentChangedNotification: (NSNotification *)not { if ( settingValue ) { return; } settingValue = YES; NSString *attr = [[not userInfo] objectForKey: WrapperChangedAttributeName]; id val = [[not userInfo] objectForKey: WrapperChangedAttributeValue]; if ( [attr isEqualToString: @"appIcon"] && appIcon ) { [appIcon setIcon: [Icon iconWithImage: val]]; } else if ( [attr isEqualToString: @"name"] && name ) { [name setStringValue: val]; } else if ( [attr isEqualToString: @"version"] && version ) { [version setStringValue: val]; } else if ( [attr isEqualToString: @"fullVersion"] && fullVersion ) { [fullVersion setStringValue: val]; } else if ( [attr isEqualToString: @"description"] && description ) { [description setStringValue: val]; } else if ( [attr isEqualToString: @"url"] && url ) { [url setStringValue: val]; } else if ( [attr isEqualToString: @"authors"] && authors ) { [authors setStringValue: val]; } else if ( [attr isEqualToString: @"role"] && rolePopUp ) { [rolePopUp selectItemAtIndex: [rolePopUp indexOfItemWithTag: [val intValue]]]; } else if ( [attr isEqualToString: @"startScript"] && currentScript) { if ( currentScriptId == StartScript ) { [currentScript setString: val]; } } else if ( [attr isEqualToString: @"startScriptShell"] && currentScriptShell ) { if ( currentScriptId == StartScript ) { [currentScriptShell setStringValue: val]; } } else if ( [attr isEqualToString: @"startScriptAction"] && currentScriptActionPopUp ) { if ( currentScriptId == StartScript ) { [currentScriptActionPopUp selectItemAtIndex: [currentScriptActionPopUp indexOfItemWithTag: [val intValue]]]; } } else if ( [attr isEqualToString: @"startOpenScript"] && currentScriptActionPopUp ) { if ( currentScriptId == StartOpenScript ) { [currentScriptActionPopUp selectItemAtIndex: [currentScriptActionPopUp indexOfItemWithTag: [val intValue]]]; } } else if ( [attr isEqualToString: @"startOpenScriptShell"] && currentScriptShell ) { if ( currentScriptId == StartOpenScript ) { [currentScriptShell setStringValue: val]; } } else if ( [attr isEqualToString: @"startOpenScriptAction"] && currentScriptActionPopUp ) { if ( currentScriptId == StartOpenScript ) { [currentScriptActionPopUp selectItemAtIndex: [currentScriptActionPopUp indexOfItemWithTag: [val intValue]]]; } } else if ( [attr isEqualToString: @"openScript"] && currentScript ) { if ( currentScriptId == OpenScript ) { [currentScript setString: val]; } } else if ( [attr isEqualToString: @"openScriptAction"] && currentScriptActionPopUp ) { if ( currentScriptId == OpenScript ) { [currentScriptActionPopUp selectItemAtIndex: [currentScriptActionPopUp indexOfItemWithTag: [val intValue]]]; } } else if ( [attr isEqualToString: @"openScriptShell"] && currentScriptShell ) { if ( currentScriptId == OpenScript ) { [currentScriptShell setStringValue: val]; } } else { NSLog(@"Received WrapperChangedNotification for unknown attribute %@", attr); } settingValue = NO; } @end GNUstepWrapper-0.1.0/COPYING0000644000175000017500000003545110000500531016603 0ustar rherzogrherzog00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS GNUstepWrapper-0.1.0/NEWS0000644000175000017500000000022710105723273016260 0ustar rherzogrherzog00000000000000No news yet... :) $Id: NEWS 103 2004-08-09 16:30:51Z rherzog $ $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/NEWS $ GNUstepWrapper-0.1.0/GNUmakefile.development0000644000175000017500000000011710105704770022153 0ustar rherzogrherzog00000000000000GNUSTEP_INSTALLATION_DIR=$(GNUSTEP_USER_ROOT) OBJCFLAGS+=-Werror -DFREEDESKTOP GNUstepWrapper-0.1.0/README0000644000175000017500000001135210105723273016442 0ustar rherzogrherzog00000000000000GNUstepWrapper ============= GNUstepWrapper is an easy way to create GNUstep app-wrappers of non-GNUstep binaries. It is the most useful in conjunction with Enrico Sersale's GWorkspace environment. INSTALL ======= GNUstepWrapper needs a fairly current build of GNUstep installed. Get GNUstep here: http://www.gnustep.org/ Also, a recent installation of GWorkspace.app is highly recommended. Get GWorkspace here: http://www.gnustep.it/enrico/gworkspace/ Decompress the archive: tar xfvz GNUstepWrapper-[Version].tar.gz Next, compile and install the application: $ make # make install (as root) GNUstepWrapper installs a tool to $GNUSTEP_SYSTEM_ROOT/Tools, a library (libGSWrapper) to $GNUSTEP_SYSTEM_ROOT/Libraries, and an application / GUI for creating and editing wrappers in $GNUSTEP_SYSTEM_ROOT/Applications. Now, update the available services for GWorkspace.app: $ make_services You may need to restart GWorkspace to make it stick. If everything went well, you will have two new entries in GWorkspace.app's "Services" menu: WrapperFactory > Create Wrapper / Edit Wrapper. USAGE ===== Create a Wrapper ---------------- 1. Browse to the application binary you want to wrap. 2. Select the binary and hit "Services > WrapperFactoryWrapper > Create Wrapper". WrapperFactory will launch and create a basic wrapper for the application you selected. 3. If applicable, use the "Start" dropdown to change the application's behaviour when starting by opening a file ("Start Application and Open Files") and when opening additional files ("Open Files in Running Application"). The code used for the selected file to be opened is "$@", including the " ". EXAMPLE: Gimp Start Application: exec /usr/bin/gimp Start Application and Open Files: exec /usr/bin/gimp "$@" Open Files in Running Application: exec /usr/bin/gimp-remote "$@" 4. Add your wrapped application's app-icon by dragging it from a GWorkspace window to the "AppIcon" area. By default, WrapperFactory uses the GNUstep logo as app-icon. Supported image formats are GIF, JPEG, PNG, XPM and TIFF (non-compressed). As of now, overlarge images are not properly scaled, hence you should chose a 48x48px image as your app-icon. You can also use preview images provided by Inspector.app by dragging the preview to the "AppIcon" area. 5. If you feel like it, add application specific meta-information to the fields in the upper part of WrapperFactory's window and define the application's role (none, editor, viewer). This information is not necessary for creating a working app-wrapper. Add File Types -------------- 1. Click the "Types" tab to edit the file types to be associated with your wrapped application. 2. Hit the "New Type" button. The right side of WrapperFactory's window will show you a drag-and-drop area for the file icon, and two text fields for extensions and file type names to be supported by the wrapped application. 3. Enter the file type extensions in the "Extensions" field. You can use comma (,) to seperate multiple extensions. Extensions are case insensitive. 4. Next, enter the proper name of the file type in the "Name" field. EXAMPLE: HTML Extensions: htm,html,xhtml Name: Hypertext Markup Language File 5. Add the icon for the file type you are creating, using drag-and-drop from a GWorkspace window. By default, WrapperFactory uses the GNUstep logo as file type icon. Supported image formats are GIF, JPEG, PNG, XPM and TIFF (non-compressed). As of now, overlarge images are not properly scaled, hence you should chose a 48x48px image as your file type icon. You can also use preview images provided by Inspector.app by dragging the preview to the "Icon" area. 6. Hit "New Type" for adding further file types, or "Delete Type" to get rid of a superfluous file type. When you're done configuring your app-wrapper, use "Document > Save" to save the wrapper. By default, WrapperFactory saves wrapped applications in ~/GNUstep/Applications/. Naturally, you can move all wrapped applications to wherever you see fit. Edit a Wrapper -------------- 1. Browse to the wrapped application you want to edit. 2. Select the application and hit "Services > WrapperFactory > Edit Wrapper". WrapperFactory will launch, opening the previously created app-wrapper. 3. Make your changes. You have all the same options as described above. 4. Save your edited app-wrapper by using "Document > Save" or "Document > Save As". CONTACT ======= Bug reports, feature requests and comments regarding this documentation should be directed to: Raffael Herzog . http://www.raffael.ch $Id: README 103 2004-08-09 16:30:51Z rherzog $ $HeadURL: file:///home/rherzog/Subversion/GNUstep/GSWrapper/tags/release-0.1.0/README $